Modify Hp

Signature

modifyHp(casterAddress, targetAddress, amount, knockbackState, hitAnimationState, koAnimationType)

Description

Adds or removes hp from a character.

If target is a foe and their new hp is equal to or lower than their hp low limit, their death related properties (death count, death time, ...) are also updated.

Arguments

Caster Address

The battle unit keep address of the caster.

Target Address

The battle unit keep address of the target.

Amount

The amount of hp added or removed.

If positive, hp is added. If negative, hp is removed.

Knockback State

Show normal animation (0) or knockback animation (1) when target is hit or KO'd.

Only used if amount is 0 or lower.

Hit Animation State

Targets reacts to being hit (1) or not (0).

Only used if amount is 0 or lower.

KO Animation Type

Show normal animation (0) or fade animation (1) when target is KO'd.

Only used if amount is 0 or lower.

Notes

The target's hp cannot be reduced below their hp low limit.

If target is affected by god mode, their hp cannot be reduced.

The current hp is gradually updated to the new one in the battle stats section of the UI.

Last updated