mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-02 00:50:42 +00:00
Applied hp adjustment for traits...
...and a fix for undead spawns getting copied names from other units.
This commit is contained in:
parent
f219f3b8bc
commit
10f6269dee
@ -169,6 +169,7 @@
|
||||
{VARIABLE name $ai_unit[$id].user_description}
|
||||
{VARIABLE type $ai_unit[$id].type}
|
||||
{VARIABLE hitpoints $ai_unit[$id].hitpoints}
|
||||
{VARIABLE max_hp $ai_unit[$i].max_hitpoints}
|
||||
{VARIABLE facing $ai_unit[$id].facing}
|
||||
{VARIABLE gender $ai_unit[$id].gender}
|
||||
{VARIABLE experience $ai_unit[$id].experience}
|
||||
@ -177,12 +178,20 @@
|
||||
{VARIABLE hides $ai_unit[$id].status.hides}
|
||||
{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
|
||||
hitpoints=$hitpoints
|
||||
experience=$experience
|
||||
facing=$facing
|
||||
gender=$gender
|
||||
@ -194,6 +203,22 @@
|
||||
poisoned=$poisoned
|
||||
[/status]
|
||||
[/unit]
|
||||
# set hp now to adjust for trait bonuses
|
||||
[store_unit]
|
||||
variable=last_spawn
|
||||
kill=no
|
||||
[filter]
|
||||
side={SIDE2}
|
||||
x,y = $x,$y
|
||||
[/filter]
|
||||
[/store_unit]
|
||||
{VARIABLE hp_add $last_spawn.max_hitpoints}
|
||||
{VARIABLE_OP hp_add add -$max_hp}
|
||||
{VARIABLE_OP $last_spawn.hitpoints add $hp_add}
|
||||
[unstore_unit]
|
||||
variable=last_spawn
|
||||
[/unstore_unit]
|
||||
|
||||
{NEXT id}
|
||||
{CLEAR_VARIABLE ai_unit}
|
||||
{CLEAR_VARIABLE type}
|
||||
@ -205,6 +230,8 @@
|
||||
{CLEAR_VARIABLE poisoned}
|
||||
{CLEAR_VARIABLE hides}
|
||||
{CLEAR_VARIABLE slowed}
|
||||
{CLEAR_VARIABLE hp_add}
|
||||
{CLEAR_VARIABLE max_hp}
|
||||
[/then]
|
||||
[/if]
|
||||
#enddef
|
||||
|
Loading…
x
Reference in New Issue
Block a user