Question
Create a C++ program that fulfills the requirements of the following prompt: This program will create a text-based squad versus squad battling game. The game
Create a C++ program that fulfills the requirements of the following prompt:
This program will create a text-based squad versus squad battling game. The game will be set up so that two players can play and each player will control a squad. Each member of the squad will have basic and special abilities. When one squad has been fully defeated, that player will be declared the loser. The program will then exit.
The basis of this program will require the use of parallel arrays. You should maintain a set of parallel arrays for each squad. The arrays are as follows:
Squad members names
Squad members health values
Squad members mana values
Squad members attack values
Each member of the squad should be able to take the following actions:
Attack
Defend
Special Ability
You will create the special abilities as you see fit. It is okay to allow each squad to have the same special abilities. Each time the player uses a Special Ability, that squad members mana should be decremented by some amount. If there isnt enough mana left to use the ability, the player should be informed and the player should be allowed to choose another action to take. For an example, a special ability might look like this:
A squad member is a cleric. The clerics special ability is Heal. When I select Heal, I select a squad member. I then heal that squad member for 10 health points.
Play will proceed like this:
Squad As player takes their turn
Player A selects a squad member
Player A selects an action for that squad member
That action is carried out and whatever values should be updated, are
Squad Bs player takes their turn
Player B selects a squad member
Player B selects an action for that squad member
That action is carried out and whatever values should be updated, are
Play then loops back to Squad As player
The game is considered done when each member of a squad is at 0 heath or less.
Your program should be sectioned up using loops and functions. Specifically, special abilities should be in functions. If you need to pass a value to a function, do so using pointers ONLY (remember, passing an array to a function automatically works like a pointer). You should have appropriate validation when choosing what squad member to use (you shouldnt be able to use squad members with zero health).
Make your program run automatically without any player needing to make input by using randomization. That means all squad member choices are made by the program and all action choices are made by the program. Play will execute the exact same as outlined above.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started