Exemplo n.º 1
0
        public void Battle(enemy enemy)
        {
            char input;

            Console.WriteLine("you ran into " + enemy.getName());
            while (player.stillAlive() && enemy.stillAlive())
            {
                GetInput(out input, "yes", "no", "Do you want to fight?");

                if (input == '1')
                {
                    Console.WriteLine("You begin to fight the" + enemy.getName());
                    Console.WriteLine("You attack the" + enemy.getName() + " and kill it.");;
                    player.Attack(enemy);
                }

                if (input == '2')
                {
                    Console.WriteLine("You try and run away, but you trip and fall.");
                    Console.WriteLine(player.getName() + " Has taken 5 damage for falling");
                    player.Takedamage(5);
                    Console.WriteLine(player.getHealth());
                }
            }
        }
Exemplo n.º 2
0
 public virtual void Attack(enemy enemy)
 {
     enemy.Takedamage(_damage);
 }
Exemplo n.º 3
0
        public override void Attack(enemy enemy)
        {
            int totalDamage = _damage + claws;

            enemy.Takedamage(totalDamage);
        }