1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135
|
using namespace std;
double dubExponents(int, int) { return 0; }
class Mc
{
public:
Mc();
Mc(double debuggingLevel);
//XP is current XP. levelXP is the XP needed for next level. (total XP, not relative to current XP)
double XP;
double levelXP;
double level;
//cur = current, max = max
double curHP;
double maxHP;
double curMP;
double maxMP;
//raw stats
double strength;
double agility;
double endurance;
double intelligence;
double wisdom;
double charisma;
//with stat mods
double curStrength;
double curAgility;
double curEndurance;
double curIntelligence;
double curWisdom;
double curCharisma;
void checkLevelUp();
void changeXP(double value);
void levelUp();
void modStat(int statChoice, double value);
void damage(double value);
//HM means health and mana. the number chooses whether to do only HP, only MP, or both
void resetHM(double choice);
//allows for easy adjustment of starting stats; especially if you want multiple possible stat distributions
void setStartStats(double str, double agi, double end, double intel, double wis, double cha, double setHP, double setMP);
void checkDeath();
};
Mc::Mc()
{
level = 1;
XP = 0;
levelXP = dubExponents(2, level);
setStartStats(1, 1, 1, 1, 1, 1, 10, 10);
}
void Mc::checkLevelUp()
{
if (XP >= levelXP)
{
levelUp();
}
}
void Mc::changeXP(double value)
{
XP += value;
}
void Mc::levelUp()
{
level += 1;
levelXP = dubExponents(2, level);
XP = 0;
}
void Mc::modStat(int statChoice, double value)
{
switch (statChoice)
{
case 1:
curStrength += value;
break;
case 2:
curAgility += value;
break;
case 3:
curEndurance += value;
break;
case 4:
curIntelligence += value;
break;
case 5:
curWisdom += value;
break;
case 6:
curCharisma += value;
break;
}
}
void Mc::checkDeath() // ADDED
{
}
void Mc::damage(double value)
{
curHP += value;
checkDeath();
}
void Mc::setStartStats(double str, double agi, double end, double intel, double wis, double cha, double setHP, double setMP)
{
strength = str;
agility = agi;
endurance = end;
intelligence = intel;
wisdom = wis;
charisma = cha;
maxHP = setHP;
curHP = setHP;
maxMP = setMP;
curMP = setMP;
}
int main()
{
Mc mc;
}
|