diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-03-21 22:20:17 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-03-21 22:33:12 +0300 |
commit | c1352727417accc5a953749d4f089e9a1fb474d4 (patch) | |
tree | cd84b0be463b1c9bf202ffb0889d8ce76ebf5ab2 | |
parent | 3b71334296de5b53d2a6fa64c33b283ca3fa2a71 (diff) | |
download | manaplus-c1352727417accc5a953749d4f089e9a1fb474d4.tar.gz manaplus-c1352727417accc5a953749d4f089e9a1fb474d4.tar.bz2 manaplus-c1352727417accc5a953749d4f089e9a1fb474d4.tar.xz manaplus-c1352727417accc5a953749d4f089e9a1fb474d4.zip |
Remove stun related functions from actorsprite.
-rw-r--r-- | src/being/actorsprite.cpp | 22 | ||||
-rw-r--r-- | src/being/actorsprite.h | 19 |
2 files changed, 1 insertions, 40 deletions
diff --git a/src/being/actorsprite.cpp b/src/being/actorsprite.cpp index b315a7c08..5ada5bec9 100644 --- a/src/being/actorsprite.cpp +++ b/src/being/actorsprite.cpp @@ -71,12 +71,10 @@ ActorSprite::ActorSprite(const BeingId id) : CompoundSprite(), Actor(), mStatusEffects(), - mStunParticleEffects(), - mStatusParticleEffects(&mStunParticleEffects, false), + mStatusParticleEffects(), mChildParticleEffects(&mStatusParticleEffects, false), mHorseId(0), mId(id), - mStunMode(0), mUsedTargetCursor(nullptr), mActorSpriteListeners(), mCursorPaddingX(0), @@ -292,7 +290,6 @@ void ActorSprite::setStatusEffectOpitons(const uint32_t option, { uint32_t statusEffects = opt2; statusEffects |= option << 16; - setStunMode(opt1); setStatusEffectBlock(0, CAST_U16((statusEffects >> 16) & 0xffffU)); setStatusEffectBlock(16, @@ -319,7 +316,6 @@ void ActorSprite::setStatusEffectOpitons(const uint32_t option, { uint32_t statusEffects = opt2; statusEffects |= option << 16; - setStunMode(opt1); setStatusEffectBlock(0, CAST_U16((statusEffects >> 16) & 0xffffU)); setStatusEffectBlock(16, @@ -342,14 +338,6 @@ void ActorSprite::setStatusEffectOpiton0(const uint32_t option) } } -void ActorSprite::updateStunMode(const int oldMode, const int newMode) -{ - handleStatusEffect(StatusEffectDB::getStatusEffect( - oldMode, Enable_false), -1); - handleStatusEffect(StatusEffectDB::getStatusEffect( - newMode, Enable_true), -1); -} - void ActorSprite::updateStatusEffect(const int index, const Enable newStatus) { StatusEffect *const effect = StatusEffectDB::getStatusEffect( @@ -380,15 +368,7 @@ void ActorSprite::handleStatusEffect(const StatusEffect *const effect, Particle *const particle = effect->getParticle(); if (effectId >= 0) - { mStatusParticleEffects.setLocally(effectId, particle); - } - else - { - mStunParticleEffects.clearLocally(); - if (particle) - mStunParticleEffects.addLocally(particle); - } } void ActorSprite::setupSpriteDisplay(const SpriteDisplay &display, diff --git a/src/being/actorsprite.h b/src/being/actorsprite.h index 06433628f..25e7c446a 100644 --- a/src/being/actorsprite.h +++ b/src/being/actorsprite.h @@ -107,17 +107,6 @@ class ActorSprite notfinal : public CompoundSprite, public Actor void untarget() { mUsedTargetCursor = nullptr; } - /** - * Sets the actor's stun mode. If zero, the being is `normal', - * otherwise it is `stunned' in some fashion. - */ - void setStunMode(const uint16_t stunMode) - { - if (mStunMode != stunMode) - updateStunMode(mStunMode, stunMode); - mStunMode = stunMode; - } - void setStatusEffect(const int index, const Enable active); void setStatusEffectOpitons(const uint32_t option, @@ -202,12 +191,6 @@ class ActorSprite notfinal : public CompoundSprite, public Actor void setStatusEffectBlock(const int offset, const uint16_t flags); /** - * Notify self that the stun mode has been updated. Invoked by - * setStunMode if something changed. - */ - virtual void updateStunMode(const int oldMode, const int newMode); - - /** * Notify self that a status effect has flipped. * The new flag is passed. */ @@ -244,12 +227,10 @@ class ActorSprite notfinal : public CompoundSprite, public Actor std::set<int> mStatusEffects; /**< set of active status effects */ - ParticleList mStunParticleEffects; ParticleVector mStatusParticleEffects; ParticleList mChildParticleEffects; int mHorseId; BeingId mId; - uint16_t mStunMode; /**< Stun mode; zero if not stunned */ /** Target cursor being used */ AnimatedSprite *mUsedTargetCursor; |