Associate deaths with resurrections

Counting deaths was not previously directly associated with the
resurrection of the units. By converting the death event into two
events, it can be included in the same generation macro as the
resurrection portion of the logic.
This commit is contained in:
Alarantalara 2013-11-12 19:30:34 -05:00
parent d3baad2531
commit 3566fe63a2

View file

@ -474,76 +474,6 @@
{CLEAR_VARIABLE rally_chance}
[/event]
# Count (or store) dying elves and orcs, they will make a host
# for posessed Garak sets variables : $azkotep_casualties,
# $ystara_casualties affects variables : $killed_by_ystara,
# $killed_by_azkotep
# This event is pretty simple, with intention of giving Garak a
# number of walking corpses equal to number of lost units.
# Point to consider is to actually zombify the killed by storing
# them and unstoring as a recruit list when Garak is possessed.
[event]
name=die
first_time_only=no
[filter]
side=1,4
[/filter]
[filter_condition]
[variable]
name=turn_number
less_than=12
[/variable]
[/filter_condition]
[if]
[variable]
name=second_unit.side
equals=2
[/variable]
[then]
#ifdef HARD
[store_unit]
[filter]
x,y=$x1,$y1
[/filter]
mode=append
variable=azkotep_casualties
kill=no
[/store_unit]
{VARIABLE azkotep_casualties[$killed_by_azkotep].side 2}
{VARIABLE azkotep_casualties[$killed_by_azkotep].hitpoints $azkotep_casualties[$killed_by_azkotep].max_hitpoints}
{VARIABLE azkotep_casualties[$killed_by_azkotep].status.poisoned "no"}
#endif
{VARIABLE_OP killed_by_azkotep add 1}
[/then]
[/if]
[if]
[variable]
name=second_unit.side
equals=3
[/variable]
[then]
#ifdef HARD
[store_unit]
[filter]
id=$unit.id
[/filter]
mode=append
variable=ystara_casualties
kill=no
[/store_unit]
{VARIABLE ystara_casualties[$killed_by_ystara].side 3}
{VARIABLE ystara_casualties[$killed_by_ystara].hitpoints $ystara_casualties[$killed_by_ystara].max_hitpoints}
{VARIABLE ystara_casualties[$killed_by_ystara].status.poisoned "no"}
#endif
{VARIABLE_OP killed_by_ystara add 1}
[/then]
[/if]
[/event]
# The first capture of an elven_camp has some speech
[event]
name=capture
@ -1465,8 +1395,9 @@
[/modify_turns]
{CLEAR_VARIABLE choice_flag}
{CLEAR_VARIABLE coords}
{CLEAR_VARIABLE azkotep_casualties}
{CLEAR_VARIABLE ystara_casualties}
#ifdef HARD
{CLEAR_VARIABLE azkotep_casualties,ystara_casualties}
#endif
{CLEAR_VARIABLE killed_by_azkotep}
{CLEAR_VARIABLE killed_by_ystara}
[/event]
@ -1535,7 +1466,42 @@
[/kill]
[/event]
#define UTBS_CREATE_MINIONS FOR_VILLAIN SIDE
# Count (or store) dying elves and orcs, they will make a host for possessed Garak.
# Two events per undead side: one to count units as killed by that side and one to
# create the appropriate number of minions when Garak is possessed by that side.
#define UTBS_COUNT_DEATHS_AND_CREATE_MINIONS FOR_VILLAIN SIDE
[event]
name=die
first_time_only=no
[filter]
side=1,4
[/filter]
[filter_second]
side={SIDE}
[/filter_second]
[filter_condition]
[variable]
name=turn_number
less_than=12
[/variable]
[/filter_condition]
#ifdef HARD
[store_unit]
[filter]
x,y=$x1,$y1
[/filter]
mode=append
variable={FOR_VILLAIN}_casualties
kill=no
[/store_unit]
{VARIABLE {FOR_VILLAIN}_casualties[$killed_by_{FOR_VILLAIN}].side {SIDE}}
{VARIABLE {FOR_VILLAIN}_casualties[$killed_by_{FOR_VILLAIN}].hitpoints ${FOR_VILLAIN}_casualties[$killed_by_{FOR_VILLAIN}].max_hitpoints}
{VARIABLE {FOR_VILLAIN}_casualties[$killed_by_{FOR_VILLAIN}].status.poisoned "no"}
#endif
{VARIABLE_OP killed_by_{FOR_VILLAIN} add 1}
[/event]
[event]
name=create_garak_minions_{FOR_VILLAIN}
@ -1580,9 +1546,9 @@
[/event]
#enddef
{UTBS_CREATE_MINIONS azkotep 2}
{UTBS_CREATE_MINIONS ystara 3}
#undef UTBS_CREATE_MINIONS
{UTBS_COUNT_DEATHS_AND_CREATE_MINIONS azkotep 2}
{UTBS_COUNT_DEATHS_AND_CREATE_MINIONS ystara 3}
#undef UTBS_COUNT_DEATHS_AND_CREATE_MINIONS
[event]
name=garak_gloats
@ -2215,8 +2181,9 @@
{CLEAR_VARIABLE grak_defeated}
{CLEAR_VARIABLE ElvishGarak}
{CLEAR_VARIABLE elven_camps}
{CLEAR_VARIABLE azkotep_casualties}
{CLEAR_VARIABLE ystara_casualties}
#ifdef HARD
{CLEAR_VARIABLE azkotep_casualties,ystara_casualties}
#endif
{CLEAR_VARIABLE killed_by_azkotep}
{CLEAR_VARIABLE killed_by_ystara}
[/event]