Expose SpeciesID3 for CK3/XK3

Closes #3463
Not going to add unobtainable species IDs to the GUI.
This commit is contained in:
Kurt 2022-03-13 19:53:46 -07:00
parent d95ba482f3
commit 5942a74147
4 changed files with 9 additions and 6 deletions

View file

@ -34,8 +34,8 @@ namespace PKHeX.Core
public Span<byte> NicknameCopy_Trash => Data.AsSpan(0x44, 22);
// Future Attributes
public override int Species { get => SpeciesConverter.GetG4Species(ReadUInt16BigEndian(Data.AsSpan(0x00))); set => WriteUInt16BigEndian(Data, (ushort)SpeciesConverter.GetG3Species(value)); }
public override ushort SpeciesID3 { get => ReadUInt16BigEndian(Data.AsSpan(0x00)); set => WriteUInt16BigEndian(Data.AsSpan(0x00), value); } // raw access
public override int Species { get => SpeciesConverter.GetG4Species(SpeciesID3); set => SpeciesID3 = (ushort)SpeciesConverter.GetG3Species(value); }
// 02-04 unused
public override uint PID { get => ReadUInt32BigEndian(Data.AsSpan(0x04)); set => WriteUInt32BigEndian(Data.AsSpan(0x04), value); }
public override int Version { get => GetGBAVersionID(Data[0x08]); set => Data[0x08] = GetGCVersionID(value); }

View file

@ -69,14 +69,14 @@ namespace PKHeX.Core
public ushort Sanity { get => ReadUInt16LittleEndian(Data.AsSpan(0x1E)); set => WriteUInt16LittleEndian(Data.AsSpan(0x1E), value); }
#region Block A
public int SpeciesID3 { get => ReadUInt16LittleEndian(Data.AsSpan(0x20)); set => WriteUInt16LittleEndian(Data.AsSpan(0x20), (ushort)value); } // raw access
public override ushort SpeciesID3 { get => ReadUInt16LittleEndian(Data.AsSpan(0x20)); set => WriteUInt16LittleEndian(Data.AsSpan(0x20), value); } // raw access
public override int Species
{
get => SpeciesConverter.GetG4Species(SpeciesID3);
set
{
SpeciesID3 = SpeciesConverter.GetG3Species(value);
SpeciesID3 = (ushort)SpeciesConverter.GetG3Species(value);
FlagHasSpecies = Species > 0;
}
}

View file

@ -35,6 +35,8 @@
public sealed override int CurrentHandler { get => 0; set { } }
public sealed override int Egg_Location { get => 0; set { } }
public abstract ushort SpeciesID3 { get; set; } // raw access
public sealed override int Form
{
get => Species == (int)Core.Species.Unown ? PKX.GetUnownForm(PID) : 0;
@ -118,7 +120,7 @@
/// <returns>New object with transferred properties.</returns>
protected T ConvertTo<T>() where T : G3PKM, new() => new()
{
Species = Species,
SpeciesID3 = SpeciesID3,
Language = Language,
PID = PID,
TID = TID,

View file

@ -31,7 +31,8 @@ namespace PKHeX.Core
public override Span<byte> Nickname_Trash => Data.AsSpan(0x4E, 22);
public Span<byte> NicknameCopy_Trash => Data.AsSpan(0x64, 22);
public override int Species { get => SpeciesConverter.GetG4Species(ReadUInt16BigEndian(Data.AsSpan(0x00))); set => WriteUInt16BigEndian(Data.AsSpan(0x00), (ushort)SpeciesConverter.GetG3Species(value)); }
public override ushort SpeciesID3 { get => ReadUInt16BigEndian(Data.AsSpan(0x00)); set => WriteUInt16BigEndian(Data.AsSpan(0x00), value); } // raw access
public override int Species { get => SpeciesConverter.GetG4Species(SpeciesID3); set => SpeciesID3 = (ushort)SpeciesConverter.GetG3Species(value); }
public override int SpriteItem => ItemConverter.GetItemFuture3((ushort)HeldItem);
public override int HeldItem { get => ReadUInt16BigEndian(Data.AsSpan(0x02)); set => WriteUInt16BigEndian(Data.AsSpan(0x02), (ushort)value); }
public override int Stat_HPCurrent { get => ReadUInt16BigEndian(Data.AsSpan(0x04)); set => WriteUInt16BigEndian(Data.AsSpan(0x04), (ushort)value); }