From 7cf334f49fe9157aabeef8eb1e69e115749d1b8f Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 25 Mar 2014 23:56:55 +0300 Subject: If player poisoned, hightlight his life bar in social window with special color. --- src/being/actorsprite.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/being/actorsprite.cpp') 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, -- cgit v1.2.3-60-g2f50