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

            if (Enemy.getLife() >= Enemy.getLifeSize() * 0.80)
            {
                chanceATK = 75;
            }
            else if (Enemy.getLife() <= Enemy.getLifeSize() * 0.80)
            {
                chanceATK = 50;
            }
            else if (Enemy.getLife() <= Enemy.getLifeSize() * 0.50)
            {
                chanceATK = 25;
            }
            else if (Enemy.getLife() <= Enemy.getLifeSize() * 0.15)
            {
                chanceATK = 10;
            }

            if ((0 < Mode) && (Mode <= chanceATK))
            {
                Enemy.Attack();
            }
            else if ((chanceATK < Mode) && (Mode <= 100))
            {
                Enemy.Defence();
            }
        }
Пример #2
0
        public virtual void roundHero()
        {
            Console.WriteLine("A to ATK");
            Console.WriteLine("D to DEF");
            string option = Console.ReadLine();


            if ((option == "A") || (option == "a"))
            {
                hero.Attack();

                bool check = false;
                while (check == false)
                {
                    Console.WriteLine("Select the monster to attack");
                    IndexMonster = Convert.ToInt32(Console.ReadLine());
                    foreach (Monster item in EnemyList)
                    {
                        if (item.getID() == IndexMonster)
                        {
                            check = true;
                        }
                    }
                }
            }
            else
            {
                hero.Defence();
            }
        }