Table of Contents

Class DefensePenetrationFnSO

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

Base type for defense penetration functions. Implementations compute a reduced defense value based on a piercing stat and the pierced defense stat.

public abstract class DefensePenetrationFnSO : ReductionFnSO, ITaggable
Inheritance
object
DefensePenetrationFnSO
Implements
ITaggable
Derived
Inherited Members

Methods

CalculatePiercedDefense(long, long, StatSO, in ReductionContext, bool)

Same as CalculatePiercedDefense(long, long, StatSO, bool), for functions that also depend on the entities involved (a constant that grows with the attacker's level, another stat of the attacker). The damage pipeline always calls this overload.

public virtual double CalculatePiercedDefense(long piercingStatValue, long defensiveStatValue, StatSO defensiveStat, in ReductionContext context, bool applyClamp = true)

Parameters

piercingStatValue long

The attacker's piercing stat value used to reduce defense.

defensiveStatValue long

The defender's original defense stat value to be reduced.

defensiveStat StatSO

The defensive stat object used to clamp the result within its min/max bounds.

context ReductionContext

The entities involved in the hit: their levels and stats. Valid only during the call.

applyClamp bool

Whether to apply stat clamping to the result.

Returns

double

The reduced defense value (clamped if applyClamp is true).

Remarks

The default implementation ignores context and forwards to the abstract overload, so existing implementations keep working unchanged. Override it to use the context.

CalculatePiercedDefense(long, long, StatSO, bool)

Compute the reduced defense value after applying a piercing stat.

public abstract double CalculatePiercedDefense(long piercingStatValue, long defensiveStatValue, StatSO defensiveStat, bool applyClamp = true)

Parameters

piercingStatValue long

The attacker's piercing stat value used to reduce defense.

defensiveStatValue long

The defender's original defense stat value to be reduced.

defensiveStat StatSO

The defensive stat object used to clamp the result within its min/max bounds.

applyClamp bool

Whether to apply stat clamping to the result. Default true for normal gameplay; false for analysis/graphs.

Returns

double

The reduced defense value (clamped if applyClamp is true).