ChainMovement ​
Inherits: ProjectileMovement < RefCounted
Chain movement strategy - bounces between multiple targets Updated to support both Entity and InteractableObject targets
Variables ​
int | max_chains | 3 |
int | current_chain_count | 0 |
float | chain_range | 5.0 |
Variant | current_target | |
Array[Variant] | previous_targets | [] |
bool | allow_repeat_targets | false |
ChainEffect.ChainTargetType | chain_target_filter | ChainEffect.ChainTargetType.ENAMY |
float | arrival_threshold | 1.0 |
bool | chain_finished | false |
Methods ​
void | set_max_chains( max_count: int ) |
void | set_chain_range( range: float ) |
void | set_chain_target_filter( filter: ChainEffect.ChainTargetType ) |
void | set_allow_repeat_targets( allow: bool ) |
void | set_arrival_threshold( threshold: float ) |
int | get_current_chain_count() |
Variant | get_current_chain_target() |
Array[Variant] | get_previous_targets() |
bool | is_chain_finished() |
int | get_remaining_chains() |
float | get_distance_to_target() |
Vector3 | get_target_position() |
bool | wants_to_continue() |
void | cleanup() |
Variable descriptions ​
int max_chains = 3 ​
Maximum number of chain bounces
int current_chain_count = 0 ​
Current chain count
float chain_range = 5.0 ​
Range to find next chain target
Variant current_target ​
Current target in the chain
Array[Variant] previous_targets = [] ​
Previous targets hit (to avoid infinite loops)
bool allow_repeat_targets = false ​
Whether to allow hitting the same target multiple times
ChainEffect.ChainTargetType chain_target_filter = ChainEffect.ChainTargetType.ENAMY ​
Team filter for chain targets
float arrival_threshold = 1.0 ​
Distance threshold to consider target reached
bool chain_finished = false ​
Whether chain movement is finished
Method descriptions ​
void set_max_chains( max_count: int ) ​
Set maximum number of chains
void set_chain_range( range: float ) ​
Set chain range
void set_chain_target_filter( filter: ChainEffect.ChainTargetType ) ​
Set target filter ("Enemy", "Ally", "All")
void set_allow_repeat_targets( allow: bool ) ​
Set whether to allow repeat targets
void set_arrival_threshold( threshold: float ) ​
Set arrival threshold
int get_current_chain_count() ​
Get current chain count
Variant get_current_chain_target() ​
Get current target in chain
Array[Variant] get_previous_targets() ​
Get previous targets hit
bool is_chain_finished() ​
Check if chain is finished
int get_remaining_chains() ​
Get remaining chains
float get_distance_to_target() ​
Override distance calculation to use current chain target
Vector3 get_target_position() ​
Override target position to use current chain target
bool wants_to_continue() ​
Check if chain movement wants to continue
void cleanup() ​
Override cleanup to reset chain state