public FormStats(Pokedex pokedex, int form_id, Generations min_generation, int type1, int type2, IntStatValues base_stats, ByteStatValues reward_evs) : base(pokedex) { m_form_pair = Form.CreatePair(m_pokedex); m_type1_pair = Type.CreatePair(m_pokedex); m_type2_pair = Type.CreatePair(m_pokedex); m_lazy_pairs.Add(m_form_pair); m_lazy_pairs.Add(m_type1_pair); m_lazy_pairs.Add(m_type2_pair); m_form_pair.Key = form_id; MinGeneration = min_generation; m_type1_pair.Key = type1; m_type2_pair.Key = type2; BaseStats = base_stats; RewardEvs = reward_evs; }
public FormStats(Pokedex pokedex, int form_id, Generations min_generation, int type1, int type2, IntStatValues base_stats, ByteStatValues reward_evs) : base(pokedex) { m_form_pair = Form.CreatePair(m_pokedex); m_type1_pair = Type.CreatePair(m_pokedex); m_type2_pair = Type.CreatePair(m_pokedex); m_lazy_pairs.Add(m_form_pair); m_lazy_pairs.Add(m_type1_pair); m_lazy_pairs.Add(m_type2_pair); m_form_pair.Key = form_id; MinGeneration = min_generation; m_type1_pair.Key = type1; m_type2_pair.Key = type2; BaseStats = base_stats; RewardEvs = reward_evs; }
protected override void Load(BinaryReader reader) { base.Load(reader); { int rand = (int)Personality; byte[] block = reader.ReadBytes(100); for (int pos = 0; pos < 100; pos += 2) { rand = DecryptRNG(rand); block[pos] ^= (byte)(rand >> 16); block[pos + 1] ^= (byte)(rand >> 24); } StatusAffliction = block[0]; Unknown5 = block[1]; Unknown6 = BitConverter.ToUInt16(block, 2); // todo: validate this against the computed level //Level = block[4]; CapsuleIndex = block[5]; HP = BitConverter.ToUInt16(block, 6); // todo: validate this against computed stats m_stats = new IntStatValues(BitConverter.ToUInt16(block, 8), BitConverter.ToUInt16(block, 10), BitConverter.ToUInt16(block, 12), BitConverter.ToUInt16(block, 14), BitConverter.ToUInt16(block, 16), BitConverter.ToUInt16(block, 18)); Mail = new byte[56]; Array.Copy(block, 20, Mail, 0, 56); Unknown7 = new byte[8]; Array.Copy(block, 76, Unknown7, 0, 8); Padding = new byte[16]; Array.Copy(block, 84, Padding, 0, 16); } }