diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-07-10 22:19:49 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-07-10 22:22:53 +0300 |
commit | 4aa184df5a208c51cb0141ae6a609c60294d8323 (patch) | |
tree | 35d8be02657f234ac2803c2cd3f4c30780e237ac | |
parent | f9a7f96525c7485de4cf27f973f0b52f5d74f048 (diff) | |
download | plus-4aa184df5a208c51cb0141ae6a609c60294d8323.tar.gz plus-4aa184df5a208c51cb0141ae6a609c60294d8323.tar.bz2 plus-4aa184df5a208c51cb0141ae6a609c60294d8323.tar.xz plus-4aa184df5a208c51cb0141ae6a609c60294d8323.zip |
Rename StatusEffect::getParticle into StatusEffect::getStartParticle
-rw-r--r-- | src/being/actorsprite.cpp | 6 | ||||
-rw-r--r-- | src/resources/db/statuseffectdb.cpp | 4 | ||||
-rw-r--r-- | src/statuseffect.cpp | 8 | ||||
-rw-r--r-- | src/statuseffect.h | 4 |
4 files changed, 12 insertions, 10 deletions
diff --git a/src/being/actorsprite.cpp b/src/being/actorsprite.cpp index 7007d52aa..d5527f161 100644 --- a/src/being/actorsprite.cpp +++ b/src/being/actorsprite.cpp @@ -384,13 +384,15 @@ void ActorSprite::handleStatusEffect(const StatusEffect *const effect, if (effectId >= 0) { + Particle *particle = nullptr; if (start == IsStart_true) { - Particle *const particle = effect->getParticle(); - mStatusParticleEffects.setLocally(effectId, particle); + particle = effect->getStartParticle(); } // +++ here also need enable permanent status effects, // need new field in StatusEffect + if (particle) + mStatusParticleEffects.setLocally(effectId, particle); } } diff --git a/src/resources/db/statuseffectdb.cpp b/src/resources/db/statuseffectdb.cpp index 256fbaf88..4e73b8ee7 100644 --- a/src/resources/db/statuseffectdb.cpp +++ b/src/resources/db/statuseffectdb.cpp @@ -166,7 +166,7 @@ void StatusEffectDB::loadXmlFile(const std::string &fileName, node, "start-message", ""); startEffect->mSFXEffect = XML::getProperty( node, "start-audio", ""); - startEffect->mParticleEffect = XML::getProperty( + startEffect->mStartParticleEffect = XML::getProperty( node, "start-particle", ""); startEffect->mIcon = XML::getProperty(node, "icon", ""); @@ -182,7 +182,7 @@ void StatusEffectDB::loadXmlFile(const std::string &fileName, endEffect->mIsPostDelay = startEffect->mIsPostDelay; endEffect->mMessage = XML::getProperty(node, "end-message", ""); endEffect->mSFXEffect = XML::getProperty(node, "end-audio", ""); - endEffect->mParticleEffect = XML::getProperty( + endEffect->mStartParticleEffect = XML::getProperty( node, "end-particle", ""); statusEffects[1][id] = startEffect; diff --git a/src/statuseffect.cpp b/src/statuseffect.cpp index 54465e96f..7e89ae0f2 100644 --- a/src/statuseffect.cpp +++ b/src/statuseffect.cpp @@ -38,7 +38,7 @@ StatusEffect::StatusEffect() : mMessage(), mSFXEffect(), - mParticleEffect(), + mStartParticleEffect(), mIcon(), mAction(), mName(), @@ -67,12 +67,12 @@ void StatusEffect::deliverMessage() const localChatTab->chatLog(mMessage, ChatMsgType::BY_SERVER); } -Particle *StatusEffect::getParticle() const +Particle *StatusEffect::getStartParticle() const { - if (!particleEngine || mParticleEffect.empty()) + if (!particleEngine || mStartParticleEffect.empty()) return nullptr; else - return particleEngine->addEffect(mParticleEffect, 0, 0); + return particleEngine->addEffect(mStartParticleEffect, 0, 0); } AnimatedSprite *StatusEffect::getIcon() const diff --git a/src/statuseffect.h b/src/statuseffect.h index 1a77536a2..7ef6f212f 100644 --- a/src/statuseffect.h +++ b/src/statuseffect.h @@ -55,7 +55,7 @@ class StatusEffect final * Creates the particle effect associated with this status effect, if * possible. */ - Particle *getParticle() const A_WARN_UNUSED; + Particle *getStartParticle() const A_WARN_UNUSED; /** * Retrieves the status icon for this effect, if applicable @@ -69,7 +69,7 @@ class StatusEffect final std::string mMessage; std::string mSFXEffect; - std::string mParticleEffect; + std::string mStartParticleEffect; std::string mIcon; std::string mAction; std::string mName; |