internal SimPokemon(int id, SimPlayer owner, IPokemonData custom)
        {
            Id     = id;
            Owner  = owner;
            TeamId = owner.Team;

            Gender       = custom.Gender;
            Lv           = custom.Lv;
            nature       = custom.Nature;
            abilityIndex = custom.AbilityIndex;
            Moves        = custom.Moves.Select((m) => new Move(m.Move, m.PP)).ToArray();
            Item         = custom.Item;
            iv           = new ReadOnly6D(custom.Iv);
            ev           = new ReadOnly6D(custom.Ev);
            _hp          = new PairValue(GameHelper.GetHp(custom.Form.Data.Base.Hp, (byte)iv.Hp, (byte)ev.Hp, (byte)Lv));

            Form       = custom.Form;
            originForm = Form;
            Name       = custom.Name ?? GameString.Current.Pokemon(_form.Species.Number);
        }
示例#2
0
 public SimGame(IGameSettings settings, SimPlayer player, SimPlayer partner)
 {
     Settings = settings;
     Player   = player;
     Team     = new SimPlayer[Settings.Mode.PlayersPerTeam()];
     Team[player.TeamIndex] = Player;
     if (partner != null)
     {
         Team[partner.TeamIndex] = partner;
     }
     OnboardPokemons = new SimOnboardPokemon[Settings.Mode.XBound()];
     Pokemons        = new Dictionary <int, SimPokemon>();
     foreach (var p in Team)
     {
         foreach (var pm in p.Pokemons)
         {
             Pokemons.Add(pm.Id, pm);
         }
     }
 }
示例#3
0
        internal SimPokemon(int id, SimPlayer owner, IPokemonData custom)
        {
            Id     = id;
            Owner  = owner;
            TeamId = owner.Team;

            Gender       = custom.Gender;
            Lv           = custom.Lv;
            nature       = custom.Nature;
            abilityIndex = custom.AbilityIndex;
            Moves        = custom.Moves.Select((m) => new Move(m.Move, m.PP)).ToArray();

            Item      = custom.Item;
            Happiness = custom.Happiness;

            iv  = new ReadOnly6D(custom.Iv);
            ev  = new ReadOnly6D(custom.Ev);
            _hp = new PairValue(GameHelper.GetHp(custom.Form.Data.Base.Hp, (byte)iv.Hp, (byte)ev.Hp, (byte)Lv));

            Form       = custom.Form;
            originForm = Form;
            Name       = custom.Name ?? GameString.Current.Pokemon(_form.Species.Number);

            HiddenPower = GameHelper.HiddenPower(iv);
            for (int i = 0; i < Moves.Length; ++i)
            {
                if (Moves[i].Type.Id == Ms.HIDDEN_POWER)
                {
                    Moves[i] = new Move(new MoveType(Moves[i].Type.Id, HiddenPower, Moves[i].Type.Category, Moves[i].Type.Power, Moves[i].Type.Accuracy, Moves[i].Type.PP, Moves[i].Type.Range), Moves[i].PP.Value);
                }
                if (Moves[i].Type.Id == Ms.NATURAL_GIFT)
                {
                    Moves[i] = new Move(new MoveType(Moves[i].Type.Id, GameHelper.NatureGift(Item), Moves[i].Type.Category, Moves[i].Type.Power, Moves[i].Type.Accuracy, Moves[i].Type.PP, Moves[i].Type.Range), Moves[i].PP.Value);
                }
            }
        }