diff --git a/PKHeX.Core/Legality/Areas/EncounterArea7.cs b/PKHeX.Core/Legality/Areas/EncounterArea7.cs index 479af8b23..44602aae5 100644 --- a/PKHeX.Core/Legality/Areas/EncounterArea7.cs +++ b/PKHeX.Core/Legality/Areas/EncounterArea7.cs @@ -28,7 +28,7 @@ void CachePressureSlot(EncounterSlot s) slotMax = s; } - if (Legal.AlolanVariantEvolutions12.Contains(species)) // match form if same species, else form 0. + if (Legal.AlolanVariantEvolutions12.Contains(species) || Legal.GalarVariantFormEvolutions.Contains(species)) // match form if same species, else form 0. { foreach (var slot in slots) { @@ -60,7 +60,7 @@ void CachePressureSlot(EncounterSlot s) if (slotMax == null) yield break; - if (Legal.AlolanVariantEvolutions12.Contains(species)) // match form if same species, else form 0. + if (Legal.AlolanVariantEvolutions12.Contains(species) || Legal.GalarVariantFormEvolutions.Contains(species)) // match form if same species, else form 0. { if (species == slotMax.Species ? slotMax.Form == form : slotMax.Form == 0) yield return GetPressureSlot(slotMax, pkm); diff --git a/PKHeX.Core/Legality/Areas/EncounterArea7b.cs b/PKHeX.Core/Legality/Areas/EncounterArea7b.cs index 8774900c6..ba26241e4 100644 --- a/PKHeX.Core/Legality/Areas/EncounterArea7b.cs +++ b/PKHeX.Core/Legality/Areas/EncounterArea7b.cs @@ -24,7 +24,7 @@ protected override IEnumerable GetFilteredSlots(PKM pkm, IEnumera int species = pkm.Species; int form = pkm.AltForm; - if (Legal.AlolanVariantEvolutions12.Contains(species)) // match form if same species, else form 0. + if (Legal.AlolanVariantEvolutions12.Contains(species) || Legal.GalarVariantFormEvolutions.Contains(species)) // match form if same species, else form 0. { if (pkm.AltForm != 0 && pkm is PB7) yield break; // can't get Alolan forms from wild diff --git a/PKHeX.Core/Legality/Areas/EncounterArea7g.cs b/PKHeX.Core/Legality/Areas/EncounterArea7g.cs index 5a0a389bb..5b88a819b 100644 --- a/PKHeX.Core/Legality/Areas/EncounterArea7g.cs +++ b/PKHeX.Core/Legality/Areas/EncounterArea7g.cs @@ -13,7 +13,7 @@ protected override IEnumerable GetFilteredSlots(PKM pkm, IEnumera int species = pkm.Species; int form = pkm.AltForm; - if (Legal.AlolanVariantEvolutions12.Contains(species)) // match form if same species, else form 0. + if (Legal.AlolanVariantEvolutions12.Contains(species) || Legal.GalarVariantFormEvolutions.Contains(species)) // match form if same species, else form 0. { foreach (var slot in slots) { diff --git a/PKHeX.Core/Legality/Core.cs b/PKHeX.Core/Legality/Core.cs index 14c76f4db..e2709b03c 100644 --- a/PKHeX.Core/Legality/Core.cs +++ b/PKHeX.Core/Legality/Core.cs @@ -453,7 +453,7 @@ private static bool IsEvolvedFormChange(PKM pkm) if (pkm.IsEgg) return false; - if (pkm.Format >= 7 && AlolanVariantEvolutions12.Contains(pkm.Species)) + if (pkm.Format >= 7 && (AlolanVariantEvolutions12.Contains(pkm.Species) || GalarVariantFormEvolutions.Contains(pkm.Species))) return pkm.AltForm == 1; if (pkm.Format >= 8) { diff --git a/PKHeX.Core/Legality/Encounters/Generator/EncounterEggGenerator.cs b/PKHeX.Core/Legality/Encounters/Generator/EncounterEggGenerator.cs index f56d7b824..cb24b0c5c 100644 --- a/PKHeX.Core/Legality/Encounters/Generator/EncounterEggGenerator.cs +++ b/PKHeX.Core/Legality/Encounters/Generator/EncounterEggGenerator.cs @@ -34,7 +34,7 @@ public static IEnumerable GenerateEggs(PKM pkm, IReadOnlyList 5 && (pkm.WasTradedEgg || all) && HasOtherGamePair(ver)) @@ -45,7 +45,7 @@ public static IEnumerable GenerateEggs(PKM pkm, IReadOnlyList 5 && (pkm.WasTradedEgg || all) && HasOtherGamePair(ver)) @@ -66,6 +66,14 @@ private static bool NoHatchFromEggForm(int species, int form, int gen) return false; } + private static bool NoHatchFromEggFormGen(int species, int form, GameVersion game) + { + // Sanity check form for origin + var gameInfo = GameData.GetPersonal(game); + var entry = gameInfo.GetFormeEntry(species, form); + return form >= entry.FormeCount; + } + // Gen6+ update the origin game when hatched. Quick manip for X.Y<->A.O | S.M<->US.UM, ie X->A private static GameVersion GetOtherTradePair(GameVersion ver) { diff --git a/PKHeX.Core/Legality/Evolutions/EvolutionTree.cs b/PKHeX.Core/Legality/Evolutions/EvolutionTree.cs index fbe598ab7..f0a1ec1fd 100644 --- a/PKHeX.Core/Legality/Evolutions/EvolutionTree.cs +++ b/PKHeX.Core/Legality/Evolutions/EvolutionTree.cs @@ -176,7 +176,7 @@ private void FixEvoTreeSS() { // Gigantamax Pikachu, Meowth-0, and Eevee are prevented from evolving. BanEvo((int)Species.Raichu, 0, pkm => pkm is IGigantamax g && g.CanGigantamax); - BanEvo((int)Species.Raichu, 1, pkm => pkm is IGigantamax g && g.CanGigantamax || pkm.Gen8); + BanEvo((int)Species.Raichu, 1, pkm => pkm is IGigantamax g && g.CanGigantamax || pkm.Gen8 || pkm.GG); BanEvo((int)Species.Persian, 0, pkm => pkm is IGigantamax g && g.CanGigantamax); BanEvo((int)Species.Weezing, 0, pkm => pkm.Gen8);