class Necromancer : public CPlayer{ //Derived necromancer class
public:
Necromancer(){ //Default constructor stats i want for a necromancer
setHealth(100);
setMaxHealth(100);
setMana(60);
setMaxMana(60);
setStrength(20);
setSpeed(60);
setDefense(40);
setName(nameSet());
setClass("Necromancer");
initSkills();
}
void printInfo(){ //Same as above
system("cls");
cout<<"Class: "<<getClass()<<endl;
printBaseInfo();
cout<<" Health: "<<getHealth()<<"/"<<getMaxHealth()<<endl;
cout<<" Mana: "<<getMana()<<"/"<<getMaxMana()<<endl;
cout<<" Strength: "<<getStrength()<<endl;
cout<<" Speed: "<<getSpeed()<<endl;
cout<<" Defense: "<<getDefense()<<endl;
printSkills();
}
void initSkills(){ //Same as above cept its for necromancer
skill[0] = "Fire";
skill[1] = "Flame";
skill[2] = "Burn";
skill[3] = "Big Burn";
skill[4] = "Blaze";
skill[5] = "Firestorm";
skill[6] = "Forest Fire";
skill[7] = "Flame of Demon";
skill[8] = "Smoke Rings";
skill[9] = "Hell Fire";
}
void attack(CMonster monster){
monster.setMonsterHealth(monster.getMonsterHealth() - 10);
cout<<monster.getHealth();
}
}player;
class CMonster{
private:
int health;
int maxhealth;
int defense;
int speed;
int strength;
public:
CMonster(){
health = 100;
maxhealth = 100;
defense = 100;
speed = 100;
strength = 100;
}
int getMonsterHealth(){
return health;
}
void setMonsterHealth(int newhealth){
health = newhealth;
}
}big;
int chartype;
void getCharacterType(){
cout<<"1) Barbarian\n";
cout<<"2) Necromancer\n";
cout<<"What kind of character would you like to be?";
cin>>chartype;
}
void main(){
getCharacterType();
player.attack(big);
}
if you didn't want to read that the part where i'm havin trouble is:
void attack(CMonster monster){
monster.setMonsterHealth(monster.getMonsterHealth() - 10);
cout<<monster.getHealth();
}
Plz help i'm stuck
Favorite Quotes:Gandalf: You shall not pass!|Smeagol: We don't need you!|Sloth: Hey you guys!|
[edited by - ssjcory on November 6, 2003 7:46:13 PM]
[edited by - ssjcory on November 6, 2003 7:46:52 PM]
[edited by - ssjcory on November 6, 2003 7:49:05 PM]