summaryrefslogtreecommitdiff
path: root/src/being.h
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/being.h
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/being.h')
-rw-r--r--src/being.h27
1 files changed, 17 insertions, 10 deletions
diff --git a/src/being.h b/src/being.h
index 9b3bbde4..63e5e07f 100644
--- a/src/being.h
+++ b/src/being.h
@@ -123,6 +123,15 @@ class Being : public Sprite
NUM_SPEECH
};
+ enum AttackType
+ {
+ HIT = 0x00,
+ CRITICAL = 0x0a,
+ MULTI = 0x08,
+ REFLECT = 0x04,
+ FLEE = 0x0b
+ };
+
/**
* Directions, to be used as bitmask values
*/
@@ -171,22 +180,20 @@ class Being : public Sprite
/**
* Puts a damage bubble above this being.
*
- * @param amount The amount of damage.
- */
- virtual void takeDamage(int amount);
-
- /**
- * Puts a crit notification bubble above this being.
+ * @param attacker the attacking being
+ * @param damage the amount of damage recieved (0 means miss)
+ * @param type the attack type
*/
- virtual void showCrit();
+ virtual void takeDamage(Being *attacker, int damage, AttackType type);
/**
* Handles an attack of another being by this being.
*
- * @param victim The attacked being.
- * @param damage The amount of damage dealt (0 means miss).
+ * @param victim the victim being
+ * @param damage the amount of damage dealt (0 means miss)
+ * @param type the attack type
*/
- virtual void handleAttack(Being *victim, int damage);
+ virtual void handleAttack(Being *victim, int damage, AttackType type);
/**
* Returns the name of the being.