]> jfr.im git - irc/gameservirc.git/blame - gameserv/pouch.h
Added a couple new directives to the config file
[irc/gameservirc.git] / gameserv / pouch.h
CommitLineData
3662210f 1#ifndef POUCH_H
2#define POUCH_H
3
4class Pouch {
5 public:
6
7 Pouch(int h = 0, int s = 0, int d = 0); // Default constructor
8
9 // Access functions to get the number of each potion in inventory
10 int Healing() { return healing; };
11 int Strength() { return strength; };
12 int Defense() { return defense; };
8c734eb9 13 int HP() { return hp; };
3662210f 14
15 // Modifiers to set the number of potions
16 int setHealing (int h = 0) { healing = h; return Healing();};
17 int setStrength (int s = 0) { strength = s; return Strength(); };
18 int setDefense (int d = 0) { defense = d; return Defense();};
8c734eb9 19 int setHP (int h = 0) { hp = h; return HP(); };
3662210f 20
21 // Add one healing potion
22 int incHealing() { return setHealing(Healing() + 1); };
23
24 // Add one Strength potion
25 int incStrength() { return setStrength(Strength() + 1); };
26
27 // Add one Defense potion
28 int incDefense() { return setDefense(Defense() + 1); };
29
8c734eb9 30 // Add one Max HP Potion
31 int incHP() { return setHP(HP() + 1); };
32
83cf716f 33 int decHealing() { return setHealing(Healing() - 1); };
34 int decStrength() { return setStrength(Strength() - 1); };
35 int decDefense() { return setDefense(Defense() - 1); };
8c734eb9 36 int decHP() { return setHP(HP() - 1); };
83cf716f 37
ee38284f 38 void setInventory(Pouch *right) { setHealing(right->Healing());
39 setStrength(right->Strength());
40 setDefense(right->Defense());
8c734eb9 41 setHP(right->HP());
ee38284f 42 };
3662210f 43 // Reset all potions to 0
8c734eb9 44 void reset() { setHealing(0); setStrength(0); setDefense(0);
45 setHP(0);};
3662210f 46
47 private:
48 // Potions
49 int healing;
50 int strength;
51 int defense;
8c734eb9 52 int hp;
3662210f 53};
54
55#endif