Killed ADD; expanded some VARIABLE_OP and VARIABLE calls;...

...killed some unneeded initial variable setups; made some [variable]
codeblocks use 'boolean_equals' instead of 'equals'.
This commit is contained in:
Steven Panek 2010-10-10 00:05:57 +00:00
parent 72a3dcd738
commit 8db7212c73
3 changed files with 58 additions and 31 deletions

View file

@ -182,14 +182,7 @@
# and in the barracks. Depending on which way you circle around
# the village, you will encounter the NW or barracks first.
# At start seen a mudcrawler is false
{VARIABLE seen_mudcrawler "no"}
# Whether Naru (scout hiding in a village) has been rescued yet
{VARIABLE seen_naru "no"}
# Can't end scenario until all elves have been rescued (5 events)
{VARIABLE rescued_elves 0}
# setting up the village occupants
# 2 fighters, 2 archers, 2 hunters, 2 scouts
@ -337,7 +330,11 @@
[event]
name=first_mudcrawler_encounter
{VARIABLE_OP rescued_elves add 1}
[set_variable]
name=rescued_elves
add=1
[/set_variable]
{NAMED_GENERIC_UNIT 1 "Desert Fighter" 24 25 "Vecnu" ( _ "Vecnu")}
{NAMED_GENERIC_UNIT 1 "Desert Archer" 24 27 "Eranor" ( _ "Eranor")}
{NAMED_GENERIC_UNIT 1 "Desert Archer" 21 25 "Seela" ( _ "Seela")}
@ -364,12 +361,16 @@
[if]
[variable]
name=seen_mudcrawler
equals=no
boolean_equals=no
[/variable]
[then]
# Haven't seen a mudcrawler yet, set the flag and perform
# what-the-hell-is-that routine.
{VARIABLE seen_mudcrawler yes}
[set_variable]
name=seen_mudcrawler
value=yes
[/set_variable]
[message]
speaker=Vecnu
message= _ "Kaleh, Nym, help us!"
@ -424,7 +425,11 @@
[event]
name=second_mudcrawler_encounter
{VARIABLE_OP rescued_elves add 1}
[set_variable]
name=rescued_elves
add=1
[/set_variable]
{NAMED_GENERIC_UNIT 1 "Desert Hunter" 24 34 "Eloshi" ( _ "Eloshi")}
{NAMED_GENERIC_UNIT 1 "Desert Archer" 19 33 "Illuvia" ( _ "Illuvia")}
[+unit]
@ -480,7 +485,10 @@
x,y=36,34
[/capture_village]
{ADD rescued_elves 1}
[set_variable]
name=rescued_elves
add=1
[/set_variable]
# wmllint: recognize Rocky Horror
{NOTRAIT_UNIT 2 "Giant Mudcrawler" 34 33}
@ -554,7 +562,7 @@
[if]
[variable]
name=seen_mudcrawler
equals=no
boolean_equals=no
[/variable]
[then]
# Again, haven't seen a mudcrawler yet, set the flag and perform what-the-hell-is-that routine.
@ -665,7 +673,11 @@
side=1
[/filter]
{ADD rescued_elves 1}
[set_variable]
name=rescued_elves
add=1
[/set_variable]
[message]
speaker=Kaleh
message= _ "The great tree! It has been buried under the rocks. Our most holy sanctuary, defiled. Oh, Eloh, what shall we do?"
@ -855,11 +867,17 @@
speaker=unit
message= _ "Hey, Nisa, the rocks have stopped falling. You can come out now!"
[/message]
{NAMED_GENERIC_UNIT 1 "Desert Scout" $x1 $y1 "Nisa" (_"Nisa")}
{ADD rescued_elves 1}
[+unit]
gender=female
[/unit]
[set_variable]
name=rescued_elves
add=1
[/set_variable]
[message]
speaker=Nisa
message= _ "Oh, thank Eloh, I thought they would never stop."

View file

@ -1108,11 +1108,15 @@
side=1
[/filter]
{VARIABLE x_coord $x1}
{VARIABLE y_coord $y1}
[set_variable]
name=x_coord
sub=2
[/set_variable]
{ADD x_coord -2}
{ADD y_coord -4}
[set_variable]
name=y_coord
sub=4
[/set_variable]
[unit]
# Elyssa used to have her own unit type. This was
@ -1154,8 +1158,15 @@
side=1
[/unit]
{ADD x_coord 7}
{ADD y_coord -1}
[set_variable]
name=x_coord
add=7
[/set_variable]
[set_variable]
name=y_coord
sub=1
[/set_variable]
{RANDOM_PLACEMENT_AREA $x_coord $y_coord 3}
@ -2086,7 +2097,10 @@
{VARIABLE_OP ghosts_already_spawned add 1}
[/else]
[/if]
{ADD i 1}
[set_variable]
name=i
add=1
[/set_variable]
[/do]
[/while]
{CLEAR_VARIABLE spawn}
@ -2158,7 +2172,10 @@
[/variable]
[then]
{ADD ghosts_killed 1}
[set_variable]
name=ghosts_killed
add=1
[/set_variable]
[/then]
[else]

View file

@ -66,14 +66,6 @@
{CLEAR_VARIABLE random_placement_locations}
#enddef
#***Macro that will unclutter scenarios somewhat***
#define ADD VAR AMOUNT
[set_variable]
name={VAR}
add={AMOUNT}
[/set_variable]
#enddef
# wmlindent: start ignoring
#define STARTLOOP VAR
# Loop VAR times, counting from -VAR to -1.