summaryrefslogtreecommitdiff
path: root/src/being.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-10-05 22:36:53 +0300
committerAndrei Karas <akaras@inbox.ru>2012-10-05 22:36:53 +0300
commit69b5220d914fb3b874622dcbf8e0fbd4fd73d1f7 (patch)
treea1f58e14f61ec924018b32924132ddbd004a4c91 /src/being.cpp
parente6d7fca349c28eaf98d643325dc99dd9d3a53568 (diff)
downloadmv-69b5220d914fb3b874622dcbf8e0fbd4fd73d1f7.tar.gz
mv-69b5220d914fb3b874622dcbf8e0fbd4fd73d1f7.tar.bz2
mv-69b5220d914fb3b874622dcbf8e0fbd4fd73d1f7.tar.xz
mv-69b5220d914fb3b874622dcbf8e0fbd4fd73d1f7.zip
Second part adding mob particle effects for attacks.
Base on commit from mana afa134640b2e2c7c0f28a54c8691545848795dd9 by Yohann Ferreira
Diffstat (limited to 'src/being.cpp')
-rw-r--r--src/being.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/being.cpp b/src/being.cpp
index 0df07870f..48c6cbe8b 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -510,7 +510,7 @@ void Being::setSpeech(const std::string &text, int time)
}
void Being::takeDamage(Being *const attacker, const int amount,
- const AttackType type, const int id)
+ const AttackType type, const int attackId)
{
if (!userPalette || !attacker)
return;
@@ -652,6 +652,19 @@ void Being::takeDamage(Being *const attacker, const int amount,
else
hitEffectId = attackerWeapon->getCriticalHitEffectId();
}
+ else if (attacker && attacker->getType() == MONSTER)
+ {
+ const BeingInfo *const info = attacker->getInfo();
+ if (info)
+ {
+ const Attack *attack = info->getAttack(attackId);
+
+ if (type != CRITICAL)
+ hitEffectId = attack->mHitEffectId;
+ else
+ hitEffectId = attack->mCriticalHitEffectId;
+ }
+ }
else
{
if (type != CRITICAL)
@@ -663,7 +676,7 @@ void Being::takeDamage(Being *const attacker, const int amount,
else
{
// move skills effects to +100000 in effects list
- hitEffectId = id + 100000;
+ hitEffectId = attackId + 100000;
}
effectManager->trigger(hitEffectId, this);
}