Class PercentageDefensePenetrationFnSO
- Assembly
- com.electricdrill.astra-health.Runtime.dll
Reduces defense by subtracting a percentage of the pierced defense equal to the piercing stat percentage. Example: piercingStatValue = 20 -> reduces defense by 20%. Create isntances via Assets -> Create -> Astra Health / Def Mitigation Functions / Log Def Mitigation.
public class PercentageDefensePenetrationFnSO : DefensePenetrationFnSO, ITaggable
- Inheritance
-
objectPercentageDefensePenetrationFnSO
- Implements
-
ITaggable
- Inherited Members
Methods
CalculatePiercedDefense(long, long, StatSO, bool)
Apply percentage-based penetration to the pierced defense and optionally clamp the result to the stat's bounds.
public override double CalculatePiercedDefense(long piercingStatValue, long defensiveStatValue, StatSO defensiveStat, bool applyClamp = true)
Parameters
piercingStatValuelongPercentage to reduce (e.g. 25 means 25%).
defensiveStatValuelongOriginal defense stat.
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).