my example compiles fine...hmmm, I thought I included the problem, here is the full class
Code:
class player {
public:
player (int health, int intelligence, int strength, int agility,
int stamina, int armormin, int armormax, string weap1name,
string weap1descr, string weap1shrtdescr, int weap1dmg,
int weap1moddmg, int weap1modtype, string weap2name,
string weap2descr, string weap2shrtdescr, int weap2dmg,
int weap2moddmg, int weap2modtype, string weap3name,
string weap3descr, string weap3shrtdescr, int weap3dmg,
int weap3moddmg, int weap3modtype ) {
}
~player () {}
int getagility ( void ) {
return agility;
}
int attack ( void ) {
cout << "Select you weapon of destruction\n\n";
cout << "1. " << weap1name << "\n";
cout << "2. " << weap2name << "\n";
cout << "3. " << weap3name << "\n";
cin >> choice;
cin.ignore();
switch ( choice ) {
case 1:
weap1dmg = dmg;
break;
case 2:
weap2dmg = dmg;
break;
case 3:
weap3dmg = dmg;
break;
default:
cout << "Don't be an idiot\n" << "You need to make a choice\nNow no attack for you!\n";
cin.get();
clrscrn();
break;
}
return dmg;
}
void takedmg( int dmg, int enemyagility) {
if (agility > enemyagility) {
agilitydif = agility - enemyagility;
}
if (agilitydif < 10) {
dmg = (dmg * ( 1 - ( agilitydif / 10 ) ) );
def = rand() % (armormax - armormin + 1) + armormin;
dmg = dmg - def;
if (dmg < 0) {
dmg = 0;
}
if (dmg != 0) {
cout << "Your armor blocked " << def << "DMG.\n";
cout << "\nYou took " << dmg << " DMG.\n:";
health = health - dmg;
cout << "\nYour health is down to " << health << " HP.\n";
cin.get();
clrscrn();
}
if (dmg == 0) {
cout << "No Damage Taken\n\n";
cout << "HP remains at " << health;
cin.get();
clrscrn();
}
}
if ( enemyagility <= agility ) {
cout << "You dodged the attack";
cin.get();
clrscrn();
}
}
private:
int health, intelligence, strength, agility, stamina, armormin, armormax;
int choice, enemyagility, agilitydif, dmg, def;
};