Table of Contents

Class DamageStep

Namespace
ElectricDrill.AstraHealth.Damage.CalculationPipeline
Assembly
com.electricdrill.astra-health.Runtime.dll

Base class for a single step in the damage calculation pipeline. A DamageStep performs a focused transformation on a DamageInfo instance (for example applying defenses, barriers or modifiers).

[Serializable]
public abstract class DamageStep
Inheritance
object
DamageStep
Derived

Properties

DisplayName

Human-readable name shown in editors and logs for this step. Implementations should return a short descriptive label.

public abstract string DisplayName { get; }

Property Value

string

Methods

Process(DamageInfo)

Entry point executed by the pipeline runner. This method enforces common preconditions (skipping when already prevented or when the current amount is <= 0), invokes ProcessStep(DamageInfo), records the before/after amounts for tracing and sets the PipelineReducedToZero reason when a step reduces a positive amount to zero or less.

public DamageInfo Process(DamageInfo data)

Parameters

data DamageInfo

The pipeline state being processed.

Returns

DamageInfo

The same data instance, potentially modified by the step.

ProcessStep(DamageInfo)

Implement this method in derived classes to perform the actual transformation of the pipeline state.

public abstract DamageInfo ProcessStep(DamageInfo data)

Parameters

data DamageInfo

Pipeline state to process. Implementations should mutate this instance to reflect changes.

Returns

DamageInfo

The modified data instance.

Remarks

Accessing external services from a step: Use pre-resolved properties on data for core framework dependencies (data.TargetStats, data.TargetBarrier, data.PerformerStats). For services provided by external packages, use data.Target.TryGetComponent<IYourInterface>(out var svc) — the same pattern used by ApplyDamageCapStep and ApplyDamageFloorStep. This keeps DamageInfo lean while allowing full extensibility.