Class DefensePenetrationFnSO
- 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
-
objectDefensePenetrationFnSO
- 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
piercingStatValuelongThe attacker's piercing stat value used to reduce defense.
defensiveStatValuelongThe defender's original defense stat value to be reduced.
defensiveStatStatSOThe defensive stat object used to clamp the result within its min/max bounds.
contextReductionContextThe entities involved in the hit: their levels and stats. Valid only during the call.
applyClampboolWhether 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
piercingStatValuelongThe attacker's piercing stat value used to reduce defense.
defensiveStatValuelongThe defender's original defense stat value to be reduced.
defensiveStatStatSOThe defensive stat object used to clamp the result within its min/max bounds.
applyClampboolWhether 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).