-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathD20HitPoints.hpp
More file actions
46 lines (33 loc) · 1.2 KB
/
Copy pathD20HitPoints.hpp
File metadata and controls
46 lines (33 loc) · 1.2 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
#ifndef __D20HitPoints
#define __D20HitPoints
#include "GlobalDef.hpp"
#include "Rollable.hpp"
namespace D20Rules
{
class D20Character;
namespace Rollables
{
class D20HitPoints : public Rollable
{
private:
Loki::StrongPtr<D20Rules::Definitions::ModifierType, false> iConModifier;
D20Rules::Definitions::HPType iMaxHP;
D20Rules::Definitions::HPType iTempHP;
D20Rules::Definitions::HPType iCurrentHP;
D20Rules::Definitions::HPType iNonlethalDamage;
unsigned short int iHD;
void updateTotal() { iTotal = iConModifier; }
public:
D20HitPoints();
inline Definitions::HPType getMaxHP() const { return iMaxHP; }
inline Definitions::HPType getTempHP() const { return iTempHP; }
inline Definitions::HPType getCurrentHP() const { return iCurrentHP; }
Definitions::HPType addHitDie(const Definitions::Dice dHitDie);
inline void healDamage(const Definitions::HPType iHealedHP) { iCurrentHP += iHealedHP < iMaxHP ? iHealedHP : iMaxHP; }
inline void doDamage(const Definitions::HPType iHPLost) { iCurrentHP -= iHPLost; }
inline void setTempHP(const Definitions::HPType iNewTempHP) { iTempHP = iNewTempHP; }
friend class D20Character;
};
}
}
#endif