From c738857010bc35786efece24e2cd45a7f6062206 Mon Sep 17 00:00:00 2001 From: Kurt Date: Sat, 29 Aug 2020 14:33:51 -0700 Subject: [PATCH] Handle KOR Arcanine with PID=1 type Revise some logic flow and add comments indicating why There is no wc.Gender==3 for any gift; that's not how things are specified in GameFreak's internal tool (suspected). --- PKHeX.Core/MysteryGifts/PCD.cs | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/PKHeX.Core/MysteryGifts/PCD.cs b/PKHeX.Core/MysteryGifts/PCD.cs index 6ca005b1a..65dcd24b8 100644 --- a/PKHeX.Core/MysteryGifts/PCD.cs +++ b/PKHeX.Core/MysteryGifts/PCD.cs @@ -166,10 +166,26 @@ protected override bool IsMatchExact(PKM pkm, DexLevel evo) if (wc.Ball != pkm.Ball) return false; if (wc.OT_Gender < 3 && wc.OT_Gender != pkm.OT_Gender) return false; - if (wc.PID == 1 && pkm.IsShiny) return false; - if (wc.Gender != 3 && wc.Gender != pkm.Gender) return false; - if (pkm is IContestStats s && s.IsContestBelow(wc)) + if (wc.PID == 1) + { + // Random PID, never shiny + // PID=0 was never used (pure random). + if (pkm.IsShiny) + return false; + + // Don't check gender. All gifts that have PID=1 are genderless, with one exception. + // The KOR Arcanine can end up with either gender, even though the template may have a specified gender. + } + else + { + // Fixed PID + if (wc.Gender != pkm.Gender) + return false; + } + + // Milotic is the only gift to come with Contest stats. + if (wc.Species == (int)Core.Species.Milotic && pkm is IContestStats s && s.IsContestBelow(wc)) return false; return true;