Skip to content

CompositeEffect ​

Inherits: Effect < DatabaseResource < Resource

Inherited by: BaseProjectileEffect, ChainEffect, CollisionEffect, ConditionalEffect, ConsumeEffect, DelayedEffect, HitscanEffect, MoveDirectionalEffect, MoveToPointEffect, ProcEffect

CompositeEffect applies multiple child effects when triggered. The effects handle their own registration with EffectsComponent via EffectInstance.start_effect()

Description ​

Key features:

  • Applies multiple child effects to targets
  • Supports both standard targeting and custom targeting (for AreaEffect, etc.)
  • Child effects handle their own stacking rules and registration
  • Clean separation of concerns - CompositeEffect just creates and starts effects

Properties ​

boolremove_child_effects_on_finishfalse
Array[int]child_effects[]

Methods ​

voidspecific_effect_logic( effect_instance: EffectInstance )
voidapply_child_effects( effect_instance: EffectInstance )
voidapply_child_effects_to_target( effect_instance: EffectInstance, target: Variant )
voidapply_effect_list_to_target( effect_instance: EffectInstance, effect_ids: Array[int], target: Variant )
voidapply_child_effect( parent_instance: EffectInstance, child_effect: Effect, target: Variant )
voidon_apply_finished( effect_instance: EffectInstance )
voidcleanup_child_effects( effect_instance: EffectInstance )
Array[EffectInstance]get_active_child_instances( effect_instance: EffectInstance )
intget_active_child_count( effect_instance: EffectInstance )
Array[int]get_direct_child_effect_ids()
Stringget_effect_description()
Stringget_editor_description()

Property descriptions ​

bool remove_child_effects_on_finish = false ​

Whether to remove child effects when this effect ends

Array[int] child_effects = [] ​

Array of child effects to apply

Method descriptions ​

void specific_effect_logic( effect_instance: EffectInstance ) ​

Apply all child effects using the simplified system

void apply_child_effects( effect_instance: EffectInstance ) ​

Apply child effects to the standard target (can be overridden by specialized effects)

void apply_child_effects_to_target( effect_instance: EffectInstance, target: Variant ) ​

Apply child effects to a specific target (used by AreaEffect and other specialized effects)

void apply_effect_list_to_target( effect_instance: EffectInstance, effect_ids: Array[int], target: Variant ) ​

Apply a list of effects (ids) to a specific target, each as its own running effect

void apply_child_effect( parent_instance: EffectInstance, child_effect: Effect, target: Variant ) ​

Apply a single child effect to a specific target

void on_apply_finished( effect_instance: EffectInstance ) ​

Handle effect completion

void cleanup_child_effects( effect_instance: EffectInstance ) ​

Clean up all child effects

Array[EffectInstance] get_active_child_instances( effect_instance: EffectInstance ) ​

Get all currently active child effect instances

int get_active_child_count( effect_instance: EffectInstance ) ​

Get count of active child effects

Array[int] get_direct_child_effect_ids() ​

The effects this composite applies itself (see Effect.get_child_effect_definitions for the flattened list the placeholders of the Description count)

String get_effect_description() ​

Get effect description for tooltips

String get_editor_description() ​

A short text for the effect editor that says what the effect does.