internal PBEPokemon(PBETeam team, byte id, PBEPokemonShell shell) { Team = team; Id = id; Species = OriginalSpecies = KnownSpecies = shell.Species; var pData = PBEPokemonData.GetData(Species); KnownType1 = Type1 = pData.Type1; KnownType2 = Type2 = pData.Type2; KnownWeight = Weight = pData.Weight; Nickname = KnownNickname = shell.Nickname; Level = shell.Level; Friendship = shell.Friendship; Shiny = KnownShiny = shell.Shiny; Ability = OriginalAbility = shell.Ability; KnownAbility = PBEAbility.MAX; Nature = shell.Nature; Gender = KnownGender = shell.Gender; Item = OriginalItem = shell.Item; KnownItem = (PBEItem)ushort.MaxValue; EffortValues = new PBEEffortValues(shell.EffortValues); IndividualValues = new PBEIndividualValues(shell.IndividualValues); SetStats(); HP = MaxHP; HPPercentage = 1D; OriginalMoveset = new PBEMoveset(shell.Moveset); Moves = new PBEBattleMoveset(OriginalMoveset); KnownMoves = new PBEBattleMoveset(Team.Battle.Settings); TransformBackupMoves = new PBEBattleMoveset(Team.Battle.Settings); team.Party.Add(this); }
internal PBEPokemon(BinaryReader r, PBETeam team) { Team = team; Id = r.ReadByte(); Species = OriginalSpecies = KnownSpecies = (PBESpecies)r.ReadUInt32(); var pData = PBEPokemonData.GetData(Species); KnownType1 = Type1 = pData.Type1; KnownType2 = Type2 = pData.Type2; KnownWeight = Weight = pData.Weight; Nickname = KnownNickname = PBEUtils.StringFromBytes(r); Level = r.ReadByte(); Friendship = r.ReadByte(); Shiny = KnownShiny = r.ReadBoolean(); Ability = OriginalAbility = (PBEAbility)r.ReadByte(); KnownAbility = PBEAbility.MAX; Nature = (PBENature)r.ReadByte(); Gender = KnownGender = (PBEGender)r.ReadByte(); Item = OriginalItem = (PBEItem)r.ReadUInt16(); KnownItem = (PBEItem)ushort.MaxValue; EffortValues = new PBEEffortValues(Team.Battle.Settings, r); IndividualValues = new PBEIndividualValues(Team.Battle.Settings, r); SetStats(); HP = MaxHP; HPPercentage = 1D; OriginalMoveset = new PBEMoveset(Species, Level, Team.Battle.Settings, r); Moves = new PBEBattleMoveset(OriginalMoveset); KnownMoves = new PBEBattleMoveset(Team.Battle.Settings); TransformBackupMoves = new PBEBattleMoveset(Team.Battle.Settings); Team.Party.Add(this); }