Attempted fix of #72 by using byte 0x41 for nature instead of PV.

This commit is contained in:
Greg Edwards
2019-12-31 02:38:17 -05:00
parent 9d59f2b922
commit 785dfca0a6
2 changed files with 11 additions and 2 deletions

View File

@@ -105,7 +105,7 @@ namespace PkmnFoundations.Structures
m_genderless = (forme & 0x04) != 0;
FormID = (byte)(forme >> 3);
byte nature = block[25]; // todo: which nature is real? Do they both need to match?
m_nature = block[25]; // todo: which nature is real? Do they both need to match?
m_bw_flags = BitConverter.ToUInt16(block, 26);
HiddenAbility = (m_bw_flags & 0x01) != 0;
N = (m_bw_flags & 0x02) != 0;
@@ -184,6 +184,15 @@ namespace PkmnFoundations.Structures
get { return Generations.Generation5; }
}
private byte m_nature;
public override Natures Nature
{
get
{
return (Natures)(m_nature % 25u);
}
}
private ushort m_bw_flags;
public bool HiddenAbility { get; set; }
public bool N { get; set; }

View File

@@ -123,7 +123,7 @@ namespace PkmnFoundations.Structures
public IList<MoveSlot> Moves { get { return m_moves; } }
public uint TrainerID { get; set; }
public uint Personality { get; set; }
public Natures Nature { get { return (Natures)(Personality % 25u); } }
public virtual Natures Nature { get { return (Natures)(Personality % 25u); } }
public byte Happiness { get; set; }
public Languages Language { get; set; }
public IvStatValues IVs { get; set; }