Class HyperbolicDefensePenetrationFnSO
- Assembly
- com.electricdrill.astra-health.Runtime.dll
Pierces P / (P + K) of the target's defense, where P is the piercing stat and K
the piercing that removes half of it. The penetration counterpart of
HyperbolicDamageMitigationFnSO.
public class HyperbolicDefensePenetrationFnSO : DefensePenetrationFnSO, ITaggable
- Inheritance
-
objectHyperbolicDefensePenetrationFnSO
- Implements
-
ITaggable
- Inherited Members
Remarks
K is BaseValue + PerLevel × level, like on the mitigation function, with its own values.
Create instances via Assets -> Create -> Astra Health / Def Penetration Functions / Hyperbolic Def Penetration.
Methods
CalculatePiercedDefense(long, long, StatSO, in ReductionContext, bool)
Reduces defense with Defense × K / (P + K).
public override double CalculatePiercedDefense(long piercingStatValue, long defensiveStatValue, StatSO defensiveStat, in ReductionContext context, bool applyClamp = true)
Parameters
piercingStatValuelongThe attacker's piercing stat value
P.defensiveStatValuelongThe defender's original defense stat value.
defensiveStatStatSOThe defensive stat used to clamp the result. No clamp is applied when it is null.
contextReductionContextLevels used to evaluate
K.applyClampboolWhether to clamp the result to the stat's bounds.
Returns
- double
The reduced defense value.
Remarks
If piercingStatValue is zero or negative the defense is returned unchanged.
CalculatePiercedDefense(long, long, StatSO, bool)
Reduces defense with Defense × K / (P + K), evaluating K at level 1 because no
entity is known. The gameplay path uses the overload with a ReductionContext.
public override double CalculatePiercedDefense(long piercingStatValue, long defensiveStatValue, StatSO defensiveStat, bool applyClamp = true)
Parameters
piercingStatValuelongdefensiveStatValuelongdefensiveStatStatSOapplyClampbool
Returns
- double