From e95dddd86d2c6ac4e6e28ba2629edea917484c7c Mon Sep 17 00:00:00 2001 From: Kurt Date: Tue, 16 Dec 2025 01:18:13 -0600 Subject: [PATCH] Fix initial move application of low leveled mons Relearn moves shouldn't really be applied by default (fixes honedge expecting Sacred Sword) Add edge case for modified learnset (Espurr) pre-dlc as an untouched level 7-8 capture. Only need 3 moves. ty abby on discord --- PKHeX.Core/Legality/Learnset/Learnset.cs | 5 ++++- .../Legality/Verifiers/LegendsZAVerifier.cs | 18 +++++++++++++++--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/PKHeX.Core/Legality/Learnset/Learnset.cs b/PKHeX.Core/Legality/Learnset/Learnset.cs index 84fdf966c..3ecdc7e89 100644 --- a/PKHeX.Core/Legality/Learnset/Learnset.cs +++ b/PKHeX.Core/Legality/Learnset/Learnset.cs @@ -134,7 +134,7 @@ public void SetEncounterMovesBackwards(byte level, Span moves, int ctr = if (sameDescend) { - while(start != 0 && Levels[start] == Levels[start - 1]) + while (start != 0 && Levels[start] == Levels[start - 1]) start--; } @@ -144,6 +144,9 @@ public void SetEncounterMovesBackwards(byte level, Span moves, int ctr = if (moves.Contains(move)) continue; + if (Levels[i] == 0) + break; // not a Level Up move + moves[ctr++] = move; if (ctr == 4) return; diff --git a/PKHeX.Core/Legality/Verifiers/LegendsZAVerifier.cs b/PKHeX.Core/Legality/Verifiers/LegendsZAVerifier.cs index e3a600931..30e7d232b 100644 --- a/PKHeX.Core/Legality/Verifiers/LegendsZAVerifier.cs +++ b/PKHeX.Core/Legality/Verifiers/LegendsZAVerifier.cs @@ -56,8 +56,20 @@ private void CheckLearnset(LegalityAnalysis data, PA9 pa) for (int i = 0; i < expect.Length; i++) { var move = expect[i]; - if (pa.GetMove(i) != move) - moves[i] = MoveResult.Unobtainable(move); + if (pa.GetMove(i) == move) + continue; + + // Espurr (among others) had new moves added to their learnset at low levels. + // Only for Espurr does it actually happen (Absol/Meowstic is never found at a low enough level). + // - Espurr @ Level 9 will gain Confusion to be 4 moves total (Pre-DLC). + // - Otherwise, the DLC learnset would require 4 at level 6 (lowest encounter is 7-8). + if (e9a.Species is (int)Espurr && move is (int)Teleport && pa.CurrentLevel < 9) // DLC + { + // do the more expensive check after; check species first + if (WasPossiblyObtainedBeforeDLC(pa, e9a)) + continue; + } + moves[i] = MoveResult.Unobtainable(move); } } @@ -310,7 +322,6 @@ private static bool WasPossiblyObtainedBeforeDLC(PKM pk, IEncounterTemplate enc) Roserade or Whirlipede or Scolipede when move is MortalSpin => true, Abomasnow when move is IceHammer => true, Gallade when move is SacredSword => true, - Espurr or Meowstic when move is Teleport => true, Meowstic when move is Moonblast => true, Honedge or Doublade or Aegislash when move is SacredSword => true, Malamar when move is Octolock => true, @@ -318,6 +329,7 @@ private static bool WasPossiblyObtainedBeforeDLC(PKM pk, IEncounterTemplate enc) Aurorus when move is IceHammer => true, // Level-up moves added in DLC: + Espurr or Meowstic when move is Teleport => true, Absol when move is ConfuseRay or ShadowSneak => true, _ => false,