From bdd1158a251f52dfd2ea0739e98fdc1d73ddc039 Mon Sep 17 00:00:00 2001 From: Kurt Date: Sun, 11 Dec 2016 17:13:59 -0800 Subject: [PATCH] Add greninja variable PID edge case game programmer should have used the nonshiny mode option instead of randomly coming up with a PID closes #458 added missing gift check for level (was 'deferred' but never implemented) --- PKHeX/Legality/Checks.cs | 5 +++++ PKHeX/Legality/Core.cs | 14 +++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/PKHeX/Legality/Checks.cs b/PKHeX/Legality/Checks.cs index 671b5a2ce..0f84d9da4 100644 --- a/PKHeX/Legality/Checks.cs +++ b/PKHeX/Legality/Checks.cs @@ -486,6 +486,11 @@ private void verifyLevel() return; } } + if (MatchedGift != null && MatchedGift.Level > pkm.CurrentLevel) + { + AddLine(new CheckResult(Severity.Invalid, "Current Level below Wonder Card level.", CheckIdentifier.Level)); + return; + } int lvl = pkm.CurrentLevel; if (lvl > 1 && pkm.IsEgg) diff --git a/PKHeX/Legality/Core.cs b/PKHeX/Legality/Core.cs index 4c28a401a..96e124265 100644 --- a/PKHeX/Legality/Core.cs +++ b/PKHeX/Legality/Core.cs @@ -439,9 +439,6 @@ private static IEnumerable getMatchingWC7(PKM pkm, IEnumerable getMatchingWC7(PKM pkm, IEnumerable pkm.CNT_Tough) continue; if (wc.CNT_Sheen > pkm.CNT_Sheen) continue; + if (wc.PIDType == 2 && !pkm.IsShiny) continue; + if (wc.PIDType == 3 && pkm.IsShiny) continue; + + if ((pkm.SID << 16 | pkm.TID) == 0x79F57B49) // Greninja WC has variant PID and can arrive @ 36 or 37 + { + if (!pkm.IsShiny) + validWC7.Add(wc); + continue; + } + if (wc.PIDType == 0 && pkm.PID != wc.PID) continue; + // Some checks are best performed separately as they are caused by users screwing up valid data. // if (!wc.RelearnMoves.SequenceEqual(pkm.RelearnMoves)) continue; // Defer to relearn legality // if (wc.OT.Length > 0 && pkm.CurrentHandler != 1) continue; // Defer to ownership legality