From d42eb4372f6bd97264cf3731f271f17c06af303d Mon Sep 17 00:00:00 2001 From: Kurt Date: Sun, 1 Apr 2018 15:04:53 -0700 Subject: [PATCH] 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. --- .../Encounters/Verifiers/VerifyCurrentMoves.cs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/PKHeX.Core/Legality/Encounters/Verifiers/VerifyCurrentMoves.cs b/PKHeX.Core/Legality/Encounters/Verifiers/VerifyCurrentMoves.cs index f006347c8..e828e9c5b 100644 --- a/PKHeX.Core/Legality/Encounters/Verifiers/VerifyCurrentMoves.cs +++ b/PKHeX.Core/Legality/Encounters/Verifiers/VerifyCurrentMoves.cs @@ -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 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))