diff options
Diffstat (limited to 'src/game-server/being.cpp')
-rw-r--r-- | src/game-server/being.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/game-server/being.cpp b/src/game-server/being.cpp index e9fa42b2..d1d4afe4 100644 --- a/src/game-server/being.cpp +++ b/src/game-server/being.cpp @@ -100,6 +100,21 @@ int Being::damage(Actor *, const Damage &damage) return HPloss; } +void Being::heal() +{ + Attribute &HP = mAttributes[BASE_ATTR_HP]; + HP.mod = HP.base; + modifiedAttribute(BASE_ATTR_HP); +} + +void Being::heal(int hp) +{ + Attribute &HP = mAttributes[BASE_ATTR_HP]; + HP.mod += hp; + if (HP.mod > HP.base) HP.mod = HP.base; + modifiedAttribute(BASE_ATTR_HP); +} + void Being::died() { if (mAction == DEAD) |