Exemplo n.º 1
0
        /// <summary>
        /// Converts the <see cref="PKM"/> data into an importable set format for Pokémon Showdown.
        /// </summary>
        /// <param name="pkm">PKM to convert to string</param>
        /// <returns>New ShowdownSet object representing the input <see cref="pkm"/></returns>
        public ShowdownSet(PKM pkm)
        {
            if (pkm.Species <= 0)
            {
                return;
            }

            Format = pkm.Format;

            Nickname   = pkm.Nickname;
            Species    = pkm.Species;
            HeldItem   = pkm.HeldItem;
            Ability    = pkm.Ability;
            EVs        = pkm.EVs;
            IVs        = pkm.IVs;
            Moves      = pkm.Moves;
            Nature     = pkm.StatNature;
            Gender     = genders[pkm.Gender < 2 ? pkm.Gender : 2];
            Friendship = pkm.CurrentFriendship;
            Level      = Experience.GetLevel(pkm.EXP, pkm.PersonalInfo.EXPGrowth);
            Shiny      = pkm.IsShiny;

            if (pkm is IGigantamax g)
            {
                CanGigantamax = g.CanGigantamax;
            }

            SetFormString(pkm.AltForm);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Converts the <see cref="PKM"/> data into an importable set format for Pokémon Showdown.
        /// </summary>
        /// <param name="pkm">PKM to convert to string</param>
        /// <returns>New ShowdownSet object representing the input <see cref="pkm"/></returns>
        public ShowdownSet(PKM pkm)
        {
            if (pkm.Species <= 0)
            {
                return;
            }

            Nickname   = pkm.Nickname;
            Species    = pkm.Species;
            HeldItem   = pkm.HeldItem;
            Ability    = pkm.Ability;
            EVs        = pkm.EVs;
            IVs        = pkm.IVs;
            Moves      = pkm.Moves;
            Nature     = pkm.Nature;
            Gender     = genders[pkm.Gender < 2 ? pkm.Gender : 2];
            Friendship = pkm.CurrentFriendship;
            Level      = Experience.GetLevel(pkm.EXP, pkm.Species, pkm.AltForm);
            Shiny      = pkm.IsShiny;

            FormIndex = pkm.AltForm;
            string[] Forms = PKX.GetFormList(Species, Strings.Types, Strings.forms, genderForms, pkm.Format);
            Form   = pkm.AltForm > 0 && pkm.AltForm < Forms.Length ? Forms[pkm.AltForm] : string.Empty;
            Format = pkm.Format;
        }
Exemplo n.º 3
0
        /// <summary>
        /// Converts the <see cref="PKM"/> data into an importable set format for Pokémon Showdown.
        /// </summary>
        /// <param name="pkm">PKM to convert to string</param>
        /// <returns>New ShowdownSet object representing the input <see cref="pkm"/></returns>
        public ShowdownSet(PKM pkm)
        {
            if (pkm.Species <= 0)
            {
                return;
            }

            Format = pkm.Format;

            Nickname   = pkm.Nickname;
            Species    = pkm.Species;
            HeldItem   = pkm.HeldItem;
            Ability    = pkm.Ability;
            EVs        = pkm.EVs;
            IVs        = pkm.IVs;
            Moves      = pkm.Moves;
            Nature     = pkm.StatNature;
            Gender     = genders[pkm.Gender < 2 ? pkm.Gender : 2];
            Friendship = pkm.CurrentFriendship;
            Level      = Experience.GetLevel(pkm.EXP, pkm.PersonalInfo.EXPGrowth);
            Shiny      = pkm.IsShiny;
            Ball       = pkm.Ball;

            if (pkm is IGigantamax g)
            {
                CanGigantamax = g.CanGigantamax;
            }

            HiddenPowerType = HiddenPower.GetType(IVs, Format);
            if (pkm is IHyperTrain h)
            {
                for (int i = 0; i < 6; i++)
                {
                    if (h.GetHT(i))
                    {
                        IVs[i] = pkm.MaxIV;
                    }
                }
            }

            SetFormString(pkm.AltForm);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Converts the <see cref="PKM"/> data into an importable set format for Pokémon Showdown.
        /// </summary>
        /// <param name="pkm">PKM to convert to string</param>
        /// <returns>New ShowdownSet object representing the input <see cref="pkm"/></returns>
        public ShowdownSet(PKM pkm)
        {
            if (pkm.Species <= 0)
            {
                return;
            }

            Format = pkm.Format;

            Nickname   = pkm.Nickname;
            Species    = pkm.Species;
            HeldItem   = pkm.HeldItem;
            Ability    = pkm.Ability;
            EVs        = pkm.EVs;
            IVs        = pkm.IVs;
            Moves      = pkm.Moves;
            Nature     = pkm.Nature;
            Gender     = genders[pkm.Gender < 2 ? pkm.Gender : 2];
            Friendship = pkm.CurrentFriendship;
            Level      = Experience.GetLevel(pkm.EXP, pkm.Species, pkm.AltForm);
            Shiny      = pkm.IsShiny;

            SetFormString(pkm.AltForm);
        }
Exemplo n.º 5
0
 /// <summary>
 /// Gets the current level of a species.
 /// </summary>
 /// <param name="exp">Experience points</param>
 /// <param name="species">National Dex number of the Pokémon.</param>
 /// <param name="forme">AltForm ID (starters in Let's Go)</param>
 /// <returns>Current level of the species.</returns>
 public static int GetLevel(uint exp, int species, int forme)
 {
     return(Experience.GetLevel(exp, species, forme));
 }
Exemplo n.º 6
0
 /// <summary>
 /// Gets the current level of a species.
 /// </summary>
 /// <param name="species">National Dex number of the Pokémon.</param>
 /// <param name="exp">Experience points</param>
 /// <returns>Current level of the species.</returns>
 public static int GetLevel(int species, uint exp)
 {
     return(Experience.GetLevel(species, exp));
 }