AbilityCooldown
class in OpalScript
Gate an ability behind a cooldown. Tick counts down and emits ready when it hits zero.
Properties
| Member | Description |
|---|---|
| AbilityCooldown.Duration | Seconds the ability stays on cooldown after use. |
| AbilityCooldown.Remaining | Live countdown until the ability is ready again. |
Methods
| Member | Description |
|---|---|
| AbilityCooldown.TryUse | Attempt to start the cooldown and return the committed result. Read Applied to see whether it succeeded. |
| AbilityCooldown.UseAsync | Start a cooldown and await that use's completion. |
| AbilityCooldown.WaitUntilReady | Wait until the current cooldown is ready without consuming a use. |
| AbilityCooldown.ForceReady | Clear the remaining cooldown. |
| AbilityCooldown.SetDuration | Set cooldown duration in seconds. |
| AbilityCooldown.CanUse | Whether a use can start now. |
| AbilityCooldown.IsCoolingDown | Whether time remains on the cooldown. |
Events
| Member | Description |
|---|---|
| AbilityCooldown.consumed | Raised after a cooldown use starts, with its committed AbilityUse result. |
| AbilityCooldown.useRefused | Raised when a cooldown use is refused, with its AbilityUse result. |