A class in Root.Township, Alta.Intelligence.
Prefab scoring component that adds a StatValue rule on a stat of the creature or the target. The shipped "Aggroing Stat" rules are this.
Constructors
| Member | What it is |
|---|
StatOperation() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
6 private and internal fields
| Member | What it is |
|---|
private float from | Stat value that maps to 0. |
private bool isRatio | Use the stat's position between its minimum and maximum (0 to 1) instead of its raw value. |
private bool isTargetStat | Read the target's stat instead of the creature's. |
private float multiplier | Weight of the rule. Only matters for preferred rules. |
private StatDefinition statDefinition | The stat read. |
private float to | Stat value that maps to 1 (default 1). |
Methods
| Member | What it is |
|---|
override TargetOperation GetOperation() | Makes the StatValue rule, weighted by multiplier. Logs an error and returns null if no stat is set. |
protected override string GetName() | Builds the GameObject name from the stat's name and range. |