Table of Contents

Class DamageMitigationFnSO

Namespace
ElectricDrill.AstraHealth.DamageMitigationFunctions
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
object
DamageMitigationFnSO
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

amount long

The original incoming damage amount to be reduced.

defensiveStatValue double

The value of the defensive statistic used to reduce damage (semantics depend on the implementation: absolute value, percentage, etc.).

roundingMode RoundingMode

Rounding 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 roundingMode to fractional results.