Class PreHealContext
- Namespace
- ElectricDrill.AstraHealth.Heal
- Assembly
- com.electricdrill.astra-health.Runtime.dll
Mutable pre-heal context raised via the pre-heal game event before the heal pipeline runs. Listeners may mutate Amount, HealSource, IsCritical, CriticalMultiplier and Ignore to transform the incoming heal — e.g. amplify a heal via a buff, reroute it through a different HealSourceSO, or negate it entirely by setting Ignore (temporary heal immunity). The pipeline reads these fields after the event is dispatched.
public sealed class PreHealContext : IHasEntity, IHasTarget, IHasPerformer, IHasAmount, IHasInstigator, IReactable
- Inheritance
-
objectPreHealContext
- Implements
-
IHasEntityIHasTargetIHasPerformerIHasInstigator
Properties
Amount
The requested heal amount (base value before modifiers). Listeners may mutate this.
public long Amount { get; set; }
Property Value
- long
Builder
Fluent builder entry point for creating a PreHealContext. Use the returned builder to set amount, source, and target. The healer entity (WithPerformer(EntityCore)) is optional.
public static PreHealContext.HealInfoAmount Builder { get; }
Property Value
CriticalMultiplier
Multiplier applied when this is a critical heal. A value of 1.0 means no change. Values <= 0 are normalized to 1.0 by the constructor. Listeners may mutate this.
public double CriticalMultiplier { get; set; }
Property Value
- double
Entity
The entity receiving the healing. Same as Target in this case.
public EntityCore Entity { get; }
Property Value
- EntityCore
HealSource
The HealSource identifying the origin/type of the healing. Listeners may mutate this.
public HealSourceSO HealSource { get; set; }
Property Value
Ignore
If true, the heal will be ignored and not applied to the target. Use this to model heal-immunity buffs or listener-driven cancellation. Listeners may mutate this.
public bool Ignore { get; set; }
Property Value
- bool
Instigator
The specific thing that caused this heal — for example an ability definition, a modifier
instance, or a passive. Use pattern matching to identify the concrete type.
May be null if no specific instigator is relevant beyond Performer and
HealSource.
public IEffectInstigator Instigator { get; }
Property Value
- IEffectInstigator
IsCritical
Whether this heal is flagged as a critical heal. Listeners may mutate this.
public bool IsCritical { get; set; }
Property Value
- bool
IsReactable
When true, reactive systems may respond to this heal event.
When false, reactive systems should skip execution to prevent chain reactions.
Defaults to true. Set to false when building contexts for secondary effects
such as a passive that heals in response to another heal or damage event.
public bool IsReactable { get; }
Property Value
- bool
Performer
The entity that performed the heal (may be null for system-initiated or non-entity sources).
public EntityCore Performer { get; }
Property Value
- EntityCore
Target
The target entity receiving the healing.
public EntityCore Target { get; }
Property Value
- EntityCore