Skip to content

Stats ​

class in OpalScript

Attack, defense, and speed values with temporary modifiers.

Properties ​

MemberDescription
Stats.AttackBase attack power used to calculate combat damage.
Stats.DefenseBase defense subtracted from incoming damage.
Stats.SpeedBase speed; higher acts earlier in Turn Queue order.

Methods ​

MemberDescription
Stats.GetRead a stat's base value plus its modifiers.
Stats.SetBaseChange a stat's base value and return the committed result.
Stats.AddModifierAdd a persistent modifier to a stat and return the committed result.
Stats.ApplyModifierAsyncOwn an additive modifier until its gameplay duration ends. Cancellation removes only this modifier.
Stats.HoldModifierOwn an additive modifier until the returned task is canceled or its owner retires.
Stats.ClearModifiersRemove stat modifiers.

Events ​

MemberDescription
Stats.changedRaised after this component commits a state change, with the typed result.
Stats.changeRefusedRaised when a requested state change is refused, with the typed result and reason.

See also ​