g3 shedinja api usage fix

see comments in src for justification
need ninjask moves if gen3; dl.Count is guaranteed to be >= 1
This commit is contained in:
Kurt 2020-01-11 21:41:24 -08:00
parent 7cbf8d0fcf
commit 0eca1bbd1c

View File

@ -139,10 +139,20 @@ private static IEnumerable<int> GetMovesForGeneration(PKM pk, IReadOnlyList<EvoC
IEnumerable<int> moves = Legal.GetValidMoves(pk, dl, generation);
if (generation >= 8)
{
// Shared Egg Moves via daycare
// Any egg move can be obtained
var evo = dl[dl.Count - 1];
var shared = MoveEgg.GetEggMoves(pk, evo.Species, evo.Form, GameVersion.SW);
moves = moves.Concat(shared);
}
if (generation == 3 && dl[0].Species == (int)Species.Shedinja)
{
// Leveling up Nincada in Gen3 levels up, evolves to Ninjask, applies moves for Ninjask, then spawns Shedinja with the current moveset.
// Future games spawn the Shedinja before doing Ninjask moves, so this is a special case.
// Can't get more than the evolved-at level move; >=2 special moves will get caught by the legality checker later.
var ninjask = MoveLevelUp.GetMovesLevelUp(pk, (int)Species.Ninjask, 0, 0, 100, 0, GameVersion.Any, false, 3);
moves = moves.Concat(ninjask);
}
return moves;
}