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.
- Listed in Stats, effects, heat and liquid
- Inherits or implements
Modifier
Constructors
| Member | What 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
| Member | What it is |
|---|---|
private Stat affectedStat | The stat that gets changed while the tracked stat is full. |
private float builddownCooldown | Seconds after the tracked stat last rose before it starts draining. |
private float cooldownTimer | Real time after which draining may start. |
private bool isContinuous | If true, the change is applied every update while full instead of once. |
private bool isMultiplier | If true, the affected stat's base is multiplied by the value instead of added to. |
private bool isRevertingOnEnd | For one-off changes, undo the change when the tracked stat empties. |
private float modifierValue | The amount added to, or the factor applied to, the affected stat's base. |
private float tickBuilddown | How much the tracked stat drains per update once the cooldown has passed. |
private Stat trackedStat | The stat being watched for full and empty. |
private bool wasFull | True between the tracked stat reaching full and reaching empty. |
Methods
| Member | What 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
| Member | What 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. |