Пример #1
0
        public override void roundEnemies(Monster Enemy)
        {
            int Mode      = random.Next(0, 100);
            int chanceATK = 33;
            int chanceDEF = 33;

            if (Enemy.getLife() >= Enemy.getLifeSize() * 0.80)
            {
                chanceATK = 45;
                chanceDEF = 45;
            }
            else if (Enemy.getLife() <= Enemy.getLifeSize() * 0.80)
            {
                chanceATK = 25;
                chanceDEF = 50;
            }
            else if (Enemy.getLife() <= Enemy.getLifeSize() * 0.50)
            {
                chanceATK = 15;
                chanceDEF = 40;
            }
            else if (Enemy.getLife() <= Enemy.getLifeSize() * 0.15)
            {
                chanceATK = 5;
                chanceDEF = 30;
            }

            if ((0 < Mode) && (Mode <= chanceATK))
            {
                Enemy.Attack();
            }
            else if ((chanceATK < Mode) && (Mode <= (chanceATK + chanceDEF)))
            {
                Enemy.Defence();
            }
            else
            {
                Enemy.runAway();
            }
        }