LifeAdd (SCTRL)

Started by JustNoPoint, October 29, 2015, 11:37:58 PM

Previous topic - Next topic

JustNoPoint

Adds the specified amount to the player's life, scaled by the player's defense multiplier if necessary.

Required parameters:
value = add_amt (int)
Specifies amount of life to add to the player's life bar.

Optional parameters:
kill = kill_flag (int)
If kill_flag is 0, then the addition will not take the player below 1 life point. Defaults to 1.

absolute = abs_flag (int)
If abs_flag is 1, then exactly add_amt is added to the player's life (the defense multiplier is ignored). Defaults to 0.

Example:
none

coldskin1

#1
I've used lifeadd in the passed but i always had problems with it.

here is the code i used

[State -2, lifeadd support]
type = LifeAdd
trigger1 = NumHelper(6000) = 1
value = floor(0.01*gethitvar(damage))

Spoiler (click to show)

lifeadd support is important

this code helps (def up)  to calculate instantly
without it the character can die before the code can calculate

however the lifeadd does not work when character is at max hp
so the (defup) won't calculate if the character one shotted at max hp :(





[State 0, Def up]
type = LifeAdd
triggerall = life > 1
triggerall = Var(5) = 1
trigger1 = 1
value= 0.80*fvar(7)

[State -2, Combo]
type = VarSet
trigger1 = 1
fvar(7) = (GetHitVar(damage))
ignorehitpause = 1