summaryrefslogtreecommitdiff
path: root/src/game-server/character.h
diff options
context:
space:
mode:
authorErik Schilling <ablu.erikschilling@googlemail.com>2012-06-10 15:11:01 +0200
committerErik Schilling <ablu.erikschilling@googlemail.com>2013-01-08 16:58:57 +0100
commit6f287f239e9d94707735b183d6c6b89eea9fef20 (patch)
tree694427dbff77f73a1a3a4f84b4f53269a4763f74 /src/game-server/character.h
parent0f0004ff3e286270c0425642a5669661ef6cb592 (diff)
downloadmanaserv-6f287f239e9d94707735b183d6c6b89eea9fef20.tar.gz
manaserv-6f287f239e9d94707735b183d6c6b89eea9fef20.tar.bz2
manaserv-6f287f239e9d94707735b183d6c6b89eea9fef20.tar.xz
manaserv-6f287f239e9d94707735b183d6c6b89eea9fef20.zip
Work on (Auto)Attack system.
During the implementation bjorn and I agreed to limit the number of attacks that can be used in the same tick to one. This makes a lot of stuff easier and the client cannot display two frames at the same time Things done: - Implemented setting of attacks when equipping/unequipping items - Single place where the xml attack node is parsed - Finished attack logic - Unified the attack handling of monsters and characters - Added a global cooldown after attack use (not only for next use of same attack) - Removed the temponary attributes for the monster attack values - Priorities for all attacks - Rewrote the attack core: - Attacks now have this attributes: - warmup -> time a attack needs after starting it to actually deal the damage - cooldown -> time a attack needs after dealing damage before another attack can be used - reuse -> time before the same attack can be used again - If no attack is performed at the moment the following is done: - make a list with all ready attacks - check for attack that has the necessarily range and highest priority - start this attack (inform client about it) - when warmup is finished -> trigger damage - when cooldown is finished -> allow to use other (or the same if reusetimer allows) attacks TODO: - sync client with this to allow better timed animations
Diffstat (limited to 'src/game-server/character.h')
-rw-r--r--src/game-server/character.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/game-server/character.h b/src/game-server/character.h
index b5ef578a..11762291 100644
--- a/src/game-server/character.h
+++ b/src/game-server/character.h
@@ -424,6 +424,10 @@ class Character : public Being
void triggerLoginCallback();
+ virtual void addAttack(AttackInfo *attackInfo);
+
+ virtual void removeAttack(AttackInfo *attackInfo);
+
protected:
/**
* Gets the way the actor blocks pathfinding for other objects
@@ -527,6 +531,8 @@ class Character : public Being
Timeout mMuteTimeout; /**< Time until the character is no longer muted */
+ AttackInfo *mKnuckleAttackInfo;
+
static Script::Ref mDeathCallback;
static Script::Ref mDeathAcceptedCallback;
static Script::Ref mLoginCallback;