diff options
author | sniper <sniper@livecd.janhome.net> | 2009-03-10 14:28:31 +0100 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-03-10 08:01:51 -0600 |
commit | cf49b996e41f6e28aa67fb2d6891c1b28e65d520 (patch) | |
tree | a12a5ee85064b2271e3c21554e89649ea07a3540 /src/monster.cpp | |
parent | 7aeec98b0d2ff6c034c78e9ae6572179a808cfc5 (diff) | |
download | mana-client-cf49b996e41f6e28aa67fb2d6891c1b28e65d520.tar.gz mana-client-cf49b996e41f6e28aa67fb2d6891c1b28e65d520.tar.bz2 mana-client-cf49b996e41f6e28aa67fb2d6891c1b28e65d520.tar.xz mana-client-cf49b996e41f6e28aa67fb2d6891c1b28e65d520.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.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/monster.cpp b/src/monster.cpp index 2979e9fd..89d0953d 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -160,19 +160,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 |