Question: In this C++ project, you will create a simple class hierarchy as the basis for a fantasy combat game . Your universe contains Vampires, Barbarians,
In this C++ project, you will create a simple class hierarchy as the basis for a fantasy combat game. Your universe contains Vampires, Barbarians, Blue Men, Medusa and Harry Potter. Each has characteristics for attack, defense, armor, and strength points as follows.
| Type | Attack | Defense | Armor | Strength Points |
| Vampire1 | 1d12 | 1d6* Charm | 1 | 18 |
| Barbarian2 | 2d6 | 2d6 | 0 | 12 |
| Blue Men3 | 2d10 | 3d6 | 3 | 12 *Mob |
| Medusa4 | 2d6* Glare | 1d6 | 3 | 8 |
| Harry Potter5 | 2d6 | 2d6 | 0 | 10/20*Hogwarts |
Suave, debonair, but vicious and surprisingly resilient!
Think Conan or Hercules from the movies. Big sword, big muscles, bare torso.
They are small (6 tall), fast and tough. So they are hard to hit and can take some damage. As for the attack value, you can do a LOT of damage when you can crawl inside the armor or clothing of your opponent.
Scrawny lady with snakes for hair. They help with fighting. Just dont look at her!
Why are you reading this? How can you not know who Harry Potter is?
3d6 is rolling three 6-sided dice, 2d10 is rolling two 10-sided dice, etc.
*Charm: Vampires can charm an opponent into not attacking. For a given attack there is a 50% chance that their opponent does not actually attack them.
*Glare: If a Medusa rolls a 12 in attack, then the target has looked her in the eyes and is turned to stone. The Medusa wins! If Medusa uses Glare on Harry Potter on his first life, then Harry Potter get back to life. If the Vampire's Charm ability activates versus Medusa's Glare, the Vampire's Charm trump the Glare.
*Mob: The Blue Men are actually a swarm of small individuals. For every 4 points of damage (round down), they lose one defense die. For example, when they reach strength of 8 they only have 2d6 for defense.
*Hogwarts: If Harry dies (i.e. strength <=0), he immediately recovers and his total strength becomes 20. If he were to die again, then hes dead.
//--------------------------------------------------------------------
Project Requirements
In this project, you will write a program to run a tournament. Start with your project 3 program for creatures.
This is a one-user-two-players game. A user will enter the number of fighters both players will use. (You can limit the number of fighters in each team, but set it a little bit larger, like 10, or 20 to allow the enough testing.) The user should also enter the type of creatures and fighter names. You can give fighters different names. So player As first fighter could by Harry Potter and he could name the Harry Potter Creature "Larry Snotter" or just "Harry Potter No.1". One team could have more than 1 of the same character (e.g. Team A has 3 members: 2 barbarians and 1 harry potter). The first player supplies a lineup of creatures in order. The second player then supplies his lineup of creatures in order. By lineup I mean something like a batting order in baseball or softball. The head of each lineup fight against each other first. The winner gets put at the back of her/his teams lineup; the loser goes to the container for those who lost (there should be only one loser pile shared between both sides). The lineup order cannot be changed once the players are entered. Similarly, the loser pile should have the last loser at the top and the first loser at the bottom.
Even if a creature wins, she/he may have taken damage. You should restore some percentage of the damage when they get back in line. Make this simple as you are adding a new member function to the parent class. Some examples are: generate a random integer in some ranges, e.g., on a roll of 5 they recover 50% of the damage they lost, or some scheme of your own. If you want to use a different recovery function for each character, that is fine. Remember to use polymorphism if the recovery is different for different creatures!
After each round, you will display which type of creatures fought and which won on screen (For example, Round 1: Team A Blue man No.1 VS. Team B Harry Potter No.1, Harry Potter No.1 won!). At the end of the tournament (when one team or both run out of fighters in the lineup), your program will display final total points for each team (you can determine how to score each round of fight, for example, winner team +2, loser team -1, tie +1). You must display which team won the tournament. This is another element you must define in the analysis and design stage. You must have a method to determine the winner and you can determine it by yourself. Also provide an option at the end of the tournament to display the contents of the loser pile, i.e. print them out in order with the loser of the first round displayed last.
You should be using polymorphism and all creatures will inherit from the Creature class. Each object should be instantiated and put into their lineup. You will only use pointers to creatures in your program. A creature pointer can then be used to indicate an object of a subclass and polymorphism will ensure the correct function is called. Ask your TA if you are uncertain what this means.
NOTE: How does that tie change your end of match logic? What do you do if the final match is a tie? Specifically, where do you put the fighters? For this program, you should use stack-like or queue-like structures to hold the lineups and the loser pile. Which will you use for the lineup? Which will you use for the loser pile?
This is a programming assignment and not a complete game! Other than entering the lineup, the players just wait for the results. They should take no further actions. Make sure you test your program with instances of all creature types youve created. You may not be able to do an exhaustive test, but make it as extensive as you can. In the menu, please add an option that ask players if they would like to play again once the winner has been declared (it's nice for grading since we run it multiple times).
For this project please use your own containers like queue and linked list instead of the STL containers.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
