UtBS: Update objectives automatically via [show_if]

This commit is contained in:
DisherProject 2019-04-11 21:05:35 +02:00 committed by nemaara
parent 41d8a5abb0
commit 86017cb7ee
7 changed files with 166 additions and 336 deletions

View file

@ -118,11 +118,19 @@
# Can't end scenario until all elves have been rescued (5 events)
[objectives]
summary= _ "Starting Objectives:"
[objective]
description= _ "Rescue surviving elves"
condition=win
[/objective]
[objective]
description= _ "Defeat Xanthos"
condition=win
[show_if]
[have_unit]
id=Xanthos
[/have_unit]
[/show_if]
[/objective]
[objective]
description= _ "Death of Kaleh"
condition=lose
@ -1126,54 +1134,8 @@
y=1-5
[/place_shroud]
[objectives]
summary= _ "New Objectives:"
silent=no
[objective]
description= _ "Rescue surviving elves"
condition=win
[/objective]
[objective]
description= _ "Defeat Xanthos"
condition=win
[/objective]
[objective]
description= _ "Death of Kaleh"
condition=lose
[/objective]
[objective]
description= _ "Death of Nym"
condition=lose
[/objective]
[objective]
description= _ "Death of Garak"
condition=lose
[show_if]
# We could just use [have_unit], but if Garak or Zhul dies and the player
# checks the objectives, the respective objective won't be displayed,
# and disappearing objectives for no good reason would look buggy.
[variable]
name=found_garak
boolean_equals=yes
[/variable]
[/show_if]
[/objective]
[objective]
description= _ "Death of Zhul"
condition=lose
[show_if]
[variable]
name=found_zhul
boolean_equals=yes
[/variable]
[/show_if]
[/objective]
[gold_carryover]
bonus=yes
carryover_percentage=40
[/gold_carryover]
[/objectives]
[show_objectives]
[/show_objectives]
[/event]
# This event prevents player from running to the dark sorcerer's base

View file

@ -179,11 +179,19 @@
# Set starting scenario objectives
[objectives]
summary= _ "Starting Objectives:"
[objective]
description= _ "Kaleh must reach the northern edge of the desert"
condition=win
[/objective]
[objective]
description= _ "Defeat outlaw leader"
condition=win
[show_if]
[have_unit]
id=Thorn
[/have_unit]
[/show_if]
[/objective]
[objective]
description= _ "Death of Kaleh"
condition=lose
@ -1411,40 +1419,6 @@
[/message]
{CLEAR_VARIABLE explorer}
[objectives]
summary= _ "New Objectives:"
silent=no
[objective]
description= _ "Kaleh must reach the northern edge of the desert"
condition=win
[/objective]
[objective]
description= _ "Defeat outlaw leader"
condition=win
[/objective]
[objective]
description= _ "Death of Kaleh"
condition=lose
[/objective]
[objective]
description= _ "Death of Nym"
condition=lose
[/objective]
[objective]
description= _ "Death of Garak"
condition=lose
[/objective]
[objective]
description= _ "Death of Zhul"
condition=lose
[/objective]
[gold_carryover]
bonus=yes
carryover_percentage=40
[/gold_carryover]
[/objectives]
[unit]
side=2
id=Thorn
@ -1465,6 +1439,9 @@
{INCOME 9 11 13}
{GOLD 100 125 150}
[/modify_side]
[show_objectives]
[/show_objectives]
[/event]
# limit recruitment to one bandit and trapper

View file

@ -336,7 +336,7 @@
[set_variable]
name=ally_must_live
value=1
value=yes
[/set_variable]
[set_variable]
@ -387,10 +387,33 @@
# set starting scenario objectives
[objectives]
summary= _ "Starting Objectives:"
[objective]
description= _ "Escape the caves"
condition=win
[show_if]
{VARIABLE_CONDITIONAL ally_must_live boolean_equals yes}
[/show_if]
[/objective]
[objective]
description= _ "Explore outside"
condition=win
[show_if]
[not]
[have_unit]
id=Sergeant Durstrag,Esanoo
[/have_unit]
[/not]
{VARIABLE_CONDITIONAL ally_must_live boolean_equals no}
[/show_if]
[/objective]
[objective]
description= _ "Defeat Sergeant Durstrag"
condition=win
[show_if]
[have_unit]
id=Sergeant Durstrag
[/have_unit]
[/show_if]
[/objective]
[objective]
description= _ "Death of Kaleh"
@ -408,42 +431,48 @@
description= _ "Death of Grog"
condition=lose
[show_if]
[variable]
name=ally_name
equals=Grog
[/variable]
{VARIABLE_CONDITIONAL ally_name equals "Grog"}
{VARIABLE_CONDITIONAL ally_must_live boolean_equals yes}
[/show_if]
[/objective]
[objective]
description= _ "Death of Nog"
condition=lose
[show_if]
[variable]
name=ally_name
equals=Nog
[/variable]
{VARIABLE_CONDITIONAL ally_name equals "Nog"}
{VARIABLE_CONDITIONAL ally_must_live boolean_equals yes}
[/show_if]
[/objective]
[objective]
description= _ "Death of Rogrimir"
condition=lose
[show_if]
[variable]
name=ally_name
equals=Rogrimir
[/variable]
{VARIABLE_CONDITIONAL ally_name equals "Rogrimir"}
{VARIABLE_CONDITIONAL ally_must_live boolean_equals yes}
[/show_if]
[/objective]
[objective]
description= _ "Death of Jarl"
condition=lose
[show_if]
[variable]
name=ally_name
equals=Jarl
[/variable]
{VARIABLE_CONDITIONAL ally_name equals "Jarl"}
{VARIABLE_CONDITIONAL ally_must_live boolean_equals yes}
[/show_if]
[/objective]
[objective]
description= _ "A human messenger escapes the valley"
condition=lose
[show_if]
{VARIABLE_CONDITIONAL messengers_incoming boolean_equals yes}
[/show_if]
[/objective]
[note]
description= _ "The messenger is the leader of the special white colored units"
[show_if]
{VARIABLE_CONDITIONAL messengers_incoming boolean_equals yes}
[/show_if]
[/note]
[gold_carryover]
bonus=yes
@ -2681,31 +2710,10 @@
message= _ "Well, Nyms right, we dont know whats out there. So we should set up a perimeter guard around the cave mouth and start discovering what this side of the mountains looks like."
[/message]
[objectives]
summary= _ "New Objectives:"
silent=no
[objective]
description= _ "Explore outside"
condition=win
[/objective]
[objective]
description= _ "Death of Kaleh"
condition=lose
[/objective]
[objective]
description= _ "Death of Nym"
condition=lose
[/objective]
[objective]
description= _ "Death of Zhul"
condition=lose
[/objective]
{VARIABLE ally_must_live no}
[gold_carryover]
bonus=yes
carryover_percentage=40
[/gold_carryover]
[/objectives]
[show_objectives]
[/show_objectives]
[event]
name=new turn
@ -2764,11 +2772,6 @@
[event]
name=ally_conversation
[set_variable]
name=ally_must_live
value=0
[/set_variable]
{MESSAGE_DEPEND_ON_ALLY
(
[message]
@ -3490,31 +3493,8 @@
side=2
[/capture_village]
[objectives]
summary= _ "New Objectives:"
silent=no
[objective]
description= _ "Defeat Sergeant Durstrag"
condition=win
[/objective]
[objective]
description= _ "Death of Kaleh"
condition=lose
[/objective]
[objective]
description= _ "Death of Nym"
condition=lose
[/objective]
[objective]
description= _ "Death of Zhul"
condition=lose
[/objective]
[gold_carryover]
bonus=yes
carryover_percentage=40
[/gold_carryover]
[/objectives]
[show_objectives]
[/show_objectives]
[event]
name=new turn
@ -3591,46 +3571,16 @@
message= _ "Then well just have to make sure that no messenger escapes this valley to summon reinforcements."
[/message]
[objectives]
summary= _ "New Objectives:"
silent=no
[objective]
description= _ "Defeat Sergeant Durstrag"
condition=win
[/objective]
[objective]
description= _ "A human messenger escapes the valley"
condition=lose
[/objective]
[objective]
description= _ "Death of Kaleh"
condition=lose
[/objective]
[objective]
description= _ "Death of Nym"
condition=lose
[/objective]
[objective]
description= _ "Death of Zhul"
condition=lose
[/objective]
[gold_carryover]
bonus=yes
carryover_percentage=40
[/gold_carryover]
[note]
description= _ "The messenger is the leader of the special white colored units"
[/note]
[/objectives]
#set messenger timer at 2, so first messenger goes in 6,5,4 turns
[set_variable]
name=messenger_timer
value=2
[/set_variable]
{VARIABLE messengers_incoming yes}
[show_objectives]
[/show_objectives]
# schedule events that occur after the humans start fighting
[event]
@ -4544,7 +4494,7 @@
{CLEAR_VARIABLE healing_rune1,healing_rune2}
{CLEAR_VARIABLE messenger_timer}
{CLEAR_VARIABLE messenger_timer,messengers_incoming}
[/event]
# set time for all underground areas to be always night/underground

View file

@ -318,10 +318,28 @@
# set starting scenario objectives
[objectives]
summary= _ "Starting Objectives:"
[objective]
description= _ "Rescue at least two merfolk by turn 16"
condition=win
[show_if]
{VARIABLE_CONDITIONAL turn_number less_than 16}
[/show_if]
[/objective]
[objective]
description= _ "Defeat Tanstafaal and Eloh"
condition=win
[show_if]
[have_unit]
id=Tanstafaal,Eloh
[/have_unit]
[/show_if]
[/objective]
[objective]
description= _ "Capture all 4 human ships"
condition=win
[show_if]
{VARIABLE_CONDITIONAL capture_ships boolean_equals yes}
[/show_if]
[/objective]
[objective]
description= _ "Three merfolk must survive"
@ -1908,36 +1926,8 @@
message= _ "Then we will make do with those few that we have."
[/message]
# change scenario objectives
[objectives]
summary= _ "New Objectives:"
[objective]
description= _ "Defeat Tanstafaal and Eloh"
condition=win
[/objective]
[objective]
description= _ "Three merfolk must survive"
condition=win
[/objective]
[objective]
description= _ "Death of Kaleh"
condition=lose
[/objective]
[objective]
description= _ "Death of Nym"
condition=lose
[/objective]
[objective]
description= _ "Death of Zhul"
condition=lose
[/objective]
[gold_carryover]
bonus=yes
carryover_percentage=40
[/gold_carryover]
[/objectives]
[show_objectives]
[/show_objectives]
# move tanstafaal to keep
@ -2406,36 +2396,10 @@
message= _ "Though the cost be high, we do what we must. Come let us go capture those boats."
[/message]
# change scenario objectives
{VARIABLE capture_ships yes}
[objectives]
summary= _ "New Objectives:"
[objective]
description= _ "Capture all 4 human ships"
condition=win
[/objective]
[objective]
description= _ "Three merfolk must survive"
condition=win
[/objective]
[objective]
description= _ "Death of Kaleh"
condition=lose
[/objective]
[objective]
description= _ "Death of Nym"
condition=lose
[/objective]
[objective]
description= _ "Death of Zhul"
condition=lose
[/objective]
[gold_carryover]
bonus=yes
carryover_percentage=40
[/gold_carryover]
[/objectives]
[show_objectives]
[/show_objectives]
# allow players elves to recruit units again
[set_recruit]
@ -2825,6 +2789,7 @@
{PLACE_IMAGE "units/transport/galleon.png~RC(magenta>red)~FL()" 9 25}
{CLEAR_VARIABLE number_merfolk_caged}
{CLEAR_VARIABLE number_merfolk_deaths}
{CLEAR_VARIABLE capture_ships}
[/event]
{UTBS_INCLUDE utils/deaths.cfg}

View file

@ -367,10 +367,44 @@
# set starting scenario objectives
[objectives]
summary= _ "Starting Objectives:"
[objective]
description= _ "Kaleh must capture a keep"
condition=win
[show_if]
{VARIABLE_CONDITIONAL keep_reached boolean_equals no}
[/show_if]
[/objective]
[objective]
description= _ "Reach the black citadel in the center of the island"
condition=win
[show_if]
{VARIABLE_CONDITIONAL keep_reached boolean_equals yes}
{VARIABLE_CONDITIONAL found_door boolean_equals no}
[/show_if]
[/objective]
[objective]
description= _ "Defeat enemy leaders, find both keys"
condition=win
[show_if]
{VARIABLE_CONDITIONAL found_door boolean_equals yes}
[have_unit]
canrecruit=yes
side=2,3
[/have_unit]
[/show_if]
[/objective]
[objective]
description= _ "Any unit must reach the black citadel"
condition=win
[show_if]
{VARIABLE_CONDITIONAL found_door boolean_equals yes}
[not]
[have_unit]
canrecruit=yes
side=2,3
[/have_unit]
[/not]
[/show_if]
[/objective]
[objective]
description= _ "Death of Kaleh"
@ -783,29 +817,10 @@
id=jungle_warning
[/remove_event]
[objectives]
summary= _ "New Objectives:"
[objective]
description= _ "Reach the black citadel in the center of the island"
condition=win
[/objective]
[objective]
description= _ "Death of Kaleh"
condition=lose
[/objective]
[objective]
description= _ "Death of Nym"
condition=lose
[/objective]
[objective]
description= _ "Death of Zhul"
condition=lose
[/objective]
{VARIABLE keep_reached yes}
[gold_carryover]
carryover_percentage=0
[/gold_carryover]
[/objectives]
[show_objectives]
[/show_objectives]
# change the music playing
[music]
@ -923,29 +938,8 @@
{VARIABLE found_door yes}
[objectives]
summary= _ "New Objectives:"
[objective]
description= _ "Defeat enemy leaders, find both keys"
condition=win
[/objective]
[objective]
description= _ "Death of Kaleh"
condition=lose
[/objective]
[objective]
description= _ "Death of Nym"
condition=lose
[/objective]
[objective]
description= _ "Death of Zhul"
condition=lose
[/objective]
[gold_carryover]
carryover_percentage=0
[/gold_carryover]
[/objectives]
[show_objectives]
[/show_objectives]
[/else]
[/if]
[/event]
@ -972,29 +966,8 @@
message= _ "Weve found both keys. Now we just have to take them and open the door to the black citadel. I tire of all this bloodshed. Wherever Yechnagoth hides, we will find her and make her pay for all she has done."
[/message]
[objectives]
summary= _ "New Objectives:"
[objective]
description= _ "Any unit must reach the black citadel"
condition=win
[/objective]
[objective]
description= _ "Death of Kaleh"
condition=lose
[/objective]
[objective]
description= _ "Death of Nym"
condition=lose
[/objective]
[objective]
description= _ "Death of Zhul"
condition=lose
[/objective]
[gold_carryover]
carryover_percentage=0
[/gold_carryover]
[/objectives]
[show_objectives]
[/show_objectives]
[remove_shroud]
[filter_side]
side=1
@ -1072,7 +1045,7 @@
[if]
[variable]
name=found_door
numerical_equals=yes
boolean_equals=yes
[/variable]
[then]
@ -1468,6 +1441,7 @@
)}
{CLEAR_VARIABLE found_door}
{CLEAR_VARIABLE keep_reached}
[/event]
# create bats at dusk function

View file

@ -253,10 +253,23 @@
# set starting scenario objectives
[objectives]
summary= _ "Starting Objectives:"
[objective]
description= _ "Defeat the false Eloh"
condition=win
[show_if]
[have_unit]
id=Eloh
[/have_unit]
[/show_if]
[/objective]
[objective]
description= _ "Defeat Yechnagoth"
condition=win
[show_if]
[have_unit]
id=Yechnagoth
[/have_unit]
[/show_if]
[/objective]
[objective]
description= _ "Death of Kaleh"
@ -905,19 +918,8 @@
message= _ "It must have some sort of weak point. Look at those pulsing spires, I thought they were stone, but they seem to be alive. Maybe if we destroy them it will weaken the creature. No matter what horrors appear, we must keep attacking it. We cant stop now!"
[/message]
[objectives]
summary= _ "New Objectives:"
[objective]
description= _ "Defeat Yechnagoth"
condition=win
[/objective]
[objective]
description= _ "Death of Kaleh"
condition=lose
[/objective]
{IS_LAST_SCENARIO}
[/objectives]
[show_objectives]
[/show_objectives]
# Start spawning minions, increasing the number each turn.
{VARIABLE number_minions_to_spawn 1}

View file

@ -121,7 +121,7 @@
[if]
[variable]
name=ally_must_live
numerical_equals=1
boolean_equals=yes
[/variable]
[then]