From 6f287f239e9d94707735b183d6c6b89eea9fef20 Mon Sep 17 00:00:00 2001 From: Erik Schilling Date: Sun, 10 Jun 2012 15:11:01 +0200 Subject: 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 --- example/monsters.xml | 98 ++++++++++++++++++++++++++++++++-------------------- 1 file changed, 61 insertions(+), 37 deletions(-) (limited to 'example/monsters.xml') diff --git a/example/monsters.xml b/example/monsters.xml index 962b137e..5e73e93e 100644 --- a/example/monsters.xml +++ b/example/monsters.xml @@ -21,10 +21,6 @@ attributes : Tells all the monsters attribute. These attribute, as for ite size[integer]: The monster maximal amplitude in pixels. Used to compute player's hit area. speed[float]: The monster's speed in tiles per second. (A tile is the smallest square map unit: by default, a tile is 32 pixel long.) - attack-min[integer]: The minimal attack strength of the monster. If your hasn't got any armor, - there are the minimal hit points he will lose when hit by the monster. - attack-delta[integer]: The amplitude between minimal and maximal damages the monster can do. - attack-magic[integer]: The magical attacks are removing hp when hit but are computed against magical defense instead. mutation[integer]: The mutation indicates the amplitude in percent where attributes get modified with. For instance, with a mutation of 50, each attribute can be altered to become 100% to 149% of what they are. vulnerability: Tells the monster specific vulnerability to an element. @@ -46,12 +42,9 @@ exp: Tells how much experience point a monster is giving up : Tells how much experience point a monster is giving up + @@ -99,9 +108,6 @@ exp: Tells how much experience point a monster is giving up hp="20" size="8" speed="6.0" - attack-min="10" - attack-delta="2" - attack-magic="0" hit="10" evade="10" magical-evade="10" @@ -120,21 +126,29 @@ exp: Tells how much experience point a monster is giving up @@ -155,9 +169,6 @@ exp: Tells how much experience point a monster is giving up hp="20" size="8" speed="6.0" - attack-min="20" - attack-delta="10" - attack-magic="0" hit="30" evade="30" magical-evade="30" @@ -177,11 +188,15 @@ exp: Tells how much experience point a monster is giving up @@ -200,15 +215,25 @@ exp: Tells how much experience point a monster is giving up hp="200" size="4" speed="1.0" - attack-min="2" - attack-delta="10" - attack-magic="0" hit="100" evade="10" magical-evade="10" physical-defence="0" magical-defence="0" /> + : Tells how much experience point a monster is giving up cowardly="false" track-range="4" stroll-range="24" - attack-distance="32" /> -- cgit v1.2.3-60-g2f50