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
|
#ifndef _ARMOR_H_
#define _ARMOR_H_
#include "Include.h"
enum armorType {
HEAD, BODY, ARMS, LEGS, HANDS, FEET, RING1, RING2, RING3, RING4, NECK, EYE, SHIELD, BELT, NOARMOR
};
class Armor : public Item {
private:
armorType type;
int hpBonus;
int mpBonus;
int strBonus;
int magBonus;
int sklBonus;
int spdBonus;
int defBonus;
int resBonus;
int lckBonus;
public:
Armor();
void setBonus(stats, int);
int getBonus(stats);
void setArmorType(armorType);
armorType getArmorType();
};
Armor::Armor() {
type = NOARMOR;
hpBonus = 0;
mpBonus = 0;
strBonus = 0;
magBonus = 0;
sklBonus = 0;
spdBonus = 0;
defBonus = 0;
resBonus = 0;
lckBonus = 0;
}
void Armor::setBonus(stats choice, int value) {
switch(choice) {
case HP:
hpBonus += value;
break;
case MP:
mpBonus += value;
break;
case STR:
strBonus += value;
break;
case MAG:
magBonus += value;
break;
case SKL:
sklBonus += value;
break;
case SPD:
spdBonus += value;
break;
case DEF:
defBonus += value;
break;
case RES:
resBonus += value;
break;
case LCK:
lckBonus += value;
break;
default:
//If no match by now
logger("Classes.h", __LINE__, "ERROR! Invalid stat bonus to set");
break;
}
}
int Armor::getBonus(stats choice) {
switch(choice) {
case HP:
return hpBonus;
case MP:
return mpBonus;
case STR:
return strBonus;
case MAG:
return magBonus;
case SKL:
return sklBonus;
case SPD:
return spdBonus;
case DEF:
return defBonus;
case RES:
return resBonus;
case LCK:
return lckBonus;
default:
//If no match by now
logger("Classes.h", __LINE__, "ERROR! Invalid stat bonus to get");
break;
}
return 0;
}
void Armor::setArmorType(armorType Type) {
type = Type;
}
armorType Armor::getArmorType() {
return type;
}
#endif
|