mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-28 13:56:18 +00:00
Simplify an event
This commit is contained in:
parent
aa685d7e56
commit
2a1387186c
@ -430,16 +430,9 @@
|
||||
[/event]
|
||||
|
||||
[event]
|
||||
name=side turn
|
||||
name=side 2 turn
|
||||
first_time_only=no
|
||||
|
||||
[if]
|
||||
[variable]
|
||||
name=side_number
|
||||
equals=2
|
||||
[/variable]
|
||||
|
||||
[then]
|
||||
[if]
|
||||
[have_unit]
|
||||
side=1
|
||||
@ -464,7 +457,7 @@
|
||||
# which is the aggressive side and thus the nearby enemies will begin
|
||||
# to pursue the player
|
||||
|
||||
[store_unit]
|
||||
[modify_unit]
|
||||
[filter]
|
||||
side=2
|
||||
|
||||
@ -477,30 +470,22 @@
|
||||
[/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}
|
||||
side=3
|
||||
[/modify_unit]
|
||||
[/then]
|
||||
|
||||
[else]
|
||||
# if player isn't seen by enemies anymore, make all enemies idle again
|
||||
|
||||
{MODIFY_UNIT side=3 side 2}
|
||||
[modify_unit]
|
||||
[filter]
|
||||
side=3
|
||||
[/filter]
|
||||
|
||||
side=2
|
||||
[/modify_unit]
|
||||
[/else]
|
||||
[/if]
|
||||
[/then]
|
||||
[/if]
|
||||
[/event]
|
||||
|
||||
[event]
|
||||
|
Loading…
x
Reference in New Issue
Block a user