Greatly simplify Delfador's lightning animation WML.

This commit is contained in:
Lari Nieminen 2007-09-24 06:52:39 +00:00
parent 20d8c5160b
commit 2ff0d3c7e3

View file

@ -41,148 +41,79 @@
[/specials]
damage=14
number=4
# The lightning bolt animation is a little complex; the bolt itself is
# done as an animated halo, and so it needs to have different halo_x and
# halo_y coordinates for all six directions. For this reason I wrote
# this macro, which is also used to create the bolt variations.
#define ELDER_MAGE_LIGHTNING_BOLTS VARIATION DIR HALO_X HALO_Y
#enddef
# The three variations for the north direction:
{ELDER_MAGE_LIGHTNING_BOLTS 1 n 0 -210}
{ELDER_MAGE_LIGHTNING_BOLTS 2 n 0 -210}
{ELDER_MAGE_LIGHTNING_BOLTS 3 n 0 -210}
# The three variations for the south direction:
{ELDER_MAGE_LIGHTNING_BOLTS 1 s 0 -72}
{ELDER_MAGE_LIGHTNING_BOLTS 2 s 0 -72}
{ELDER_MAGE_LIGHTNING_BOLTS 3 s 0 -72}
# And so on...
{ELDER_MAGE_LIGHTNING_BOLTS 1 se,sw 54 -104}
{ELDER_MAGE_LIGHTNING_BOLTS 2 se,sw 54 -104}
{ELDER_MAGE_LIGHTNING_BOLTS 3 se,sw 54 -104}
{ELDER_MAGE_LIGHTNING_BOLTS 1 ne,nw 54 -176}
{ELDER_MAGE_LIGHTNING_BOLTS 2 ne,nw 54 -176}
{ELDER_MAGE_LIGHTNING_BOLTS 3 ne,nw 54 -176}
[/attack]
[attack_anim]
[attack_filter]
name=lightning
[/attack_filter]
hits=yes
direction={DIR}
[frame]
begin=-300
end=-200
image="units/elder-mage-ranged1.png"
halo=halo/lightning-bolt-{VARIATION}-1.png:100
halo_x,halo_y={HALO_X},{HALO_Y}
sound=lightning.ogg
[/frame]
[frame]
begin=-200
end=-100
image="units/elder-mage-ranged2.png"
halo=halo/lightning-bolt-{VARIATION}-2.png
halo_x,halo_y={HALO_X},{HALO_Y}
[/frame]
[frame]
begin=-100
end=100
image="units/elder-mage-ranged3.png"
halo=halo/lightning-bolt-{VARIATION}-3.png
halo_x,halo_y={HALO_X},{HALO_Y}
[/frame]
[frame]
begin=100
end=200
image="units/elder-mage-ranged2.png"
halo=halo/lightning-bolt-{VARIATION}-4.png
halo_x,halo_y={HALO_X},{HALO_Y}
[/frame]
[frame]
begin=200
end=250
image="units/elder-mage-ranged1.png"
halo=misc/blank-hex.png
halo_x,halo_y={HALO_X},{HALO_Y}
[/frame]
[/attack_anim]
[attack_anim]
[attack_filter]
name=lightning
[/attack_filter]
hits=no
direction={DIR}
[frame]
begin=-300
end=-200
image="units/elder-mage-ranged1.png"
halo=halo/lightning-bolt-{VARIATION}-1.png:100
halo_x,halo_y={HALO_X},{HALO_Y}
sound=lightning-miss.ogg
[/frame]
[frame]
begin=-200
end=-100
image="units/elder-mage-ranged2.png"
halo=halo/lightning-bolt-{VARIATION}-2.png
halo_x,halo_y={HALO_X},{HALO_Y}
[/frame]
[frame]
begin=-100
end=0
image="units/elder-mage-ranged1.png"
halo=halo/lightning-bolt-{VARIATION}-4.png
halo_x,halo_y={HALO_X},{HALO_Y}
[/frame]
[frame]
begin=0
end=100
image="units/elder-mage.png"
halo=misc/blank-hex.png
halo_x,halo_y={HALO_X},{HALO_Y}
[/frame]
[/attack_anim]
#define ELDER_MAGE_LIGHTNING VAR
[attack_anim]
[attack_filter]
name=staff
name=lightning
[/attack_filter]
[frame]
begin=-250
end=-200
image="units/elder-mage.png"
[/frame]
[frame]
begin=-200
end=-100
image="units/elder-mage-melee1.png"
[/frame]
[if]
direction=sw,s,se
[missile_frame]
begin=-250
end=150
halo=halo/lightning-bolt-{VAR}-1.png~FL(vert):100,halo/lightning-bolt-{VAR}-2.png~FL(vert):100,halo/lightning-bolt-{VAR}-3.png~FL(vert):100,halo/lightning-bolt-{VAR}-4.png~FL(vert):100
halo_y=-125
offset=1.0
[/missile_frame]
[/if]
[else]
direction=nw,n,ne
[missile_frame]
begin=-250
end=150
halo=halo/lightning-bolt-{VAR}-1.png:100,halo/lightning-bolt-{VAR}-2.png:100,halo/lightning-bolt-{VAR}-3.png:100,halo/lightning-bolt-{VAR}-4.png:100
halo_y=-125
offset=1.0
[/missile_frame]
[/else]
[if]
hits=yes
[frame]
begin=-100
end=100
image="units/elder-mage-melee2.png"
sound=staff.wav
begin=-300
end=-200
image="units/elder-mage-ranged1.png"
sound=lightning.ogg
[/frame]
[/if]
[else]
hits=no
[frame]
begin=-100
end=100
image="units/elder-mage-melee2.png"
sound={SOUND_LIST:MISS}
begin=-300
end=-200
image="units/elder-mage-ranged1.png"
sound=lightning-miss.ogg
[/frame]
[/else]
[frame]
begin=100
end=150
begin=-200
end=-100
image="units/elder-mage-ranged2.png"
[/frame]
[frame]
begin=150
begin=-100
end=100
image="units/elder-mage-ranged3.png"
[/frame]
[frame]
begin=100
end=200
image="units/elder-mage.png"
image="units/elder-mage-ranged2.png"
[/frame]
[frame]
begin=200
end=250
image="units/elder-mage-ranged1.png"
[/frame]
[/attack_anim]
#enddef
{ELDER_MAGE_LIGHTNING 1}
{ELDER_MAGE_LIGHTNING 2}
{ELDER_MAGE_LIGHTNING 3}
[/unit]