DW S9: Improve event handling of undead and bats on the players' side

Add dialog for the cases of a bat or undead entering Caladon's house
that does not lead to victory to prevent the scenario from being too easy.
This commit is contained in:
spixi 2024-09-22 18:36:57 +02:00 committed by GitHub
parent a8d68165ec
commit 6f15150d99
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -52,6 +52,10 @@
shroud=yes shroud=yes
[ai] [ai]
village_value=0 village_value=0
[avoid]
# Caladons shack
x,y=8,5
[/avoid]
[/ai] [/ai]
[/side] [/side]
@ -69,6 +73,48 @@
[objective] [objective]
description= _ "Find Caladon the mage" description= _ "Find Caladon the mage"
condition=win condition=win
[show_if]
[variable]
name=Caladon_discovered
not_equals=yes
[/variable]
[/show_if]
[/objective]
[objective]
description= _ "Move a merfolk unit to Caladons shack and talk to him"
condition=win
[show_if]
[variable]
name=Caladon_discovered
equals=yes
[/variable]
[/show_if]
[/objective]
[objective]
description= _ "You can also visit Caladon with Keshan"
condition=win
[show_if]
[variable]
name=Caladon_discovered
equals=yes
[/variable]
[have_unit]
id=Keshan
[/have_unit]
[/show_if]
[/objective]
[objective]
description= _ "You can also visit Caladon with Inky"
condition=win
[show_if]
[variable]
name=Caladon_discovered
equals=yes
[/variable]
[have_unit]
id=Inky
[/have_unit]
[/show_if]
[/objective] [/objective]
{HOW_TO_LOSE} {HOW_TO_LOSE}
@ -81,6 +127,28 @@
{PLACE_IMAGE scenery/temple1.png 8 5} {PLACE_IMAGE scenery/temple1.png 8 5}
[unit]
type=Silver Mage
x=8
y=5
side=1
id=Caladon
name= _ "Caladon"
unrenamable=yes
[modifications]
{TRAIT_LOYAL_HERO}
{TRAIT_QUICK}
[/modifications]
profile=portraits/caladon.webp
[/unit]
[store_unit]
[filter]
id=Caladon
[/filter]
variable=Caladon_stored
kill=yes
[/store_unit]
[unit] [unit]
type=Giant Spider type=Giant Spider
x=17 x=17
@ -108,6 +176,10 @@
variable=scorp variable=scorp
[filter_location] [filter_location]
include_borders=no include_borders=no
[not]
# Caladons shack
x,y=8,5
[/not]
[not] [not]
# In water or a chasm # In water or a chasm
terrain=Qx*,W* terrain=Qx*,W*
@ -195,9 +267,6 @@
{CLEAR_VARIABLE chasm_hexes} {CLEAR_VARIABLE chasm_hexes}
#enddef #enddef
#define BATS_ENTER_CAVE
#enddef
[event] [event]
name=side 2 turn name=side 2 turn
first_time_only=no first_time_only=no
@ -365,6 +434,162 @@
[/if] [/if]
[/event] [/event]
# ***** END BATS SECTION********************END BATS SECTION***** # ***** END BATS SECTION********************END BATS SECTION*****
[event]
name=moveto
[filter]
side=1
x,y=8,5
[and]
# Either a living or an undead bat
race=bats
[or]
variation=bat
[/or]
[/and]
[/filter]
[message]
speaker=unit
message= _ "Neep, neep, neep!"
[/message]
[unstore_unit]
variable=Caladon_stored
find_vacant=yes
[/unstore_unit]
[message]
speaker=Caladon
message= _ "Another of these ACCURSED bats! BEGONE!"
[/message]
[animate_unit]
[filter]
id=Caladon
[/filter]
flag = attack
[primary_attack]
range=ranged
[/primary_attack]
[facing]
x,y=$x1,$y1
[/facing]
hits=no
[/animate_unit]
[sound]
name=bat-flapping.wav
[/sound]
[floating_text]
x,y=$x1,$y1
text= "<span color='red'>" + _ "SHRIEK!" + "</span>"
[/floating_text]
[move_unit]
x,y=$x1,$y1
to_x=10
to_y=6
[/move_unit]
[move_unit]
id=Caladon
to_x=8
to_y=5
[/move_unit]
[delay]
time=400
accelerate=yes
[/delay]
[store_unit]
[filter]
id=Caladon
[/filter]
variable=Caladon_stored
kill=yes
[/store_unit]
[message]
speaker=Cylanna
message= _ "Caladon does not seem to be very happy about the bat infestation." + " " + _ "He might be more welcoming of one of our people."
[/message]
[message]
speaker=Kai Krellis
message= _ "Lets go, men!"
[/message]
[label]
x,y=8,5
text= _ "Caladons shack"
[/label]
[set_variable]
name=Caladon_discovered
value=yes
[/set_variable]
[show_objectives]
[/show_objectives]
[/event]
[event]
name=moveto
[filter]
race=undead
[not]
variation=bat
[/not]
x,y=8,5
[/filter]
[unstore_unit]
variable=Caladon_stored
find_vacant=yes
[/unstore_unit]
[message]
speaker=Caladon
message= _ "What kind of abomination is THAT!?!"
[/message]
[animate_unit]
[filter]
id=Caladon
[/filter]
flag = attack
[primary_attack]
range=melee
[/primary_attack]
[facing]
x,y=$x1,$y1
[/facing]
hits=yes
[/animate_unit]
[move_unit]
x,y=$x1,$y1
to_x=8
to_y=6
[/move_unit]
[move_unit]
id=Caladon
to_x=8
to_y=5
[/move_unit]
[delay]
time=400
accelerate=yes
[/delay]
[store_unit]
[filter]
id=Caladon
[/filter]
variable=Caladon_stored
kill=yes
[/store_unit]
[message]
speaker=Cylanna
message= _ "It appears that Caladon does not want to deal with the undead." + " " + _ "He might be more welcoming of one of our people."
[/message]
[message]
speaker=Kai Krellis
message= _ "Lets go, men!"
[/message]
[label]
x,y=8,5
text= _ "Caladons shack"
[/label]
[set_variable]
name=Caladon_discovered
value=yes
[/set_variable]
[show_objectives]
[/show_objectives]
[/event]
[event] [event]
name=moveto name=moveto
@ -372,33 +597,40 @@
side=1 side=1
x=8 x=8
y=5 y=5
[not]
race=bats
[/not]
[not]
race=undead
[/not]
[/filter] [/filter]
[unit] [unstore_unit]
type=Silver Mage variable=Caladon_stored
x=8 find_vacant=yes
y=5 [/unstore_unit]
side=1
id=Caladon
name= _ "Caladon"
unrenamable=yes
[modifications]
{TRAIT_LOYAL_HERO}
{TRAIT_QUICK}
[/modifications]
profile=portraits/caladon.webp
[/unit]
[if] [if]
[have_unit] [have_unit]
x,y=$x1,$y1 x,y=$x1,$y1
id=Keshan,Inky id=Keshan,Inky
[/have_unit] [/have_unit]
[then] [then]
[message] [if]
speaker=Keshan [have_unit]
message= _ "There is somebody here." x,y=$x1,$y1
[/message] id=Keshan
[/have_unit]
[message]
speaker=unit
message= _ "There is somebody here."
[/message]
[else]
[message]
speaker=unit
message= _ "Gllllbbbg!"
[/message]
[/else]
[/if]
[message] [message]
speaker=Caladon speaker=Caladon
message= _ "Whoa there! BACK off or else!" message= _ "Whoa there! BACK off or else!"
@ -409,24 +641,10 @@
[/message] [/message]
[/then] [/then]
[else] [else]
[if] [message]
[variable] speaker=unit
name=unit.id message= _ "Hey, I found somebody!"
contains=Bat [/message]
[/variable]
[then]
[message]
speaker=unit
message= _ "Neep, neep, neep!"
[/message]
[/then]
[else]
[message]
speaker=unit
message= _ "Hey, I found somebody!"
[/message]
[/else]
[/if]
[/else] [/else]
[/if] [/if]
[message] [message]
@ -468,6 +686,12 @@
[clear_variable] [clear_variable]
name=time_of_day name=time_of_day
[/clear_variable] [/clear_variable]
[clear_variable]
name=Caladon_stored
[/clear_variable]
[clear_variable]
name=Caladon_discovered
[/clear_variable]
[endlevel] [endlevel]
result=victory result=victory