Table of Contents

Class LogDamageMitigationFnSO

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

Methods

CalculateMitigatedDamage(long, double, RoundingMode)

Reduces damage using a logarithmic formula that produces diminishing returns as the defensive stat increases.

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

Parameters

amount long

Incoming damage amount.

defensiveStatValue double

Defensive statistic value used to compute the mitigation multiplier.

roundingMode RoundingMode

Rounding mode applied to the final fractional damage value.

Returns

long

The reduced damage as a non-negative long.

Remarks

Formula: Reduced Damage = Damage * (BaseValue / (BaseValue + Log(1 + DefensiveStat * ScaleFactor)))

If defensiveStatValue is zero or negative the original damage is returned. The final result is clamped to be non-negative and rounded to the nearest integer.