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/net | |
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/net')
-rw-r--r-- | src/net/beinghandler.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/net/beinghandler.cpp b/src/net/beinghandler.cpp index 356d9509..b92e0e31 100644 --- a/src/net/beinghandler.cpp +++ b/src/net/beinghandler.cpp @@ -242,14 +242,17 @@ void BeingHandler::handleMessage(MessageIn *msg) switch (type) { - case 0x0a: // Critical Damage + case Being::HIT: // Damage + case Being::CRITICAL: // Critical Damage + case Being::MULTI: // Critical Damage + case Being::REFLECT: // Reflected Damage + case Being::FLEE: // Lucky Dodge if (dstBeing) - dstBeing->showCrit(); - case 0x00: // Damage - if (dstBeing) - dstBeing->takeDamage(param1); + dstBeing->takeDamage(srcBeing, param1, + (Being::AttackType)type); if (srcBeing) - srcBeing->handleAttack(dstBeing, param1); + srcBeing->handleAttack(dstBeing, param1, + (Being::AttackType)type); break; case 0x02: // Sit |