mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-04-24 15:47:15 -05:00
Add PBR Poké Coupons accessor (#4230)
This commit is contained in:
parent
c1b98025f7
commit
21a1d5fe6f
|
|
@ -157,14 +157,14 @@ public static bool IsChecksumsValid(Span<byte> sav)
|
|||
|
||||
private string GetOTName(int slot)
|
||||
{
|
||||
var ofs = 0x390 + (0x6FF00 * slot);
|
||||
var ofs = 0x390 + (SIZE_SLOT * slot);
|
||||
var span = Data.AsSpan(ofs, 16);
|
||||
return GetString(span);
|
||||
}
|
||||
|
||||
private void SetOTName(int slot, ReadOnlySpan<char> name)
|
||||
{
|
||||
var ofs = 0x390 + (0x6FF00 * slot);
|
||||
var ofs = 0x390 + (SIZE_SLOT * slot);
|
||||
var span = Data.AsSpan(ofs, 16);
|
||||
SetString(span, name, 7, StringConverterOption.ClearZero);
|
||||
}
|
||||
|
|
@ -175,6 +175,17 @@ private void SetOTName(int slot, ReadOnlySpan<char> name)
|
|||
public override int GetPartyOffset(int slot) => Party + (SIZE_PARTY * slot);
|
||||
public override int GetBoxOffset(int box) => Box + (SIZE_STORED * box * 30);
|
||||
|
||||
public override uint Money
|
||||
{
|
||||
get => (uint)((Data[(_currentSlot * SIZE_SLOT) + 0x12861] << 16) | (Data[(_currentSlot * SIZE_SLOT) + 0x12862] << 8) | Data[(_currentSlot * SIZE_SLOT) + 0x12863]);
|
||||
set
|
||||
{
|
||||
Data[(_currentSlot * SIZE_SLOT) + 0x12861] = (byte)((value >> 16) & 0xFF);
|
||||
Data[(_currentSlot * SIZE_SLOT) + 0x12862] = (byte)((value >> 8) & 0xFF);
|
||||
Data[(_currentSlot * SIZE_SLOT) + 0x12863] = (byte)(value & 0xFF);
|
||||
}
|
||||
}
|
||||
|
||||
public override ushort TID16
|
||||
{
|
||||
get => (ushort)((Data[(_currentSlot * SIZE_SLOT) + 0x12867] << 8) | Data[(_currentSlot * SIZE_SLOT) + 0x12860]);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user