summaryrefslogtreecommitdiffstats
path: root/example/monsters.xml
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 /example/monsters.xml
parent0f0004ff3e286270c0425642a5669661ef6cb592 (diff)
downloadmanaserv-6f287f239e9d94707735b183d6c6b89eea9fef20.tar.gz
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 'example/monsters.xml')
-rw-r--r--example/monsters.xml98
1 files changed, 61 insertions, 37 deletions
diff --git a/example/monsters.xml b/example/monsters.xml
index 962b137..5e73e93 100644
--- a/example/monsters.xml
+++ b/example/monsters.xml
@@ -21,10 +21,6 @@ attributes <TAG>: 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<TAG>: Tells the monster specific vulnerability to an element.
@@ -46,12 +42,9 @@ exp<TAG>: Tells how much experience point a monster is giving up
<drop item="3" percent="2.8"/>
<drop item="4" percent="0.7"/>
<attributes
- hp="20"
+ hp="200"
size="4"
speed="2.0"
- attack-min="10"
- attack-delta="2"
- attack-magic="0"
hit="10"
evade="5"
magical-evade="5"
@@ -73,12 +66,28 @@ exp<TAG>: Tells how much experience point a monster is giving up
<attack id="1"
priority="1"
type="physical"
- pre-delay="10"
- aft-delay="5"
- damage-factor="1"
+ warmuptime="10"
+ cooldowntime="10"
+ reusetime="10"
+ basedamage="10"
+ deltadamage="1"
+ chancetohit="1000"
+ element="neutral"
+ range="32"
+ animation="attack"
+ />
+ <attack id="2"
+ priority="2"
+ type="physical"
+ warmuptime="0"
+ cooldowntime="100"
+ reusetime="100"
+ basedamage="100"
+ deltadamage="1"
+ chancetohit="1000"
+ element="neutral"
range="32"
animation="attack"
- script-event="strike"
/>
<script>testmonster.lua</script> <!-- only Proof of Concept-->
</monster>
@@ -99,9 +108,6 @@ exp<TAG>: 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<TAG>: Tells how much experience point a monster is giving up
<attack id="1"
priority="1"
type="physical"
- pre-delay="5"
- aft-delay="15"
- damage-factor="3"
- range="64"
- particle-effect="graphics/particles/attack.particle.xml"
- action="special1"
+ warmuptime="10"
+ cooldowntime="100"
+ reusetime="100"
+ basedamage="20"
+ deltadamage="1"
+ chancetohit="1000"
+ element="neutral"
+ range="32"
+ animation="attack"
/>
<!-- fast, weak, short-range scissor attack -->
<attack id="2"
- priority="4"
+ priority="2"
type="physical"
- pre-delay="3"
- aft-delay="3"
- damage-factor="1"
+ warmuptime="0"
+ cooldowntime="5"
+ reusetime="1"
+ basedamage="5"
+ deltadamage="1"
+ chancetohit="1000"
+ element="neutral"
range="32"
+ animation="attack"
/>
</monster>
@@ -155,9 +169,6 @@ exp<TAG>: 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<TAG>: Tells how much experience point a monster is giving up
<attack id="1"
priority="1"
type="physical"
- element="fire"
- pre-delay="5"
- aft-delay="10"
- damage-factor="1"
- range="64"
+ warmuptime="0"
+ cooldowntime="100"
+ reusetime="100"
+ basedamage="100"
+ deltadamage="1"
+ chancetohit="1000"
+ element="neutral"
+ range="32"
+ animation="attack"
/>
</monster>
@@ -200,15 +215,25 @@ exp<TAG>: 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"
/>
+ <attack id="1"
+ priority="1"
+ type="physical"
+ warmuptime="0"
+ cooldowntime="100"
+ reusetime="100"
+ basedamage="100"
+ deltadamage="1"
+ chancetohit="1000"
+ element="neutral"
+ range="32"
+ animation="attack"
+ />
<!-- Is fulfilling some unknown purpose that requires it to move around
a lot and leaves no time for pursing attackers -->
<behavior
@@ -216,7 +241,6 @@ exp<TAG>: Tells how much experience point a monster is giving up
cowardly="false"
track-range="4"
stroll-range="24"
- attack-distance="32"
/>
</monster>