Restored a subtler Shaun and Ed easter egg

This commit is contained in:
ln-zookeeper 2014-12-27 15:06:40 +02:00
parent 8ae98d442a
commit 47a3f8bec9

View file

@ -154,51 +154,6 @@
[/message]
[/event]
# Generate a random number of guards between 0 and 2 around X,Y
#define RANDOM_GUARDS TYPE NAME_STRING SIDE X Y
{VARIABLE_OP number_of_guards rand "0..2"}
{REPEAT $number_of_guards (
[store_locations]
[filter_adjacent_location]
x,y={X},{Y}
[/filter_adjacent_location]
[not]
[filter]
[/filter]
[/not]
variable=possible_guard_locations
[/store_locations]
{IF_VAR possible_guard_locations.length greater_than 0 (
[then]
{VARIABLE_OP random_location_index rand "0..$possible_guard_locations.length"}
[move_unit_fake]
side={SIDE}
type={TYPE}
x={X},$possible_guard_locations[$random_location_index].x
y={Y},$possible_guard_locations[$random_location_index].y
[/move_unit_fake]
[unit]
name={NAME_STRING} # wmllint: ignore
type={TYPE}
side={SIDE}
x,y=$possible_guard_locations[$random_location_index].x,$possible_guard_locations[$random_location_index].y
random_traits=yes
[/unit]
[/then]
)}
)}
{CLEAR_VARIABLE number_of_guards}
{CLEAR_VARIABLE possible_guard_locations}
{CLEAR_VARIABLE random_location_index}
#enddef
# In-scenario events
[event]
name=capture
@ -220,17 +175,110 @@
side=1
[/filter]
{IF_VAR village_$x1|_$y1|_cleared not_equals yes (
[filter_condition]
[variable]
name=village_$x1|_$y1|_cleared
not_equals=yes
[/variable]
[/filter_condition]
{VARIABLE_OP number_of_guards rand "0..2"}
{VARIABLE guard_i 1}
[while]
[variable]
name=guard_i
less_than_equal_to=$number_of_guards
[/variable]
[do]
[store_locations]
[filter_adjacent_location]
x,y=$x1,$y1
[/filter_adjacent_location]
[not]
[filter]
[/filter]
[/not]
variable=possible_guard_locations
[/store_locations]
{IF_VAR possible_guard_locations.length greater_than 0 (
[then]
{VARIABLE_OP random_location_index rand "0..$($possible_guard_locations.length - 1)"}
[move_unit_fake]
side=2
type=Goblin Spearman
x=$x1,$possible_guard_locations[$random_location_index].x
y=$y1,$possible_guard_locations[$random_location_index].y
[/move_unit_fake]
[unit]
id=guard_$x1|_$y1|_$guard_i
name= _ "Villager"
type=Goblin Spearman
side=2
x,y=$possible_guard_locations[$random_location_index].x,$possible_guard_locations[$random_location_index].y
random_traits=yes
[/unit]
[/then]
)}
{VARIABLE_OP guard_i add 1}
[/do]
[/while]
{VARIABLE village_$x1|_$y1|_cleared yes}
# Trigger an easter egg sometime after a third of villages have been taken
[if]
[variable]
name=done_shaun
not_equals=yes
[/variable]
[variable]
name=number_of_guards
numerical_equals=2
[/variable]
[have_location]
owner_side=1
count=4-99
[/have_location]
# Make sure the guards actually exist, in case there was no space for them
[have_unit]
id=guard_$x1|_$y1|_1
[/have_unit]
[have_unit]
id=guard_$x1|_$y1|_2
[/have_unit]
[then]
{RANDOM_GUARDS (Goblin Spearman) (_ "Villager") 2 $x1 $y1}
[modify_unit]
[filter]
id=guard_$x1|_$y1|_1
[/filter]
#po: Shaun and Ed are characters from the zombie film "Shaun of the Dead".
#po: If the names cannot be translated into your language so that the
#po: movie reference remains recognizable, then simply translate these the
#po: same as "Villager" above.
name= _ "Shaun"
[/modify_unit]
[modify_unit]
[filter]
id=guard_$x1|_$y1|_2
[/filter]
name= _ "Ed"
[/modify_unit]
{VARIABLE village_$x1|_$y1|_cleared yes}
{VARIABLE done_shaun yes}
[/then]
[/if]
[else]
[allow_undo][/allow_undo]
[/else]
)}
{CLEAR_VARIABLE number_of_guards,guard_i,possible_guard_locations,random_location_index}
[/event]
[event]
@ -310,29 +358,6 @@
[/message]
[/event]
# This event has been disabled because the campaign has evolved in
# a direction away from black comedy.
# [event]
# name=moveto
# [filter]
# type=Walking Corpse
# x,y=4,1
# [/filter]
# {NAMED_LOYAL_UNIT 2 (Goblin Spearman) 3 2 Shaun (_ "Shaun")}
# {NAMED_LOYAL_UNIT 2 (Goblin Spearman) 5 2 Ed (_ "Ed")}
# {SPEAK Ed (_ "Any zombies out there?")}
# {SPEAK Shaun (_ "Dont say that!")}
# {SPEAK Ed (_ "What?")}
# {SPEAK Shaun (_ "That!")}
# {SPEAK Ed (_ "What?")}
# {SPEAK Shaun (_ "The zee word. Dont say it!")}
# {SPEAK Ed (_ "Why not?")}
# {SPEAK Shaun (_ "Because its ridiculous!")}
# {SPEAK Ed (_ "Well... are there any?")}
# {SPEAK Shaun (_ "I dont see any. Maybe its not as bad as all that.")}
# {SPEAK Shaun (_ "Oh, no, wait, there they are.")}
# [/event]
# Defeat Conditions
{MALIN_DEATH}
{VOLK_DEATH}
@ -393,7 +418,6 @@
{CLEAR_VARIABLE $village_var}
{NEXT i}
{CLEAR_VARIABLE villages}
{CLEAR_VARIABLE village_var}
{CLEAR_VARIABLE villages,village_var,done_shaun}
[/event]
[/scenario]