Skip to content

ModifierStep ​

Inherits: RefCounted

One calculation modifier that changed the number during a phase of a hit (armor took 5 off, block took 30 %, a damage-done bonus added 12). A DamageResult keeps the steps in the order they ran, which is what the combat log, tooltips and tests read to explain a final number.

Variables ​

intstat_id0
Stringstat_name""
floatbefore0.0
floatafter0.0
Stringrequired_tag""
floateffect_value0.0

Methods ​

ModifierStepcreate( p_stat_id: int, p_stat_name: String, p_before: float, p_after: float, p_required_tag: String = "", p_effect_value: float = 0.0 ) static
floatdelta()
floatremoved()
floatadded()

Variable descriptions ​

int stat_id = 0 ​

The stat whose modifier changed the number.

String stat_name = "" ​

The name of that stat.

float before = 0.0 ​

The number before the modifier.

float after = 0.0 ​

The number after the modifier.

String required_tag = "" ​

The trigger tag the modifier required to run ("" when it needed none)

float effect_value = 0.0 ​

The value the modifier calculated from the stat points (flat amount or percentage, depending on its type)

Method descriptions ​

ModifierStep create( p_stat_id: int, p_stat_name: String, p_before: float, p_after: float, p_required_tag: String = "", p_effect_value: float = 0.0 ) ​

Makes a step: the stat, the number before and after, and what the modifier needed.

float delta() ​

Signed change (negative = the step reduced the number)

float removed() ​

How much the step took off (0 when it added)

float added() ​

How much the step added (0 when it reduced)