summaryrefslogtreecommitdiff
path: root/src/monster.cpp
diff options
context:
space:
mode:
authorsniper <sniper@livecd.janhome.net>2009-03-10 14:28:31 +0100
committerIra Rice <irarice@gmail.com>2009-03-10 09:02:53 -0600
commit2353f11b75e347c9662c7224f5b3abcd9189a6bb (patch)
treebf4c6b7dca4cab6b6bacf5e32c51518cbd327ae5 /src/monster.cpp
parent1570fb33d5909786ef2997246ada7c46dd6de9e4 (diff)
downloadmana-client-2353f11b75e347c9662c7224f5b3abcd9189a6bb.tar.gz
mana-client-2353f11b75e347c9662c7224f5b3abcd9189a6bb.tar.bz2
mana-client-2353f11b75e347c9662c7224f5b3abcd9189a6bb.tar.xz
mana-client-2353f11b75e347c9662c7224f5b3abcd9189a6bb.zip
Extended hit type handling
The client can now differentiate between the following hit types: - hit (normal) - critical (full attack) - multi (more than one hit at once, currently not used) - reflect (reflected damage, currently not used) - flee (dodging criticals) The Being's showCrit method is now merged into takeDamage. Being's takeDamage and handleAttack now both get the opponent, the amount of damage and the attack type as parameter.
Diffstat (limited to 'src/monster.cpp')
-rw-r--r--src/monster.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/monster.cpp b/src/monster.cpp
index 61c867e9..45d2fbeb 100644
--- a/src/monster.cpp
+++ b/src/monster.cpp
@@ -161,19 +161,19 @@ void Monster::setAction(Action action)
}
}
-void Monster::handleAttack(Being *victim, int damage)
+void Monster::handleAttack(Being *victim, int damage, AttackType type)
{
- Being::handleAttack(victim, damage);
+ Being::handleAttack(victim, damage, type);
const MonsterInfo &mi = getInfo();
sound.playSfx(mi.getSound((damage > 0) ?
MONSTER_EVENT_HIT : MONSTER_EVENT_MISS));
}
-void Monster::takeDamage(int amount)
+void Monster::takeDamage(Being *attacker, int amount, AttackType type)
{
if (amount > 0) sound.playSfx(getInfo().getSound(MONSTER_EVENT_HURT));
- Being::takeDamage(amount);
+ Being::takeDamage(attacker, amount, type);
}
Being::TargetCursorSize Monster::getTargetCursorSize() const