A class in Root.Township, Alta.StatSystem.
A stat modifier whose value follows a curve over a number of ticks, scaled by a base value. The owner calls Update each tick.
Constructors
| Member | What it is |
|---|
IndirectModifier(float baseValue, uint duration, Curve valueOverDuration, uint tick) | Creates an IndirectModifier from baseValue, duration and valueOverDuration. |
IndirectModifier(float baseValue, uint duration, Curve valueOverDuration) | Creates an IndirectModifier from baseValue, duration and valueOverDuration. |
Fields
| Member | What it is |
|---|
Action<IndirectModifier> Changed | Called when the value moves by more than 0.1. Must be set, or Update throws. |
Action<IndirectModifier> Finished | Called on each Update once the duration has passed. Must be set. |
4 private and internal fields
| Member | What it is |
|---|
private float baseValue | Value the curve is multiplied by. |
private uint duration | Length in ticks; Finished fires on the tick that reaches it. |
private uint tick | Ticks run so far, one per Update. Saved, so the modifier can resume. |
private Curve valueOverDuration | Curve from progress (0 to 1) to a factor of baseValue. Changed only fires when the value moves by more than 0.1. |
Properties
| Member | What it is |
|---|
float LastValue { get; private set; } | The value before the latest change. Inside Changed it still holds the old value. |
float Value { get; private set; } | Current value of the modifier. |
Methods
| Member | What it is |
|---|
IndirectModifierSaveData Save() | Returns the curve, base value, duration and current tick for saving. |
void Update() | Advances one tick and updates the value, or calls Finished once the duration is reached. |
Used in
Members of other types that take, return or hold a IndirectModifier: