diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-03-25 23:56:55 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-03-25 23:56:55 +0300 |
commit | 7cf334f49fe9157aabeef8eb1e69e115749d1b8f (patch) | |
tree | 7b5bb97a0b3079bf7e1aa6dcf277f8989952f98d /src/being | |
parent | e0ad1f9076f322f18b54c4f1e0894a9cdd52937c (diff) | |
download | plus-7cf334f49fe9157aabeef8eb1e69e115749d1b8f.tar.gz plus-7cf334f49fe9157aabeef8eb1e69e115749d1b8f.tar.bz2 plus-7cf334f49fe9157aabeef8eb1e69e115749d1b8f.tar.xz plus-7cf334f49fe9157aabeef8eb1e69e115749d1b8f.zip |
If player poisoned, hightlight his life bar in social window with special color.
Diffstat (limited to 'src/being')
-rw-r--r-- | src/being/actorsprite.cpp | 11 | ||||
-rw-r--r-- | src/being/actorsprite.h | 11 |
2 files changed, 18 insertions, 4 deletions
diff --git a/src/being/actorsprite.cpp b/src/being/actorsprite.cpp index bbb016525..9c1eeddc7 100644 --- a/src/being/actorsprite.cpp +++ b/src/being/actorsprite.cpp @@ -57,7 +57,8 @@ ActorSprite::ActorSprite(const int id) : mActorSpriteListeners(), mCursorPaddingX(0), mCursorPaddingY(0), - mMustResetParticles(false) + mMustResetParticles(false), + mPoison(false) { } @@ -197,7 +198,13 @@ void ActorSprite::updateStunMode(const int oldMode, const int newMode) void ActorSprite::updateStatusEffect(const int index, const bool newStatus) { - handleStatusEffect(StatusEffect::getStatusEffect(index, newStatus), index); + StatusEffect *const effect = StatusEffect::getStatusEffect( + index, newStatus); + if (!effect) + return; + if (effect->isPoison() && getType() == PLAYER) + setPoison(newStatus); + handleStatusEffect(effect, index); } void ActorSprite::handleStatusEffect(StatusEffect *const effect, diff --git a/src/being/actorsprite.h b/src/being/actorsprite.h index 444232ddd..76e90182d 100644 --- a/src/being/actorsprite.h +++ b/src/being/actorsprite.h @@ -179,12 +179,18 @@ public: */ void removeActorSpriteListener(ActorSpriteListener *const listener); - int getActorX() const + int getActorX() const A_WARN_UNUSED { return getPixelX() - mapTileSize / 2; } - int getActorY() const + int getActorY() const A_WARN_UNUSED { return getPixelY() - mapTileSize; } + void setPoison(const bool b) + { mPoison = b; } + + bool getPoison() const A_WARN_UNUSED + { return mPoison; } + protected: /** * Notify self that the stun mode has been updated. Invoked by @@ -244,6 +250,7 @@ private: /** Reset particle status effects on next redraw? */ bool mMustResetParticles; + bool mPoison; }; #endif // BEING_ACTORSPRITE_H |