From 83bc2bf6534a2e989ec851a210ef58b8aa49c702 Mon Sep 17 00:00:00 2001 From: Kurt Date: Wed, 14 May 2025 01:35:11 -0500 Subject: [PATCH] Set egg form for gen5-9 Missed this in the PR gen5 needs form for basculin --- .../Encounters/Generator/ByGeneration/EncounterGenerator5.cs | 4 ++-- .../Legality/Encounters/Templates/Gen5/EncounterEgg5.cs | 4 ++-- .../Legality/Encounters/Templates/Gen6/EncounterEgg6.cs | 1 + .../Legality/Encounters/Templates/Gen7/EncounterEgg7.cs | 1 + .../Legality/Encounters/Templates/Gen8/EncounterEgg8.cs | 1 + .../Legality/Encounters/Templates/Gen8b/EncounterEgg8b.cs | 1 + .../Legality/Encounters/Templates/Gen9/EncounterEgg9.cs | 1 + 7 files changed, 9 insertions(+), 4 deletions(-) diff --git a/PKHeX.Core/Legality/Encounters/Generator/ByGeneration/EncounterGenerator5.cs b/PKHeX.Core/Legality/Encounters/Generator/ByGeneration/EncounterGenerator5.cs index baf07cdd6..ceda2b3f6 100644 --- a/PKHeX.Core/Legality/Encounters/Generator/ByGeneration/EncounterGenerator5.cs +++ b/PKHeX.Core/Legality/Encounters/Generator/ByGeneration/EncounterGenerator5.cs @@ -34,7 +34,7 @@ public IEnumerable GetEncounters(PKM pk, EvoCriteria[] chain, Le private const EntityContext Context = EntityContext.Gen5; private const byte EggLevel = EggStateLegality.EggMetLevel; - private static EncounterEgg5 CreateEggEncounter(ushort species, GameVersion version) => new(species, version); + private static EncounterEgg5 CreateEggEncounter(ushort species, byte form, GameVersion version) => new(species, form, version); private static (ushort Species, byte Form) GetBaby(EvoCriteria lowest) { @@ -63,7 +63,7 @@ public static bool TryGetEgg(ReadOnlySpan chain, GameVersion versio if (!PersonalTable.B2W2.IsPresentInGame(species, form)) return false; - result = CreateEggEncounter(species, version); + result = CreateEggEncounter(species, form,version); return true; } diff --git a/PKHeX.Core/Legality/Encounters/Templates/Gen5/EncounterEgg5.cs b/PKHeX.Core/Legality/Encounters/Templates/Gen5/EncounterEgg5.cs index 794ccd12b..2a2e92743 100644 --- a/PKHeX.Core/Legality/Encounters/Templates/Gen5/EncounterEgg5.cs +++ b/PKHeX.Core/Legality/Encounters/Templates/Gen5/EncounterEgg5.cs @@ -3,7 +3,7 @@ namespace PKHeX.Core; -public sealed record EncounterEgg5(ushort Species, GameVersion Version) : IEncounterEgg, IRandomCorrelation +public sealed record EncounterEgg5(ushort Species, byte Form, GameVersion Version) : IEncounterEgg, IRandomCorrelation { private const ushort Location = Locations.HatchLocation5; @@ -13,7 +13,6 @@ public sealed record EncounterEgg5(ushort Species, GameVersion Version) : IEncou public const byte Level = 1; public bool CanHaveVoltTackle => Species is (int)Core.Species.Pichu; - public byte Form => 0; public byte Generation => 5; public EntityContext Context => EntityContext.Gen5; public bool IsShiny => false; @@ -41,6 +40,7 @@ public PK5 ConvertToPKM(ITrainerInfo tr, EncounterCriteria criteria) var pk = new PK5 { Species = Species, + Form = Form, CurrentLevel = Level, Version = Version, Ball = (byte)FixedBall, diff --git a/PKHeX.Core/Legality/Encounters/Templates/Gen6/EncounterEgg6.cs b/PKHeX.Core/Legality/Encounters/Templates/Gen6/EncounterEgg6.cs index 10d41cb07..54a42fa21 100644 --- a/PKHeX.Core/Legality/Encounters/Templates/Gen6/EncounterEgg6.cs +++ b/PKHeX.Core/Legality/Encounters/Templates/Gen6/EncounterEgg6.cs @@ -41,6 +41,7 @@ public PK6 ConvertToPKM(ITrainerInfo tr, EncounterCriteria criteria) var pk = new PK6 { Species = Species, + Form = Form, CurrentLevel = Level, Version = Version, Ball = (byte)Ball.Poke, diff --git a/PKHeX.Core/Legality/Encounters/Templates/Gen7/EncounterEgg7.cs b/PKHeX.Core/Legality/Encounters/Templates/Gen7/EncounterEgg7.cs index 3d4124f85..0d4ade3ee 100644 --- a/PKHeX.Core/Legality/Encounters/Templates/Gen7/EncounterEgg7.cs +++ b/PKHeX.Core/Legality/Encounters/Templates/Gen7/EncounterEgg7.cs @@ -39,6 +39,7 @@ public PK7 ConvertToPKM(ITrainerInfo tr, EncounterCriteria criteria) var pk = new PK7 { Species = Species, + Form = Form, CurrentLevel = Level, Version = Version, Ball = (byte)Ball.Poke, diff --git a/PKHeX.Core/Legality/Encounters/Templates/Gen8/EncounterEgg8.cs b/PKHeX.Core/Legality/Encounters/Templates/Gen8/EncounterEgg8.cs index b10bb6cf3..91d16c288 100644 --- a/PKHeX.Core/Legality/Encounters/Templates/Gen8/EncounterEgg8.cs +++ b/PKHeX.Core/Legality/Encounters/Templates/Gen8/EncounterEgg8.cs @@ -36,6 +36,7 @@ public PK8 ConvertToPKM(ITrainerInfo tr, EncounterCriteria criteria) var pk = new PK8 { Species = Species, + Form = Form, CurrentLevel = Level, Version = Version, Ball = (byte)Ball.Poke, diff --git a/PKHeX.Core/Legality/Encounters/Templates/Gen8b/EncounterEgg8b.cs b/PKHeX.Core/Legality/Encounters/Templates/Gen8b/EncounterEgg8b.cs index 5602b32ba..216adc437 100644 --- a/PKHeX.Core/Legality/Encounters/Templates/Gen8b/EncounterEgg8b.cs +++ b/PKHeX.Core/Legality/Encounters/Templates/Gen8b/EncounterEgg8b.cs @@ -36,6 +36,7 @@ public PB8 ConvertToPKM(ITrainerInfo tr, EncounterCriteria criteria) var pk = new PB8 { Species = Species, + Form = Form, CurrentLevel = Level, Version = Version, Ball = (byte)Ball.Poke, diff --git a/PKHeX.Core/Legality/Encounters/Templates/Gen9/EncounterEgg9.cs b/PKHeX.Core/Legality/Encounters/Templates/Gen9/EncounterEgg9.cs index a77bf58fc..b9be056de 100644 --- a/PKHeX.Core/Legality/Encounters/Templates/Gen9/EncounterEgg9.cs +++ b/PKHeX.Core/Legality/Encounters/Templates/Gen9/EncounterEgg9.cs @@ -36,6 +36,7 @@ public PK9 ConvertToPKM(ITrainerInfo tr, EncounterCriteria criteria) var pk = new PK9 { Species = Species, + Form = Form, CurrentLevel = Level, Version = Version, Ball = (byte)Ball.Poke,