ASEffectSpec
Inherits:
RefCountedRuntime instance of an effect.
Description
[ASEffectSpec] represents an active effect. It stores the remaining duration and calculated magnitudes.
Properties
| Type | Name | Default |
|---|---|---|
Variant | hit_position | null |
Impact position (Vector2 or Vector3) usually associated with a collision query. | ||
Object | target_node | |
The target Object/Node that the effect is applied to or interacting with. | ||
Methods
| Return | Name |
|---|---|
float | get_duration_remaining(
)
const |
Returns time left before effect ends. | |
ASEffect | get_effect(
)
const |
Returns the effect resource definition. | |
float | get_level(
)
const |
Returns the power level of the effect instance. | |
float | get_magnitude(
name: StringName)
const |
Returns the calculated modifier value for an attribute. | |
float | get_period_timer(
)
const |
Returns the time remaining until the next periodic tick. | |
float | get_source_attribute_value(
attribute: StringName)
const |
Returns the value of an attribute on the source component. | |
ASComponent | get_source_component(
)
const |
Returns the ASC that applied this effect. | |
int | get_stack_count(
)
const |
Returns the current number of stacks for this effect. | |
float | get_target_attribute_value(
attribute: StringName)
const |
Returns the value of an attribute on the target component. | |
ASComponent | get_target_component(
)
const |
Returns the destination component where the effect is applied. | |
float | get_total_duration(
)
const |
Returns the initial calculated duration. | |
void | init(
effect: ASEffect, level: float = 1.0) |
Initializes the effect specification with a definition and level. | |
void | set_duration_remaining(
value: float) |
Sets the remaining time for the effect. | |
void | set_level(
level: float) |
Sets the power level of this instance. | |
void | set_magnitude(
name: StringName, value: float) |
Manually sets the calculated magnitude for an attribute. | |
void | set_period_timer(
timer: float) |
Sets the internal timer for the next periodic tick. | |
void | set_stack_count(
count: int) |
Sets the number of stacks. | |
void | set_total_duration(
value: float) |
Sets the total duration. | |