Shortened (the expanded form of) Tallin's type changing code.

This commit is contained in:
Lari Nieminen 2008-09-11 19:31:27 +00:00
parent 61cffeba6a
commit 6a5bf76dd4

View file

@ -200,39 +200,45 @@
# Check his level, and set new type to be a commander of the same level.
{STORE_UNIT_VAR id=Tallin level old_tallin_level}
[if]
[variable]
name=old_tallin_level
greater_than=2
[/variable]
[then]
{TRANSFORM_UNIT id=Tallin General}
[/then]
[switch]
variable=old_tallin_level
[case]
value=0
{VARIABLE new_tallin_type Sergeant}
[/case]
[case]
value=1
{VARIABLE new_tallin_type Sergeant}
[/case]
[case]
value=2
{VARIABLE new_tallin_type Lieutenant}
[/case]
[else]
[if]
[variable]
name=old_tallin_level
greater_than=1
[/variable]
[then]
{TRANSFORM_UNIT id=Tallin Lieutenant}
[/then]
[else]
{TRANSFORM_UNIT id=Tallin Sergeant}
[/else]
[/if]
{VARIABLE new_tallin_type General}
[/else]
[/if]
{CLEAR_VARIABLE old_tallin_level}
{TRANSFORM_UNIT id=Tallin $new_tallin_type}
{FULL_HEAL id=Tallin}
{CLEAR_VARIABLE old_tallin_level,new_tallin_type}
[/event]
# Start event, recall heroes, place some bad guys, set objectives,
# Start event, recall heroes, place some bad guys, set objectives,
# do the talking
[event]
name=start
# This hack is a workaround for unit roles not getting carried over
# This hack is a workaround for unit roles not getting carried over
# to next scenario. It may no longer be needed in 1.5 - must test.
[role]
[filter_wml]