Skip to main content

StatOperation

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​

MemberWhat it is
StatOperation()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

6 private and internal fields
MemberWhat it is
private float fromStat value that maps to 0.
private bool isRatioUse the stat's position between its minimum and maximum (0 to 1) instead of its raw value.
private bool isTargetStatRead the target's stat instead of the creature's.
private float multiplierWeight of the rule. Only matters for preferred rules.
private StatDefinition statDefinitionThe stat read.
private float toStat value that maps to 1 (default 1).

Methods​

MemberWhat 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.