public BattleField()
 {
     robotFleet   = new Fleet();
     dinosaurHerd = new Herd();
     robotList    = new List <Robot> {
         robotFleet.c3P0, robotFleet.r2, robotFleet.droideka
     };
     dinoList = new List <Dinosaur> {
         dinosaurHerd.tRex, dinosaurHerd.pterodactyl, dinosaurHerd.stegosaurus
     };
 }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            Herd  dinoHerd  = new Herd();
            Fleet roboFleet = new Fleet();


            Battlefield battlefield = new Battlefield(dinoHerd, roboFleet);

            battlefield.SetPlayers(dinoHerd, roboFleet);

            battlefield.Battle();
        }
Exemplo n.º 3
0
 // Constructor
 public Battlefield(int fleetCount, int herdCount, string nameTheNewInstance)
 {
     Console.WriteLine("The battle will take place at {2}! {0} robot fleets will engage {1} saurian herds.", fleetCount, herdCount, nameTheNewInstance);
     this.fleetCount = fleetCount;
     this.herdCount  = herdCount;
     fleetBonus      = 2;
     herdBonus       = 2;
     fleet1          = new Fleet("The Shadow");
     fleet2          = new Fleet("The Curators");
     Console.WriteLine("\n");
     herd1 = new Herd("Obsidian");
     herd2 = new Herd("Collapse");
     Console.WriteLine("\n");
 }
Exemplo n.º 4
0
        public void Attack(Herd dinosaurHerd, Random rng)
        {
            int attackRoboIndex = rng.Next(0, robots.Count);

            if (robots.Count > 0)
            {
                Dinosaur roboTarget = robots[attackRoboIndex].AttackTarget(dinosaurHerd);

                //tryAttack method for dinosaurs & robots

                robots[attackRoboIndex].TryAttack(roboTarget);
                dinosaurHerd.AliveStatus();
            }
        }
        public void StartGame()
        {
            //activeFleet = InitializeRobots();
            //activeHerd = InitializeDinosaurs();
            Console.WriteLine("Welcome to Robots vs. Dinosaurs");
            Console.WriteLine("Would you like to play as Robots or Dinosaurs?");
            Console.WriteLine("1. Robots");
            Console.WriteLine("2. Dinosaurs");
            Console.WriteLine("3. Exit Game");
            string userInput = Console.ReadLine();

            switch (userInput)
            {
            case "1":
                goodGuy      = "Robot";
                playerTeam   = "Fleet";
                playAsRobot  = true;
                badGuy       = "Dinosaur";
                computerTeam = "Herd";
                activeFleet  = InitializeRobots();
                activeHerd   = InitializeDinosaurs();
                ArmRobots();
                RunGame();
                Console.Clear();
                break;

            case "2":
                goodGuy      = "dinosaur";
                playerTeam   = "Herd";
                badGuy       = "Robot";
                computerTeam = "Fleet";
                playAsRobot  = false;
                activeHerd   = InitializeDinosaurs();
                activeFleet  = InitializeRobots();
                ArmComputerRobots();
                RunGame();
                Console.Clear();
                break;

            case "3":
                Environment.Exit(0);
                break;

            default:
                RunGame();
                break;
            }
        }
Exemplo n.º 6
0
 //Constructor
 public GameEngine()
 {
     robot                        = new Robot();
     WeaponType                   = new WeaponType();
     weaponTypeS                  = new List <WeaponType>();
     dinoList                     = new List <Dinosaur>();
     robotList                    = new List <Robot>();
     runGame                      = true;
     fleet                        = new Fleet();
     counter                      = 0;
     difficulty                   = 0; // this will be set by the player before anything else, this is how we will determine how many dinos or robots they fight against.
     herdClass                    = new Herd();
     battlefieldClass             = new Battlefield();
     listofEnviroments            = new List <BattleEnviroment>();
     gamemode                     = 0;
     battlefieldEnvironmentPicked = 0;
 }
Exemplo n.º 7
0
        public Battlefield()
        {
            this.herd    = new Herd();
            this.fleet   = new Fleet();
            this.weapons = new Weapons();

            Console.WriteLine($"How many weapons do you want to create: ");
            int numWeapons = int.Parse(Console.ReadLine());

            for (int i = 0; i < numWeapons; i++)
            {
                weapons.AddWeaponToList();
            }

            fleet.AddRobotToFleet(weapons.weapons);
            fleet.AddRobotToFleet(weapons.weapons);
            fleet.AddRobotToFleet(weapons.weapons);

            herd.AddDinoToHerd();
            herd.AddDinoToHerd();
            herd.AddDinoToHerd();
        }
        public Herd herd; // use the constructor to instantiate
        // constructor
        public Battlefield()
        {
            fleet = new Fleet();
            herd  = new Herd();

            //fleet.AddRobotToFleet(fleet.CreateRobot("Glide", 100, 100));
            //fleet.ElementAt(0).ChooseWeapon();

            //fleet.AddRobotToFleet(fleet.CreateRobot("Grind", 100, 100));
            //fleet.ElementAt(1).ChooseWeapon();

            //fleet.AddRobotToFleet(fleet.CreateRobot("Delete", 100, 100));
            //fleet.ElementAt(2).ChooseWeapon();

            //herd.AddDinosaurToHerd(herd.CreateDinosaur("T-Rex", 100, 100, 20));
            //herd.AddDinosaurToHerd(herd.CreateDinosaur("Stegosaurus", 100, 100, 10));
            //herd.AddDinosaurToHerd(herd.CreateDinosaur("Pterodactyl", 100, 100, 5));



            //Weapon weapon1 = new Weapon("Gun", 30); // which class handles this?
            //Weapon weapon2 = new Weapon();

            //Robot robot1 = new Robot("Glide", 100, 100, weapon2); // which class handles this?
            //Robot robot2 = new Robot("Grind", 100, 100, weapon2);
            //Robot robot3 = new Robot("Delete", 100, 100, weapon1);

            //Dinosaur dinosaur1 = new Dinosaur("T-Rex", 100, 100, 20); // etc
            //Dinosaur dinosaur2 = new Dinosaur("Stegosaurus", 100, 100, 10);
            //Dinosaur dinosaur3 = new Dinosaur("Pterodactyl", 100, 100, 5);

            //fleet.AddRobotToFleet(robot1);
            //fleet.AddRobotToFleet(robot2);
            //fleet.AddRobotToFleet(robot3);

            //herd.AddDinosaurToHerd(dinosaur1);
            //herd.AddDinosaurToHerd(dinosaur2);
            //herd.AddDinosaurToHerd(dinosaur3);
        }
Exemplo n.º 9
0
        public Dinosaur AttackTarget(Herd herd)
        {
            Dinosaur targetedDinosaur = herd.dinosaurs[0];
            // make dinosaurs psychically target the robot in the fleet with the least amount of health that is greater than 0
            int leastHealth = 1;

            foreach (Dinosaur dinosaur in herd.dinosaurs)
            {
                if (dinosaur.health > 0 && dinosaur.health <= leastHealth)
                {
                    leastHealth      = dinosaur.health;
                    targetedDinosaur = dinosaur;
                }
                else if (dinosaur.health > 0 && dinosaur.health > leastHealth)
                {
                    leastHealth      = dinosaur.health;
                    targetedDinosaur = dinosaur;
                }
            }

            return(targetedDinosaur);
        }
Exemplo n.º 10
0
        //member methods
        public Herd CreateHerd()
        {
            Herd herd = new Herd();

            return(herd);
        }
Exemplo n.º 11
0
 //ctor
 public Battlefield()
 {
     robotFleet   = new Fleet();
     dinosaurHerd = new Herd();
 }
Exemplo n.º 12
0
 //CONSTRUCTOR SPAWNning in ?
 public Battlefield(Fleet fleet, Herd herd)
 {
     fleet = new Fleet();
     herd  = new Herd();
 }
Exemplo n.º 13
0
 public Battlefield()
 {
     herd       = new Herd();
     fleet      = new Fleet();
     dinoAttack = new DinoWeapon();
 }
Exemplo n.º 14
0
 //Constructor
 public Battlefield()
 {
     this.fleet = new Fleet();
     this.herd  = new Herd();
 }
Exemplo n.º 15
0
 //constructor (INITIAL VALUES)
 public BattleField()
 {
     herd  = new Herd();
     fleet = new Fleet();
 }
        //member variables


        //constructor



        //member methods



        public void RunBattle()
        {
            Fleet fleet = new Fleet();
            Herd  herd  = new Herd();

            Console.WriteLine("Welcome to the Jungle");
            fleet.fleetList[0].RobotChooseWeapon(fleet);
            while (fleet.fleetList.Count > 0 && herd.herdList.Count > 0)
            {
                fleet.fleetList[0].RobotAttack(herd.herdList[0]);
                herd.herdList[0].DinoChooseAttack(fleet.fleetList[0]);
                Console.WriteLine(herd.herdList[0].dinoName + "'s health is at: " + herd.herdList[0].dinoHealth);
                Console.WriteLine(fleet.fleetList[0].robotName + "'s health is at: " + fleet.fleetList[0].robotHealth);

                if (herd.herdList[0].dinoEnergy <= 0 && fleet.fleetList[0].robotPowerLevel <= 0)
                {
                    herd.herdList[0].DinoRest();
                    fleet.fleetList[0].RobotRest();
                }
                else if (herd.herdList[0].dinoEnergy <= 0)
                {
                    herd.herdList[0].DinoRest();
                    fleet.fleetList[0].RobotAttack(herd.herdList[0]);
                }
                else if (fleet.fleetList[0].robotPowerLevel <= 0)
                {
                    fleet.fleetList[0].RobotRest();
                    herd.herdList[0].DinoChooseAttack(fleet.fleetList[0]);
                }

                if (fleet.fleetList[0].robotHealth <= 0 && fleet.fleetList.Count > 1)
                {
                    Console.WriteLine(fleet.fleetList[0].robotName + " is defeated");
                    Console.ReadLine();
                    fleet.fleetList.RemoveAt(0);
                    //fleet.fleetList[0].RobotChooseWeapon(fleet);
                }
                else if (fleet.fleetList[0].robotHealth <= 0)
                {
                    Console.WriteLine(fleet.fleetList[0].robotName + " is defeated");
                    Console.ReadLine();
                    fleet.fleetList.RemoveAt(0);
                }
                else if (herd.herdList[0].dinoHealth <= 0)
                {
                    Console.WriteLine(herd.herdList[0].dinoName + " is defeated");
                    Console.ReadLine();
                    herd.herdList.RemoveAt(0);
                }
            }
            if (fleet.fleetList.Count == 0)
            {
                Console.WriteLine("Dinosaurs Win");
            }
            else
            {
                Console.WriteLine("Robots Win");
            }

            Console.ReadLine();
        }
Exemplo n.º 17
0
        //// member variables - Has A
        //List<Weapon> nameofweaponsinList; // The Battlefield has 3 weapons to use


        //// constructor - Spawner
        public Battlefield()
        {
            theFleet = new Fleet();
            theHerd  = new Herd();
        }
 // Instantiate these variables in the constructor
 public Battlefield()
 {
     Fleet robots    = new Fleet();
     Herd  dinosaurs = new Herd();
 }
 public Fleet robotSquad; //calling in the herd class to be used in the battlefield class/object
 public Battlefield()
 {
     dinoSquad  = new Herd();  // this is a new Herd
     robotSquad = new Fleet(); // this is a new Fleet
 }
Exemplo n.º 20
0
 public abstract float ComputerChooseAttackType(Warrior warrior, Herd herd, Random rng);
Exemplo n.º 21
0
 public Battlefield(Herd dinosCreator, Fleet robosCreator)
 {
     dinosaurs = dinosCreator;
     robots    = robosCreator;
 }
Exemplo n.º 22
0
 //Constructor
 public Battlefield()
 {
     fleet = new Fleet();
     herd  = new Herd();
 }
Exemplo n.º 23
0
 public Battlefield()
 {
     fleet = new Fleet();
     herd  = new Herd();
     rng   = new Random();
 }
Exemplo n.º 24
0
 public override float ComputerChooseAttackType(Warrior warrior, Herd herd, Random rng)
 {
     throw new NotImplementedException();
 }