Fix 4 egg move gen2 oddish

egg moves also can be taught in gen1, which causes the learn source to
be locked to a tradeback (removing egg moves that have IDs greater than
RBY's moves). Simplify gen<=2 parse preference ordering with this
addition to force egg moves to be acknowledged.
This commit is contained in:
Kurt 2018-04-01 15:04:53 -07:00
parent 07b2568b1f
commit d42eb4372f

View File

@ -140,11 +140,11 @@ private static CheckMoveResult[] ParseMovesPre3DS(PKM pkm, int[] Moves, LegalInf
int[] SpecialMoves = GetSpecialMoves(info.EncounterMatch);
return ParseMovesIsEggPreRelearn(pkm, Moves, SpecialMoves, egg);
}
if (info.EncounterMatch is EncounterEgg e)
return ParseMovesWasEggPreRelearn(pkm, Moves, info, e);
if (info.Generation <= 2 &&
info.EncounterMatch is IGeneration g && (g.Generation == 1 || g.Generation == 2 && !Legal.AllowGen2MoveReminder(pkm))) // fixed encounter moves without relearning
return ParseMovesGenGB(pkm, Moves, info);
if (info.EncounterMatch is EncounterEgg e)
return ParseMovesWasEggPreRelearn(pkm, Moves, info, e);
return ParseMovesSpecialMoveset(pkm, Moves, info);
}
@ -300,10 +300,15 @@ private static void ParseMovesByGeneration(PKM pkm, IList<CheckMoveResult> res,
if (move == 0)
continue;
if (gen <= 2 && learnInfo.Source.Base.Contains(move))
res[m] = new CheckMoveResult(MoveSource.Initial, gen, Severity.Valid, native ? V361 : string.Format(V362, gen), CheckIdentifier.Move);
if (gen == 2 && !native && move > Legal.MaxMoveID_1 && pkm.VC1)
res[m] = new CheckMoveResult(MoveSource.Unknown, gen, Severity.Invalid, V176, CheckIdentifier.Move);
if (gen <= 2)
{
if (gen == 2 && !native && move > Legal.MaxMoveID_1 && pkm.VC1)
res[m] = new CheckMoveResult(MoveSource.Unknown, gen, Severity.Invalid, V176, CheckIdentifier.Move);
else if (gen == 2 && learnInfo.EggMovesLearned.Contains(move))
res[m] = new CheckMoveResult(MoveSource.EggMove, gen, Severity.Valid, V171, CheckIdentifier.Move);
else if (learnInfo.Source.Base.Contains(move))
res[m] = new CheckMoveResult(MoveSource.Initial, gen, Severity.Valid, native ? V361 : string.Format(V362, gen), CheckIdentifier.Move);
}
else if (info.EncounterMoves.LevelUpMoves[gen].Contains(move))
res[m] = new CheckMoveResult(MoveSource.LevelUp, gen, Severity.Valid, native ? V177 : string.Format(V330, gen), CheckIdentifier.Move);
else if (info.EncounterMoves.TMHMMoves[gen].Contains(move))