Exemple #1
0
 //function to enemy pet attack
 static void battleGary(petfight attacker, petfight defender)
 {
     Console.ReadLine();
     Console.Clear();
     Console.WriteLine("-------------------------------------------");
     Console.WriteLine("Surprise, Gary chooses to attack");
     attacker.attack(defender);
     Console.WriteLine("-------------------------------------------");
 }
Exemple #2
0
        //function to player attack
        static void battle(petfight attacker, petfight defender)
        {
            Console.WriteLine("-------------------------------------------");
            Console.WriteLine("1. Comeback(Attack)");
            Console.WriteLine("2. Take a deep breath(Heal)");

            Console.WriteLine("-------------------------------------------");
            int inputPlayer = getUserInputAsInteger(1, 2);



            if (inputPlayer == 1)
            {
                attacker.attack(defender);
            }
            if (inputPlayer == 2)
            {
                attacker.Potion();
            }
        }