summaryrefslogtreecommitdiff
path: root/src/effectmanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-02-19 03:10:42 +0300
committerAndrei Karas <akaras@inbox.ru>2013-02-19 13:17:00 +0300
commit4464ef501c562cf6eeda3b59b1dfcf21d9dfb5a9 (patch)
tree1eab9247b1b58d448d64e25f6906447dfba53bd4 /src/effectmanager.cpp
parent2a09c2afe8bd1f476ef1901c9c639896534a081c (diff)
downloadplus-4464ef501c562cf6eeda3b59b1dfcf21d9dfb5a9.tar.gz
plus-4464ef501c562cf6eeda3b59b1dfcf21d9dfb5a9.tar.bz2
plus-4464ef501c562cf6eeda3b59b1dfcf21d9dfb5a9.tar.xz
plus-4464ef501c562cf6eeda3b59b1dfcf21d9dfb5a9.zip
Add support for away particle effect.
Diffstat (limited to 'src/effectmanager.cpp')
-rw-r--r--src/effectmanager.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/effectmanager.cpp b/src/effectmanager.cpp
index 59b85c796..be7fa1e83 100644
--- a/src/effectmanager.cpp
+++ b/src/effectmanager.cpp
@@ -87,6 +87,31 @@ bool EffectManager::trigger(const int id, Being *const being,
return rValue;
}
+Particle *EffectManager::triggerReturn(const int id, Being *const being,
+ const int rotation)
+{
+ if (!being || !particleEngine)
+ return nullptr;
+
+ Particle *rValue = nullptr;
+ FOR_EACH (std::vector<EffectDescription>::const_iterator, i, mEffects)
+ {
+ if ((*i).id == id)
+ {
+ if (!(*i).GFX.empty())
+ {
+ rValue = particleEngine->addEffect(
+ (*i).GFX, 0, 0, rotation);
+ being->controlParticle(rValue);
+ }
+ if (!(*i).SFX.empty())
+ sound.playSfx((*i).SFX);
+ break;
+ }
+ }
+ return rValue;
+}
+
bool EffectManager::trigger(const int id, const int x, const int y,
const int rotation)
{