コード例 #1
0
        public static IVS LevelUp(IVS ivsToLvl)
        {
            Random rand = new Random();

            int hp    = 0;
            int atk   = 0;
            int spAtk = 0;
            int def   = 0;
            int spDef = 0;
            int speed = 0;

            hp =
                ivsToLvl.HP + rand.Next(MIN_STAT_GAIN, MAX_STAT_GAIN) +
                rand.Next(MIN_BONUS_HP_GAIN, MAX_BONUS_HP_GAIN);
            atk =
                ivsToLvl.Attack + rand.Next(MIN_STAT_GAIN, MAX_STAT_GAIN);
            spAtk =
                ivsToLvl.SpecialAttack + rand.Next(MIN_STAT_GAIN, MAX_STAT_GAIN);
            def =
                ivsToLvl.Defense + rand.Next(MIN_STAT_GAIN, MAX_STAT_GAIN);
            spDef =
                ivsToLvl.SpecialDefense + rand.Next(MIN_STAT_GAIN, MAX_STAT_GAIN);
            speed =
                ivsToLvl.Speed + rand.Next(MIN_STAT_GAIN, MAX_STAT_GAIN);

            if (hp >= 300)
            {
                hp = 300;
            }
            if (atk >= 300)
            {
                atk = 300;
            }
            if (spAtk >= 300)
            {
                spAtk = 300;
            }
            if (def >= 300)
            {
                def = 300;
            }
            if (spDef >= 300)
            {
                spDef = 300;
            }
            if (speed >= 300)
            {
                speed = 300;
            }

            return(new IVS(hp, atk, spAtk, def, spDef, speed));
        }
コード例 #2
0
 public void LevelUp()
 {
     IVs = IVS.LevelUp(IVs);
 }