Class DamageMitigationFnSO
- Assembly
- com.electricdrill.astra-health.Runtime.dll
Base type for damage mitigation functions. Implementations compute how an incoming damage amount is reduced using a defensive statistic value.
public abstract class DamageMitigationFnSO : ReductionFnSO, ITaggable
- Inheritance
-
objectDamageMitigationFnSO
- Implements
-
ITaggable
- Derived
- Inherited Members
Methods
CalculateMitigatedDamage(long, double, RoundingMode)
Reduces the specified amount of damage using the provided defensive
statistic value and returns the resulting damage amount rounded with roundingMode.
public abstract long CalculateMitigatedDamage(long amount, double defensiveStatValue, RoundingMode roundingMode)
Parameters
amountlongThe original incoming damage amount to be reduced.
defensiveStatValuedoubleThe value of the defensive statistic used to reduce damage (semantics depend on the implementation: absolute value, percentage, etc.).
roundingModeRoundingModeRounding mode applied to fractional results.
Returns
- long
The reduced damage amount as a non-negative long. Implementations should ensure the returned value is >= 0 and apply
roundingModeto fractional results.