Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In C++, what is the Main.cpp for this program to run the tournament? Thank you.

ID: 3844238 • Letter: I

Question

In C++, what is the Main.cpp for this program to run the tournament? Thank you.

In this project, using C++, you will write a program to run a tournament. Start with creature header and inplementation files listed below.
This is a one-user-two-players game. A user will enter the number of fighters both players will use. The user should also enter the type of creatures and fighter names. 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 winner gets put at the back of her/his team’s lineup; the loser goes to the container for those who lost. 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. To help you testing and that of the grader’s, provide an option to display the winner and the updated scores for each round. 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.
NOTE: Depending upon your implementation, you could have ties. 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 you’ve created. You may not be able to do an exhaustive test, but make it as extensive as you can.

Here are header and inplementation files. Ask if you need other files. These are files started and used for another program.

barbarian.cpp

#include <iostream>
#include "barbarian.hpp"

using namespace std;

void Barbarian::setData(){
fightName = "Barbarian";
fighterArmor = 0;
strength = 12;
death = false;
}

int Barbarian::fightAttack(){
int damage = rollForAttack();
cout << "Barbarian attacked for a total of " << damage<< " damage." << endl;
return damage;
}

void Barbarian::defend(int d){
int defend = rollForDefense();
int damage;
if(d != 999){
  cout << "Barbarian defends for " << defend<< " damage." << endl;
  damage = d - defend;
}else{
  damage = d;
}

if(damage <= 0){
  cout << "Barbarian defended himself." << endl;
  cout << "Armor at: " << fighterArmor<< endl;
  cout << "Strength left: " << strength<< endl;
}else if(damage = 999){
  cout << "Barbarian has died. He failed to divert his eyes from Medusa." << endl;
  cout << "Armor at: 0" << endl;
  cout << "Strength left: 0" << endl;
  death = true;
}else if(damage > fighterArmor){
  damage = damage - fighterArmor;
  strength = strength - damage;
  fighterArmor = 0;  
  if(strength > 0){
   cout << "Barbarian wounded." << endl;
   cout << "Armor at: " << endl;
   cout << "Strength at: " << endl;
  }else if(strength <= 0){
   cout << "Barbarian died. :(" << endl;
   cout << "Armor at: " << endl;
   cout << "Strength at: " << endl;
   death = true; //barbarian has died
  }
}
}

string Barbarian::getUserName(){
return fightName;
}

bool Barbarian::checkDeath(){
return death;
}

int Barbarian::rollForAttack(){
int diceRoll = rand()%6 + 1; //generate random number within 6 for die roll
diceRoll = diceRoll + (rand()%6 +1); //2nd dice added to get full attack
return diceRoll;
}

int Barbarian::rollForDefense(){
int diceRoll = rand()%6 + 1; //generate ramdom number for defense
diceRoll = diceRoll + (rand()%6 + 1);
return diceRoll;
}

int Barbarian::getFighterArmor(){
return fighterArmor;
}

int Barbarian::getFighterStrength(){
return strength;
}

barbarian.hpp

#ifndef BARBARIAN_HPP
#define BARBARIAN_HPP

#include "creature.hpp"

using namespace std;

class Barbarian:public Creature{
protected:

public:
  void setData();
  int fightAttack();
  void defend(int d);
  string getUserName();
  bool checkDeath();
  int rollForAttack();
  int rollForDefense();
  int getFighterArmor();
  int getFighterStrength();
  ~Barbarian(){};
};

#endif

bluemen.cpp

#include <iostream>
#include "bluemen.hpp"

void BlueMen::setData(){
fightName = "Bleu Men";
fighterArmor = 3;
strength = 12;
death = false;
lossDie = 0; //special ability
}

int BlueMen::fightAttack(){
int damage = rollForAttack();
cout << "Blue Men attacked for " << damage << "damage." << endl;
return damage;
}

void BlueMen::defend(int d){
int defend = rollForDefense();
int damage;
if(d != 999){
  cout << "Blue Men defended for " << defend<< " points." << endl;
  damage = d - defend;
}else{
  damage = d;

  if(damage <= 0){
   cout << "Blue Men defened." << endl;
   cout << "Armor points: " << fighterArmor << endl;
   cout << "Strength points: " << strength << endl;
  }else if(damage > 0 && damage <= fighterArmor){
   fighterArmor = fighterArmor - damage;
   cout << "Blue Men defended with minor damage." << endl;
   cout << "Armor points: " << fighterArmor << endl;
   cout << "Strength points: " << strength << endl;
  }else if(damage == 999){
   cout << "Blue Men has turned to stone after looking at Medusa." << endl;
   cout << "Armor points: " << fighterArmor << endl;
   cout << "Strength points: 0" << endl;
   death = true; //Blue men died
  }else if(damage > fighterArmor){
   damage = damage - fighterArmor;
   strength = strength - damage;
   fighterArmor = 0;
   if(strength > 0){
    cout << "Blue men have been wounded."<< endl;
    cout << "Armor points: " << fighterArmor << endl;
    cout << "Strength points: " << strength << endl;
   }else if(strength <= 0){
    cout << "Blue Men have died. :("<< endl;
    cout << "Armor points: " << fighterArmor << endl;
    cout << "Strength points: " << strength << endl;
    death = true; //blue men died
   }
  }
  if(strength <= 8 && strength > 4){//special ability for mob attack from blue men - every 4 pts of demage they lose one defensive roll
   lossDie = 1; //lose 1 die
  }else if(strength <= 4 && strength > 0){
   lossDie = 2; //lose 2 die
  }
}
}

string BlueMen::getUserName(){
return fightName;
}

bool BlueMen::checkDeath(){
return death;
}

int BlueMen::rollForAttack(){
int diceRoll = rand()%10 + 1; //generates a number within in 10
diceRoll = diceRoll + (rand()%10 + 1); //2nd dice roll added to first
return diceRoll;
}

int BlueMen::rollForDefense(){
int diceRoll;

if(lossDie == 0){
  diceRoll = rand()%6 + 1; //defensive roll within 6
  diceRoll = diceRoll + (rand()%6 + 1);
  diceRoll = diceRoll + (rand()%6 + 1);
}else if(lossDie == 1){
  diceRoll = rand()%6 + 1;
  diceRoll = diceRoll + (rand()%6 + 1);
}else if(lossDie == 2){
  diceRoll = rand()%6 + 1;
}

return diceRoll;
}

int BlueMen::getFighterArmor(){
return fighterArmor;
}

int BlueMen::getFighterStrength(){
return strength;
}   

bluemen.hpp

#ifndef BLUEMEN_HPP
#define BLUEMEN_HPP

#include "creature.hpp"
#include <time.h>

using namespace std;

class BlueMen:public Creature{
protected:
  int lossDie;
public:
  void setData();
  int fightAttack();
  void defend(int d);
  string getUserName();
  bool checkDeath();
  int rollForAttack();
  int rollForDefense();
  int getFighterArmor();
  int getFighterStrength();
  ~BlueMen(){}
};

#endif

harrypotter.cpp

#include <iostream>
#include "harrypotter.hpp"

void HarryPotter::setData(){
fightName = "Harry Potter";
fighterArmor = 0;
strength = 10;
death = false;
hogwarts = 1; //special ability for HP
}

int HarryPotter::fightAttack(){
int damage = rollForAttack(); //calling attack function
cout << "Harry Potter attacks and generated " << damage<< " damage points." << endl;
return damage;
}

void HarryPotter::defend(int d){
int defend = rollForDefense(); //calling defense function
int damage;
if(d != 999){
  cout << "Harry Potter defended for " << defend << " defense points." << endl;
  damage = d - defend;
}else{
  damage = d;
}

if(damage <= 0){
  cout << "Harry Potter defended himself." << endl;
  cout << "Armor points: " << fighterArmor<< endl;
  cout << "Strength points: " << strength<< endl;
}else if(damage = 999 && hogwarts == 1){//special ability
  cout << "Harry Potter died by looking at Medusa"<< endl;
  cout << "*At Hogwarts* and Harry Potter has recovered with 20 strength points." << endl;
  hogwarts = 0;
  strength = 20;
  cout << "Armor points: " << fighterArmor<< endl;
  cout << "Strength points: " << strength<< endl;
}else if(damage == 999 && hogwarts == 0){
  cout << "Harry Potter died by looking at Medusa. :(" << endl;
  strength = 0;
  cout << "Armor points: " << fighterArmor<< endl;
  cout << "Strength points: " << strength<< endl;
  death = true; //HP died
}else if(damage > fighterArmor){
  damage = damage - fighterArmor;
  strength = strength - damage;
  fighterArmor = 0;
  if(strength > 0){
   cout << "Potter is hurt." << endl;
   cout << "Armor points: " << fighterArmor << endl;
   cout << "Strength points: " << strength << endl;
  }else if(strength <= 0 && hogwarts == 1){ //special ability
   cout << "Potter died." << endl;
   cout << "*Hogwarts* saves HP." << endl;
   hogwarts = 0;
   strength = 20;
   cout << "Armor points: " << fighterArmor << endl;
   cout << "Strength points: " << strength << endl;
  }else if(strength <= 0 && hogwarts == 0){
   cout << "Potter has died. :(" << endl;
   cout << "Armor points: " << fighterArmor << endl;
   cout << "Strength points: " << strength << endl;
   death = true; //HP died
  }
}
}

string HarryPotter::getUserName(){
return fightName;
}

bool HarryPotter::checkDeath(){
return death;
}

int HarryPotter::rollForAttack(){
int diceRoll = rand()%6 + 1;
diceRoll = diceRoll + (rand()%6 + 1);
return diceRoll;
}

int HarryPotter::rollForDefense(){
int diceRoll = rand()%6 + 1;
diceRoll = diceRoll + (rand()%6 + 1);
return diceRoll;
}

int HarryPotter::getFighterArmor(){
return fighterArmor;
}

int HarryPotter::getFighterStrength(){
return strength;
}
harrypotter.hpp

#ifndef HARRYPOTTER_HPP
#define HARRYPOTTER_HPP

#include "creature.hpp"

class HarryPotter:public Creature{
protected:
  int hogwarts; //special ability indicated in instructions

public:
  void setData();
  int fightAttack();
  void defend(int d);
  string getUserName();
  bool checkDeath();
  int rollForAttack();
  int rollForDefense();
  int getFighterArmor();
  int getFighterStrength();
  ~HarryPotter() {}
};

#endif

medusa.cpp

#include <iostream>
#include "medusa.hpp"

void Medusa::setData(){
fightName = "Medusa";
fighterArmor = 3;
strength = 8;
death = false;
}

int Medusa::fightAttack(){
int damage = rollForAttack();
if(damage == 12){ //call special ability
  cout << "Enemy has stared into Medusa and is now stone." << endl;
  damage = 999;
}else if(damage != 12) {
  cout << "Medusa attacked for " << damage<< " damage points." << endl;
}

return damage;
}

void Medusa::defend(int d){
int defend = rollForDefense();
int damage;

if(d != 999){
  cout << "Medusa defened for " << defend<< " points." << endl;
  damage = d - defend;
}else{
  damage = d;
}

if(damage < 0){
  cout << "Medusa defended herself." << endl;
  cout << "Armor points: " << fighterArmor<< endl;
  cout << "Strength points: " << strength<< endl;
}else if(damage > 0 && damage <= fighterArmor){
  fighterArmor = fighterArmor - damage;
  cout << "Medusa's armor absorbed attack."<< endl;
  cout << "Armor points: " << fighterArmor<< endl;
  cout << "Strength points: " << strength<< endl;
}else if(damage = 999){
  cout << "Medusa has died by seeing her reflection. :(" << endl;
  cout << "Armor points: 0" << endl;
  cout << "Strength points: 0" << endl;
  death = true; //medusa died
}else if(damage > fighterArmor){
  damage = damage - fighterArmor;
  strength = strength - damage;
  fighterArmor = 0;
  if(strength > 0){
   cout << "Medusa hurt." << endl;
   cout << "Armor points: " << fighterArmor << endl;
   cout << "Strength points: " << strength << endl;
  }else if(strength <= 0){
   cout << "Medusa died." << endl;
   cout << "Armor points: " << fighterArmor << endl;
   cout << "Strength points: " << strength << endl;
   death = true; //medusa died
  }
}
}

string Medusa::getUserName(){
return fightName;
}

bool Medusa::checkDeath(){
return death;
}

int Medusa::rollForAttack(){
int diceRoll = rand()%6 + 1;
diceRoll = diceRoll + (rand()%6 + 1);
return diceRoll;
}

int Medusa::rollForDefense(){
int diceRoll = rand()%6 + 1;
return diceRoll;
}

int Medusa::getFighterArmor(){
return fighterArmor;
}

int Medusa::getFighterStrength(){
return strength;
}

medusa.hpp

#ifndef MEDUSA_HPP
#define MEDUSA_HPP

#include "creature.hpp"

class Medusa:public Creature{
protected:
public:
  void setData();
  int fightAttack();
  void defend(int d);
  string getUserName();
  bool checkDeath();
  int rollForAttack();
  int rollForDefense();
  int getFighterArmor();
  int getFighterStrength();
  ~Medusa() {}
};

#endif

vampire.cpp

#include <iostream>
#include "vampire.hpp"

void Vampire::setData(){
fightName = "Vampire";
fighterArmor = 1;
strength = 18;
death = false;
}

int Vampire::fightAttack(){
int damage = rollForAttack();
cout << "Vampire attacked for " << damage << "damage points." << endl;
return damage;
}

void Vampire::defend(int d){
int charm = rand()%2 + 1;//special ability, sees if vampire charmed other fighter out of attack

if(charm == 1){
  cout << "Vampire charmed opponent out of attack."<< endl;
  cout << "Armor points: " << fighterArmor<< endl;
  cout << "Strength points: " << strength<< endl;
}else{
  int defend = rollForDefense();
  int damage;
  if(d != 999){
   cout << "Vampire defended for " << defend << " defensive points." << endl;
   damage = d - defend;
  }
  else{
   damage = d;
  }

  if(damage <= 0){
   cout << "Vampire defended." << endl;
   cout << "Armor points: " << fighterArmor << endl;
   cout << "Strength points: " << strength << endl;
  }else if(damage == fighterArmor){
   fighterArmor = fighterArmor - damage;
   cout << "Vampire armor absorbed attack."<< endl;
   cout << "Armor points: " << fighterArmor << endl;
   cout << "Strength points: " << strength << endl;
  }
  else if(damage == 999){
   cout << "Vampire has died by looking at Medusa." << endl;
   cout << "Armor points: 0" << endl;
   cout << "Strength points: 0" << endl;
   death = true; //vampire died
  }else if(damage > fighterArmor){
   damage = damage - fighterArmor;
   strength = strength - damage;
   fighterArmor = 0;
   if(strength > 0){
    cout << "Vampire damaged but still lives." << endl;
    cout << "Armor points: " << fighterArmor << endl;
    cout << "Strength points: " << strength << endl;
   }else if(strength <= 0){
    cout << "Vampire has died. :("<< endl;
    cout << "Armor points: " << fighterArmor << endl;
    cout << "Strength points: " << strength << endl;
    death = true; //vampire died
   }
  }
}
}

string Vampire::getUserName(){
return fightName;
}

bool Vampire::checkDeath(){
return death;
}

int Vampire::rollForAttack(){
int diceRoll = rand()%12 + 1;
return diceRoll;
}

int Vampire::rollForDefense(){
int diceRoll = rand()%6 + 1;
return diceRoll;
}

int Vampire::getFighterArmor(){
return fighterArmor;
}

int Vampire::getFighterStrength(){
return strength;
}

vampire.hpp

#ifndef VAMPIRE_HPP
#define VAMPIRE_HPP

#include "creature.hpp"
#include <time.h>

class Vampire:public Creature{
protected:

public:
  void setData();
  int fightAttack();
  void defend(int d);
  string getUserName();
  bool checkDeath();
  int rollForAttack();
  int rollForDefense();
  int getFighterArmor();
  int getFighterStrength();
  ~Vampire(){}
};

#endif

creature.hpp

#ifndef CREATURE_HPP
#define CREATURE_HPP

#include <string>
#include <time.h>
#include <cstdlib>

using namespace std;

class Creature{
protected:
  string fightName;
  int fighterArmor;
  int strength;
  bool death;

public:
//all functions are virtual
  virtual void setData() = 0;
  virtual int fightAttack() = 0;
  virtual void defend(int d) = 0;
  virtual string getUserName() = 0;
  virtual bool checkDeath() = 0;
  virtual int rollForAttack() = 0;
  virtual int rollForDefense() = 0;
  virtual int getFighterArmor() = 0;
  virtual int getFighterStrength() = 0;
  virtual ~Creature() {}
};

#endif

Explanation / Answer

main.cpp

#include <iostream>
#include <cstdlib>
#include "Game.hpp"

// Note: system("CLS") works with win / visual studio. Use "clear" for *nix...
#define CLEAR_SCREEN "CLS"

int main(){

   int choice;       // how many fighters are on each team, or to exit
   char data;        // user input for showData
   bool showData;    // does the user want to see fight data?

   do
   {
       // main menu
       system(CLEAR_SCREEN);
       std::cout << "Welcome to the Tournament of Champions Team Fight!" << std::endl;
       std::cout << "Please enter the number of fighters on both teams (1 - 10),"
                  << std::endl;
       std::cout << "or zero to exit." << std::endl;
       std::cin >> choice;

       // validate choice
       while (choice < 0 || choice > 10){
           std::cout << "Please enter a value between 0 and 10." << std::endl;
           std::cin >> choice;
       }

       // if the user didn't exit
       if (choice != 0){
           //does the user want to see fight output for each round?
           std::cout << "Would you like to see fight details as combat occurs? (y/n)"
                      << std::endl;
           std::cin >> data;

           // validate data
           while ((data != 'y' && data != 'Y') && (data != 'n' && data != 'N')){
               std::cout << "Pleae enter a "y" or an "n"." << std::endl;
               std::cin >> data;
           }

           // convert data to bool value
           if (data == 'y' || data == 'Y')
               showData = true;
           else
               showData = false;

           // create a game and run it
           Game myGame(choice, showData);
           myGame.init();
           myGame.play();
           }

   // did the user exit?
   } while (choice != 0);
  

   return 0;
}
Barbarian.cpp

#include "Barbarian.hpp"


/************************************************************************************
** Default Constructor: Barbarian()
** Description: Creates a Barbarian object with 0 armor and 12 Strength Points.
************************************************************************************/
Barbarian::Barbarian(std::string n, bool s)
{
   setArmor(0);
   setSP(12);
   setPoints(0);
   setName(n);
   setCreatType("Barbarian");
   setShowData(s);
   d6 = new Die(6);
}


// Barbarian Destructor deletes d6
Barbarian::~Barbarian()
{
   delete d6;
}


/************************************************************************************
** Function: attack()
** Description: Calls 'Barbarian's attack function. Returns result of 2d6 rolls.
************************************************************************************/
int Barbarian::attack()
{
   int rawDamage = d6->roll() + d6->roll();
   if (showData){
       std::cout << "The Barbarian, " << name << ", attacks for: " << rawDamage
           << std::endl;
   }
   return rawDamage;
}


/************************************************************************************
** Function: defend(int)
** Description: Calls Barbarian's defend function.
** Parameters: int - represents raw damage of incoming attack. Defend function
**                     reduces this amound by 2d6 rolls and armor value. Adjusts
**                     Barbarian's Strength Points accordingly.
************************************************************************************/
int Barbarian::defend(int rD)
{
   if (rD == 99){ // Medusa glare attack
       if (showData){
           std::cout << "The Barbarian, " << name << ", has been turned to stone!"
               << std::endl;
       }
       SP = 0;
       return 20;
   }
   else {
       int def = d6->roll() + d6->roll() + armor;
       int f1pts = defensePrint(name, creatType, rD, def);
       return f1pts;
   }
}


/************************************************************************************
** Function: heal()
** Description: Heals the fighter for about half of their SP. Can't go over starting
**              SP value.
************************************************************************************/
void Barbarian::heal()
{
   int life = SP + 6;
   if (life > 12)
       SP = 12;
   else
       SP = life;
}
Barbarian.hpp

#ifndef BARBARIAN_HPP
#define BARBARIAN_HPP

#include "Creature.hpp"
#include <iostream>

class Barbarian : public Creature
{
private:
   Die *d6;   // 6 sided die used for attack and defend rolls.

public:

   /************************************************************************************
   ** Default Constructor: Barbarian()
   ** Description: Creates a Barbarian object with 0 armor and 12 Strength Points.
   ************************************************************************************/
   Barbarian(std::string, bool);


   // Barbarian Destructor deletes d6
   ~Barbarian();


   /************************************************************************************
   ** Function: attack()
   ** Description: Calls 'Barbarian's attack function. Returns result of 2d6 rolls.
   ************************************************************************************/
   int attack();


   /************************************************************************************
   ** Function: defend(int)
   ** Description: Calls Barbarian's defend function.
   ** Parameters: int - represents raw damage of incoming attack. Defend function
   **                     reduces this amound by 2d6 rolls and armor value. Adjusts
   **                     Barbarian's Strength Points accordingly.
   ************************************************************************************/
   int defend(int);

   /************************************************************************************
   ** Function: heal()
   ** Description: Heals the fighter for about half of their SP. Can't go over starting
   **              SP value.
   ************************************************************************************/
   void heal();

};

#endif
BlueMen.cpp

#include "BlueMen.hpp"


/************************************************************************************
** Default Constructor: BlueMen()
** Description: Creates a BlueMen object with 3 armor and 12 (*Mob) Strength Points.
************************************************************************************/
BlueMen::BlueMen(std::string n, bool s)
{
   setArmor(3);
   setSP(12);
   setPoints(0);
   setName(n);
   setCreatType("Blue Men");
   setShowData(s);
   d6 = new Die(6);
   d10 = new Die(10);
}


// BlueMen Destructor deletes d6 and d10
BlueMen::~BlueMen()
{
   delete d6;
   delete d10;
}


/************************************************************************************
** Function: attack()
** Description: Calls 'BlueMen's attack function. Returns result of 2d10 rolls.
************************************************************************************/
int BlueMen::attack()
{
   int rawDamage = d10->roll() + d10->roll();
   if (showData)
       std::cout << "The Blue Men, " << name << ", attack for: " << rawDamage
                  << std::endl;
   return rawDamage;
}


/************************************************************************************
** Function: defend(int)
** Description: Calls BlueMen's defend function.
** Parameters: int - represents raw damage of incoming attack. Defend function
**                     reduces this amound by 3d6* rolls and armor value. Adjusts
**                     BlueMen's Strength Points accordingly.
**                   * 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.
************************************************************************************/
int BlueMen::defend(int rD)
{
   if (rD == 99){ // Medusa glare attack
       if (showData){
           std::cout << "One of the Blue Men have been turned to stone!" << std::endl;
           std::cout << "The petrified fighter is dragged off the field "
               << "of battle by his comrades." << std::endl;
       }
       SP = 0;
       return 20;
   }
   else {
       int def;

       // Mob defense calculation...
       if (SP <= 4)
           def = d6->roll() + armor;
       else if (SP <= 8)
           def = d6->roll() + d6->roll() + armor;
       else // (SP <= 12)
           def = d6->roll() + d6->roll() + d6->roll() + armor;
      
       int f1pts = defensePrint(name, creatType, rD, def);
       return f1pts;
   }
}

/************************************************************************************
** Function: heal()
** Description: Heals the fighter for about half of their SP. Can't go over starting
**              SP value.
************************************************************************************/
void BlueMen::heal()
{
   int life = SP + 6;
   if (life > 12)
       SP = 12;
   else
       SP = life;
}
BlueMen.hpp

#ifndef BLUEMEN_HPP
#define BLUEMEN_HPP

#include "Creature.hpp"
#include <iostream>

class BlueMen : public Creature
{
private:
   Die *d6,      // 6 sided die used for defend rolls.
       *d10;    // 10 sided die used for attack rolls.

public:

   /************************************************************************************
   ** Default Constructor: BlueMen()
   ** Description: Creates a BlueMen object with 3 armor and 12 (*Mob) Strength Points.
   ************************************************************************************/
   BlueMen(std::string, bool);


   // BlueMen Destructor deletes d6 and d10
   ~BlueMen();


   /************************************************************************************
   ** Function: attack()
   ** Description: Calls 'BlueMen's attack function. Returns result of 2d10 rolls.
   ************************************************************************************/
   int attack();


   /************************************************************************************
   ** Function: defend(int)
   ** Description: Calls BlueMen's defend function.
   ** Parameters: int - represents raw damage of incoming attack. Defend function
   **                     reduces this amound by 3d6* rolls and armor value. Adjusts
   **                     BlueMen's Strength Points accordingly.
   **                   * 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.
   ************************************************************************************/
   int defend(int);

   /************************************************************************************
   ** Function: heal()
   ** Description: Heals the fighter for about half of their SP. Can't go over starting
   **              SP value.
   ************************************************************************************/
   void heal();

};

#endif
Creature.cpp

#include "Creature.hpp"

// Abstract Class, so not used...
Creature::Creature() {}
Creature::~Creature() {}


// calculates damage to deal to a fighter and possibly displays it
int Creature::defensePrint(std::string name, std::string type, int rD, int def)
{
   // raw damage - defense = damage
   int damage = rD - def;
   if (damage < 0)
       damage = 0;

   // subtract damage from Strength Points, can't go below zero
   SP -= damage;
   if (SP < 0)
       SP = 0;

   // display the round attack and damage info?
   if (showData){
       std::cout << "The " << type << ", " << name << " defends for: " << def << std::endl;
       std::cout << "The attack dealt: " << damage << " damage." << std::endl;
       std::cout << name << " has: " << SP << " Strength Point(s)." << std::endl;

   }

   // returns damage dealt to be used for adding points to attacking fighter
   return damage;
}

// adds scored points to a cretures points variable
void Creature::addPoints(int p)
{
   this->points += p;
}
// getters
int Creature::getPoints()
{
   return points;
}

int Creature::getArmor()
{
   return armor;
}

int Creature::getSP()
{
   return SP;
}

bool Creature::getShowData()
{
   return showData;
}

std::string Creature::getName()
{
   return name;
}

std::string Creature::getCreatType()
{
   return creatType;
}


// setters
void Creature::setPoints(int p)
{
   this->points = p;
}

void Creature::setArmor(int a)
{
   this->armor = a;
}
void Creature::setSP(int SP)
{
   this->SP = SP;
}

void Creature::setShowData(bool s)
{
   this->showData = s;
}


void Creature::setName(std::string n)
{
   this->name = n;
}

void Creature::setCreatType(std::string c)
{
   this->creatType = c;
}
Creature.hpp

#ifndef CREATURE_HPP
#define CREATURE_HPP

#include "Die.hpp"
#include <string>
#include <iostream>

class Creature
{
protected:
   int points,              // how many points the creature has earned
       armor,               // amout to subtract from incoming attack damage
       SP;                  // Strength Points - basically health...
   bool showData;           // Will the creature display attack/defend info?
   std::string name,        // name of the derived creature
                creatType;   // what creature is it? Vampire, Harry Potter, Barb, etc.

public:
   // Abstract Class, so not used...
   Creature();
   ~Creature();

   // virtual functions. See Derived Classes...
   virtual int attack() = 0;
   virtual int defend(int) = 0;
   virtual void heal() = 0;

   // normal functions
   // calculates damage to deal to a fighter and possibly displays it
   int defensePrint(std::string, std::string, int, int);

   // adds scored points to a cretures points variable
   void addPoints(int);


   // getters
   int getPoints();
   int getArmor();
   int getSP();
   bool getShowData();
   std::string getName();
   std::string getCreatType();

   // setters
   void setPoints(int);
   void setArmor(int);
   void setSP(int);
   void setShowData(bool);
   void setName(std::string);
   void setCreatType(std::string);


};

#endif
Die.cpp

#include "Die.hpp"
#include <cstdlib>


// default constructor sets sides to 6.
Die::Die()
{
   setSides(6);
}


// constructor with parameter to set the amount of sides for the die.
Die::Die(int s)
{
   setSides(s);
}


// sets the member variabe "sides".
void Die::setSides(int s)
{
   sides = s;
}


// getter function to return the number of sides this die object has.
int Die::getSides()
{
   return sides;
}

/*********************************************************************
** Function: roll()
** Description: Simulates a roll of a die and returns the int value.
** Parameters: None.
** Pre-Conditions: A random num generator must be seeded first.
** Post-Conditions: Returns a random int limited by the size of the die.
*********************************************************************/
int Die::roll()
{
   return std::rand() % sides + 1;
}
Die.hpp

#ifndef DIE_H
#define DIE_H

class Die
{
protected:

   int sides;      // how many side the die has.

public:

   // default constructor sets sides to 6.
   Die();

   // constructor with parameter to set the amount of sides for the die.
   Die(int);

   // sets the member variabe "sides".
   void setSides(int);

   // getter function to return the number of sides this die object has.
   int getSides();

   /***************************************************************************************
   ** Function: roll()
   ** Description: Simulates a roll of a die and returns the int value.
   ** Parameters: None.
   ** Pre-Conditions: A random num generator must be seeded first.
   ** Post-Conditions: Returns a random int limited by the size of the die.
   ***************************************************************************************/
   int roll();

};

#endif

Note. Due to limited character.I am not able to put all files..