Stats
class in OpalScript
Attack, defense, and speed values with temporary modifiers.
Properties
| Member | Description |
|---|---|
| Stats.Attack | Base attack power used to calculate combat damage. |
| Stats.Defense | Base defense subtracted from incoming damage. |
| Stats.Speed | Base speed; higher acts earlier in Turn Queue order. |
Methods
| Member | Description |
|---|---|
| Stats.Get | Read a stat's base value plus its modifiers. |
| Stats.SetBase | Change a stat's base value and return the committed result. |
| Stats.AddModifier | Add a persistent modifier to a stat and return the committed result. |
| Stats.ApplyModifierAsync | Own an additive modifier until its gameplay duration ends. Cancellation removes only this modifier. |
| Stats.HoldModifier | Own an additive modifier until the returned task is canceled or its owner retires. |
| Stats.ClearModifiers | Remove stat modifiers. |
Events
| Member | Description |
|---|---|
| Stats.changed | Raised after this component commits a state change, with the typed result. |
| Stats.changeRefused | Raised when a requested state change is refused, with the typed result and reason. |