Ported most of the events in the twelfth scenario to custom events.

This commit is contained in:
Steven Panek 2010-11-06 19:58:38 +00:00
parent 5c0a422571
commit b724327aca

View File

@ -24,6 +24,17 @@
{UNDERGROUND}
#########################################################################################################
# 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 #
# yechnagoth_regenerate : causes Yechnagoth to fully heal #
# yechnagoth_special_attack : trigger Yechnagoth's special slowing attack #
# yechnagoth_vulnerate : vulnerates Yechnagoth #
# yechnagoth_death : triggers Yechnagoth's death event #
#########################################################################################################
# Side 1: elves
[side]
side=1
@ -665,6 +676,14 @@
id=Eloh
[/filter]
[fire_event]
name=eloh_death
[/fire_event]
[/event]
[event]
name=eloh_death
[message]
speaker=Eloh
image=portraits/eloh_rage.png
@ -1089,19 +1108,28 @@
[/have_unit]
[then]
{CREATE_MINION}
[set_variable]
name=minion_turn_counter
add=1
[/set_variable]
#[message]
#speaker=narrator
#message= _ "minion turn counter: $minion_turn_counter"
#[/message]
[fire_event]
name=spawn_minions
[/fire_event]
[/then]
[/if]
[/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]
@ -1149,61 +1177,70 @@
[/have_unit]
[then]
[store_unit]
[filter]
type=Central Body
[/filter]
variable=stored_alien
[/store_unit]
[set_variable]
name=temp
value=$stored_alien.hitpoints
[/set_variable]
[object]
[filter]
type=Central Body
[/filter]
silent=yes
duration="level"
[effect]
apply_to="hitpoints"
heal_full="yes"
[/effect]
[/object]
[if]
[variable]
name=temp
less_than=100
[/variable]
[variable]
name=attacked_yechnagoth
numerical_equals=0
[/variable]
[then]
[set_variable]
name=attacked_yechnagoth
value=1
[/set_variable]
[message]
speaker=Kaleh
message= _ "That central body is healing faster than we can damage it. Its almost as if our attacks are doing no damage at all. We got to try another tactic, and fast!"
[/message]
[/then]
[/if]
{CLEAR_VARIABLE stored_alien}
[fire_event]
name=yechnagoth_regenerate
[/fire_event]
[/then]
[/if]
[/event]
[event]
name=yechnagoth_regenerate
first_time_only=no
[store_unit]
[filter]
type=Central Body
[/filter]
variable=stored_alien
[/store_unit]
[set_variable]
name=temp
value=$stored_alien.hitpoints
[/set_variable]
[object]
[filter]
type=Central Body
[/filter]
silent=yes
duration="level"
[effect]
apply_to="hitpoints"
heal_full="yes"
[/effect]
[/object]
[if]
[variable]
name=temp
less_than=100
[/variable]
[variable]
name=attacked_yechnagoth
numerical_equals=0
[/variable]
[then]
[set_variable]
name=attacked_yechnagoth
value=1
[/set_variable]
[message]
speaker=Kaleh
message= _ "That central body is healing faster than we can damage it. Its almost as if our attacks are doing no damage at all. We got to try another tactic, and fast!"
[/message]
[/then]
[/if]
{CLEAR_VARIABLE stored_alien}
[/event]
# Event 4: Special attack my Central Body each turn
[event]
@ -1216,136 +1253,145 @@
[/have_unit]
[then]
[store_unit]
[filter]
side=1
{EVERYWHERE}
[/filter]
kill=no
variable=elf_list
[/store_unit]
{VARIABLE_OP victim_i rand "1..$elf_list.length"}
{VARIABLE_OP victim_i sub 1}
#used to be 140,255,247
[color_adjust]
red,green,blue=40,0,100
[/color_adjust]
[redraw]
[/redraw]
[delay]
time=250
[/delay]
[color_adjust]
red,green,blue=0,0,0
[/color_adjust]
[redraw]
[/redraw]
[delay]
time=100
[/delay]
# Add two effects slow unit and damage it
# 1: do damage to unit (8/9/10 based on difficulty?-stops healing)
# 2: slow unit
#ifdef EASY
{VARIABLE special_attack_damage 10}
#endif
#ifdef NORMAL
{VARIABLE special_attack_damage 11}
#endif
#ifdef HARD
{VARIABLE special_attack_damage 12}
#endif
[if]
[variable]
name=elf_list[$victim_i].hitpoints
less_than_equal_to=$special_attack_damage
[/variable]
[then]
{VARIABLE special_attack_damage $elf_list[$victim_i].hitpoints}
{VARIABLE_OP special_attack_damage sub 1}
[/then]
[/if]
{VARIABLE_OP elf_list[$victim_i].hitpoints sub $special_attack_damage}
[unstore_unit]
variable=elf_list[$victim_i]
find_vacant=no
text="$special_attack_damage" # wmllint: ignore no spellcheck
{COLOR_HARM}
[/unstore_unit]
[delay]
time=300
[/delay]
{VARIABLE elf_list[$victim_i].status.slowed yes}
[if]
[variable]
name="elf_list[$victim_i].gender"
equals="female"
[/variable]
[then]
#textdomain wesnoth
{VARIABLE slowed_text ( _ "female^slowed")}
[/then]
[else]
{VARIABLE slowed_text ( _ "slowed")}
[/else]
[/if]
#textdomain wesnoth-utbs
[unstore_unit]
variable=elf_list[$victim_i]
find_vacant=no
text=$slowed_text
{COLOR_HARM}
[/unstore_unit]
{CLEAR_VARIABLE slowed_text}
[if]
[variable]
name=hit_by_special_attack
not_equals=yes
[/variable]
[then]
{VARIABLE hit_by_special_attack yes}
[message]
x,y=$elf_list[$victim_i].x,$elf_list[$victim_i].y
message= _ "What the heck? That central creature just hit me with some sort of slime. It hurts and I— Im stuck!"
[/message]
[/then]
[else]
[message]
x,y=$elf_list[$victim_i].x,$elf_list[$victim_i].y
message= _ "Ow, Im stuck!"
[/message]
[/else]
[/if]
{CLEAR_VARIABLE elf_list}
[fire_event]
name=yechnagoth_special_attack
[/fire_event]
[/then]
[/if]
[/event]
[event]
name=yechnagoth_special_attack
first_time_only=no
[store_unit]
[filter]
side=1
{EVERYWHERE}
[/filter]
kill=no
variable=elf_list
[/store_unit]
{VARIABLE_OP victim_i rand "1..$elf_list.length"}
{VARIABLE_OP victim_i sub 1}
#used to be 140,255,247
[color_adjust]
red,green,blue=40,0,100
[/color_adjust]
[redraw]
[/redraw]
[delay]
time=250
[/delay]
[color_adjust]
red,green,blue=0,0,0
[/color_adjust]
[redraw]
[/redraw]
[delay]
time=100
[/delay]
# Add two effects slow unit and damage it
# 1: do damage to unit (8/9/10 based on difficulty?-stops healing)
# 2: slow unit
#ifdef EASY
{VARIABLE special_attack_damage 10}
#endif
#ifdef NORMAL
{VARIABLE special_attack_damage 11}
#endif
#ifdef HARD
{VARIABLE special_attack_damage 12}
#endif
[if]
[variable]
name=elf_list[$victim_i].hitpoints
less_than_equal_to=$special_attack_damage
[/variable]
[then]
{VARIABLE special_attack_damage $elf_list[$victim_i].hitpoints}
{VARIABLE_OP special_attack_damage sub 1}
[/then]
[/if]
{VARIABLE_OP elf_list[$victim_i].hitpoints sub $special_attack_damage}
[unstore_unit]
variable=elf_list[$victim_i]
find_vacant=no
text="$special_attack_damage" # wmllint: ignore no spellcheck
{COLOR_HARM}
[/unstore_unit]
[delay]
time=300
[/delay]
{VARIABLE elf_list[$victim_i].status.slowed yes}
[if]
[variable]
name="elf_list[$victim_i].gender"
equals="female"
[/variable]
[then]
#textdomain wesnoth
{VARIABLE slowed_text ( _ "female^slowed")}
[/then]
[else]
{VARIABLE slowed_text ( _ "slowed")}
[/else]
[/if]
#textdomain wesnoth-utbs
[unstore_unit]
variable=elf_list[$victim_i]
find_vacant=no
text=$slowed_text
{COLOR_HARM}
[/unstore_unit]
{CLEAR_VARIABLE slowed_text}
[if]
[variable]
name=hit_by_special_attack
not_equals=yes
[/variable]
[then]
{VARIABLE hit_by_special_attack yes}
[message]
x,y=$elf_list[$victim_i].x,$elf_list[$victim_i].y
message= _ "What the heck? That central creature just hit me with some sort of slime. It hurts and I— Im stuck!"
[/message]
[/then]
[else]
[message]
x,y=$elf_list[$victim_i].x,$elf_list[$victim_i].y
message= _ "Ow, Im stuck!"
[/message]
[/else]
[/if]
{CLEAR_VARIABLE elf_list}
[/event]
# Event 5: When player destroys all 3 Pulsing Spires, Central Body is weakened
[event]
@ -1364,63 +1410,71 @@
[/not]
[then]
# when all 3 spires are destroyed, weaken main body
[kill]
type=Pulsing Spire
fire_event=no
animate=no
[/kill]
[scroll]
x=20
[/scroll]
[scroll]
x=-20
[/scroll]
[scroll]
x=20
[/scroll]
[scroll]
x=-20
[/scroll]
[scroll]
x=20
[/scroll]
[scroll]
x=-20
[/scroll]
[message]
speaker=narrator
message= _ "<big><b>Aaaurrgghh!!</b></big>"
image= # wmllint: no-icon
[/message]
[kill]
type=Central Body
animate=no
fire_event=no
[/kill]
[unit]
type=Central Body2
id=Yechnagoth
name= _ "Yechnagoth"
side=2
x,y=10,10
[/unit]
[redraw]
[/redraw]
[message]
speaker=Kaleh
message= _ "I think were finally doing some damage. We must attack the central body, while it remains vulnerable!"
[/message]
[fire_event]
name=yechnagoth_vulnerate
[/fire_event]
[/then]
[/if]
[/event]
[event]
name=yechnagoth_vulnerate
# when all 3 spires are destroyed, weaken main body
[kill]
type=Pulsing Spire
fire_event=no
animate=no
[/kill]
[scroll]
x=20
[/scroll]
[scroll]
x=-20
[/scroll]
[scroll]
x=20
[/scroll]
[scroll]
x=-20
[/scroll]
[scroll]
x=20
[/scroll]
[scroll]
x=-20
[/scroll]
[message]
speaker=narrator
message= _ "<big><b>Aaaurrgghh!!</b></big>"
image= # wmllint: no-icon
[/message]
[kill]
type=Central Body
animate=no
fire_event=no
[/kill]
[unit]
type=Central Body2
id=Yechnagoth
name= _ "Yechnagoth"
side=2
x,y=10,10
[/unit]
[redraw]
[/redraw]
[message]
speaker=Kaleh
message= _ "I think were finally doing some damage. We must attack the central body, while it remains vulnerable!"
[/message]
[/event]
# Event 6: Death of weakened Central Body
[event]
@ -1509,6 +1563,14 @@
type=Central Body2
[/filter]
[fire_event]
name=yechnagoth_death
[/fire_event]
[/event]
[event]
name=yechnagoth_death
# have a minion scream
[message]
@ -1640,19 +1702,6 @@
[/endlevel]
[/event]
# testing event to skip to end of battle
#[event]
#name=turn 2
#[kill]
#type=Pulsing Spire
#animate=yes
#fire_event=yes
#[/kill]
#[/event]
{UTBS_INCLUDE utils/kaleh-abilities.cfg}
{UTBS_INCLUDE utils/deaths.cfg}
[/scenario]