public void MakeRobotAttack(Robots robot)
 {
     int userInput = AttackOptions(true);
     robot.Attack(herd.dinosaurs[userInput]);
     if (herd.dinosaurs[userInput].dinohealth <= 0)
     {
         Console.WriteLine(herd.dinosaurs[userInput].type + "has been killed by opponent");
         herd.dinosaurs.RemoveAt(userInput);
     }
 }
Пример #2
0
        public Fleet()
        {
            robots = new List <Robots>();

            Robots robot1 = new Robots();
            Robots robot2 = new Robots();
            Robots robot3 = new Robots();

            robots.Add(robot1);
            robots.Add(robot2);
            robots.Add(robot3);
        }
        static void Main(string[] args)
        {
            Weapon selectedWeapon = new Weapon();

            Console.WriteLine("Please select a weapon type");
            string input = Console.ReadLine();

            switch (input)
            {
            case "Sword":
                selectedWeapon = new Weapon("Sword", 10);
                break;

            case "Axe":
                selectedWeapon = new Weapon("Axe", 5);
                break;

            default:
                break;
            }
            Robots Tom = new Robots(selectedWeapon);
        }
Пример #4
0
 public void Attack(Robots robot)
 {
     Console.WriteLine(robot.Name + "is attacked by" + type);
     robot.Health -= attackpower;
     energy       -= 10;
 }