StatModifier
A class in Root.Township, Alta.StatSystem.
A modifier that adds to or multiplies one stat while it's applied. Buff and non-buff modifiers change separate parts of the stat.
- Listed in Stats, effects, heat and liquid
- Inherits or implements
Modifier - Documented in Stats
Constructors
| Member | What it is |
|---|---|
StatModifier(StatDefinition statDefinition, float value, bool isMultiplier = false, bool isBuff = true) | Creates a StatModifier from stat, value, isMultiplier and isBuff. |
StatModifier(Stat stat, float value, bool isMultiplier = false, bool isBuff = true) | Creates a StatModifier from stat, value, isMultiplier and isBuff. |
Fields
1 private and internal field
Properties
| Member | What it is |
|---|---|
bool IsMultiplier { get; private set; } | Whether the value multiplies the stat instead of adding to it. |
Stat Stat { get; private set; } | The stat being changed. |
StatDefinition StatDefinition { get; private set; } | Which stat this modifier is for. |
float Value { get; private set; } | The amount added, or the multiplier. |
Methods
| Member | What it is |
|---|---|
override bool Initialize(StatManager manager) | Finds the stat in the manager if it wasn't given one. False if the stat doesn't exist. |
void UpdateValue(float value) | Changes the value while applied. It always changes the buff parts, even for a non-buff modifier. |
protected override void InternalApply() | Adds the value to the stat's extra, or multiplies its multiplier, buff or non-buff. |
protected override void InternalRemove() | Undoes InternalApply. |
Used in
Members of other types that take, return or hold a StatModifier: