From afa134640b2e2c7c0f28a54c8691545848795dd9 Mon Sep 17 00:00:00 2001 From: Yohann Ferreira Date: Sat, 4 Jun 2011 00:50:23 +0200 Subject: Added hit effects on victims from monsters attacks. Resolves: Mana-Mantis #336. Reviewed-by: Jaxad0127. --- src/being.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/being.cpp') 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) -- cgit v1.2.3-70-g09d2