summaryrefslogtreecommitdiff
path: root/src/being.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/being.cpp')
-rw-r--r--src/being.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/being.cpp b/src/being.cpp
index c9dd5b08..d9180bc9 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -309,7 +309,8 @@ void Being::setSpeech(const std::string &text, int time)
}
}
-void Being::takeDamage(Being *attacker, int amount, AttackType type)
+void Being::takeDamage(Being *attacker, int amount,
+ AttackType type, int attackId)
{
gcn::Font *font;
std::string damage = amount ? toString(amount) : type == FLEE ?
@@ -400,6 +401,15 @@ void Being::takeDamage(Being *attacker, int amount, AttackType type)
else
hitEffectId = attackerWeapon->getCriticalHitEffectId();
}
+ else if (attacker && attacker->getType() == MONSTER)
+ {
+ const Attack *attack = attacker->getInfo()->getAttack(attackId);
+
+ if (type != CRITICAL)
+ hitEffectId = attack->mHitEffectId;
+ else
+ hitEffectId = attack->mCriticalHitEffectId;
+ }
else
{
if (type != CRITICAL)