Namespace ElectricDrill.AstraHealth.Damage
Classes
- DamageAmountContext
Holds numeric details related to an attempt to apply damage, allowing intermediate values to be recorded for each phase of the calculation pipeline (e.g. reductions, resistances, absorptions).
- DamagePreventionReasonExtensions
Extension helpers for DamagePreventionReason.
- DamageResolutionContext
The immutable result returned by damage application attempts. Encapsulates whether the damage was applied or prevented, the reasons for prevention, and the concrete damage information that was ultimately applied (if any).
- DamageSourceSO
Defines a damage source asset that identifies how damage was produced (for example: a spell, trap, environmental hazard, system event, etc.). Create instances via Assets -> Create -> Astra Health / Damage Source.
- DamageTypeSO
Scriptable asset that describes a damage category (for example: Physical, Fire, Poison). A DamageType declares which stat reduces this damage, which mitigation/penetration functions to use, whether a stat pierces its defensive stats and whether it ignores barriers. Create instances via Assets -> Create -> Astra Health / DamageType.
- PreDamageContext
Mutable pre-damage context raised via the pre-damage game event before the damage pipeline runs. Listeners may mutate Amount, Type, IsCritical, CriticalMultiplier and Ignore to transform the incoming damage — e.g. convert magical damage above a threshold into physical, apply a flat reduction, or negate it entirely by setting Ignore. The pipeline reads these fields after the event is dispatched. Use Builder to construct instances via the fluent step builder.
- PreDamageContext.PreDamageInfoStepBuilder
Concrete step builder implementing the fluent interfaces. After all required fields are set, optional fields (dealer, critical, multiplier, instigator, ignore) can be configured before calling Build().
- PreDamageContextConfig
Serializable configuration that fully describes a damage application and can build a PreDamageContext at runtime. Designed to be embedded in ScriptableObjects or MonoBehaviours.
Structs
- DamageAmountContext.StepAmountRecord
Immutable record representing the damage value before and after a single pipeline phase (identified by the phase type).
Interfaces
- IDamageable
Implemented by entities that can receive damage. The TakeDamage(PreDamageContext) method accepts a PreDamageContext record describing a pending damage attempt and returns a DamageResolutionContext describing whether the damage was applied or prevented and additional details.
- IHasAmount
Represents a context that carries an associated numeric amount. The value is nullable to represent cases where no amount was resolved — for damage contexts,
nullmeans the damage was prevented or not applied.
- PreDamageContext.DamageInfoAmount
Fluent builder step: specify the damage amount.
- PreDamageContext.DamageInfoSource
Fluent builder step: specify the damage source category.
- PreDamageContext.DamageInfoTarget
Fluent builder step: specify the target entity.
- PreDamageContext.DamageInfoType
Fluent builder step: specify the damage type.
Enums
- ContextDealerRole
Selects the entity that will act as the damage dealer, including the option of no dealer (system damage).
- ContextEntityRole
Selects one of the two entities involved in a damage context.
- DamageAmountMode
Determines how the damage amount is calculated.
- DamageOutcome
The overall result of attempting to apply damage to a target. Use this in DamageResolutionContext to indicate whether any damage was applied or if the attempt was prevented.
- DamagePreventionReason
Flags that explain why a damage attempt was prevented. Multiple reasons may be combined. These flags are used in Reasons when an attempt is prevented.