Constructor
new StatusEffectManager(configopt)
| Name | Type | Attributes | Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
config | Object | <optional> | Properties
|
Classes
Methods
applyEffect(effectConfig) → {Object}
Apply or stack a status effect.
| Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
effectConfig | Object | Properties
|
The active effect record
- Type:
- Object
cleanse(tagOrCategory) → {number}
Remove all effects matching a tag or category.
| Name | Type | Description |
|---|---|---|
tagOrCategory | string | E.g. 'poison', 'debuff', 'buff' |
Count of removed effects
- Type:
- number
clearAll()
Clear all active status effects unconditionally.
getEffect(name) → {Object|null}
Get effect record by name.
| Name | Type | Description |
|---|---|---|
name | string |
- Type:
- Object |
null
getModifiedStat(stat, baseValueopt) → {number}
Calculate compound stat multiplier across all active status effects. For intensity_stack effects, multiplier applies per stack: 1 + (mod - 1) * stacks.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
stat | string | Name of stat | ||
baseValue | number | <optional> | 1 |
- Type:
- number
hasEffect(name) → {boolean}
Check if a status effect is active by name.
| Name | Type | Description |
|---|---|---|
name | string |
- Type:
- boolean
onStatusEvent(listener) → {function}
Listen for status events: applied, refreshed, ticked, expired, cleansed.
| Name | Type | Description |
|---|---|---|
listener | function |
Unsubscribe
- Type:
- function
setPaused(paused)
Set paused state. When paused, effect durations and tick intervals do not advance.
| Name | Type | Description |
|---|---|---|
paused | boolean |
update(deltaTime, optionsopt)
Advance elapsed time for active effects. When paused, timers do not decrement and no periodic ticks fire.
| Name | Type | Attributes | Description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
deltaTime | number | ||||||||||||
options | Object | <optional> | Properties
|