Spawn minions in loop/event instead of macro copies
This commit is contained in:
parent
81d36dbc24
commit
8a65202fc8
1 changed files with 71 additions and 97 deletions
|
@ -22,7 +22,7 @@
|
|||
# Events table (stuff that can be triggered with 'fire') #
|
||||
#########################################################################################################
|
||||
# eloh_death : causes the post-Eloh events to occur #
|
||||
# spawn_minions : spawns some of Yechnagoth's minions #
|
||||
# create_minion : spawns one of Yechnagoth's minions #
|
||||
# yechnagoth_regenerate : causes Yechnagoth to fully heal #
|
||||
# yechnagoth_special_attack : trigger Yechnagoth's special slowing attack #
|
||||
# yechnagoth_vulnerate : vulnerates Yechnagoth #
|
||||
|
@ -243,11 +243,8 @@
|
|||
{VARIABLE allies_killed 0}
|
||||
{VARIABLE nym_dead false}
|
||||
{VARIABLE zhul_dead false}
|
||||
|
||||
# if ally survived to final battle then save this info
|
||||
{VARIABLE ally_died_in_final_fight no}
|
||||
|
||||
{VARIABLE minion_turn_counter 0}
|
||||
{VARIABLE number_minions_to_spawn 0}
|
||||
|
||||
# set starting scenario objectives
|
||||
|
||||
|
@ -609,37 +606,39 @@
|
|||
[/message]
|
||||
[/event]
|
||||
|
||||
# MACRO 1: Create an alien minion
|
||||
# Create an alien minion
|
||||
[event]
|
||||
name=create_minion
|
||||
first_time_only=no
|
||||
|
||||
#define CREATE_MINION
|
||||
[store_locations]
|
||||
x=6-14
|
||||
y=7-14
|
||||
terrain=Rr,Uu
|
||||
[store_locations]
|
||||
x=6-14
|
||||
y=7-14
|
||||
terrain=Rr,Uu
|
||||
|
||||
[not]
|
||||
[filter]
|
||||
[/filter]
|
||||
[/not]
|
||||
[not]
|
||||
[filter]
|
||||
[/filter]
|
||||
[/not]
|
||||
|
||||
variable=possible_spawn_locations
|
||||
[/store_locations]
|
||||
variable=possible_spawn_locations
|
||||
[/store_locations]
|
||||
|
||||
[if]
|
||||
[variable]
|
||||
name=possible_spawn_locations.length
|
||||
greater_than_equal_to=1
|
||||
[/variable]
|
||||
[if]
|
||||
[variable]
|
||||
name=possible_spawn_locations.length
|
||||
greater_than_equal_to=1
|
||||
[/variable]
|
||||
|
||||
[then]
|
||||
{VARIABLE_OP new_minion_loc_i rand "1..$possible_spawn_locations.length"}
|
||||
{VARIABLE_OP new_minion_loc_i sub 1}
|
||||
[then]
|
||||
{VARIABLE_OP new_minion_loc_i rand "1..$possible_spawn_locations.length"}
|
||||
{VARIABLE_OP new_minion_loc_i sub 1}
|
||||
|
||||
{UNIT 2 (Crawling Horror) $possible_spawn_locations[$new_minion_loc_i].x $possible_spawn_locations[$new_minion_loc_i].y (upkeep=free)}
|
||||
[/then]
|
||||
[/if]
|
||||
{CLEAR_VARIABLE possible_spawn_locations}
|
||||
#enddef
|
||||
{UNIT 2 (Crawling Horror) $possible_spawn_locations[$new_minion_loc_i].x $possible_spawn_locations[$new_minion_loc_i].y (upkeep=free)}
|
||||
[/then]
|
||||
[/if]
|
||||
{CLEAR_VARIABLE possible_spawn_locations}
|
||||
[/event]
|
||||
|
||||
# Event 1: The Death of Eloh and the revealing of the true monster
|
||||
|
||||
|
@ -873,13 +872,16 @@
|
|||
[redraw]
|
||||
[/redraw]
|
||||
|
||||
# alien bugs appear
|
||||
|
||||
# create 3 bugs using a macro
|
||||
|
||||
{CREATE_MINION}
|
||||
{CREATE_MINION}
|
||||
{CREATE_MINION}
|
||||
# create 3 bugs
|
||||
[fire_event]
|
||||
name=create_minion
|
||||
[/fire_event]
|
||||
[fire_event]
|
||||
name=create_minion
|
||||
[/fire_event]
|
||||
[fire_event]
|
||||
name=create_minion
|
||||
[/fire_event]
|
||||
|
||||
[redraw]
|
||||
[/redraw]
|
||||
|
@ -916,6 +918,24 @@
|
|||
|
||||
{IS_LAST_SCENARIO}
|
||||
[/objectives]
|
||||
|
||||
# Start spawning minions, increasing the number each turn.
|
||||
{VARIABLE number_minions_to_spawn 1}
|
||||
[event]
|
||||
name="turn $($turn_number+{ON_DIFFICULTY 2 2 1})"
|
||||
delayed_variable_substitution=no
|
||||
{VARIABLE number_minions_to_spawn 2}
|
||||
[/event]
|
||||
[event]
|
||||
name="turn $($turn_number+{ON_DIFFICULTY 4 3 3})"
|
||||
delayed_variable_substitution=no
|
||||
{VARIABLE number_minions_to_spawn 3}
|
||||
[/event]
|
||||
[event]
|
||||
name="turn $($turn_number+{ON_DIFFICULTY 6 5 5})"
|
||||
delayed_variable_substitution=no
|
||||
{VARIABLE number_minions_to_spawn 4}
|
||||
[/event]
|
||||
[/event]
|
||||
|
||||
[event]
|
||||
|
@ -1029,70 +1049,24 @@
|
|||
[/event]
|
||||
|
||||
# Event 2: New minions are created each turn
|
||||
|
||||
[event]
|
||||
name=new turn
|
||||
first_time_only=no
|
||||
|
||||
[filter_condition]
|
||||
[have_unit]
|
||||
id=Yechnagoth
|
||||
[/have_unit]
|
||||
[/filter_condition]
|
||||
|
||||
[fire_event]
|
||||
name=spawn_minions
|
||||
[/fire_event]
|
||||
[/event]
|
||||
|
||||
[event]
|
||||
name=spawn_minions
|
||||
first_time_only=no
|
||||
|
||||
{CREATE_MINION}
|
||||
|
||||
[set_variable]
|
||||
name=minion_turn_counter
|
||||
add=1
|
||||
[/set_variable]
|
||||
|
||||
#[message]
|
||||
#speaker=narrator
|
||||
#message= _ "minion turn counter: $minion_turn_counter"
|
||||
#[/message]
|
||||
|
||||
[if]
|
||||
{VARIABLE i 0}
|
||||
[while]
|
||||
[variable]
|
||||
name=minion_turn_counter
|
||||
greater_than={ON_DIFFICULTY 2 2 1}
|
||||
name=i
|
||||
less_than=$number_minions_to_spawn
|
||||
[/variable]
|
||||
|
||||
[then]
|
||||
{CREATE_MINION}
|
||||
[/then]
|
||||
[/if]
|
||||
|
||||
[if]
|
||||
[variable]
|
||||
name=minion_turn_counter
|
||||
greater_than={ON_DIFFICULTY 4 3 3}
|
||||
[/variable]
|
||||
|
||||
[then]
|
||||
{CREATE_MINION}
|
||||
[/then]
|
||||
[/if]
|
||||
|
||||
[if]
|
||||
[variable]
|
||||
name=minion_turn_counter
|
||||
greater_than={ON_DIFFICULTY 6 5 5}
|
||||
[/variable]
|
||||
|
||||
[then]
|
||||
{CREATE_MINION}
|
||||
[/then]
|
||||
[/if]
|
||||
[do]
|
||||
[fire_event]
|
||||
name=create_minion
|
||||
[/fire_event]
|
||||
{VARIABLE_OP i add 1}
|
||||
[/do]
|
||||
[/while]
|
||||
{CLEAR_VARIABLE i}
|
||||
[/event]
|
||||
|
||||
# Event 3: Central Body heals fully each turn
|
||||
|
@ -1160,7 +1134,7 @@
|
|||
[/message]
|
||||
[/event]
|
||||
|
||||
# Event 4: Special attack my Central Body each turn
|
||||
# Event 4: Special attack by Central Body each turn
|
||||
|
||||
[event]
|
||||
name=new turn
|
||||
|
@ -1542,7 +1516,7 @@
|
|||
[/then]
|
||||
[/if]
|
||||
|
||||
{CLEAR_VARIABLE minion_turn_counter}
|
||||
{CLEAR_VARIABLE number_minions_to_spawn}
|
||||
{CLEAR_VARIABLE hit_by_special_attack}
|
||||
|
||||
[endlevel]
|
||||
|
|
Loading…
Add table
Reference in a new issue