TSG: S8b don't show the objectives when the mages arrive again

This is one of the few cases where it is not only a refactoring, but has
an actual advanatge to use [show_if] - the note can be removed from the
objectives witout showing them to the player.

[ci skip]
This commit is contained in:
Severin Glöckner 2018-07-15 20:00:17 +02:00
parent 5fb9a65be7
commit f1dc61481b

View file

@ -100,7 +100,7 @@
[time_area]
find_in=illuminated_locations
# Schedule from morning to 2nd night, with adjusted red,green,blue and illumination image.
# Schedule from morning to 2nd night, with adjusted red,green,blue and illumination image.
{MORNING}
[+time]
image=misc/time-schedules/default/schedule-dawn.png~BLIT(misc/tod-bright.png)
@ -231,7 +231,7 @@
[/do]
[/foreach]
# the player gets 20 extra starting gold for each turn past 22
# The player gets 20 extra starting gold for each turn past 22
[if]
[variable]
name=pebbles_defense_length
@ -287,7 +287,7 @@
{STARTING_VILLAGES 1 $village_radius}
#start
# Start
[event]
name=start
[recall]
@ -365,6 +365,8 @@
[/elseif]
[/if]
# This message is not necessarily spoken, as Nilaf is only here if pebbles_defense_length is >= 13,
# while Deoran speaks if pebbles_defense_length is >= 6 (i.e. provincial_guard equals some)
[message]
speaker=Nilaf
message= _ "Indeed, Lord, we are ready to defend our homes!"
@ -416,106 +418,64 @@
message= _ "We have rallied all the forces that we will be able to! Let us not make Sir Gerricks sacrifice a vain one. For Wesnoth!"
[/message]
[if]
[variable]
name=pebbles_defense_length
less_than=24
[/variable]
[then]
[objectives]
side=1
[objective]
description= _ "Defeat Mal MBrin"
condition=win
[/objective]
[objective]
description= _ "Death of Deoran"
condition=lose
[/objective]
[objectives]
side=1
[objective]
description= _ "Defeat Mal MBrin"
condition=win
[/objective]
[objective]
description= _ "Death of Deoran"
condition=lose
[/objective]
{TURNS_RUN_OUT}
{TURNS_RUN_OUT}
{IS_LAST_SCENARIO}
{IS_LAST_SCENARIO}
[note]
description= _ "The Council of Westin will arrive on turn $council_arrive_turn|."
[/note]
[/objectives]
[/then]
[else]
[objectives]
side=1
[objective]
description= _ "Defeat Mal MBrin"
condition=win
[/objective]
[objective]
description= _ "Death of Deoran"
condition=lose
[/objective]
{TURNS_RUN_OUT}
{IS_LAST_SCENARIO}
[/objectives]
[/else]
[/if]
[note]
[show_if]
[variable]
name=turn_number
less_than=$council_arrive_turn
[/variable]
[/show_if]
description= _ "The Council of Westin will arrive on turn $council_arrive_turn|."
[/note]
[/objectives]
{CLEAR_VARIABLE pebbles_defense_length,defenses,provincial_guard,village_radius}
[/event]
[event]
name=new turn
first_time_only=no
[if]
[filter_condition]
[variable]
name=council_arrive_turn
equals=$turn_number
name=turn_number
numerical_equals=$council_arrive_turn
[/variable]
[variable]
name=council_arrive_turn
not_equals=$empty
[/variable]
[then]
{NAMED_LOYAL_UNIT 1 (Arch Mage) 10 1 (Minister Romand) (_"Minister Romand")}
{NAMED_LOYAL_UNIT 1 (Red Mage) 12 1 (Minister Alanafel) (_"Minister Alanafel")}
{LOYAL_UNIT 1 (White Mage) 9 1}
{LOYAL_UNIT 1 (White Mage) 13 1}
[message]
speaker=Minister Romand
message= _ "We have heard your summons, and we shall send these dark foes back to the abyss that spawned them!"
[/message]
[message]
speaker=Deoran
message= _ "Council of Westin, we are cheered by your presence. Your aid will be most welcome."
[/message]
[/filter_condition]
[objectives]
side=1
silent=yes
[objective]
description= _ "Defeat Mal MBrin"
condition=win
[/objective]
[objective]
description= _ "Death of Deoran"
condition=lose
[/objective]
{TURNS_RUN_OUT}
{IS_LAST_SCENARIO}
[/objectives]
[/then]
[/if]
{NAMED_LOYAL_UNIT 1 (Arch Mage) 10 1 (Minister Romand) (_"Minister Romand")}
{NAMED_LOYAL_UNIT 1 (Red Mage) 12 1 (Minister Alanafel) (_"Minister Alanafel")}
{LOYAL_UNIT 1 (White Mage) 9 1}
{LOYAL_UNIT 1 (White Mage) 13 1}
[message]
speaker=Minister Romand
message= _ "We have heard your summons, and we shall send these dark foes back to the abyss that spawned them!"
[/message]
[message]
speaker=Deoran
message= _ "Council of Westin, we are cheered by your presence. Your aid will be most welcome."
[/message]
{CLEAR_VARIABLE council_arrive_turn}
[/event]
[event]
name=die
[filter]
id="Mal M'Brin"
[/filter]
{CLEAR_VARIABLE council_arrive_turn}
[endlevel]
result=victory
carryover_report=no
@ -523,7 +483,7 @@
[/endlevel]
[/event]
# in order to allow Hylas to die, the death events aren't included from the
# In order to allow Hylas to die, the death events aren't included from the
# standard location here
[event]
name=last breath