diff options
Diffstat (limited to 'src/game-server/effect.hpp')
-rw-r--r-- | src/game-server/effect.hpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/game-server/effect.hpp b/src/game-server/effect.hpp index 49a12596..15db5d2e 100644 --- a/src/game-server/effect.hpp +++ b/src/game-server/effect.hpp @@ -23,6 +23,7 @@ #define _TMWSERV_EFFECT_H #include "game-server/actor.hpp" +#include "game-server/being.hpp" class Effect : public Actor { @@ -31,11 +32,15 @@ class Effect : public Actor : Actor(OBJECT_EFFECT) , mEffectId(id) , mHasBeenShown(false) + , mBeing(NULL) {} int getEffectId() const { return mEffectId; } + Being *getBeing() const + { return mBeing; } + /** * Removes effect after it has been shown. */ @@ -47,18 +52,33 @@ class Effect : public Actor void show() { mHasBeenShown = true; } + + bool setBeing(Being *b) + { + if (b) + { + setPosition(b->getPosition()); + mBeing = b; + return true; + } else { + return false; + } + } + private: int mEffectId; bool mHasBeenShown; + Being *mBeing; }; namespace Effects { /** - * Convenience method to show an effect. + * Convenience methods to show an effect. */ void show(int id, MapComposite *map, const Point &pos); + void show(int id, MapComposite *map, Being *b); // TODO: get this in sync with effects.xml enum { |