Skip to main content

FullEmptyUpdateModifier

A internal class in Root.Township, Alta.StatSystem. Reach it through att-stubs' publicized assemblies or Harmony's AccessTools.

Internal modifier made by OnFullAffectTargetStatDefinition: when the tracked stat fills up it changes another stat, and it drains the tracked stat back down over time.

Constructors​

MemberWhat it is
FullEmptyUpdateModifier(Stat trackedStat, Stat affectedStat, float builddownCooldown, float tickBuilddown, float modifierValue, bool isMultiplier, bool isContinuous, bool isRevertingOnEnd)Creates a FullEmptyUpdateModifier from trackedStat, affectedStat, builddownCooldown, tickBuilddown, modifierValue, isMultiplier, isContinuous and isRevertingOnEnd.

Fields​

10 private and internal fields
MemberWhat it is
private Stat affectedStatThe stat that gets changed while the tracked stat is full.
private float builddownCooldownSeconds after the tracked stat last rose before it starts draining.
private float cooldownTimerReal time after which draining may start.
private bool isContinuousIf true, the change is applied every update while full instead of once.
private bool isMultiplierIf true, the affected stat's base is multiplied by the value instead of added to.
private bool isRevertingOnEndFor one-off changes, undo the change when the tracked stat empties.
private float modifierValueThe amount added to, or the factor applied to, the affected stat's base.
private float tickBuilddownHow much the tracked stat drains per update once the cooldown has passed.
private Stat trackedStatThe stat being watched for full and empty.
private bool wasFullTrue between the tracked stat reaching full and reaching empty.

Methods​

MemberWhat it is
override bool Initialize(StatManager manager)Hooks TickDown to the manager's update and initializes the modifier.
protected override void InternalApply()Marks the stat as full and, if not continuous, adds or multiplies the modifier into the affected stat once.
protected override void InternalRemove()Marks the stat as not full and, if not continuous and set to revert, undoes the one-off change.
2 private and internal methods
MemberWhat it is
private void CheckApply(Stat stat)Runs when the tracked stat changes. Restarts the drain cooldown on any rise, applies when the stat hits its maximum and removes when it hits its minimum.
private void TickDown(StatManager manager)Each manager update: applies the continuous change while full, and drains the tracked stat once the cooldown has passed.