mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-09 02:29:50 +00:00
use simpler helper finding code from Eftboren in FInal Confrontation
This commit is contained in:
parent
b896fd293d
commit
6ac024ae77
@ -940,20 +940,16 @@
|
|||||||
[/filter]
|
[/filter]
|
||||||
|
|
||||||
kill=no
|
kill=no
|
||||||
variable=lvl4_recalls
|
variable=possible_helpers
|
||||||
[/store_unit]
|
[/store_unit]
|
||||||
|
|
||||||
[if]
|
[if]
|
||||||
[variable]
|
[variable]
|
||||||
name=lvl4_recalls.length
|
name=possible_helpers.length
|
||||||
greater_than=0
|
equals=0
|
||||||
[/variable]
|
[/variable]
|
||||||
|
|
||||||
[then]
|
[then]
|
||||||
{VARIABLE helper_level 4}
|
|
||||||
[/then]
|
|
||||||
|
|
||||||
[else]
|
|
||||||
[store_unit]
|
[store_unit]
|
||||||
[filter]
|
[filter]
|
||||||
side=1
|
side=1
|
||||||
@ -962,20 +958,16 @@
|
|||||||
[/filter]
|
[/filter]
|
||||||
|
|
||||||
kill=no
|
kill=no
|
||||||
variable=lvl3_recalls
|
variable=possible_helpers
|
||||||
[/store_unit]
|
[/store_unit]
|
||||||
|
|
||||||
[if]
|
[if]
|
||||||
[variable]
|
[variable]
|
||||||
name=lvl3_recalls.length
|
name=possible_helpers.length
|
||||||
greater_than=0
|
equals=0
|
||||||
[/variable]
|
[/variable]
|
||||||
|
|
||||||
[then]
|
[then]
|
||||||
{VARIABLE helper_level 3}
|
|
||||||
[/then]
|
|
||||||
|
|
||||||
[else]
|
|
||||||
[store_unit]
|
[store_unit]
|
||||||
[filter]
|
[filter]
|
||||||
side=1
|
side=1
|
||||||
@ -984,20 +976,16 @@
|
|||||||
[/filter]
|
[/filter]
|
||||||
|
|
||||||
kill=no
|
kill=no
|
||||||
variable=lvl2_recalls
|
variable=possible_helpers
|
||||||
[/store_unit]
|
[/store_unit]
|
||||||
|
|
||||||
[if]
|
[if]
|
||||||
[variable]
|
[variable]
|
||||||
name=lvl2_recalls.length
|
name=possible_helpers.length
|
||||||
greater_than=0
|
equals=0
|
||||||
[/variable]
|
[/variable]
|
||||||
|
|
||||||
[then]
|
[then]
|
||||||
{VARIABLE helper_level 2}
|
|
||||||
[/then]
|
|
||||||
|
|
||||||
[else]
|
|
||||||
[store_unit]
|
[store_unit]
|
||||||
[filter]
|
[filter]
|
||||||
side=1
|
side=1
|
||||||
@ -1008,54 +996,23 @@
|
|||||||
kill=no
|
kill=no
|
||||||
variable=lvl1_recalls
|
variable=lvl1_recalls
|
||||||
[/store_unit]
|
[/store_unit]
|
||||||
|
[/then]
|
||||||
|
[/if]
|
||||||
|
[/then]
|
||||||
|
[/if]
|
||||||
|
[/then]
|
||||||
|
[/if]
|
||||||
|
|
||||||
[if]
|
[if]
|
||||||
[variable]
|
[variable]
|
||||||
name=lvl1_recalls.length
|
name=possible_helpers.length
|
||||||
greater_than=0
|
greater_than=0
|
||||||
[/variable]
|
[/variable]
|
||||||
|
|
||||||
[then]
|
[then]
|
||||||
{VARIABLE helper_level 1}
|
|
||||||
[/then]
|
|
||||||
|
|
||||||
[else]
|
|
||||||
{VARIABLE no_possible_helpers_left yes}
|
|
||||||
[/else]
|
|
||||||
[/if]
|
|
||||||
[/else]
|
|
||||||
[/if]
|
|
||||||
[/else]
|
|
||||||
[/if]
|
|
||||||
[/else]
|
|
||||||
[/if]
|
|
||||||
|
|
||||||
{CLEAR_VARIABLE lvl1_recalls,lvl2_recalls,lvl3_recalls,lvl4_recalls}
|
|
||||||
|
|
||||||
[if]
|
|
||||||
[variable]
|
|
||||||
name=no_possible_helpers_left
|
|
||||||
not_equals=yes
|
|
||||||
[/variable]
|
|
||||||
|
|
||||||
[then]
|
|
||||||
[store_unit]
|
|
||||||
[filter]
|
|
||||||
side=1
|
|
||||||
level=$helper_level
|
|
||||||
x,y=recall,recall
|
|
||||||
[/filter]
|
|
||||||
|
|
||||||
kill=no
|
|
||||||
variable=possible_helpers
|
|
||||||
[/store_unit]
|
|
||||||
|
|
||||||
{VARIABLE_OP random_helper_i rand "1..$possible_helpers.length"}
|
{VARIABLE_OP random_helper_i rand "1..$possible_helpers.length"}
|
||||||
{VARIABLE_OP random_helper_i sub 1}
|
{VARIABLE_OP random_helper_i sub 1}
|
||||||
|
|
||||||
{VARIABLE possible_helpers[$random_helper_i].x 10}
|
|
||||||
{VARIABLE possible_helpers[$random_helper_i].y 18}
|
|
||||||
|
|
||||||
[move_unit_fake]
|
[move_unit_fake]
|
||||||
type=$possible_helpers[$random_helper_i].type
|
type=$possible_helpers[$random_helper_i].type
|
||||||
side=1
|
side=1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user