Liberty S1-S7: Fire victory when enemies are defeated

Instead of checking whether there are no enemy units left
every time one of them dies, use the "enemies defeated"
event.
This commit is contained in:
DisherProject 2018-07-14 23:29:43 +02:00 committed by sigurdfdragon
parent ce2f82698c
commit 2218c94a95
2 changed files with 53 additions and 76 deletions

View file

@ -6,7 +6,6 @@
{TURNS 24 18 14}
next_scenario=02_Civil_Disobedience
victory_when_enemies_defeated=no
{INTRO_AND_SCENARIO_MUSIC "heroes_rite.ogg" "northerners.ogg"}
{EXTRA_SCENARIO_MUSIC "the_king_is_dead.ogg"}
@ -87,6 +86,7 @@
user_team_name=_"Orcs"
gold=25
{FLAG_VARIANT6 ragged}
defeat_condition=no_units_left
[/side]
[event]
@ -292,55 +292,43 @@
# Victory
#
[event]
name=die
first_time_only=no
[filter]
side=2
[/filter]
name=enemies defeated
{CLEAR_VARIABLE town_guards_awakened}
[if]
[not]
[have_unit]
side=2
[/have_unit]
[/not]
[variable]
name=any_villagers_died
boolean_equals=yes
[/variable]
[then]
{CLEAR_VARIABLE town_guards_awakened}
[if]
[variable]
name=any_villagers_died
boolean_equals=yes
[/variable]
[then]
{CLEAR_VARIABLE any_villagers_died}
[message]
speaker=Harper
message= _ "We are barely able to survive these orc raids. We lost two men last week, more today... yet Weldyn does nothing!"
[/message]
[/then]
[else]
[message]
speaker=Harper
message= _ "We are barely able to survive these orc raids. We lost two men last week, more could have died today... yet Weldyn does nothing!"
[/message]
[/else]
[/if]
[message]
speaker=Baldras
message= _ "The King stopped sending patrols out here once the war started. Once that happened, the burden fell to us. We are citizens of Wesnoth, and as long as her banner flies we will resist the horde."
[/message]
{CLEAR_VARIABLE any_villagers_died}
[message]
speaker=Harper
message= _ "The banner will fly over a ghost town if help does not come soon."
message= _ "We are barely able to survive these orc raids. We lost two men last week, more today... yet Weldyn does nothing!"
[/message]
[endlevel]
result=victory
bonus=yes
{NEW_GOLD_CARRYOVER 100}
[/endlevel]
[/then]
[else]
[message]
speaker=Harper
message= _ "We are barely able to survive these orc raids. We lost two men last week, more could have died today... yet Weldyn does nothing!"
[/message]
[/else]
[/if]
[message]
speaker=Baldras
message= _ "The King stopped sending patrols out here once the war started. Once that happened, the burden fell to us. We are citizens of Wesnoth, and as long as her banner flies we will resist the horde."
[/message]
[message]
speaker=Harper
message= _ "The banner will fly over a ghost town if help does not come soon."
[/message]
[endlevel]
result=victory
bonus=yes
{NEW_GOLD_CARRYOVER 100}
[/endlevel]
[/event]
# Orcs near the villlage

View file

@ -4,7 +4,6 @@
name= _ "The Hunters"
next_scenario=08_Glory
map_data="{campaigns/Liberty/maps/07_The_Hunters.map}"
victory_when_enemies_defeated=no
{TURNS 36 31 26}
{DEFAULT_SCHEDULE_DUSK}
@ -60,6 +59,7 @@
team_name=bad_guys
user_team_name=_"Asheviere"
{FLAG_VARIANT loyalist}
defeat_condition=no_units_left
[/side]
[side]
@ -75,6 +75,7 @@
team_name=bad_guys
user_team_name=_"Asheviere"
{FLAG_VARIANT loyalist}
defeat_condition=no_units_left
[/side]
[event]
@ -318,45 +319,33 @@
# Victory
#
[event]
name=die
first_time_only=no
[filter]
side=2,3
[/filter]
name=enemies defeated
[message]
speaker=Baldras
message= _ "What a bloody mess. We must attack Halstead next. If we wait, they will become invincible. If we can burn it to the ground before that happens, our people may have a chance. Rest well tonight, because tomorrows battle will decide the fate of our homes, our families, and our freedom."
[/message]
[if]
[not]
[have_unit]
side=2,3
[/have_unit]
[/not]
[variable]
name=Helicrom_status
numerical_equals=3
[/variable]
[then]
[message]
speaker=Baldras
message= _ "What a bloody mess. We must attack Halstead next. If we wait, they will become invincible. If we can burn it to the ground before that happens, our people may have a chance. Rest well tonight, because tomorrows battle will decide the fate of our homes, our families, and our freedom."
message= _ "Send word to Helicrom that we are ready. It is time for him to repay his debt."
[/message]
[if]
[variable]
name=Helicrom_status
numerical_equals=3
[/variable]
[then]
[message]
speaker=Baldras
message= _ "Send word to Helicrom that we are ready. It is time for him to repay his debt."
[/message]
[/then]
[/if]
{CLEAR_VARIABLE stored_Archarel}
[endlevel]
result=victory
bonus=yes
{NEW_GOLD_CARRYOVER 40}
[/endlevel]
[/then]
[/if]
{CLEAR_VARIABLE stored_Archarel}
[endlevel]
result=victory
bonus=yes
{NEW_GOLD_CARRYOVER 40}
[/endlevel]
[/event]
#