public Pokemon(Player owner, PokemonCustomInfo custom, GameSettings settings) { Id = settings.NextId(); Owner = owner; TeamId = owner.TeamId; Name = custom.Name; PokemonType = DataService.GetPokemonType(custom.PokemonTypeId); Gender = custom.Gender; Lv = custom.Lv; Ability = DataService.GetAbility(custom.AbilityId); Nature = custom.Nature; { Moves = new Move[4]; int i = 0; foreach (int moveId in custom.MoveIds) if (i < 4) Moves[i++] = new Move(moveId, settings); StruggleId = settings.NextId(); SwitchId = settings.NextId(); } Base = new ReadOnly6D(PokemonType.BaseHp, PokemonType.BaseAtk, PokemonType.BaseDef, PokemonType.BaseSpAtk, PokemonType.BaseSpDef, PokemonType.BaseSpeed); Iv = new ReadOnly6D(custom.HpIv, custom.AtkIv, custom.DefIv, custom.SpAtkIv, custom.SpDefIv, custom.SpeedIv); Ev = new ReadOnly6D(custom.HpEv, custom.AtkEv, custom.DefEv, custom.SpAtkEv, custom.SpDefEv, custom.SpeedEv); Static = new ReadOnly6D(GetState(StatType.Hp), GetState(StatType.Atk), GetState(StatType.Def), GetState(StatType.SpAtk), GetState(StatType.SpDef), GetState(StatType.Speed)); if (custom.ItemId.HasValue) Item = DataService.GetItem(custom.ItemId.Value); State = PokemonState.Normal; Hp = new PairValue(Static.Hp, Static.Hp, 48); }
public Move(int moveType, GameSettings settings) { Id = settings.NextId(); Type = DataService.GetMoveType(moveType); PP = new PairValue((int)(Type.PP * settings.PPUp)); }