Cleaned up and simplified some Dwarven Doors WML...

...and made a few moveto events undoable.
This commit is contained in:
Lari Nieminen 2008-04-01 09:43:48 +00:00
parent d9a168c419
commit adf687a620

View file

@ -128,12 +128,6 @@
text= _ "The Great Doors"
[/label]
#define TALK_ABOUT_UNCLE
[set_variable]
name=uncle_smuggler
value=1
[/set_variable]
#enddef
#define LISAR_GUARD_DOORS
{LOYAL_UNIT 2 (Royal Guard) 8 44 (Royal Guard) ( _ "Royal Guard")}
#enddef
@ -219,30 +213,32 @@
[recall]
role=Outlaw_Advisor
[/recall]
[redraw]
[/redraw]
[message]
role=Outlaw_Advisor
message= _ "My uncle used to smuggle... err... I mean... trade food for the dwarves. He could get grain carts in under the very noses of those ugly orcs."
[/message]
[message]
role=Outlaw_Advisor
message= _ "He must be hiding in one of those villages."
[/message]
[if]
[have_unit]
role=Outlaw_Advisor
[/have_unit]
[then]
{TALK_ABOUT_UNCLE}
[store_unit]
variable=outlaw_advisor_store
[filter]
role=Outlaw_Advisor
[/filter]
kill=no
variable=outlaw_advisor_store
[/store_unit]
{VARIABLE outlaw_name $outlaw_advisor_store.name}
{CLEAR_VARIABLE outlaw_advisor_store}
[message]
role=Outlaw_Advisor
message= _ "My uncle used to smuggle... err... I mean... trade food for the dwarves. He could get grain carts in under the very noses of those ugly orcs."
[/message]
[message]
role=Outlaw_Advisor
message= _ "He must be hiding in one of those villages."
[/message]
[/then]
[/if]
[/event]
@ -278,6 +274,8 @@
speaker=Kalenz
message= _ "I would settle for escape, though I know not which I dread more: foul orcs or fetid caves."
[/message]
[allow_undo][/allow_undo]
[/event]
[event]
@ -291,92 +289,6 @@
[/message]
[/event]
[event]
name=moveto
first_time_only=no
[filter]
id=Uncle Somf
[/filter]
[store_unit]
variable=outlaw_advisor_store
[filter]
role=Outlaw_Advisor
[/filter]
[/store_unit]
# proximity check
[store_locations]
x=$x1
y=$y1
variable=uncle_check_loc
radius=1
[/store_locations]
# The unit we want to be next to
[store_unit]
variable=outlaw_advisor_store
[filter]
role=Outlaw_Advisor
[/filter]
[/store_unit]
# Iterate over each location checking to see if the outlaw
# target is standing next to Uncle Somf
{FOREACH uncle_check_loc i}
{VARIABLE_OP temp_x format $uncle_check_loc[$i].x}
{VARIABLE_OP temp_x multiply -1}
{VARIABLE_OP temp_x add $outlaw_advisor_store.x}
{VARIABLE_OP temp_y format $uncle_check_loc[$i].y}
{VARIABLE_OP temp_y multiply -1}
{VARIABLE_OP temp_y add $outlaw_advisor_store.y}
[if]
[variable]
name=temp_x
numerical_equals=0
[/variable]
[then]
[if]
[variable]
name=temp_y
numerical_equals=0
[/variable]
[then]
[if]
[variable]
name=outlaw_repartee
numerical_equals=0
[/variable]
[then]
{VARIABLE_OP message_text format (_ "How are we doing, $outlaw_name|?")}
[message]
speaker=Uncle Somf
message=$message_text
[/message]
[message]
speaker=$outlaw_name
message= _ "The same as always, Uncle!"
[/message]
[message]
speaker=Uncle Somf
message= _ "That bad, huh?"
[/message]
{VARIABLE outlaw_repartee 1}
[/then]
[/if]
[/then]
[/if]
[/then]
[/if]
{NEXT i}
{CLEAR_VARIABLE temp_x}
{CLEAR_VARIABLE temp_y}
{CLEAR_VARIABLE outlaw_advisor_store}
{CLEAR_VARIABLE uncle_check_loc}
[/event]
#
# Finding the bandit uncle who gives you a big hint about the true exit
#
@ -388,58 +300,46 @@
y=24
[/filter]
[if]
[variable]
name=uncle_smuggler
numerical_equals=1
[/variable]
[have_unit]
role=Outlaw_Advisor
[/have_unit]
[then]
{LOYAL_UNIT 1 (Bandit) 18 24 (Uncle Somf) ( _ "Uncle Somf")}
[redraw]
[/redraw]
#
# The bandit's speech depends on who finds him
#
[store_unit]
variable=outlaw_advisor_store
[filter]
role=Outlaw_Advisor
[/filter]
[/store_unit]
[if]
[variable]
name=outlaw_advisor_store.x
numerical_equals=18
[/variable]
[then]
[if]
[variable]
name=outlaw_advisor_store.y
numerical_equals=24
[/variable]
[then]
{VARIABLE_OP message_text format (_ "$outlaw_name|! How have you been? I haven't seen you in years.")}
[/then]
[/if]
[/then]
[else]
{VARIABLE_OP message_text format (_ "Haw! Any friend of $outlaw_name is a friend of mine too.")}
[/else]
[/if]
[message]
speaker=unit
message= _ "Who... who's here?"
[/message]
[message]
speaker=Uncle Somf
message=$message_text
[/message]
{CLEAR_VARIABLE message_text}
{CLEAR_VARIABLE outlaw_advisor_store}
#
# The bandit's speech depends on who finds him
#
[if]
[have_unit]
role=Outlaw_Advisor
x,y=18,24
[/have_unit]
# the outlaw advisor finds Uncle Somf
[then]
[message]
speaker=Uncle Somf
message= _ "$outlaw_name|! How have you been? I haven't seen you in years."
[/message]
[/then]
# ...or someone else finds him
[else]
[message]
speaker=Uncle Somf
message= _ "Haw! Any friend of $outlaw_name is a friend of mine too."
[/message]
[/else]
[/if]
[message]
speaker=Konrad
message= _ "We need to make it into the caves of the dwarves."
[/message]
#
# The bandit divulges the true location of the entrance
#
@ -461,14 +361,48 @@
[/message]
[/else]
[/if]
[set_variable]
name=uncle_smuggler
value=2
[/set_variable]
[/then]
[else]
[allow_undo][/allow_undo]
[/else]
[/if]
[/event]
[event]
name=moveto
[filter]
id=Uncle Somf
[filter_adjacent]
role=Outlaw_Advisor
[/filter_adjacent]
[or]
role=Outlaw_Advisor
[filter_adjacent]
id=Uncle Somf
[/filter_adjacent]
[/or]
[/filter]
[message]
speaker=Uncle Somf
message= _ "How are we doing, $outlaw_name|?"
[/message]
[message]
speaker=$outlaw_advisor_store.id
message= _ "The same as always, Uncle!"
[/message]
[message]
speaker=Uncle Somf
message= _ "That bad, huh?"
[/message]
[allow_undo][/allow_undo]
[/event]
#
# When any side 1 unit reaches a possible exit, we find out if it
@ -714,9 +648,8 @@
message= _ "Whew! We make our way through the dangerous fog of the mountains, and now there is all this chaos before us! Come on, men! We must make it to the caves that lie ahead of us!"
[/message]
{CLEAR_VARIABLE true_entrance_location}
{CLEAR_VARIABLE outlaw_advisor_store}
{CLEAR_VARIABLE outlaw_name}
{CLEAR_VARIABLE outlaw_repartee}
{CLEAR_VARIABLE message_text}
[/event]
{campaigns/Heir_To_The_Throne/utils/deaths.cfg}