SoF 7: add a time over event
He will be killed by an ambushing Outrider. [ci skip]
This commit is contained in:
parent
8bfed0644d
commit
7e7c74ed6a
1 changed files with 125 additions and 0 deletions
|
@ -409,6 +409,131 @@
|
|||
{CLEAR_VARIABLE random}
|
||||
[/event]
|
||||
|
||||
[event]
|
||||
name=time over
|
||||
|
||||
[message]
|
||||
race=elf
|
||||
message= _ "You slow humans took too long, our real reinforcements are here!"
|
||||
[/message]
|
||||
|
||||
[delay]
|
||||
time=700
|
||||
[/delay]
|
||||
|
||||
[store_unit]
|
||||
[filter]
|
||||
id=Alanin
|
||||
[/filter]
|
||||
variable=alanin
|
||||
[/store_unit]
|
||||
|
||||
# find a location
|
||||
[if]
|
||||
[variable]
|
||||
name=alanin.x
|
||||
greater_than=12
|
||||
[/variable]
|
||||
[then]
|
||||
{VARIABLE spawn.x 24}
|
||||
[/then]
|
||||
[else]
|
||||
{VARIABLE spawn.x 1}
|
||||
[/else]
|
||||
[/if]
|
||||
|
||||
{VARIABLE spawn.y "$($alanin.y+2)"}
|
||||
|
||||
# make sure it's not in the water
|
||||
[store_locations]
|
||||
variable=spawn_hexes
|
||||
include_borders=no
|
||||
[not]
|
||||
terrain=W*^*,A*^*
|
||||
[/not]
|
||||
x=$spawn.x
|
||||
[and]
|
||||
y=$spawn.y
|
||||
radius=2
|
||||
# this [and] is not redundant, due to the way radius works
|
||||
[/and]
|
||||
[/store_locations]
|
||||
|
||||
[unit]
|
||||
id=ambusher
|
||||
side=2
|
||||
type=Elvish Outrider
|
||||
x=$spawn_hexes[0].x
|
||||
y=$spawn_hexes[0].y
|
||||
[modifications]
|
||||
{TRAIT_QUICK}
|
||||
[/modifications]
|
||||
[/unit]
|
||||
|
||||
[store_locations]
|
||||
variable=next_to_alanin
|
||||
include_borders=no
|
||||
[not]
|
||||
[filter]
|
||||
[/filter]
|
||||
[/not]
|
||||
[and]
|
||||
x=$alanin.x
|
||||
y=$alanin.y
|
||||
radius=1
|
||||
[/and]
|
||||
[/store_locations]
|
||||
|
||||
[move_unit]
|
||||
id=ambusher
|
||||
x=$spawn_hexes[0].x
|
||||
y=$spawn_hexes[0].y
|
||||
to_x=$next_to_alanin[0].x
|
||||
to_y=$next_to_alanin[0].y
|
||||
[/move_unit]
|
||||
|
||||
# to avoid scrolling between the killing animation and the [kill]
|
||||
[scroll_to]
|
||||
x=$alanin.x
|
||||
y=$alanin.y
|
||||
[/scroll_to]
|
||||
|
||||
[animate_unit]
|
||||
[filter]
|
||||
id=ambusher
|
||||
[/filter]
|
||||
flag=attack
|
||||
hits=yes
|
||||
with_bars=yes
|
||||
[primary_attack]
|
||||
range=ranged
|
||||
[/primary_attack]
|
||||
[facing]
|
||||
x=$alanin.x
|
||||
y=$alanin.y
|
||||
[/facing]
|
||||
|
||||
[animate]
|
||||
[filter]
|
||||
id=Alanin
|
||||
[/filter]
|
||||
flag=defend
|
||||
hits=yes
|
||||
with_bars=no
|
||||
[facing]
|
||||
[filter]
|
||||
id=ambusher
|
||||
[/filter]
|
||||
[/facing]
|
||||
[/animate]
|
||||
[/animate_unit]
|
||||
[kill]
|
||||
id=Alanin
|
||||
animate=yes
|
||||
[/kill]
|
||||
{CLEAR_VARIABLE alanin,next_to_alanin,spawn,spawn_hexes}
|
||||
[/event]
|
||||
|
||||
[event]
|
||||
name=moveto
|
||||
[filter]
|
||||
|
|
Loading…
Add table
Reference in a new issue