diff options
author | Philipp Sehmisch <mana@crushnet.org> | 2010-02-25 20:21:59 +0100 |
---|---|---|
committer | Philipp Sehmisch <mana@crushnet.org> | 2010-02-25 20:21:59 +0100 |
commit | c5252ab6c58a7680f5d8ab49fc7ecb17fa778c7c (patch) | |
tree | 36237d241f7ba778e480be9b704c580edafb616d /src/game-server/being.cpp | |
parent | e993ea11bfc211fa69a08838f0d9f1ca069e9e37 (diff) | |
download | manaserv-c5252ab6c58a7680f5d8ab49fc7ecb17fa778c7c.tar.gz manaserv-c5252ab6c58a7680f5d8ab49fc7ecb17fa778c7c.tar.bz2 manaserv-c5252ab6c58a7680f5d8ab49fc7ecb17fa778c7c.tar.xz manaserv-c5252ab6c58a7680f5d8ab49fc7ecb17fa778c7c.zip |
Added script bindings for healing characters and other beings.
Reviewed-by: Jared Adams <jaxad0127@gmail.com>
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) |