mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-10 14:44:24 +00:00
Misc cxd format updates
fix friendship for xk3 fix colo fateful read
This commit is contained in:
parent
08f13cb3a1
commit
085a6e2a2b
3 changed files with 8 additions and 4 deletions
|
@ -176,14 +176,13 @@ namespace PKHeX.Core
|
|||
public override int PKRS_Strain { get => Data[0xCA] & 0xF; set => Data[0xCA] = (byte)(value & 0xF); }
|
||||
public override bool IsEgg { get => Data[0xCB] == 1; set => Data[0xCB] = (byte)(value ? 1 : 0); }
|
||||
public override bool AbilityBit { get => Data[0xCC] == 1; set => Data[0xCC] = (byte)(value ? 1 : 0); }
|
||||
public override bool Valid { get => Data[0xCD] == 0; set { if (value) Data[0xCD] = 0; } }
|
||||
public override bool FatefulEncounter { get => Data[0xCD] == 1; set { if (value) Data[0xCD] = 1; } }
|
||||
// 0xCE unknown
|
||||
public override int MarkValue { get => SwapBits(Data[0xCF], 1, 2); protected set => Data[0xCF] = (byte)SwapBits(value, 1, 2); }
|
||||
public override int PKRS_Days { get => Math.Max((sbyte)Data[0xD0], (sbyte)0); set => Data[0xD0] = (byte)(value == 0 ? 0xFF : value & 0xF); }
|
||||
public int ShadowID { get => BigEndian.ToUInt16(Data, 0xD8); set => BigEndian.GetBytes((ushort)value).CopyTo(Data, 0xD8); }
|
||||
public int Purification { get => BigEndian.ToInt32(Data, 0xDC); set => BigEndian.GetBytes(value).CopyTo(Data, 0xDC); }
|
||||
public uint EXP_Shadow { get => BigEndian.ToUInt32(Data, 0xC0); set => BigEndian.GetBytes(value).CopyTo(Data, 0xC0); }
|
||||
public override bool FatefulEncounter { get => Data[0x11C] == 1; set => Data[0x11C] = (byte)(value ? 1 : 0); }
|
||||
public new int EncounterType { get => Data[0xFB]; set => Data[0xFB] = (byte)value; }
|
||||
|
||||
protected override byte[] Encrypt()
|
||||
|
|
|
@ -93,7 +93,7 @@
|
|||
/// <returns>New object with transferred properties.</returns>
|
||||
protected T ConvertTo<T>() where T : _K3, new()
|
||||
{
|
||||
return new T // Convert away!
|
||||
var pk = new T // Convert away!
|
||||
{
|
||||
Species = Species,
|
||||
Language = Language,
|
||||
|
@ -174,6 +174,11 @@
|
|||
Unused3 = Unused3,
|
||||
Unused4 = Unused4,
|
||||
};
|
||||
|
||||
var ck3 = pk as CK3;
|
||||
if (ck3 != null)
|
||||
ck3.Purification = -100; // purified
|
||||
return pk;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ namespace PKHeX.Core
|
|||
public override int SpriteItem => ItemConverter.GetG4Item((ushort)HeldItem);
|
||||
public override int HeldItem { get => BigEndian.ToUInt16(Data, 0x02); set => BigEndian.GetBytes((ushort)value).CopyTo(Data, 0x02); }
|
||||
public override int Stat_HPCurrent { get => BigEndian.ToUInt16(Data, 0x04); set => BigEndian.GetBytes((ushort)value).CopyTo(Data, 0x04); }
|
||||
public override int OT_Friendship { get => Data[0x06]; set => Data[0x06] = (byte)value; }
|
||||
public override int OT_Friendship { get => BigEndian.ToUInt16(Data, 0x06); set => BigEndian.GetBytes((ushort)value).CopyTo(Data, 0x06); }
|
||||
public override int Met_Location { get => BigEndian.ToUInt16(Data, 0x08); set => BigEndian.GetBytes((ushort)value).CopyTo(Data, 0x08); }
|
||||
// 0x0A-0x0B Unknown
|
||||
// 0x0C-0x0D Unknown
|
||||
|
|
Loading…
Reference in a new issue