TSG S5: fix an unlikely scenario outcome

In case the player goes south and runs away fromt he bandits, and defeats
the lich first, then the choice to side or not with the bandits would
happen very late.
In case he allied with them and the other undead leader still lived, he
could end the scenario still by triggering "enemies defeated". If they were
already defeated, the scenario could not end anymore. Furthermore, the
storytext doesn't make sense anymore, at least the ending dilogue would
miss,
In case of siding with the elves one can still win by defeating Urza Afalas.
and the story still makes sense,

To solve this, in this special situation the player has no choice anymore,
the path of the elves is chosen.

(the diff may be hard to read; a good part has been wrappend with an [if])

[ci skip]
This commit is contained in:
Severin Glöckner 2018-07-03 03:18:19 +02:00
parent 00c637d5df
commit 4c20cc3354

View file

@ -456,7 +456,7 @@
side=1
[/filter_second]
{VARIABLE found_urza_afalas "yes"}
{VARIABLE found_urza_afalas yes}
[remove_shroud]
[filter_side]
@ -525,171 +525,179 @@
message= _ "Lies! Mebrin would never fight for the undead, much less lead them!"
[/message]
[message]
speaker=Deoran
message= _ "But what do you want us to do about it? You are criminals!"
[/message]
# In the unlikely case that the player did defeat "Mal M'Brin", but not sight Urza Afalas
# before, he has no choice now, as that would not fit with the storytext anymore.
[if]
[have_unit]
id="Mal M'Brin"
[/have_unit]
[then]
[message]
speaker=Deoran
message= _ "But what do you want us to do about it? You are criminals!"
[/message]
[message]
speaker=Urza Afalas
message= _ "Join us in the fight! Together we can drive off these cruel undead and restore peace to the land."
[/message]
[message]
speaker=Urza Afalas
message= _ "Join us in the fight! Together we can drive off these cruel undead and restore peace to the land."
[/message]
[message]
speaker=Sir Gerrick
message= _ "My lord, they could be valuable allies, and the undead are a greater threat to our lands. Justice can wait until we are all safely in Westin."
[/message]
[message]
speaker=Sir Gerrick
message= _ "My lord, they could be valuable allies, and the undead are a greater threat to our lands. Justice can wait until we are all safely in Westin."
[/message]
[message]
speaker=Ethiliel
image=portraits/ethiliel-mad.png
message= _ "But think of the destruction they wrought on your borders! You cannot ally yourselves with these evil men! Vengeance!"
[/message]
[message]
speaker=Ethiliel
image=portraits/ethiliel-mad.png
message= _ "But think of the destruction they wrought on your borders! You cannot ally yourselves with these evil men! Vengeance!"
[/message]
[message]
speaker=Deoran
message= _ "Hmm... I have to consider this... If I ally with the elves, I must fight the bandits, but if I ally with the bandits I will make enemies of the elves..."
[option]
label= _ "Your crimes are too great. You will fall with the rest of the foul undead!"
[command]
[music]
name=knolls.ogg
immediate=no
append=no
[/music]
[music]
name=nunc_dimittis.ogg
append=yes
[/music]
[message]
speaker=Deoran
message= _ "Hmm... I have to consider this... If I ally with the elves, I must fight the bandits, but if I ally with the bandits I will make enemies of the elves..."
[option]
label= _ "Your crimes are too great. You will fall with the rest of the foul undead!"
[command]
[music]
name=knolls.ogg
immediate=no
append=no
[/music]
[music]
name=nunc_dimittis.ogg
append=yes
[/music]
[message]
speaker=Urza Afalas
message= _ "Then this parley is over! You may have sounded the doom of all of us!"
[/message]
[message]
speaker=Urza Afalas
message= _ "Then this parley is over! You may have sounded the doom of all of us!"
[/message]
[message]
speaker=Ethiliel
image=portraits/ethiliel-mad.png
message= _ "You will pay for taking Mebrin from us! If he is harmed..."
[/message]
[message]
speaker=Ethiliel
image=portraits/ethiliel-mad.png
message= _ "You will pay for taking Mebrin from us! If he is harmed..."
[/message]
[set_variable]
name=side_with_bandits
value=no
[/set_variable]
[set_variable]
name=side_with_bandits
value=no
[/set_variable]
[show_objectives][/show_objectives]
[/command]
[/option]
[show_objectives][/show_objectives]
[/command]
[/option]
[option]
label= _ "Very well. All men must unite against the undead."
[command]
[music]
name=knalgan_theme.ogg
immediate=no
append=yes
[/music]
[option]
label= _ "Very well. All men must unite against the undead."
[command]
[music]
name=knalgan_theme.ogg
immediate=no
append=yes
[/music]
[store_villages]
owner_side=2
[store_villages]
owner_side=2
variable=side_2_villages
[/store_villages]
variable=side_2_villages
[/store_villages]
[foreach]
array=side_2_villages
[do]
[capture_village]
[foreach]
array=side_2_villages
[do]
[capture_village]
side=1
x,y=$this_item.x,$this_item.y
[/capture_village]
[/do]
[/foreach]
{CLEAR_VARIABLE side_2_villages}
[modify_unit]
[filter]
id=Urza Afalas
[/filter]
side=1
x,y=$this_item.x,$this_item.y
[/capture_village]
[/do]
[/foreach]
moves=$this_unit.max_moves
profile=portraits/urza-afalas.png
canrecruit=no
{IS_HERO}
[modifications]
{TRAIT_LOYAL}
[/modifications]
[/modify_unit]
{CLEAR_VARIABLE side_2_villages}
[modify_unit]
[filter]
side=2
[/filter]
side=1
moves=$this_unit.max_moves
[/modify_unit]
[modify_unit]
[filter]
id=Urza Afalas
[/filter]
side=1
moves=$this_unit.max_moves
profile=portraits/urza-afalas.png
canrecruit=no
{IS_HERO}
[modifications]
{TRAIT_LOYAL}
[/modifications]
[/modify_unit]
[modify_side]
side=2
hidden=yes
[/modify_side]
[modify_unit]
[filter]
side=2
[/filter]
side=1
moves=$this_unit.max_moves
[/modify_unit]
[redraw]
side=1
[/redraw]
[modify_side]
side=2
hidden=yes
[/modify_side]
[message]
speaker=Urza Afalas
message= _ "We will now fight alongside you. Come, my thugs and footpads, rally to me!"
[/message]
[redraw]
side=1
[/redraw]
[message]
speaker=Ethiliel
image=portraits/ethiliel-mad.png
message= _ "You are no better than these criminals! We shall see if you can find your own way out of the forest! Come, my people, let us return to our lands. We were foolish to ever have any dealings with these humans. Do not set foot in our land ever again, Deoran, for you have brought us nothing but grief."
[/message]
[message]
speaker=Urza Afalas
message= _ "We will now fight alongside you. Come, my thugs and footpads, rally to me!"
[/message]
[kill]
side=1
race=elf
animate=no
fire_event=no
[/kill]
[message]
speaker=Ethiliel
image=portraits/ethiliel-mad.png
message= _ "You are no better than these criminals! We shall see if you can find your own way out of the forest! Come, my people, let us return to our lands. We were foolish to ever have any dealings with these humans. Do not set foot in our land ever again, Deoran, for you have brought us nothing but grief."
[/message]
[message]
speaker=Sir Gerrick
message= _ "The elves have abandoned us in this accursed forest! We are surely lost!"
[/message]
[kill]
side=1
race=elf
animate=no
fire_event=no
[/kill]
[message]
speaker=Urza Afalas
message= _ "Do not fear, I can lead you out when the time is right."
[/message]
[message]
speaker=Sir Gerrick
message= _ "The elves have abandoned us in this accursed forest! We are surely lost!"
[/message]
{VARIABLE side_with_bandits yes}
[message]
speaker=Urza Afalas
message= _ "Do not fear, I can lead you out when the time is right."
[/message]
[allow_recruit]
side=1
type=Thug,Footpad
[/allow_recruit]
{VARIABLE side_with_bandits yes}
[disallow_recruit]
side=1
type=Elvish Shaman,Elvish Fighter
[/disallow_recruit]
[allow_recruit]
side=1
type=Thug,Footpad
[/allow_recruit]
[disallow_recruit]
side=1
type=Elvish Shaman,Elvish Fighter
[/disallow_recruit]
[modify_side]
side=1
shroud=no
[/modify_side]
[show_objectives][/show_objectives]
[/command]
[/option]
[/message]
[modify_side]
side=1
shroud=no
[/modify_side]
[show_objectives][/show_objectives]
[/command]
[/option]
[/message]
[/then]
[/if]
[reset_fog]
[filter_side]
side=1
@ -710,7 +718,7 @@
[if]
[variable]
name=side_with_bandits
equals=yes
boolean_equals=yes
[/variable]
[then]
[message]
@ -777,7 +785,7 @@
[if]
[variable]
name=side_with_bandits
equals=yes
boolean_equals=yes
[/variable]
[then]
[message]
@ -824,8 +832,7 @@
image=portraits/deoran-sad.png
message= _ "Then we shall retreat towards Westin and prepare for the oncoming battle. I pray our only chance at victory was not lost today."
[/message]
{CLEAR_VARIABLE side_with_bandits,has_mermen}
{CLEAR_VARIABLE found_urza_afalas}
{CLEAR_VARIABLE side_with_bandits,found_urza_afalas,has_mermen}
[endlevel]
result=victory
next_scenario=06b_The_Long_March
@ -842,6 +849,20 @@
speaker=Sir Gerrick
message= _ "Now, on with those bandits!"
[/message]
# It is unlikely that the player did not yet find Urza Afalas.
# If he did not yet, the player loses the possibility to side
# with him, as it fits storywise not anymore.
[if]
[variable]
name=found_urza_afalas
boolean_equals=no
[/variable]
[then]
{VARIABLE side_with_bandits no}
{VARIABLE found_urza_afalas yes}
[show_objectives][/show_objectives]
[/then]
[/if]
[/then]
[/elseif]
[else]
@ -892,7 +913,7 @@
[if]
[variable]
name=has_mermen
equals="yes"
boolean_equals=yes
[/variable]
[then]
[message]
@ -909,8 +930,7 @@
speaker=Sir Gerrick
message= _ "Fare well, Deoran! I will be there to greet you when you return to Kerlath Province."
[/message]
{CLEAR_VARIABLE side_with_bandits}
{CLEAR_VARIABLE found_urza_afalas}
{CLEAR_VARIABLE side_with_bandits,found_urza_afalas}
[endlevel]
result=victory
next_scenario=06a_Tidings_Good_and_Ill