ConditionalEffect ​
Inherits: CompositeEffect < Effect < DatabaseResource < Resource
Inherited by: ConditionConditionalEffect, DistanceConditionalEffect, EffectConditionalEffect, HealthConditionalEffect, RandomChanceConditionalEffect
Base class for all conditional effects. Subclasses implement _evaluate_condition() and call _check_and_apply_condition() from their specific_effect_logic().
Description ​
The condition is checked once, when the effect is applied. When it is met the child effects are applied; when it is not met the else effects are applied instead (if there are any).
Properties ​
Array[int] | else_effects | [] |
Methods ​
void | specific_effect_logic( effect_instance: EffectInstance ) |
void | apply_else_effects( effect_instance: EffectInstance ) |
Array[int] | get_direct_child_effect_ids() |
String | get_effect_description() |
bool | is_one_off_application() |
Property descriptions ​
Array[int] else_effects = [] ​
Effects applied when the condition is NOT met ("if undead apply A, else apply B"). Empty = nothing happens.
Method descriptions ​
void specific_effect_logic( effect_instance: EffectInstance ) ​
What the effect does to its target when it is applied.
void apply_else_effects( effect_instance: EffectInstance ) ​
Apply the else effects to the standard target
Array[int] get_direct_child_effect_ids() ​
The child effects, then the else effects (the flattened list the placeholders of the Description count comes from this)
String get_effect_description() ​
What the effect does, for the tooltip: the condition, then the child effects, then the else effects
bool is_one_off_application() ​
What this effect does it does once, when it is applied: a loaded save does not do it again