-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathitems.h
More file actions
51 lines (46 loc) · 1.07 KB
/
items.h
File metadata and controls
51 lines (46 loc) · 1.07 KB
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
class Item{
private:
char* name;
int price;
int levelReq;
public:
Item(const char*,const int, const int);
char* getName() const;
int getPrice() const;
int getLevelReq() const;
bool operator == (Item* t1){return getName() == t1->getName();};
bool operator != (Item* t1){return !operator==(t1);};
virtual int use() =0;
virtual ~Item();
};
enum HandType {OneHanded,TwoHanded};
class Weapon: public Item{
private:
int damage;
HandType type;
public:
Weapon(const char*,const int, const int,const int, HandType);
int use(); //Active Use
~Weapon();
};
class Armor: public Item{
private:
int defense;
public:
Armor(const char*,const int, const int,const int);
int use(); //Passive Use
~Armor();
};
enum PotionType {HEAL,MANA,STRENGTH,DEXTERITY,AGILITY};
class Potion: public Item{
private:
PotionType type;
int stat;
bool available;
public:
Potion(const char*,const int, const int, PotionType, const int);
PotionType getType() const;
bool isUsable();
int use(); //Active Use
~Potion();
};