Simplified an incredibly unnecessarily complicated bit of code.

This commit is contained in:
Lari Nieminen 2009-07-19 16:25:04 +00:00
parent ff5bf8dd6e
commit 77d735d105

View File

@ -168,71 +168,15 @@ Note: You need to use map settings for the scenario to work right."
[/filter]
[/store_unit]
{FOREACH ai_unit id}
{VARIABLE name $ai_unit[$id].name}
{VARIABLE type $ai_unit[$id].type}
{VARIABLE damage $ai_unit[$id].hitpoints}
{VARIABLE_OP damage add -$ai_unit[$i].max_hitpoints}
{VARIABLE facing $ai_unit[$id].facing}
{VARIABLE gender $ai_unit[$id].gender}
{VARIABLE experience $ai_unit[$id].experience}
{VARIABLE poisoned $ai_unit[$id].status.poisoned}
{VARIABLE slowed $ai_unit[$id].status.slowed}
{VARIABLE hidden $ai_unit[$id].status.hidden}
{VARIABLE x $ai_unit[$id].x}
{VARIABLE y $ai_unit[$id].y}
[if]
[variable]
name=ai_unit[$id].race
equals="undead"
[/variable]
[then]
{VARIABLE name ""}
[/then]
[/if]
[unit]
type=$type
side={SIDE2}
x=$x
y=$y
experience=$experience
facing=$facing
gender=$gender
name=$name
random_traits=yes
[status]
hidden=$hidden
slowed=$slowed
poisoned=$poisoned
[/status]
[/unit]
# add the damage the unit had
[store_unit]
variable=last_spawn
kill=yes
[filter]
side={SIDE2}
x,y = $x,$y
[/filter]
[/store_unit]
{VARIABLE hitpoints $last_spawn.hitpoints}
{VARIABLE_OP hitpoints add $damage}
{VARIABLE last_spawn.hitpoints $hitpoints}
{VARIABLE ai_unit[$id].side {SIDE2}}
[unstore_unit]
variable=last_spawn
variable=ai_unit[$id]
find_vacant=no
[/unstore_unit]
{NEXT id}
{CLEAR_VARIABLE ai_unit}
{CLEAR_VARIABLE type}
{CLEAR_VARIABLE name}
{CLEAR_VARIABLE hitpoints}
{CLEAR_VARIABLE facing}
{CLEAR_VARIABLE gender}
{CLEAR_VARIABLE experience}
{CLEAR_VARIABLE poisoned}
{CLEAR_VARIABLE hidden}
{CLEAR_VARIABLE slowed}
{CLEAR_VARIABLE hp_add}
{CLEAR_VARIABLE max_hp}
[/then]
[/if]
#enddef