Added a FULL_HEAL macro for restoring units to full health.

This commit is contained in:
Lari Nieminen 2007-09-07 11:18:14 +00:00
parent 015eadd189
commit 9dd3ae4a47

View file

@ -289,24 +289,24 @@
[event]
name=side turn
first_time_only=no
[if]
[variable]
name=side_number
numerical_equals={SIDE}
[/variable]
[then]
[store_unit]
[filter]
side={SIDE}
canrecruit=1
[/filter]
kill=no
variable=stored_side_{SIDE}_leader
[/store_unit]
{MODIFY_UNIT (
side={SIDE}
canrecruit=1
@ -314,29 +314,60 @@
[/then]
[/if]
[/event]
[event]
name=ai turn
first_time_only=no
[if]
[variable]
name=side_number
numerical_equals={SIDE}
[/variable]
[then]
[unstore_unit]
variable=stored_side_{SIDE}_leader
find_vacant=no
[/unstore_unit]
{CLEAR_VARIABLE stored_side_{SIDE}_leader}
[/then]
[/if]
[/event]
#enddef
#define FULL_HEAL FILTER
# This heals the specified unit(s) to full health. Does not work on units on
# a recall list.
[store_unit]
[filter]
{FILTER}
[/filter]
kill=no
variable=FULL_HEAL_temp
[/store_unit]
{FOREACH FULL_HEAL_temp FULL_HEAL_i}
[object]
silent=yes
[filter]
x,y=$FULL_HEAL_temp[$FULL_HEAL_i].x,$FULL_HEAL_temp[$FULL_HEAL_i].y
[/filter]
[effect]
apply_to=hitpoints
heal_full=yes
[/effect]
[/object]
{NEXT FULL_HEAL_i}
{CLEAR_VARIABLE FULL_HEAL_temp}
{CLEAR_VARIABLE FULL_HEAL_i}
#enddef
#define PUT_TO_RECALL_LIST FILTER
# This places a given unit back to the recall list of the side it is on.
# Note however, that the unit is not healed to full health, so when