Use [transform_unit] for TRANSFORM_UNIT

This commit is contained in:
Charles Dang 2015-01-06 23:40:46 +11:00
parent 8a620dd5f1
commit 238a489444

View file

@ -259,51 +259,9 @@
#
# Example to turn all spearmen into cavalrymen:
#! {TRANSFORM_UNIT type=Spearman Cavalryman}
[store_unit]
[filter]
{FILTER}
[/filter]
variable=TU_store
kill=no
[/store_unit]
{ADVANCE_UNIT ({FILTER}) ({TYPE}) }
{FOREACH TU_store TRANSFORM_UNIT_i}
[store_unit]
[filter]
id=$TU_store[$TRANSFORM_UNIT_i].id
[/filter]
variable=TUrestore_store
kill=yes
[/store_unit]
[set_variables]
name=TUrestore_store
mode=merge
[value]
hitpoints=$TU_store[$TRANSFORM_UNIT_i].hitpoints
experience=$TU_store[$TRANSFORM_UNIT_i].experience
[insert_tag]
name=status
variable=TU_store[$TRANSFORM_UNIT_i].status
[/insert_tag]
[/value]
[/set_variables]
[if]
[variable]
name=TUrestore_store.status.unpoisonable
boolean_equals=true
[/variable]
[then]
[clear_variable]
name=TUrestore_store.status.poisoned
[/clear_variable]
[/then]
[/if]
[unstore_unit]
variable=TUrestore_store
find_vacant=no
advance=false
[/unstore_unit]
{CLEAR_VARIABLE TUrestore_store}
{NEXT TRANSFORM_UNIT_i}
{CLEAR_VARIABLE TU_store}
[transform_unit]
{FILTER}
trasnform_to={TYPE}
[/transform_unit]
#enddef