Skip to main content

OnFullAffectTargetStatDefinition

A class in Root.Township, Alta.StatSystem.

Stat definition asset: when this stat fills up it changes another stat on the same manager, and it drains back down over time. The work is done by a FullEmptyUpdateModifier.

Constructors​

MemberWhat it is
OnFullAffectTargetStatDefinition()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

7 private and internal fields
MemberWhat it is
private StatDefinition affectedStatDefinitionThe stat that gets changed while this one is full.
private float builddownCooldownSeconds after this stat last rose before it starts draining.
private bool isContinuousApply the change every update while full instead of once.
private bool isMultiplierMultiply the affected stat's base instead of adding to it.
private bool isRevertingOnEndFor one-off changes, undo the change when this stat empties.
private float modifierValueThe amount or factor applied to the affected stat.
private float tickBuilddownHow much this stat drains per update once the cooldown has passed.

Methods​

MemberWhat it is
override void Applied(StatManager manager, Stat stat)Creates and starts a FullEmptyUpdateModifier linking this stat to the affected stat, if the manager has it.