Use [filter_condition] in RECALL_AI_SIDE

This commit is contained in:
Charles Dang 2015-01-06 19:33:13 +11:00
parent 75e7d41425
commit 8a620dd5f1

View file

@ -281,52 +281,49 @@
[/event]
[event]
name=ai turn
[if]
[filter_condition]
[variable]
name=side_number
equals={SIDE}
[/variable]
[and]
[have_unit]
canrecruit=yes
side={SIDE}
[filter_location]
terrain=K*
[/filter_location]
[/have_unit]
[/and]
[then]
[have_unit]
canrecruit=yes
side={SIDE}
[filter_location]
terrain=K*
[/filter_location]
[/have_unit]
[/filter_condition]
[store_gold]
side={SIDE}
[/store_gold]
[while]
[variable]
name=gold
greater_than=19
[/variable]
[variable]
name=recall_ai_side_units_{SIDE}.length
greater_than=0
[/variable]
[do]
[gold]
side={SIDE}
amount=-20
[/gold]
[store_gold]
side={SIDE}
[/store_gold]
[recall]
id=$recall_ai_side_units_{SIDE}[0].id
[/recall]
{CLEAR_VARIABLE recall_ai_side_units_{SIDE}[0]}
[/do]
[/while]
[while]
[variable]
name=gold
greater_than=19
[/variable]
[variable]
name=recall_ai_side_units_{SIDE}.length
greater_than=0
[/variable]
[do]
[gold]
side={SIDE}
amount=-20
[/gold]
[store_gold]
side={SIDE}
[/store_gold]
[recall]
id=$recall_ai_side_units_{SIDE}[0].id
[/recall]
{CLEAR_VARIABLE recall_ai_side_units_{SIDE}[0]}
[/do]
[/while]
{CLEAR_VARIABLE gold}
[/then]
[/if]
{CLEAR_VARIABLE gold}
[/event]
#enddef