From 4913ef9647d898950beb1ebfab86ca86e7a63327 Mon Sep 17 00:00:00 2001 From: Kurt Date: Tue, 8 May 2018 21:17:31 -0700 Subject: [PATCH] More generator updates * B2 has an error in the encounter table for Route 3 Corphish Special water encounter; GF edited from Basculin-1 to Corphish-1 and forgot to update the form to 0. * Ranch Trade egg locations * Trade gender-PID set correctly * static roamer glitch does not apply for emerald * Mirage Island wild Wynaut case now allowed (collision with Gift Wynaut egg hatched on Mirage Island?) gen1-3 done; now at 413 (Wormadam) which currently yields an EncounterEgg AS wormadam, which isn't right... --- .../Legality/Encounters/EncounterStatic.cs | 2 +- .../Legality/Encounters/EncounterTrade.cs | 10 ++++++++-- .../Generator/EncounterGenerator.cs | 1 + PKHeX.Core/Resources/byte/encounter_b2.pkl | Bin 39794 -> 39794 bytes 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/PKHeX.Core/Legality/Encounters/EncounterStatic.cs b/PKHeX.Core/Legality/Encounters/EncounterStatic.cs index d81541996..46246b2ca 100644 --- a/PKHeX.Core/Legality/Encounters/EncounterStatic.cs +++ b/PKHeX.Core/Legality/Encounters/EncounterStatic.cs @@ -193,7 +193,7 @@ private PIDType GetPIDType() { switch (Generation) { - case 3 when Roaming: + case 3 when Roaming && Version != GameVersion.E: // Roamer IV glitch was fixed in Emerald return PIDType.Method_1_Roamer; case 4 when Shiny == Shiny.Always: // Lake of Rage Gyarados return PIDType.ChainShiny; diff --git a/PKHeX.Core/Legality/Encounters/EncounterTrade.cs b/PKHeX.Core/Legality/Encounters/EncounterTrade.cs index 16c7ed1ea..03e94e908 100644 --- a/PKHeX.Core/Legality/Encounters/EncounterTrade.cs +++ b/PKHeX.Core/Legality/Encounters/EncounterTrade.cs @@ -76,13 +76,19 @@ public PKM ConvertToPKM(ITrainerInfo SAV) pk.Met_Level = level; pk.Met_Location = Location > 0 ? Location : DefaultMetLocation[Generation - 1]; } - pk.MetDate = DateTime.Today; + var today = DateTime.Today; + pk.MetDate = today; + if (EggLocation != 0) + { + pk.Egg_Location = EggLocation; + pk.EggMetDate = today; + } SAV.ApplyToPKM(pk); int nature = Nature == Nature.Random ? Util.Rand.Next(25) : (int)Nature; pk.Nature = nature; pk.Version = (int)version; - pk.Gender = Gender < 0 ? pk.PersonalInfo.RandomGender : Gender; + pk.Gender = pk.GetSaneGender(Gender < 0 ? pk.PersonalInfo.RandomGender : Gender); pk.AltForm = Form; pk.Language = lang; diff --git a/PKHeX.Core/Legality/Encounters/Generator/EncounterGenerator.cs b/PKHeX.Core/Legality/Encounters/Generator/EncounterGenerator.cs index 42b4cce27..540dedeaf 100644 --- a/PKHeX.Core/Legality/Encounters/Generator/EncounterGenerator.cs +++ b/PKHeX.Core/Legality/Encounters/Generator/EncounterGenerator.cs @@ -353,6 +353,7 @@ private static IEnumerable GenerateRawEncounters3(PKM pkm, Legal int species = pkm.Species; var deferNoFrame = new Queue(); var deferFrame = new Queue(); + pkm.WasEgg = false; // clear flag if set from static var slots = FrameFinder.GetFrames(info.PIDIV, pkm).ToList(); foreach (var z in GetValidWildEncounters34(pkm)) { diff --git a/PKHeX.Core/Resources/byte/encounter_b2.pkl b/PKHeX.Core/Resources/byte/encounter_b2.pkl index 9175c1388a4b2da8bb21a37d045c25c87a72ad80..bb9e1eeae9c2de2612ee6e5ea397a2f9483f3b24 100644 GIT binary patch delta 20 ccmeygjp@@irVU>U7#Sy@VY1q6Q0Sxu0BX$$#{d8T delta 20 ccmeygjp@@irVU>U7&#}OVY1q6Q0Sxu0Baox&j0`b