From ae27c10dc2610c5313bdf174dcee88e0158f5c51 Mon Sep 17 00:00:00 2001 From: Kurt Date: Sun, 27 May 2018 12:18:27 -0700 Subject: [PATCH] Misc cxd fixes #1970 --- PKHeX.Core/Legality/Checks.cs | 2 ++ PKHeX.Core/Legality/Encounters/Data/EncountersWC3.cs | 2 +- .../Legality/Encounters/Generator/MysteryGiftGenerator.cs | 5 ++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/PKHeX.Core/Legality/Checks.cs b/PKHeX.Core/Legality/Checks.cs index 566426d54..209693e33 100644 --- a/PKHeX.Core/Legality/Checks.cs +++ b/PKHeX.Core/Legality/Checks.cs @@ -2366,6 +2366,8 @@ namespace PKHeX.Core VerifyWC3Shiny(w); return; case WC3 w: + if (w.Version == GameVersion.XD) + return; // Can have either state VerifyWC3Shiny(w); break; case MysteryGift g when g.Format != 3: // WC3 diff --git a/PKHeX.Core/Legality/Encounters/Data/EncountersWC3.cs b/PKHeX.Core/Legality/Encounters/Data/EncountersWC3.cs index f9c7d546f..dac0ac3ec 100644 --- a/PKHeX.Core/Legality/Encounters/Data/EncountersWC3.cs +++ b/PKHeX.Core/Legality/Encounters/Data/EncountersWC3.cs @@ -39,7 +39,7 @@ namespace PKHeX.Core new WC3 { Species = 213, Level = 20, Language = l, Location = 116, TID = 37149, SID = -1, OT_Gender = 0, OT_Name = d[l], Version = GameVersion.XD, CardTitle = $"Trade Surskit ({id})", Method = PIDType.CXD, Shiny = Shiny.Never, Moves = new[] { 092, 164, 188, 277 } }, // Shuckle @ Pyrite Town new WC3 { Species = 246, Level = 20, Language = l, Location = 116, TID = 37149, SID = -1, OT_Gender = 0, OT_Name = d[l], Version = GameVersion.XD, CardTitle = $"Trade Wooper ({id})", Method = PIDType.CXD, Shiny = Shiny.Never, Moves = new[] { 201, 349, 044, 200 } }, // Larvitar @ Pyrite Town new WC3 { Species = 311, Level = 13, Language = l, Location = 254, TID = 37149, SID = 0, OT_Gender = 0, OT_Name = d[l], Version = GameVersion.COLO, CardTitle = $"Special Gift ({id})", Method = PIDType.CXD, Shiny = Shiny.Never }, // Plusle @ Ingame Trade - new WC3 { Species = 250, Level = 70, Language = l, Location = 255, TID = 10048, SID = 0, OT_Gender = 0, OT_Name = m[l], Version = GameVersion.COLO, CardTitle = $"Mt. Battle Ho-oh ({id})", Method = PIDType.CXD, Shiny = Shiny.Never } // Ho-oh @ Mt. Battle + new WC3 { Species = 250, Level = 70, Language = l, Location = 255, TID = 10048, SID = 0, OT_Gender = 0, OT_Name = m[l], Version = GameVersion.S, CardTitle = $"Mt. Battle Ho-oh ({id})", Method = PIDType.CXD, Shiny = Shiny.Never } // Ho-oh @ Mt. Battle }; } } diff --git a/PKHeX.Core/Legality/Encounters/Generator/MysteryGiftGenerator.cs b/PKHeX.Core/Legality/Encounters/Generator/MysteryGiftGenerator.cs index adde235f8..b93c0b96c 100644 --- a/PKHeX.Core/Legality/Encounters/Generator/MysteryGiftGenerator.cs +++ b/PKHeX.Core/Legality/Encounters/Generator/MysteryGiftGenerator.cs @@ -175,7 +175,7 @@ namespace PKHeX.Core private static bool GetIsMatchWC3(PKM pkm, WC3 wc) { // Gen3 Version MUST match. - if (wc.Version != 0 && !((GameVersion)wc.Version).Contains((GameVersion)pkm.Version)) + if (wc.Version != 0 && !(wc.Version).Contains((GameVersion)pkm.Version)) return false; bool hatchedEgg = wc.IsEgg && !pkm.IsEgg; @@ -192,8 +192,7 @@ namespace PKHeX.Core if (wc.Fateful != pkm.FatefulEncounter) { // XD Gifts only at level 20 get flagged after transfer - bool valid = wc.Level == 20 && pkm is XK3; - if (!valid) + if (wc.Version == GameVersion.XD != pkm is XK3) return false; }