Skip to content

ConsumeEffect ​

Inherits: CompositeEffect < Effect < DatabaseResource < Resource

ConsumeEffect consumes another effect and applies child effects based on consumed stacks.

Properties ​

inteffect_id
boolonly_consume_effects_owned_by_usertrue
boolconsume_all_stackstrue
intstacks_to_consume1

Methods ​

voidprocess_before_start( effect_instance: EffectInstance )
voidspecific_effect_logic( effect_instance: EffectInstance )
intconsume_target_effect( effect_instance: EffectInstance )
boolcan_consume_effect( target_entity: Entity, originator: Entity )
intget_consumable_stack_count( target_entity: Entity, originator: Entity )
Stringget_effect_description()
Stringget_editor_description()
boolis_one_off_application()

Property descriptions ​

int effect_id ​

The effect that is consumed.

bool only_consume_effects_owned_by_user = true ​

True when only the effects the user put on the target can be consumed.

bool consume_all_stacks = true ​

True consumes every stack, false only the number below.

int stacks_to_consume = 1 ​

How many stacks are consumed (when not all of them).

Method descriptions ​

void process_before_start( effect_instance: EffectInstance ) ​

Check if consumption is possible and disable VFX/SFX if not

void specific_effect_logic( effect_instance: EffectInstance ) ​

Override to implement consume logic

int consume_target_effect( effect_instance: EffectInstance ) ​

Find and consume the target effect, returning the number of stacks consumed

bool can_consume_effect( target_entity: Entity, originator: Entity ) ​

Does the target have the effect to consume?

int get_consumable_stack_count( target_entity: Entity, originator: Entity ) ​

How many stacks of the effect can be consumed.

String get_effect_description() ​

The text of the effect for tooltips, with its values filled in.

String get_editor_description() ​

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

bool is_one_off_application() ​

What this effect does it does once, when it is applied: a loaded save does not do it again