diff --git a/PKHeX.Core/Legality/Encounters/Verifiers/VerifyCurrentMoves.cs b/PKHeX.Core/Legality/Encounters/Verifiers/VerifyCurrentMoves.cs index deea2951d..bbaa1b5be 100644 --- a/PKHeX.Core/Legality/Encounters/Verifiers/VerifyCurrentMoves.cs +++ b/PKHeX.Core/Legality/Encounters/Verifiers/VerifyCurrentMoves.cs @@ -394,13 +394,14 @@ private static void ParseEggMoves(PKM pkm, CheckMoveResult[] res, int gen, Learn if (moves[m] == 0) continue; - if (learnInfo.Source.EggMoveSource.Contains(moves[m])) + bool wasEggMove = learnInfo.Source.EggMoveSource.Contains(moves[m]); + if (wasEggMove) { // To learn exclusive generation 1 moves the pokemon was tradeback, but it can't be trade to generation 1 // without removing moves above MaxMoveID_1, egg moves above MaxMoveID_1 and gen 1 moves are incompatible if (learnInfo.IsGen2Pkm && learnInfo.Gen1Moves.Count != 0 && moves[m] > Legal.MaxMoveID_1) { - res[m] = new CheckMoveResult(MoveSource.EggMove, gen, Severity.Invalid, V334, CheckIdentifier.Move) { Flag = true }; + res[m] = new CheckMoveResult(MoveSource.EggMove, gen, Severity.Invalid, V334, CheckIdentifier.Move); learnInfo.MixedGen12NonTradeback = true; } else @@ -413,15 +414,15 @@ private static void ParseEggMoves(PKM pkm, CheckMoveResult[] res, int gen, Learn if (!learnInfo.Source.EggEventSource.Contains(moves[m])) continue; - if (!learnInfo.Source.EggMoveSource.Contains(moves[m])) + if (!wasEggMove) { if (learnInfo.IsGen2Pkm && learnInfo.Gen1Moves.Count != 0 && moves[m] > Legal.MaxMoveID_1) { - res[m] = new CheckMoveResult(MoveSource.SpecialEgg, gen, Severity.Invalid, V334, CheckIdentifier.Move) { Flag = true }; + res[m] = new CheckMoveResult(MoveSource.SpecialEgg, gen, Severity.Invalid, V334, CheckIdentifier.Move); learnInfo.MixedGen12NonTradeback = true; } else - res[m] = new CheckMoveResult(MoveSource.SpecialEgg, gen, Severity.Valid, V333, CheckIdentifier.Move) { Flag = true }; + res[m] = new CheckMoveResult(MoveSource.SpecialEgg, gen, Severity.Valid, V333, CheckIdentifier.Move); } if (pkm.TradebackStatus == TradebackType.Any && pkm.GenNumber == 1) pkm.TradebackStatus = TradebackType.WasTradeback; @@ -462,6 +463,16 @@ private static void ParseEggMovesRemaining(PKM pkm, CheckMoveResult[] res, Learn } } private static void ParseRedYellowIncompatibleMoves(PKM pkm, IList res, int[] moves) + { + var incompatible = GetIncompatibleRBYMoves(pkm, moves); + if (incompatible.Count == 0) + return; + for (int m = 0; m < 4; m++) + if (incompatible.Contains(moves[m])) + res[m] = new CheckMoveResult(res[m], Severity.Invalid, V363, CheckIdentifier.Move); + } + + private static List GetIncompatibleRBYMoves(PKM pkm, int[] moves) { // Check moves that are learned at the same level in red/blue and yellow, these are illegal because there is no move reminder // There are only two incompatibilites; there is no illegal combination in generation 2+. @@ -469,7 +480,7 @@ private static void ParseRedYellowIncompatibleMoves(PKM pkm, IList res, int[] moves, List tmhm) { var species = SpeciesStrings; diff --git a/PKHeX.Core/Legality/Structures/CheckMoveResult.cs b/PKHeX.Core/Legality/Structures/CheckMoveResult.cs index 7ef93d69b..f30e891e9 100644 --- a/PKHeX.Core/Legality/Structures/CheckMoveResult.cs +++ b/PKHeX.Core/Legality/Structures/CheckMoveResult.cs @@ -27,6 +27,7 @@ public class CheckMoveResult : CheckResult { public readonly MoveSource Source; public readonly int Generation; + public bool Flag; internal CheckMoveResult(MoveSource m, int g, CheckIdentifier i) : base(i) diff --git a/PKHeX.Core/Legality/Structures/CheckResult.cs b/PKHeX.Core/Legality/Structures/CheckResult.cs index 7b6155155..9d09fe530 100644 --- a/PKHeX.Core/Legality/Structures/CheckResult.cs +++ b/PKHeX.Core/Legality/Structures/CheckResult.cs @@ -9,7 +9,6 @@ public class CheckResult internal string Comment = LegalityCheckStrings.V; public bool Valid => Judgement >= Severity.Fishy; public string Rating => Judgement.Description(); - public bool Flag; internal readonly CheckIdentifier Identifier; internal CheckResult(CheckIdentifier i) { Identifier = i; }