Skip to main content

StatValue

A class in Root.Township, Alta.Intelligence.

Scoring rule on a stat of the creature or the target, mapped onto 0 to 1. Made by CreateTargetOperation.Stat.

Constructors​

MemberWhat it is
StatValue(StatDefinition statDefinition, float from, float to, bool isTargetStat, bool isRatio)Creates a StatValue from statDefinition, from, to, isTargetStat and isRatio.

Fields​

5 private and internal fields
MemberWhat it is
private float fromValue that maps to 0.
private bool isRatioUse the stat's position between its minimum and maximum.
private bool isTargetStatRead the target's stat instead of the creature's.
private StatDefinition statDefinitionThe stat read.
private float toValue that maps to 1.

Methods​

MemberWhat it is
override float Evaluate(Agent agent, ITarget target)Returns the stat's value (or ratio) inverse-lerped from from to to. Returns 1 if the stat or stat manager is missing.