Set egg form for gen5-9

Missed this in the PR
gen5 needs form for basculin
This commit is contained in:
Kurt
2025-05-14 01:35:11 -05:00
parent fa9713a1ad
commit 83bc2bf653
7 changed files with 9 additions and 4 deletions

View File

@@ -34,7 +34,7 @@ public IEnumerable<IEncounterable> 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<EvoCriteria> chain, GameVersion versio
if (!PersonalTable.B2W2.IsPresentInGame(species, form))
return false;
result = CreateEggEncounter(species, version);
result = CreateEggEncounter(species, form,version);
return true;
}

View File

@@ -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,

View File

@@ -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,

View File

@@ -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,

View File

@@ -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,

View File

@@ -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,

View File

@@ -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,