AToTB S03 Fix bug: Inconsistent objectives

The objectives and conversation presume the player will first find Baran, then kill Rotharik for the key, and finally release Baran from the cell.

If the player kills Rotharik first, the objectives jump around and the conversation makes no sense.

Let's fix the mess.

While we're at it, instead of always extending 6 turns, let's just ensure there are at least 6 turns left if all Arvith need do is run over to Baran's cage.
This commit is contained in:
Gregory A Lundberg 2016-08-15 16:16:45 -05:00
parent 77e714e4ed
commit d45f174259

View file

@ -232,13 +232,55 @@ Yet for some reason I fear these brothers more. If Mordak were here it would be
[objectives]
side=1
[objective]
[show_if]
[not]
[have_unit]
id=Baran
[/have_unit]
[/not]
[/show_if]
description= _ "Rescue Baran"
condition=win
[/objective]
[objective]
[show_if]
[have_unit]
id=Baran
[/have_unit]
[have_unit]
id=Rotharik
[/have_unit]
[/show_if]
description= _ "Kill the dark sorcerer to get the cell key"
condition=win
[/objective]
[objective]
[show_if]
[have_unit]
id=Baran
[/have_unit]
[not]
[have_unit]
id=Rotharik
[/have_unit]
[/not]
[/show_if]
description= _ "Move Arvith to the cell with his brother to free him"
condition=win
[/objective]
[objective]
description= _ "Death of Arvith"
condition=lose
[/objective]
[objective]
[show_if]
[have_unit]
id=Baran
[/have_unit]
[/show_if]
description= _ "Death of Baran"
condition=lose
[/objective]
{TURNS_RUN_OUT}
@ -248,7 +290,6 @@ Yet for some reason I fear these brothers more. If Mordak were here it would be
[/gold_carryover]
[/objectives]
{VARIABLE Got_Key no}
{VARIABLE delay_guards false}
# Making the gates impassable
@ -544,35 +585,45 @@ Yet for some reason I fear these brothers more. If Mordak were here it would be
message= _ "Theres a key in his robes."
[/message]
[message]
speaker=Arvith
message= _ "That may well be the key to the cell theyre holding Baran in! I will take it."
[/message]
[if]
[have_unit]
id=Baran
[/have_unit]
[then]
[message]
speaker=Arvith
message= _ "That may well be the key to the cell theyre holding Baran in! I will take it."
[/message]
{VARIABLE Got_Key yes}
[store_turns]
variable=turns_remaining
[/store_turns]
[set_variable]
name=turns_remaining
sub=$($turn_number| - 1)
[/set_variable]
[if]
[variable]
name=turns_remaining
less_than=7
[/variable]
[then]
[modify_turns]
add=$(7 - $turns_remaining|)
[/modify_turns]
[/then]
[/if]
{CLEAR_VARIABLE turns_remaining}
[modify_turns]
add=6
[/modify_turns]
[objectives]
side=1
[objective]
description= _ "Move Arvith to the cell with his brother to free him"
condition=win
[/objective]
[objective]
description= _ "Death of Arvith"
condition=lose
[/objective]
{TURNS_RUN_OUT}
[gold_carryover]
bonus=yes
carryover_percentage=40
[/gold_carryover]
[/objectives]
[show_objectives][/show_objectives]
[/then]
[else]
[message]
speaker=Arvith
message="It may be important, I best take it."
[/message]
[/else]
[/if]
[/event]
[event]
@ -670,31 +721,43 @@ Yet for some reason I fear these brothers more. If Mordak were here it would be
[/message]
[if]
[variable]
name=Got_Key
boolean_equals=no
[/variable]
[not]
[have_unit]
id=Rotharik
[/have_unit]
[/not]
[then]
[objectives]
side=1
[objective]
description= _ "Kill the dark sorcerer to get the cell key"
condition=win
[/objective]
[objective]
description= _ "Death of Arvith"
condition=lose
[/objective]
[message]
speaker=Arvith
message= _ "I have already met, and killed, the sorcerer. Is this the key to which you referred?"
[/message]
[message]
speaker=Baran
message= _ "Yes, it is. Come, unlock this cell door, and let us depart this place, brother!"
[/message]
{TURNS_RUN_OUT}
[gold_carryover]
bonus=yes
carryover_percentage=40
[/gold_carryover]
[/objectives]
[store_turns]
variable=turns_remaining
[/store_turns]
[set_variable]
name=turns_remaining
sub=$($turn_number| - 1)
[/set_variable]
[if]
[variable]
name=turns_remaining
less_than=7
[/variable]
[then]
[modify_turns]
add=$(7 - $turns_remaining|)
[/modify_turns]
[/then]
[/if]
{CLEAR_VARIABLE turns_remaining}
[/then]
[/if]
[show_objectives][/show_objectives]
[/event]
[event]
@ -706,10 +769,11 @@ Yet for some reason I fear these brothers more. If Mordak were here it would be
id=Arvith
[/filter]
[filter_condition]
[variable]
name=Got_Key
boolean_equals=yes
[/variable]
[not]
[have_unit]
id=Rotharik
[/have_unit]
[/not]
[/filter_condition]
[remove_item]
@ -761,7 +825,7 @@ Yet for some reason I fear these brothers more. If Mordak were here it would be
[event]
name=victory
{CLEAR_VARIABLE Got_Key,delay_guards}
{CLEAR_VARIABLE delay_guards}
[/event]
{BARAN_LAST_BREATH}