Use a rather cool WML trick to create a macro with which the slowed sound...

...can cleanly be included in attack animations.
This commit is contained in:
Lari Nieminen 2007-05-06 17:51:12 +00:00
parent bd9a37b6c2
commit 4b52bc6a5c
11 changed files with 67 additions and 203 deletions

View File

@ -93,17 +93,7 @@ Special Notes:"+{SPECIAL_NOTES_SLOW}+{SPECIAL_NOTES_CURES}
halo="halo/elven/nature-halo2.png"
halo_x,halo_y=0,-12
[/frame]
[if]
hits=yes
[secondary_unit_filter]
[not]
[wml_filter]
[status]
slowed="yes"
[/status]
[/wml_filter]
[/not]
[/secondary_unit_filter]
{ON_SLOW (
[frame]
begin=-150
end=-75
@ -112,16 +102,7 @@ Special Notes:"+{SPECIAL_NOTES_SLOW}+{SPECIAL_NOTES_CURES}
halo_x,halo_y=0,-12
sound=slowed.wav
[/frame]
[/if]
[else]
[frame]
begin=-150
end=-75
image="units/elves-wood/druid-magic-3.png"
halo="halo/elven/nature-halo3.png"
halo_x,halo_y=0,-12
[/frame]
[/else]
)}
[frame]
begin=-75
end=0

View File

@ -110,17 +110,7 @@ Special Notes:"+{SPECIAL_NOTES_MAGICAL}+{SPECIAL_NOTES_SLOW}
halo=halo/elven/nature-halo4.png
halo_x,halo_y=0,-28
[/frame]
[if]
hits=yes
[secondary_unit_filter]
[not]
[wml_filter]
[status]
slowed="yes"
[/status]
[/wml_filter]
[/not]
[/secondary_unit_filter]
{ON_SLOW (
[frame]
begin=-150
end=-75
@ -129,16 +119,7 @@ Special Notes:"+{SPECIAL_NOTES_MAGICAL}+{SPECIAL_NOTES_SLOW}
halo_x,halo_y=0,-28
sound=slowed.wav
[/frame]
[/if]
[else]
[frame]
begin=-150
end=-75
image="units/elves-wood/enchantress-magic.png"
halo=halo/elven/nature-halo5.png
halo_x,halo_y=0,-28
[/frame]
[/else]
)}
[frame]
begin=-75
end=0

View File

@ -109,35 +109,16 @@ Special Notes:"+{SPECIAL_NOTES_SLOW}+{SPECIAL_NOTES_HEALS}
halo=halo/elven/nature-halo4.png
halo_x,halo_y=0,-12
[/frame]
[if]
hits=yes
[secondary_unit_filter]
[not]
[wml_filter]
[status]
slowed="yes"
[/status]
[/wml_filter]
[/not]
[/secondary_unit_filter]
{ON_SLOW (
[frame]
begin=-150
end=-75
image="units/elves-wood/shaman-attack2.png"
image="units/random-enemy.png"
halo=halo/elven/nature-halo5.png
halo_x,halo_y=0,-12
sound=slowed.wav
[/frame]
[/if]
[else]
[frame]
begin=-150
end=-75
image="units/elves-wood/shaman-attack2.png"
halo=halo/elven/nature-halo5.png
halo_x,halo_y=0,-12
[/frame]
[/else]
)}
[frame]
begin=-75
end=0

View File

@ -98,17 +98,7 @@ Special Notes:"+{SPECIAL_NOTES_SLOW}+{SPECIAL_NOTES_CURES}
halo=halo/elven/nature-halo4.png
halo_x,halo_y=0,-12
[/frame]
[if]
hits=yes
[secondary_unit_filter]
[not]
[wml_filter]
[status]
slowed="yes"
[/status]
[/wml_filter]
[/not]
[/secondary_unit_filter]
{ON_SLOW (
[frame]
begin=-150
end=-75
@ -117,16 +107,7 @@ Special Notes:"+{SPECIAL_NOTES_SLOW}+{SPECIAL_NOTES_CURES}
halo_x,halo_y=0,-12
sound=slowed.wav
[/frame]
[/if]
[else]
[frame]
begin=-150
end=-75
image="units/elves-wood/shyde-ftouch-attack3.png"
halo=halo/elven/nature-halo5.png
halo_x,halo_y=0,-12
[/frame]
[/else]
)}
[frame]
begin=-75
end=0

View File

@ -118,17 +118,7 @@ Special Notes:"+{SPECIAL_NOTES_MAGICAL}+{SPECIAL_NOTES_SLOW}
halo=halo/elven/nature-halo4.png
halo_x,halo_y=0,-28
[/frame]
[if]
hits=yes
[secondary_unit_filter]
[not]
[wml_filter]
[status]
slowed="yes"
[/status]
[/wml_filter]
[/not]
[/secondary_unit_filter]
{ON_SLOW (
[frame]
begin=-150
end=-75
@ -137,16 +127,7 @@ Special Notes:"+{SPECIAL_NOTES_MAGICAL}+{SPECIAL_NOTES_SLOW}
halo_x,halo_y=0,-28
sound=slowed.wav
[/frame]
[/if]
[else]
[frame]
begin=-150
end=-75
image="units/elves-wood/sorceress-magic.png"
halo=halo/elven/nature-halo5.png
halo_x,halo_y=0,-28
[/frame]
[/else]
)}
[frame]
begin=-75
end=0

View File

@ -97,17 +97,7 @@ Special Notes:"+{SPECIAL_NOTES_SLOW}
halo=halo/elven/faerie-fire-halo4.png
halo_x,halo_y=0,-28
[/frame]
[if]
hits=yes
[secondary_unit_filter]
[not]
[wml_filter]
[status]
slowed="yes"
[/status]
[/wml_filter]
[/not]
[/secondary_unit_filter]
{ON_SLOW (
[frame]
begin=-150
end=-75
@ -116,16 +106,7 @@ Special Notes:"+{SPECIAL_NOTES_SLOW}
halo_x,halo_y=0,-28
sound=slowed.wav
[/frame]
[/if]
[else]
[frame]
begin=-150
end=-75
image="units/elves-wood/sylph-magic.png"
halo=halo/elven/faerie-fire-halo5.png
halo_x,halo_y=0,-28
[/frame]
[/else]
)}
[frame]
begin=-75
end=0

View File

@ -108,31 +108,14 @@ Special Notes:"+{SPECIAL_NOTES_SLOW}
sound={SOUND_LIST:MISS}
[/frame]
[/else]
[if]
hits=yes
[secondary_unit_filter]
[not]
[wml_filter]
[status]
slowed="yes"
[/status]
[/wml_filter]
[/not]
[/secondary_unit_filter]
{ON_SLOW (
[frame]
begin=-75
end=100
image="units/goblins/pillager.png"
sound=slowed.wav
[/frame]
[/if]
[else]
[frame]
begin=-75
end=100
image="units/goblins/pillager.png"
[/frame]
[/else]
)}
[/animation]
[/attack]
[/unit]

View File

@ -87,31 +87,14 @@ Special Notes:"+{SPECIAL_NOTES_SLOW}
sound=sound={SOUND_LIST:MISS}
[/frame]
[/else]
[if]
hits=yes
[secondary_unit_filter]
[not]
[wml_filter]
[status]
slowed="yes"
[/status]
[/wml_filter]
[/not]
[/secondary_unit_filter]
{ON_SLOW (
[frame]
begin=-75
end=100
image="units/merfolk/entangler.png"
sound=slowed.wav
[/frame]
[/if]
[else]
[frame]
begin=-75
end=100
image="units/merfolk/entangler.png"
[/frame]
[/else]
)}
[/animation]
[/attack]
[/unit]

View File

@ -86,31 +86,14 @@ Special Notes:"+{SPECIAL_NOTES_SLOW}
sound=sound={SOUND_LIST:MISS}
[/frame]
[/else]
[if]
hits=yes
[secondary_unit_filter]
[not]
[wml_filter]
[status]
slowed="yes"
[/status]
[/wml_filter]
[/not]
[/secondary_unit_filter]
{ON_SLOW (
[frame]
begin=-75
end=100
image="units/merfolk/netcaster.png"
sound=slowed.wav
[/frame]
[/if]
[else]
[frame]
begin=-75
end=100
image="units/merfolk/netcaster.png"
[/frame]
[/else]
)}
[/animation]
[/attack]
[/unit]

View File

@ -120,31 +120,14 @@ Special Notes:"+{SPECIAL_NOTES_POISON}+{SPECIAL_NOTES_SLOW}
sound={SOUND_LIST:MISS}
[/frame]
[/else]
[if]
hits=yes
[secondary_unit_filter]
[not]
[wml_filter]
[status]
slowed="yes"
[/status]
[/wml_filter]
[/not]
[/secondary_unit_filter]
{ON_SLOW (
[frame]
begin=-75
end=100
image="units/monsters/cavespider.png"
sound=slowed.wav
[/frame]
[/if]
[else]
[frame]
begin=-75
end=100
image="units/monsters/cavespider.png"
[/frame]
[/else]
)}
[/animation]
[/attack]
[/unit]

View File

@ -210,6 +210,52 @@
[/unit_filter]
#enddef
#define ON_SLOW CONTENTS
# When a unit is slowed, the slowed sound (slowed.wav) should be
# played by the attack animation. Wrap the [frame] containing
# the sound= key inside this macro, and the sound will not get
# played if the attack misses or the target already is slowed.
[if]
hits=yes
[secondary_unit_filter]
[not]
[wml_filter]
[status]
slowed="yes"
[/status]
[/wml_filter]
[/not]
[/secondary_unit_filter]
{CONTENTS}
[/if]
[else]
hits=yes
[secondary_unit_filter]
[wml_filter]
[status]
slowed="yes"
[/status]
[/wml_filter]
[/secondary_unit_filter]
{CONTENTS}
[+frame]
sound=
[/frame]
[/else]
[else]
hits=no
{CONTENTS}
[+frame]
sound=
[/frame]
[/else]
#enddef
#define MISSILE_FRAME_WAIL
# Animate a projectile for a wail attack.
[if]