Table of Contents

Class PercentageDamageMitigationFnSO

Namespace
ElectricDrill.AstraHealth.DamageMitigationFunctions
Assembly
com.electricdrill.astra-health.Runtime.dll
public class PercentageDamageMitigationFnSO : DamageMitigationFnSO, ITaggable
Inheritance
object
PercentageDamageMitigationFnSO
Implements
ITaggable
Inherited Members

Methods

CalculateMitigatedDamage(long, double, RoundingMode)

Reduces damage by a percentage determined by defensiveStatValue. Example: defensiveStatValue == 25 -> damage reduced by 25%.

public override long CalculateMitigatedDamage(long amount, double defensiveStatValue, RoundingMode roundingMode)

Parameters

amount long

Incoming damage amount.

defensiveStatValue double

Percentage (0..100+). Treated as a percent reduction of the incoming damage.

roundingMode RoundingMode

Rounding mode applied to the final fractional damage value.

Returns

long

The reduced damage as a non-negative long.

Remarks

The computation is: reducedAmount = amount - amount * defensiveStatValue / 100.0 The result is clamped to a minimum of 0 and rounded to the nearest integer.