state
Definitions & Systems
3 Properties
1 Methods
state
The state class represents an active status effect instance (buff or debuff) currently attached to an entity.
Overview
Properties (3)
| Property | Type | Summary |
|---|---|---|
definition
|
string
|
State definition ID string. |
duration
|
number
|
Duration of the state in seconds. |
value
|
number
|
Magnitude or intensity value of the status effect. |
Methods (1)
| Method Signature | Returns | Summary |
|---|---|---|
state.new(definition, value, duration)
|
state
|
Creates a new state instance. |
Detailed Reference
state.definition
State definition ID string.
Parameters
None
Returns
stringState definition ID string.
Description
Returns the definition ID of the state (e.g. "poison").
state.duration
Duration of the state in seconds.
Parameters
None
Returns
numberRemaining or total duration in seconds.
Description
Duration of the status effect.
state.value
Magnitude or intensity value of the status effect.
Parameters
None
Returns
numberIntensity value.
Description
Returns the strength or intensity of the active state.
state.new(definition, value, duration)
Creates a new state instance.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
definition | statedef | State definition descriptor. | |
value | number | Intensity value. | |
duration | number | Duration in seconds. |
Returns
stateNewly constructed state instance.
Description
Constructs an unattached state instance.