ASEffect
Inherits:
ResourceResource defining modifications to attributes and tags.
Description
[ASEffect] defines a package of attribute modifiers and tags. Can be instant, have a duration, or be infinite.
Properties
| Type | Name | Default |
|---|---|---|
StringName[] | activation_blocked_all_tags | [] |
Effect cannot be applied if the target has all of these tags simultaneously (AND logic). | ||
StringName[] | activation_blocked_any_tags | [] |
Effect cannot be applied if the target has any of these tags (OR logic). | ||
StringName[] | activation_required_all_tags | [] |
Effect requires the target to have all of these tags to be applied (AND logic). | ||
StringName[] | activation_required_any_tags | [] |
Effect requires the target to have at least one of these tags to be applied (OR logic). | ||
StringName[] | blocked_tags | [] |
Tags that dictate whether this effect is blocked from applying. | ||
ASCue[] | cues | [] |
Visual and Audio Cues emitted by this effect. | ||
float | duration_magnitude | 0.0 |
Base duration value. | ||
int | duration_policy | 0 |
INSTANT (0), DURATION (1), INFINITE (2). | ||
String | effect_name | "" |
Unique name for the effect. | ||
StringName | effect_tag | &"" |
Tag identifying this effect. | ||
StringName[] | events_on_apply | [] |
Events dispatched when this effect is successfully applied to a target. | ||
StringName[] | events_on_remove | [] |
Events dispatched when this effect is removed from a target. | ||
bool | execute_periodic_tick_on_application | false |
If true, the periodic effect triggers immediately upon application instead of waiting for the first period to elapse. | ||
StringName[] | granted_tags | [] |
Tags granted while effect is active. | ||
int | modifiers | 0 |
The number of attribute modifiers in this effect package. | ||
float | period | 0.0 |
The time in seconds between periodic applications. Only used if duration_policy is DURATION or INFINITE. | ||
StringName[] | removed_tags | [] |
Tags corresponding to effects that should be removed when this effect applies. | ||
int | requirements | 0 |
The number of attribute requirements needed to apply this effect. | ||
int | stacking_policy | 0 |
Policy determining how new applications stack with existing instances of the same effect tag. | ||
int | target_type | 0 |
Defines whether the effect applies to the owner (Self) or should be passed to other targets (Others). | ||
bool | use_custom_duration | false |
If true, duration is calculated via ASC callback (index -1). | ||
Methods
| Return | Name |
|---|---|
void | add_modifier(
attribute: StringName, operation: int, magnitude: float, use_custom_magnitude: bool = false) |
Adds an attribute modifier. | |
void | add_requirement(
attribute: StringName, amount: float) |
Adds an attribute requirement. | |
StringName | get_modifier_attribute(
index: int)
const |
Returns the name of the attribute targeted by a modifier at a given index. | |
int | get_modifier_count(
)
const |
Returns the number of modifiers defined in this effect. | |
float | get_modifier_magnitude(
index: int)
const |
Returns the base magnitude of a specific modifier by its index. | |
int | get_modifier_operation(
index: int)
const |
Returns the mathematical operation of a specific modifier. | |
float | get_requirement_amount(
index: int)
const |
Returns the amount for the specified requirement. | |
StringName | get_requirement_attribute(
index: int)
const |
Returns the attribute for the specified requirement. | |
bool | is_modifier_custom(
index: int)
const |
Returns true if the specified modifier uses custom calculation logic. | |
Constants
| Name | Value |
|---|---|
| POLICY_INSTANT | 0 |
Effect is applied once and removed immediately. | |
| POLICY_DURATION | 1 |
Effect lasts for a specified duration. | |
| POLICY_INFINITE | 2 |
Effect lasts indefinitely until removed. | |
| STACK_NEW_INSTANCE | 0 |
Each application is independent. | |
| STACK_OVERRIDE | 1 |
New application replaces the old (resets timer). | |
| STACK_INTENSITY | 2 |
Increases magnitude (adds to stack count). | |
| STACK_DURATION | 3 |
Extends the remaining duration. | |
| TARGET_SELF | 0 |
Effect is applied to the component that originated it. | |
| TARGET_OTHERS | 1 |
Effect is intended to be applied to other components (e.g., via projectiles or area attacks). | |
| OP_ADD | 0 |
Adds the magnitude to the attribute. | |
| OP_MULTIPLY | 1 |
Multiplies the attribute by the magnitude. | |
| OP_DIVIDE | 2 |
Divides the attribute by the magnitude. | |
| OP_OVERRIDE | 3 |
Overrides the attribute with the magnitude. | |