ASDelivery
Inherits:
NodeReactive effect delivery node for projectiles and payloads.
Description
[ASDelivery] is a specialized node designed to carry and deliver [ASPackage]s to [ASComponent] targets.
Unlike [ASComponent], which acts as a full ability system hub for an actor, [ASDelivery] is a lightweight utility that can be attached to any node (like a projectile’s Area2D) to inject effects upon impact.
Properties
| Type | Name | Default |
|---|---|---|
bool | auto_connect | false |
If true, attempts to connect automatically to [Area2D] or [Area3D] signals in the parent node. | ||
bool | is_active | false |
Current activation state. | ||
float | level | 1.0 |
The magnitude or strength level of the delivery. This gets injected into all effects spawned by the delivery. | ||
float | life_span | 0.0 |
Maximum duration the delivery stays active (0 = infinite). | ||
bool | one_shot | false |
If true, the delivery deactivates automatically after the first successful delivery. | ||
ASPackage | package | |
The [ASPackage] payload containing effects and cues. | ||
ASComponent | source_component | |
The [ASComponent] that initiated this delivery (e.g., the original attacker). | ||
StringName[] | target_groups | [] |
List of groups that targets must belong to for delivery to occur. | ||
Methods
| Return | Name |
|---|---|
void | activate(
duration: float = -1.0) |
Activates the delivery. If [param duration] is positive, it overrides [member life_span]. | |
bool | can_deliver_to(
target: Node)
const |
Checks if the delivery can reach the specified target (checks groups and validity). | |
void | deactivate( ) |
Deactivates the delivery. | |
void | deliver(
target: Node) |
Delivers the payload of an [ASPackage] to the target component. Automatically dispatches ASEventTags defined in the package upon successful delivery. | |
bool | is_delivery_valid(
)
const |
Returns true if the delivery is active and hasn’t expired. | |
Signals
- delivered(
target:
Object)Emitted when a package is successfully delivered to a target.
- expired(
)
Emitted when the life_span timer reaches zero.