UtBS 8: Simplify drowning units

Use greater_than instead of not turn 1
Remove loop for drowning units, instead letting the tags do the
iteration
Only announce "Help, I'm drowning" once per turn to save time and
reduce frustration
This commit is contained in:
Alarantalara 2014-01-30 14:09:34 -05:00
parent dcbf3c0f82
commit 5eb9b52556

View file

@ -4093,12 +4093,10 @@
[filter_condition]
# don't flood before first turn
[not]
[variable]
name=turn_number
numerical_equals=1
[/variable]
[/not]
[variable]
name=turn_number
greater_than=1
[/variable]
[/filter_condition]
[store_locations]
@ -4153,11 +4151,6 @@
terrain=Wo*
[/filter_location]
# Undead can't drown
[not]
side=3
[/not]
# Only units which cannot move in deep water can drown
movement_cost=99
[/filter]
@ -4169,32 +4162,22 @@
[redraw]
[/redraw]
{FOREACH drowning_units i}
# If unit side is 1 then display a death message
[if]
[have_unit]
x,y=$drowning_units[$i].x,$drowning_units[$i].y
side=1
# If at least one side 1 unit died then display a death message
[message]
find_in=drowning_units
side=1
[not]
type=Dust Devil,Flesh Golem
[/not]
[not]
type=Dust Devil,Flesh Golem
[/not]
[/have_unit]
message= _ "Help, Im drowning!"
[/message]
[then]
[message]
x,y=$drowning_units[$i].x,$drowning_units[$i].y
message= _ "Help, Im drowning!"
[/message]
[/then]
[/if]
[kill]
x,y=$drowning_units[$i].x,$drowning_units[$i].y
animate=yes
fire_event=yes
[/kill]
{NEXT i}
[kill]
find_in=drowning_units
animate=yes
fire_event=yes
[/kill]
{CLEAR_VARIABLE drowning_units}
[/event]