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);
        }
Exemple #2
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);
                }
            }
        }