Skip to content

ASEffect

PT | EN
Inherits: Resource

Resource 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

TypeNameDefault
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.
floatduration_magnitude0.0
Base duration value.
intduration_policy0
INSTANT (0), DURATION (1), INFINITE (2).
Stringeffect_name""
Unique name for the effect.
StringNameeffect_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.
boolexecute_periodic_tick_on_applicationfalse
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.
intmodifiers0
The number of attribute modifiers in this effect package.
floatperiod0.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.
intrequirements0
The number of attribute requirements needed to apply this effect.
intstacking_policy0
Policy determining how new applications stack with existing instances of the same effect tag.
inttarget_type0
Defines whether the effect applies to the owner (Self) or should be passed to other targets (Others).
booluse_custom_durationfalse
If true, duration is calculated via ASC callback (index -1).

Methods

ReturnName
voidadd_modifier( attribute: StringName, operation: int, magnitude: float, use_custom_magnitude: bool = false)
Adds an attribute modifier.
voidadd_requirement( attribute: StringName, amount: float)
Adds an attribute requirement.
StringNameget_modifier_attribute( index: int) const
Returns the name of the attribute targeted by a modifier at a given index.
intget_modifier_count( ) const
Returns the number of modifiers defined in this effect.
floatget_modifier_magnitude( index: int) const
Returns the base magnitude of a specific modifier by its index.
intget_modifier_operation( index: int) const
Returns the mathematical operation of a specific modifier.
floatget_requirement_amount( index: int) const
Returns the amount for the specified requirement.
StringNameget_requirement_attribute( index: int) const
Returns the attribute for the specified requirement.
boolis_modifier_custom( index: int) const
Returns true if the specified modifier uses custom calculation logic.

Constants

NameValue
POLICY_INSTANT0
Effect is applied once and removed immediately.
POLICY_DURATION1
Effect lasts for a specified duration.
POLICY_INFINITE2
Effect lasts indefinitely until removed.
STACK_NEW_INSTANCE0
Each application is independent.
STACK_OVERRIDE1
New application replaces the old (resets timer).
STACK_INTENSITY2
Increases magnitude (adds to stack count).
STACK_DURATION3
Extends the remaining duration.
TARGET_SELF0
Effect is applied to the component that originated it.
TARGET_OTHERS1
Effect is intended to be applied to other components (e.g., via projectiles or area attacks).
OP_ADD0
Adds the magnitude to the attribute.
OP_MULTIPLY1
Multiplies the attribute by the magnitude.
OP_DIVIDE2
Divides the attribute by the magnitude.
OP_OVERRIDE3
Overrides the attribute with the magnitude.