Add TR flags to emoveset generator

This commit is contained in:
Kurt 2021-01-30 21:49:45 -08:00
parent 6089268b53
commit a524032f61
2 changed files with 16 additions and 1 deletions

View file

@ -173,6 +173,9 @@ namespace PKHeX.Core
var shared = MoveEgg.GetEggMoves(8, evo.Species, evo.Form, GameVersion.SW); var shared = MoveEgg.GetEggMoves(8, evo.Species, evo.Form, GameVersion.SW);
if (shared.Length != 0) if (shared.Length != 0)
moves = moves.Concat(shared); moves = moves.Concat(shared);
// TR moves -- default logic checks the TR flags, so we need to add all possible ones here.
moves = moves.Concat(MoveTechnicalMachine.GetAllPossibleRecords(pk.Species, pk.Form));
} }
if (pk.Species == (int)Species.Shedinja) if (pk.Species == (int)Species.Shedinja)
{ {

View file

@ -484,5 +484,17 @@ namespace PKHeX.Core
r.Add(Legal.TMHM_SWSH[i + 100]); r.Add(Legal.TMHM_SWSH[i + 100]);
} }
} }
public static IEnumerable<int> GetAllPossibleRecords(int species, int form)
{
var pi = PersonalTable.SWSH.GetFormEntry(species, form);
var tmhm = pi.TMHM;
for (int i = 0; i < 100; i++)
{
if (!tmhm[i + 100])
continue;
yield return Legal.TMHM_SWSH[i + 100];
}
}
} }
} }