From d4fb002f11beabecfc66cc24ab4326850b82ba4c Mon Sep 17 00:00:00 2001 From: javierhimura Date: Mon, 20 Mar 2017 12:45:28 +0100 Subject: [PATCH] Add location to gen 3 gift egg, legal analysis adapted to ignore gen 3 gift eggs encounters if the pokemon is hatched Is impossible to differentiated gen 3 normal eggs to gift eggs after hatched, assume normal egg. In the case of pokemon box eggs with special moves those moves should be analyzed separately and check the pokemon legal moves with both possible origins: normal egg and box egg --- PKHeX/Legality/Core.cs | 10 +++++++++- PKHeX/Legality/Tables3.cs | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/PKHeX/Legality/Core.cs b/PKHeX/Legality/Core.cs index 4f6a11fea..832dffe0f 100644 --- a/PKHeX/Legality/Core.cs +++ b/PKHeX/Legality/Core.cs @@ -579,7 +579,15 @@ internal static EncounterStatic getValidStaticEncounter(PKM pkm, GameVersion gam { if (e.Nature != Nature.Random && pkm.Nature != (int)e.Nature) continue; - if (e.EggLocation != pkm.Egg_Location) + if(pkm.Gen3 && e.EggLocation != 0) + { + //Hartched gen 3 gift egg can not be differentiated form normal eggs + if (!pkm.IsEgg || pkm.Format > 3) + continue; + if (e.EggLocation != pkm.Met_Location) + continue; + } + else if (e.EggLocation != pkm.Egg_Location) continue; if (pkm.HasOriginalMetLocation) { diff --git a/PKHeX/Legality/Tables3.cs b/PKHeX/Legality/Tables3.cs index 82a669b6b..93225ba42 100644 --- a/PKHeX/Legality/Tables3.cs +++ b/PKHeX/Legality/Tables3.cs @@ -160,7 +160,7 @@ public static partial class Legal //Gift new EncounterStatic { Gift = true, Species = 351, Level = 25, Location = 034, }, // Castform @ Weather Institute new EncounterStatic { Gift = true, Species = 374, Level = 5, Location = 013, }, // Beldum @ Mossdeep City - new EncounterStatic { Gift = true, Species = 360, Level = 5, }, // Wynaut Egg + new EncounterStatic { Gift = true, Species = 360, Level = 5, EggLocation = 253}, // Wynaut Egg //Stationary new EncounterStatic { Species = 352, Level = 30, Location = 034, }, //Kecleon @ Route 119 @@ -213,7 +213,7 @@ public static partial class Legal new EncounterStatic { Gift = true, Species = 129, Level = 5, Location = 099, }, // Magikarp @ Route 4 new EncounterStatic { Gift = true, Species = 131, Level = 25, Location = 134, }, // Lapras @ Silph Co. new EncounterStatic { Gift = true, Species = 133, Level = 25, Location = 094, }, // Eevee @ Celadon City - new EncounterStatic { Gift = true, Species = 175, Level = 5, }, // Togepi Egg + new EncounterStatic { Gift = true, Species = 175, Level = 5, EggLocation = 253 }, // Togepi Egg //Stationary new EncounterStatic { Species = 143, Level = 30, Location = 112, }, //Snorlax @ Route 12