summaryrefslogtreecommitdiff
path: root/src/net
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/net
parent1570fb33d5909786ef2997246ada7c46dd6de9e4 (diff)
downloadmana-2353f11b75e347c9662c7224f5b3abcd9189a6bb.tar.gz
mana-2353f11b75e347c9662c7224f5b3abcd9189a6bb.tar.bz2
mana-2353f11b75e347c9662c7224f5b3abcd9189a6bb.tar.xz
mana-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/net')
-rw-r--r--src/net/beinghandler.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/net/beinghandler.cpp b/src/net/beinghandler.cpp
index 4ff303ab..d1810537 100644
--- a/src/net/beinghandler.cpp
+++ b/src/net/beinghandler.cpp
@@ -229,14 +229,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