Skip to content

Commit

Permalink
TSG: S8b don't show the objectives when the mages arrive again
Browse files Browse the repository at this point in the history
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]
  • Loading branch information
sevu committed Aug 27, 2018
1 parent 440efd2 commit 844e56b
Showing 1 changed file with 48 additions and 88 deletions.
136 changes: 48 additions & 88 deletions data/campaigns/The_South_Guard/scenarios/08b_The_Tides_of_War.cfg
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -287,7 +287,7 @@

{STARTING_VILLAGES 1 $village_radius}

#start
# Start
[event]
name=start
[recall]
Expand Down Expand Up @@ -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!"
Expand Down Expand Up @@ -416,114 +418,72 @@
message= _ "We have rallied all the forces that we will be able to! Let us not make Sir Gerrick’s 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 M’Brin"
condition=win
[/objective]
[objective]
description= _ "Death of Deoran"
condition=lose
[/objective]

{TURNS_RUN_OUT}

{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 M’Brin"
condition=win
[/objective]
[objective]
description= _ "Death of Deoran"
condition=lose
[/objective]

{TURNS_RUN_OUT}
{IS_LAST_SCENARIO}
[/objectives]
[/else]
[/if]
[objectives]
side=1
[objective]
description= _ "Defeat Mal M’Brin"
condition=win
[/objective]
[objective]
description= _ "Death of Deoran"
condition=lose
[/objective]

{TURNS_RUN_OUT}

{IS_LAST_SCENARIO}

[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 M’Brin"
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
save=no
[/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
Expand Down

0 comments on commit 844e56b

Please sign in to comment.