Rework how the guards in Hide and Seek work:

...now if they see the player, all nearby guards are woken up to
pursue the player (and go to sleep again if the player disappears from
sight). Also, removed the starting encampment and made the player
unable to accumulate any gold.
This commit is contained in:
Lari Nieminen 2008-02-14 15:47:54 +00:00
parent 2b5645f52e
commit 404dd5313b
2 changed files with 124 additions and 14 deletions

View file

@ -49,5 +49,5 @@ Gg , Gg , Gg , Gg , Re , Gg
Gg , Gg , Re , Re , Re , Re , Re , Ch , Ch , Ch , Rr , Ch , Ch , Ch , Gg , Gg , Gg , Gg , Gg , Gs^Fp , Hh , Gs^Fp , Gs^Fp , Gs^Fp , Gs^Fp , Gs^Fp , Gg , Gs^Fp , Gg^Vh , Rd , Gs^Fp , Gg , Gg , Gg , Gs^Fp
Gg , Gg , Re , Re , Re , Re , Re , Re , Gg , Gg , Rr , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gs^Fp , Gg , Gg , Gg , Rd , Rd , Rd , Rd , Rd , Gs^Fp , Gs^Fp , Gs^Fp , Gs^Fp , Gs^Fp
Gg , Gg , Gg , Re , Re , Re , Rr , Gg , Rr , Rr , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gs^Fp , Gs^Fp , Gs^Fp , Gg , Gs^Fp , Gg , Gs^Fp , Gs^Fp , Gg , Rd , Gg , Gg , Gg , Gs^Fp , Gs^Fp , Gs^Fp , Gs^Fp , Gs^Fp
Gg , Gg , Gg , Gg , Gg , Gg , Gg , Rr , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gs^Fp , Gs^Fp , Gs^Fp , Gs^Fp , Gs^Fp , Gg , Gs^Fp , Gs^Fp , Gs^Fp , Gs^Fp , Rd , 3 Gg , Gs^Fp , Gs^Fp , Gs^Fp , Gs^Fp , Gs^Fp , Gs^Fp , Gs^Fp
Gg , Gg , Gg , Gg , Gg , Gg , Gg , Rr , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gs^Fp , Gs^Fp , Gs^Fp , Gs^Fp , Gs^Fp , Gg , Gs^Fp , Gs^Fp , Gs^Fp , Gs^Fp , Rd , 4 Gg , Gs^Fp , Gs^Fp , Gs^Fp , Gs^Fp , Gs^Fp , Gs^Fp , Gs^Fp
Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gg , Gs^Fp , Gs^Fp , Gs^Fp , Gs^Fp , Gs^Fp , Gs^Fp , Gs^Fp , Gs^Fp , Gs^Fp , Gs^Fp , Rd , Gg , Gs^Fp , Gs^Fp , Gs^Fp , Gs^Fp , Gs^Fp , Gs^Fp , Gg

View file

@ -38,6 +38,8 @@
controller=human
recruit=Thug,Footpad,Poacher
gold=100
income=-2
village_gold=0
team_name=good_guys
shroud=no
fog=yes
@ -52,11 +54,28 @@
side=2
canrecruit=1
controller=ai
ai_algorithm=idle_ai
team_name=bad_guys
[ai]
passive_leader=yes
[/ai]
shroud=yes
shroud=no
fog=yes
[/side]
[side]
no_leader=yes
side=3
colour=blue
controller=ai
team_name=bad_guys
[ai]
aggression=2.0
caution=0.0
grouping=no
simple_targetting=yes
[/ai]
shroud=no
fog=yes
[/side]
@ -66,7 +85,8 @@
type=Rogue
description=Hans
user_description= _ "Hans"
side=3
side=4
colour=green
canrecruit=1
controller=ai
facing=sw
@ -86,6 +106,11 @@
[event]
name=prestart
[store_side]
side=1
variable=stored_side_1
[/store_side]
[objectives]
side=1
[objective]
@ -128,7 +153,6 @@
generate_description=yes
x,y={X},{Y}
side=2
ai_special=guardian
random_traits=yes
[/unit]
#enddef
@ -205,7 +229,6 @@
type=$guard_type
random_traits=yes
generate_description=yes
ai_special=guardian
[/unit]
[store_unit]
@ -320,7 +343,6 @@
x,y=$new_assistant_guard_locations[$random_i].x,$new_assistant_guard_locations[$random_i].y
generate_description=yes
random_traits=yes
ai_special=guardian
[/unit]
[store_locations]
@ -472,19 +494,18 @@
[move_unit_fake]
type=Thief
side=3
side=4
x=7,6
y=9,6
[/move_unit_fake]
[unit]
type=Thief
side=3
side=4
x,y=6,6
random_traits=yes
description=Link
user_description= _ "Link"
ai_special=guardian
[/unit]
[message]
@ -510,6 +531,17 @@
description=Baldras
[/scroll_to_unit]
{MOVE_UNIT description=Link 5 8}
[kill]
description=Link
animate=no
fire_event=no
[/kill]
[redraw]
[/redraw]
{CLEAR_VARIABLE stored_Baldras}
[/event]
@ -537,13 +569,84 @@
[/event]
[event]
name=attack
name=side turn
first_time_only=no
[if]
[variable]
name=side_number
equals=2
[/variable]
[then]
[if]
[have_unit]
side=1
[filter_vision]
visible=yes
viewing_side=2
[/filter_vision]
[or]
side=1
[filter_vision]
visible=yes
viewing_side=3
[/filter_vision]
[/or]
[/have_unit]
[then]
# if player is visible to enemies, flip all nearby enemies to side 3,
# which is the aggressive side and thus the nearby enemies will begin
# to pursue the player
[store_unit]
[filter]
side=2
[filter_location]
[filter]
side=1
[/filter]
{QUANTITY radius 8 11 13}
[/filter_location]
[/filter]
kill=yes
variable=side_2_units_nearby
[/store_unit]
{FOREACH side_2_units_nearby i}
{VARIABLE side_2_units_nearby[$i].side 3}
[unstore_unit]
variable=side_2_units_nearby[$i]
find_vacant=no
[/unstore_unit]
{NEXT i}
{CLEAR_VARIABLE side_2_units_nearby}
[/then]
[else]
# if player isn't seen by enemies anymore, make all enemies idle again
{MODIFY_UNIT side=3 side 2}
[/else]
[/if]
[/then]
[/if]
[/event]
[event]
name=moveto
[filter]
side=2
side=3
[/filter]
[filter_second]
side=1
[/filter_second]
[message]
speaker=second_unit
message= _ "They've seen us, RUN!"
@ -644,6 +747,13 @@
message= _ "Lead the way..."
[/message]
[modify_side]
side=1
gold=$stored_side_1.gold
[/modify_side]
{CLEAR_VARIABLE stored_side_1}
[endlevel]
result=victory
bonus=no