Class LogDefensePenetrationFnSO
- Assembly
- com.electricdrill.astra-health.Runtime.dll
Applies a logarithmic divisive reduction to defense to provide diminishing returns as piercing increases. Create instances via Assets -> Create -> Astra Health / Def Penetration Functions / Log Def Penetration (Legacy).
public class LogDefensePenetrationFnSO : DefensePenetrationFnSO, ITaggable
- Inheritance
-
objectLogDefensePenetrationFnSO
- Implements
-
ITaggable
- Inherited Members
Remarks
Legacy: kept so existing assets keep working; prefer HyperbolicDefensePenetrationFnSO for new
work. For small piercing values it behaves like the hyperbolic function with K = BaseValue / ScaleFactor;
at high values it grows far more slowly.
Methods
CalculatePiercedDefense(long, long, StatSO, bool)
Reduces defense using a logarithmic divisive formula that provides diminishing returns. Formula: Reduced Defense = Defense * (BaseValue / (BaseValue + Log(1 + PiercingStat * ScaleFactor)))
public override double CalculatePiercedDefense(long piercingStatValue, long defensiveStatValue, StatSO defensiveStat, bool applyClamp = true)
Parameters
piercingStatValuelongThe attacker's piercing stat value.
defensiveStatValuelongThe defender's original defense stat value.
defensiveStatStatSOThe defensive stat object used to clamp the result.
applyClampboolWhether to apply stat clamping to the result.
Returns
- double
The reduced defense value (clamped to stat's min/max bounds if applyClamp is true)