Table of Contents

Class HealthRatioChangedContext

Namespace
ElectricDrill.AstraHealth.Events.Contexts
Assembly
com.electricdrill.astra-health.Runtime.dll

Fired whenever the HP/MaxHP ratio changes — either because HP changed (AddHealth/RemoveHealth) or because MaxHP changed (RecalculateMaxHp). Provides a single reliable signal for HP-ratio-based conditions. Implements ElectricDrill.AstraRpgFramework.Contexts.IHasValueChange<T> for int where Previous/NewValue are HP percentages (0–100).

public class HealthRatioChangedContext : IHasEntity, IHasTarget, IHasValueChange<int>
Inheritance
object
HealthRatioChangedContext
Implements
IHasEntity
IHasTarget
IHasValueChange<int>

Constructors

HealthRatioChangedContext(EntityCore, long, long, long, long)

public HealthRatioChangedContext(EntityCore target, long previousHp, long newHp, long previousMaxHp, long newMaxHp)

Parameters

target EntityCore
previousHp long
newHp long
previousMaxHp long
newMaxHp long

Properties

AbsAmount

The absolute amount of change between PreviousValue and NewValue.

public int AbsAmount { get; }

Property Value

int

Entity

The primary ElectricDrill.AstraRpgFramework.EntityCore associated with this object. For entity components this is the owning entity; for context payloads this is the primary affected subject (e.g. the event target).

public EntityCore Entity { get; }

Property Value

EntityCore

NewHp

public long NewHp { get; }

Property Value

long

NewMaxHp

public long NewMaxHp { get; }

Property Value

long

NewValue

public int NewValue { get; }

Property Value

int

PreviousHp

public long PreviousHp { get; }

Property Value

long

PreviousMaxHp

public long PreviousMaxHp { get; }

Property Value

long

PreviousValue

public int PreviousValue { get; }

Property Value

int

Target

public EntityCore Target { get; }

Property Value

EntityCore