Simplify the victory check by nesting events and using [filter_condition]...

...instead of [if].
This commit is contained in:
J. Tyne 2013-02-02 00:19:32 +00:00
parent 72b7c9d94a
commit 4582bd0e1c

View File

@ -344,44 +344,39 @@ Note: You need to use the default map settings for the scenario to work right."
#enddef
#define VICTORY_CHECK_FROM_TURN TURN
# Delay the "die" event until the turn of the final spawn.
[event]
name=die
first_time_only=no
[filter]
side=1
[/filter]
[if]
[variable]
name=turn_number
greater_than={TURN}
[/variable]
[then]
[if]
[not]
[have_unit]
side=1
x=1-15
y=8-22
[/have_unit]
[/not]
[then]
[music]
name=victory.ogg
play_once=yes
immediate=yes
[/music]
[message]
speaker=narrator
message= _"The screams and pleas for mercy are finally silenced, as you remove your blood soaked blade from the last of the rebels. There will be no more resistance from the local scum. Your reign has finally earned stability."
image=wesnoth-icon.png
[/message]
[endlevel]
result=victory
[/endlevel]
[/then]
[/if]
[/then]
[/if]
name=turn_{TURN}
[event]
name=die
[filter]
side=1
[/filter]
[filter_condition]
[not]
[have_unit]
side=1,2
x=1-15
y=8-22
[/have_unit]
[/not]
[/filter_condition]
[music]
name=victory.ogg
play_once=yes
immediate=yes
[/music]
[message]
speaker=narrator
message= _"The screams and pleas for mercy are finally silenced, as you remove your blood soaked blade from the last of the rebels. There will be no more resistance from the local scum. Your reign has finally earned stability."
image=wesnoth-icon.png
[/message]
[endlevel]
result=victory
[/endlevel]
[/event]
[/event]
#enddef