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.
public class LogDefensePenetrationFnSO : DefensePenetrationFnSO, ITaggable
- Inheritance
-
objectLogDefensePenetrationFnSO
- Implements
-
ITaggable
- Inherited Members
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)