2024-03-04 05:13:16 +00:00
|
|
|
using System;
|
2022-01-03 05:35:59 +00:00
|
|
|
using static System.Buffers.Binary.BinaryPrimitives;
|
2019-06-09 02:56:11 +00:00
|
|
|
|
2022-06-18 18:04:24 +00:00
|
|
|
namespace PKHeX.Core;
|
|
|
|
|
2024-03-04 05:13:16 +00:00
|
|
|
public sealed class Situation7(SAV7 sav, Memory<byte> raw) : SaveBlock<SAV7>(sav, raw)
|
2019-06-09 02:56:11 +00:00
|
|
|
{
|
2022-06-18 18:04:24 +00:00
|
|
|
// "StartLocation"
|
2024-03-04 05:13:16 +00:00
|
|
|
public int M { get => ReadUInt16LittleEndian(Data); set => WriteUInt16LittleEndian(Data, (ushort)value); }
|
|
|
|
public float X { get => ReadSingleLittleEndian(Data[0x08..]); set => WriteSingleLittleEndian(Data[0x08..], value); }
|
|
|
|
public float Z { get => ReadSingleLittleEndian(Data[0x0C..]); set => WriteSingleLittleEndian(Data[0x0C..], value); }
|
|
|
|
public float Y { get => ReadSingleLittleEndian(Data[0x10..]); set => WriteSingleLittleEndian(Data[0x10..], value); }
|
|
|
|
public float RX { get => ReadSingleLittleEndian(Data[0x14..]); set => WriteSingleLittleEndian(Data[0x14..], value); }
|
|
|
|
public float RZ { get => ReadSingleLittleEndian(Data[0x18..]); set => WriteSingleLittleEndian(Data[0x18..], value); }
|
|
|
|
public float RY { get => ReadSingleLittleEndian(Data[0x1C..]); set => WriteSingleLittleEndian(Data[0x1C..], value); }
|
|
|
|
public float RW { get => ReadSingleLittleEndian(Data[0x20..]); set => WriteSingleLittleEndian(Data[0x20..], value); }
|
2022-06-18 18:04:24 +00:00
|
|
|
|
|
|
|
public void UpdateOverworldCoordinates()
|
|
|
|
{
|
|
|
|
var o = SAV.Overworld;
|
|
|
|
o.X = X;
|
|
|
|
o.Z = Z;
|
|
|
|
o.Y = Y;
|
2023-11-02 22:32:45 +00:00
|
|
|
o.RX = RX;
|
|
|
|
o.RZ = RZ;
|
|
|
|
o.RY = RY;
|
|
|
|
o.RW = RW;
|
2022-06-18 18:04:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public int SpecialLocation
|
|
|
|
{
|
2024-03-04 05:13:16 +00:00
|
|
|
get => Data[0x24];
|
|
|
|
set => Data[0x24] = (byte)value;
|
2022-06-18 18:04:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public int WarpContinueRequest
|
|
|
|
{
|
2024-03-04 05:13:16 +00:00
|
|
|
get => Data[0x6E];
|
|
|
|
set => Data[0x6E] = (byte)value;
|
2022-06-18 18:04:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public int StepCountEgg
|
|
|
|
{
|
2024-03-04 05:13:16 +00:00
|
|
|
get => ReadInt32LittleEndian(Data[0x70..]);
|
|
|
|
set => WriteInt32LittleEndian(Data[0x70..], value);
|
2022-06-18 18:04:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public int LastZoneID
|
|
|
|
{
|
2024-03-04 05:13:16 +00:00
|
|
|
get => ReadUInt16LittleEndian(Data[0x74..]);
|
|
|
|
set => WriteUInt16LittleEndian(Data[0x74..], (ushort)value);
|
2022-06-18 18:04:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public int StepCountFriendship
|
|
|
|
{
|
2024-03-04 05:13:16 +00:00
|
|
|
get => ReadUInt16LittleEndian(Data[0x76..]);
|
|
|
|
set => WriteUInt16LittleEndian(Data[0x76..], (ushort)value);
|
2022-06-18 18:04:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public int StepCountAffection // Kawaigari
|
2019-06-09 02:56:11 +00:00
|
|
|
{
|
2024-03-04 05:13:16 +00:00
|
|
|
get => ReadUInt16LittleEndian(Data[0x78..]);
|
|
|
|
set => WriteUInt16LittleEndian(Data[0x78..], (ushort)value);
|
2019-06-09 02:56:11 +00:00
|
|
|
}
|
2022-06-18 18:04:24 +00:00
|
|
|
}
|