diff options
Diffstat (limited to 'src/game-server/being.h')
-rw-r--r-- | src/game-server/being.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/game-server/being.h b/src/game-server/being.h index 5ccc8e89..5827ad17 100644 --- a/src/game-server/being.h +++ b/src/game-server/being.h @@ -47,6 +47,11 @@ struct Status typedef std::map< int, Status > StatusEffects; /** + * Type definition for a list of hits + */ +typedef std::vector<unsigned> Hits; + +/** * Generic being (living actor). Keeps direction, destination and a few other * relevant properties. Used for characters & monsters (all animated objects). */ @@ -280,6 +285,10 @@ class BeingComponent : public Component const Point ¤tPos, const Point &destPos); + void addHitTaken(unsigned damage); + const Hits &getHitsTaken() const; + void clearHitsTaken(); + protected: static const int TICKS_PER_HP_REGENERATION = 100; @@ -312,6 +321,8 @@ class BeingComponent : public Component /** The last being emote Id. Used when triggering a being emoticon. */ int mEmoteId; + Hits mHitsTaken; //List of punches taken since last update. + /** Called when derived attributes need to get calculated */ static Script::Ref mRecalculateDerivedAttributesCallback; @@ -319,4 +330,26 @@ class BeingComponent : public Component static Script::Ref mRecalculateBaseAttributeCallback; }; + +inline void BeingComponent::addHitTaken(unsigned damage) +{ + mHitsTaken.push_back(damage); +} + +/** + * Gets the damage list. + */ +inline const Hits &BeingComponent::getHitsTaken() const +{ + return mHitsTaken; +} + +/** + * Clears the damage list. + */ +inline void BeingComponent::clearHitsTaken() +{ + mHitsTaken.clear(); +} + #endif // BEING_H |