Use a role-based standing animation rather than a fluky macro.

This commit is contained in:
Eric S. Raymond 2008-02-11 11:59:27 +00:00
parent 25a3a25a42
commit 1dd87a1b8a
2 changed files with 17 additions and 35 deletions

View file

@ -324,8 +324,6 @@
[/not]
[/filter]
{DWARVEN_MINERS_LOAD_UP x,y=$x,$y}
[message]
speaker=unit
message= _ "I have all the coal I can carry..."
@ -361,8 +359,6 @@
[/not]
[/filter]
{DWARVEN_MINERS_LOAD_UP x,y=$x,$y}
[message]
speaker=unit
message= _ "I have all the coal I can carry..."
@ -393,8 +389,6 @@
[/not]
[/filter]
{DWARVEN_MINERS_LOAD_UP x,y=$x,$y}
[message]
speaker=unit
message= _ "Here is the mine of precious gold! Send the miners this way."
@ -420,8 +414,6 @@
[/not]
[/filter]
{DWARVEN_MINERS_LOAD_UP x,y=$x,$y}
[message]
speaker=unit
message= _ "I have all the gold I can carry..."

View file

@ -26,6 +26,23 @@
number=2
icon=attacks/pick-axe.png
[/attack]
[standing_anim]
[unit_filter]
role=loaded
# These roles are associated with Scepter of Fire
[or]
role=has_coal
[/or]
[or]
role=has_gold
[/or]
[/unit_filter]
start_time=0
[frame]
duration=1000
image=units/dwarves/miner-withstuff.png
[/frame]
[/standing_anim]
[attack_anim]
[attack_filter]
name=pick
@ -61,30 +78,3 @@
[/attack_anim]
[/unit]
#define DWARVEN_MINERS_LOAD_UP FILTER
# Load up all Dwarvish Miners satisfying FILTER; changes unit images.
# This is the body of MODIFY_UNIT with some arguments bound.
[store_unit]
[filter]
type=Dwarvish Miner
{FILTER}
[/filter]
variable=MODIFY_UNIT_store
kill=yes
[/store_unit]
{FOREACH MODIFY_UNIT_store MODIFY_UNIT_i}
[set_variable]
name=MODIFY_UNIT_store[$MODIFY_UNIT_i].image
value=units/dwarves/miner-withstuff.png
[/set_variable]
[unstore_unit]
variable=MODIFY_UNIT_store[$MODIFY_UNIT_i]
find_vacant=no
[/unstore_unit]
{NEXT MODIFY_UNIT_i}
{CLEAR_VARIABLE MODIFY_UNIT_store}
#enddef