I'm trying to figure out how to make them fight.
and show stats. Please and thank you.
#include <iostream>
#include <Windows.h>
#define frz system("pause");
using namespace std;
class fighter {
private:
int mana;
int endurance;
int armor;
int health;
protected:
fighter(int m, int e, int a, int h) : mana(m), endurance(e), armor(a), health(h) {}
public:
//methods that all Fighters can use (i.e. things that all fighters can do)
virtual void fight(fighter &opponent);
virtual void hurt(int damage) { health -= damage; }
virtual bool isdead() const { return health <= 0; }
};
class Warrior : public fighter {
public:
Warrior () : fighter (23, 3, 5, 3) {}
};
class Mage : public fighter {
public:
Mage () : fighter (13, 4, 7, 6) {}
};
class Priest : public fighter {
public:
Priest () : fighter(14, 6, 4, 5) {}
};
int main ()
{
Sleep(3000);
cout << "ARENA!!" <<endl;
Sleep(1000);
cout << "Get ready for the fight of a lifetime" << endl;
Sleep(1000);
for (int n=5;n>0; n--) {
cout << n << " " << endl;
}
Sleep(500);
cout << "Begin!";
int PerformAttack(Mage &attacker, Priest &defender, Warrior &attack);