diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-02-08 19:38:34 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-02-08 19:38:34 +0300 |
commit | 203045d6184a3e6246b64b3433f43e0bfebc2e31 (patch) | |
tree | 36388d4420f7ac5d11e0a2c2e3d400aaf14e2cee /src | |
parent | eef656d3e65cc8954d03e65aacb04ba0271b7703 (diff) | |
download | mv-203045d6184a3e6246b64b3433f43e0bfebc2e31.tar.gz mv-203045d6184a3e6246b64b3433f43e0bfebc2e31.tar.bz2 mv-203045d6184a3e6246b64b3433f43e0bfebc2e31.tar.xz mv-203045d6184a3e6246b64b3433f43e0bfebc2e31.zip |
Add support for post delay status effect. It change cast animation to stand.
Diffstat (limited to 'src')
-rw-r--r-- | src/being/actorsprite.cpp | 4 | ||||
-rw-r--r-- | src/being/actorsprite.h | 3 | ||||
-rw-r--r-- | src/being/being.cpp | 5 | ||||
-rw-r--r-- | src/being/being.h | 2 | ||||
-rw-r--r-- | src/defaults.cpp | 1 | ||||
-rw-r--r-- | src/statuseffect.cpp | 6 | ||||
-rw-r--r-- | src/statuseffect.h | 4 |
7 files changed, 24 insertions, 1 deletions
diff --git a/src/being/actorsprite.cpp b/src/being/actorsprite.cpp index 02da33367..63f224c3d 100644 --- a/src/being/actorsprite.cpp +++ b/src/being/actorsprite.cpp @@ -242,12 +242,16 @@ void ActorSprite::updateStatusEffect(const int index, const Enable newStatus) return; if (effect->isPoison() && getType() == ActorType::Player) setPoison(newStatus == Enable_true); +#ifdef EATHENA_SUPPORT else if (effect->isCart() && localPlayer == this) setHaveCart(newStatus == Enable_true); else if (effect->isRiding()) setRiding(newStatus == Enable_true); else if (effect->isTrickDead()) setTrickDead(newStatus == Enable_true); + else if (effect->isPostDelay()) + setPostDelay(newStatus == Enable_true); +#endif handleStatusEffect(effect, index); } diff --git a/src/being/actorsprite.h b/src/being/actorsprite.h index 2ca5065ef..e648e6b66 100644 --- a/src/being/actorsprite.h +++ b/src/being/actorsprite.h @@ -188,6 +188,9 @@ class ActorSprite notfinal : public CompoundSprite, public Actor const std::set<int> &getStatusEffects() const A_WARN_UNUSED { return mStatusEffects; } + virtual void setPostDelay(const bool b A_UNUSED) + { } + protected: /** * Notify self that the stun mode has been updated. Invoked by diff --git a/src/being/being.cpp b/src/being/being.cpp index 50875878b..29c28c463 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -4349,4 +4349,9 @@ void Being::removeSpiritBalls(const unsigned int balls) restrict2 } } +void Being::setPostDelay(const bool b) +{ + if (b && mAction == BeingAction::CAST) + setAction(BeingAction::STAND, 0); +} #endif diff --git a/src/being/being.h b/src/being/being.h index ee073977b..48e8b8c5e 100644 --- a/src/being/being.h +++ b/src/being/being.h @@ -938,6 +938,8 @@ class Being notfinal : public ActorSprite, unsigned int getSpiritBalls() const restrict2 noexcept A_WARN_UNUSED { return mSpiritBalls; } + + void setPostDelay(const bool b) override final; #endif void setKarma(const int karma) restrict2 noexcept diff --git a/src/defaults.cpp b/src/defaults.cpp index 095bf6c74..6e985e2d2 100644 --- a/src/defaults.cpp +++ b/src/defaults.cpp @@ -620,6 +620,7 @@ DefaultsData* getPathsDefaults() AddDEF("cartEffectName", "cart"); AddDEF("ridingEffectName", "riding"); AddDEF("trickDeadEffectName", "trick dead"); + AddDEF("postDelayName", "post delay"); AddDEF("gmTabMinimalLevel", "2"); AddDEF("team1badge", "team1.xml"); AddDEF("team2badge", "team2.xml"); diff --git a/src/statuseffect.cpp b/src/statuseffect.cpp index f4b1ce4e9..97ce131ab 100644 --- a/src/statuseffect.cpp +++ b/src/statuseffect.cpp @@ -54,7 +54,8 @@ StatusEffect::StatusEffect() : mIsPoison(false), mIsCart(false), mIsRiding(false), - mIsTrickDead(false) + mIsTrickDead(false), + mIsPostDelay(false) { } @@ -218,6 +219,8 @@ void StatusEffect::loadXmlFile(const std::string &fileName) (name == paths.getStringValue("ridingEffectName")); startEffect->mIsTrickDead = (name == paths.getStringValue("trickDeadEffectName")); + startEffect->mIsPostDelay = + (name == paths.getStringValue("postDelayName")); startEffect->mMessage = XML::getProperty( node, "start-message", ""); startEffect->mSFXEffect = XML::getProperty( @@ -235,6 +238,7 @@ void StatusEffect::loadXmlFile(const std::string &fileName) endEffect->mIsCart = startEffect->mIsCart; endEffect->mIsRiding = startEffect->mIsRiding; endEffect->mIsTrickDead = startEffect->mIsTrickDead; + endEffect->mIsPostDelay = startEffect->mIsPostDelay; endEffect->mMessage = XML::getProperty(node, "end-message", ""); endEffect->mSFXEffect = XML::getProperty(node, "end-audio", ""); endEffect->mParticleEffect = XML::getProperty( diff --git a/src/statuseffect.h b/src/statuseffect.h index dccb19554..9539e4224 100644 --- a/src/statuseffect.h +++ b/src/statuseffect.h @@ -91,6 +91,9 @@ class StatusEffect final bool isTrickDead() const A_WARN_UNUSED { return mIsTrickDead; } + bool isPostDelay() const A_WARN_UNUSED + { return mIsPostDelay; } + /** * Retrieves a status effect. * @@ -143,6 +146,7 @@ class StatusEffect final bool mIsCart; bool mIsRiding; bool mIsTrickDead; + bool mIsPostDelay; }; #endif // STATUSEFFECT_H |