summaryrefslogtreecommitdiff
path: root/src/effectmanager.cpp
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-05-26 23:41:01 +0200
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-05-26 23:42:10 +0200
commitb35aef2d924f03d85eb44a2465be5a745444eafd (patch)
tree5de5dc327397f9e970ce1bdfacf850a16da02241 /src/effectmanager.cpp
parentb02081c00450d274c23b7198620ee7748756bd72 (diff)
downloadmana-b35aef2d924f03d85eb44a2465be5a745444eafd.tar.gz
mana-b35aef2d924f03d85eb44a2465be5a745444eafd.tar.bz2
mana-b35aef2d924f03d85eb44a2465be5a745444eafd.tar.xz
mana-b35aef2d924f03d85eb44a2465be5a745444eafd.zip
Added effects support in monsters attacks.
This is provided through the use of the 'effect-id' property of the <attack> tag. Note that the 'particle-effect' support has been removed as it was redundant, but can be kept for backward compatibility. Now, on both Manaserv and tA, only the attack id 1 is supported, i.e: <monster> ... <attack id="1" effect-id="11" action="attack" /> </monster> More to come with re-enabling of the attack type support. I had to fix a crash in the Being::takeDamage() function when there were no attacker (in Manaserv), and add rotation support to the effectManager to achieve this. Reviwed-by: Jaxad0127.
Diffstat (limited to 'src/effectmanager.cpp')
-rw-r--r--src/effectmanager.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/effectmanager.cpp b/src/effectmanager.cpp
index 576d48b6..5ac1dd5a 100644
--- a/src/effectmanager.cpp
+++ b/src/effectmanager.cpp
@@ -63,7 +63,7 @@ EffectManager::~EffectManager()
{
}
-bool EffectManager::trigger(int id, Being* being)
+bool EffectManager::trigger(int id, Being* being, int rotation)
{
bool rValue = false;
for (std::list<EffectDescription>::iterator i = mEffects.begin(); i != mEffects.end(); ++i)
@@ -74,7 +74,7 @@ bool EffectManager::trigger(int id, Being* being)
if (!(*i).GFX.empty())
{
Particle *selfFX;
- selfFX = particleEngine->addEffect((*i).GFX, 0, 0);
+ selfFX = particleEngine->addEffect((*i).GFX, 0, 0, rotation);
being->controlParticle(selfFX);
}
if (!(*i).SFX.empty())
@@ -85,7 +85,7 @@ bool EffectManager::trigger(int id, Being* being)
return rValue;
}
-bool EffectManager::trigger(int id, int x, int y)
+bool EffectManager::trigger(int id, int x, int y, int rotation)
{
bool rValue = false;
for (std::list<EffectDescription>::iterator i = mEffects.begin(); i != mEffects.end(); ++i)
@@ -94,7 +94,7 @@ bool EffectManager::trigger(int id, int x, int y)
{
rValue = true;
if (!(*i).GFX.empty())
- particleEngine->addEffect((*i).GFX, x, y);
+ particleEngine->addEffect((*i).GFX, x, y, rotation);
if (!(*i).SFX.empty())
sound.playSfx((*i).SFX);
break;