Skip to content

Effect ​

Inherits: DatabaseResource < Resource

Inherited by: AbilityBoostEffect, AbilityCastModifierEffect, AbilityCooldownEffect, AbilityEffect, AbilityEffectsModifierEffect, AbilityMorphEffect, AbilityRangeEffect, AbilityRankEffect, AbilityReflectEffect, AbilityResourceEffect, AbsorbWithPoolEffect, AccessEntityInventoryEffect, ActionBarSlotEffect, AddHealthPoolEffect, AddResourcePoolEffect, BasicAttackSwapEffect, CameraShakeEffect, CharmEffect, ClearEffect, CompositeEffect, CreateItemEffect, DamageRedirectionEffect, DamageReflectEffect, EffectUnlockInteractable, EnchantEquipmentEffect, EqualizeHealthEffect, FlightEffect, GrantRewardEffect, GravityEffect, GroundMarkEffect, HealAbsorbEffect, HealReflectEffect, HijackableEffect, ImmunityEffect, InterruptEffect, LandEffect, ModifyHealthPoolEffect, ModifyResourcePoolEffect, MountEffect, PetCommandAbilityEffect, ProficiencyEffect, RepeatAbilityEffect, ResurrectEffect, RevealEffect, ScalingEffect, SchoolLockEffect, ScreenLookEffect, SetAbilityActiveEffect, SetStatActiveStateEffect, StatusEffect, StealthEffect, SummonInteractableEffect, SummonPetEffect, TauntEffect, ThreatEffect, WaterBreathingEffect

Effect is a base class for all effects in the game. It provides a framework for creating, managing, and applying various effects to entities or targets within the game world.

Description ​

The class handles effect initialization, application, stacking, and removal. It supports various features such as:

  • Aura application and management
  • Visual and audio feedback (VFX and SFX)
  • Time-based strategies for effect duration and timing
  • Stack count management

Child classes of Effect implement a wide variety of specific effects. These child classes should override the _specific_effect_logic() method to implement their unique behavior. This allows for a flexible and extensible effect system that can handle diverse game mechanics.

The Effect class also manages its lifecycle, including initialization, application, refreshing/stacking, and cleanup of resources when the effect ends or is removed.

Properties ​

inteffect_school0
AppliedToapplies_toAppliedTo.TARGET
TimeStrategytime_strategyTimeStrategy.ImmediateTimeStrategy
floatduration0.0
floattick_rate0.0
StackingRulestacking_ruleStackingRule.NO_LIMITS
boolrefreshfalse
boolreapply_on_stackfalse
intstack_amount1
intmax_stacks1
WhenFullstack_when_fullWhenFull.ALLOW
OnExpirestack_on_expireOnExpire.LOSE_ALL_STACKS
boolapplies_aurafalse
AuraTypeaura_classification
Array[int]groups[]
Array[Requirement]requirements[]
intmax_uses0
UseCountuses_countUseCount.ANY_ABILITY
intuses_filter_id0
SFXSelectionsfx_on_appliednull
VFXSelectionvfx_on_appliednull
Array[VFXSelection]extra_vfx[]
VFXSelectionvfx_on_critnull

Methods ​

voidprocess_before_start( _effect_instance: EffectInstance )
voidspecific_effect_logic( _effect_instance: EffectInstance )
voidrestore_after_load( effect_instance: EffectInstance )
boolis_one_off_application()
voidon_stack_reapply( _effect_instance: EffectInstance, _old_stack_count: int, _new_stack_count: int )
voidon_apply_finished( effect_instance: EffectInstance )
voidapply_effect_vfx( instance: EffectInstance, crit: bool = false )
voidcleanup_effect_vfx( instance: EffectInstance )
Stringget_duration_description()
Stringget_effect_description()
Array[Effect]get_child_effect_definitions( path: Array[int] = [] )
Array[int]get_direct_child_effect_ids()
Array[int]find_reference_loop( path: Array[int] = [] )
Stringget_tooltip_text()
Stringget_editor_description()
boolhas_vfx()
Array[VFXSelection]applied_vfx_selections( crit: bool = false )
Dictionarycheck_requirements( entity: Variant, context: Dictionary = {} )
Array[GroupDefinition]get_group_definitions()
floatget_charge_multiplier( effect_instance: EffectInstance, scales_with_charge: bool, minimum: float )
boolcounts_as_use( ability: AbilityInstance, abilities: AbilityComponent )

Enumerations ​

enum AppliedTo ​

The options of applied to: target, self.

  • TARGET = 0
  • SELF = 1

enum TimeStrategy ​

The options of time strategy: immediate time strategy, persistent time strategy, persistent ticking time strategy, temporary time strategy, temporary ticking time strategy.

  • ImmediateTimeStrategy = 0
  • PersistentTimeStrategy = 1
  • PersistentTickingTimeStrategy = 2
  • TemporaryTimeStrategy = 3
  • TemporaryTickingTimeStrategy = 4

enum AuraType ​

The options of aura type: buff, debuff.

  • BUFF = 0
  • DEBUFF = 1

enum UseCount ​

The options of use count: any ability, basic attack, abilities in group, abilities of school, specific ability.

  • ANY_ABILITY = 0 - every ability the entity uses
  • BASIC_ATTACK = 1 - its basic attack
  • ABILITIES_IN_GROUP = 2 - abilities that are in a group (uses_filter_id)
  • ABILITIES_OF_SCHOOL = 3 - abilities of a school (uses_filter_id)
  • SPECIFIC_ABILITY = 4 - one ability (uses_filter_id)

enum WhenFull ​

What an application does when the effect is already at its maximum stacks: allow (the refresh and reapply options still run) or refuse (nothing happens, not even a refresh).

  • ALLOW = 0
  • REFUSE = 1

enum OnExpire ​

What happens when the duration of a stacked effect runs out: all the stacks go, or only one goes and the duration starts again.

  • LOSE_ALL_STACKS = 0
  • LOSE_ONE_STACK = 1

enum StackingRule ​

The options of stacking rule: no limits, per originator, global.

  • NO_LIMITS = 0
  • PER_ORIGINATOR = 1
  • GLOBAL = 2

Property descriptions ​

int effect_school = 0 ​

The type of effect for Aura's, each is a different school for dispels/purges. None cannot be removed

AppliedTo applies_to = AppliedTo.TARGET ​

Wether the effect should apply to the target or the user

TimeStrategy time_strategy = TimeStrategy.ImmediateTimeStrategy ​

The time strategy that controls how this effect behaves over time

float duration = 0.0 ​

Time the effect lasts

float tick_rate = 0.0 ​

Timer for when effect are applied on tick

Stack Settings

StackingRule stacking_rule = StackingRule.NO_LIMITS ​

The stacking logic

bool refresh = false ​

Effect duration resets on new stack gain

bool reapply_on_stack = false ​

Re-execute effect logic when stacks are added. Use for instant damage/healing/projectiles. Stat modifiers need custom on_stack_reapply() logic.

int stack_amount = 1 ​

Stacks applied per application

int max_stacks = 1 ​

Maximum stacks allowed (respects stacking_rule)

WhenFull stack_when_full = WhenFull.ALLOW ​

What an application does when the effect is at its maximum stacks. Refuse: it does nothing at all (no refresh of the duration, no reapply), and the application is reported as refused

OnExpire stack_on_expire = OnExpire.LOSE_ALL_STACKS ​

What happens when the duration runs out. Lose one stack: the stacks wear off one at a time, and the duration starts again for the rest

Aura Settings

bool applies_aura = false ​

Show this effect on the interface as a buff or debuff (buff and debuff bars, nameplates, unit frames). Also what a ClearEffect that removes buffs or debuffs looks at

AuraType aura_classification ​

Whether it is shown as a buff or a debuff

Groups & Requirements

Array[int] groups = [] ​

Groups this effect is in (Seal, Well Fed, Battle Elixir ...). A group can limit how many of its effects are active at once: see GroupDefinition

Array[Requirement] requirements = [] ​

What the entity the effect applies to must meet when the effect is applied (a level range, a class, a weapon ...). An effect that fails is rejected

int max_uses = 0 ​

The effect ends after this many uses of abilities by the entity it is on (0 = not limited): "your next spell is instant", "your next attack deals extra damage"

UseCount uses_count = UseCount.ANY_ABILITY ​

Which uses count towards max_uses

int uses_filter_id = 0 ​

The group, school or ability the uses are counted for (see uses_count)

SFX & VFX

SFXSelection sfx_on_applied = null ​

SFX on effect application

VFXSelection vfx_on_applied = null ​

Can be any VFX type including beam, path, telegraph, etc.

Array[VFXSelection] extra_vfx = [] ​

More VFX played with it (2026-11-14, the user: an enchant's particles AND a material on the weapon; barkskin's skin and its leaves). Each can be any kind; a material comes off when the effect ends.

VFXSelection vfx_on_crit = null ​

Played in place of the main VFX when the hit or heal of this effect is a critical strike (2026-11-14: crit hits, vfx_<theme>hit<size>_crit_NN). With it set, the effect's VFX play just after its hit is worked out, so it is known whether it crit. Empty: the main VFX on a crit too.

Method descriptions ​

void process_before_start( _effect_instance: EffectInstance ) ​

Performs final processing before starting the effect (should be overridden in child classes)

void specific_effect_logic( _effect_instance: EffectInstance ) ​

Applies the specific logic for this effect (should be overridden in child classes)

void restore_after_load( effect_instance: EffectInstance ) ​

What a loaded effect does instead of specific_effect_logic when it starts again after a load. The default applies the effect again in full (right for everything that is a lasting state: a stat modifier, a status, a ward, a lock). Effects that did something once when they were first applied (a hit, a heal, a launch, a summon) return true from is_one_off_application and do nothing: only what lasts (their ticks, their duration) comes back

bool is_one_off_application() ​

True for effects whose application happens once and must not be repeated when a save is loaded

void on_stack_reapply( _effect_instance: EffectInstance, _old_stack_count: int, _new_stack_count: int ) ​

Virtual method for custom stack reapply logic Called when an existing effect gains additional stacks and reapply_on_stack is true (override in child classes if needed)

void on_apply_finished( effect_instance: EffectInstance ) ​

Handles the finishing of the effect, including cleanup and VFX/SFX (override in child classes if needed, call .super for cleanup)

void apply_effect_vfx( instance: EffectInstance, crit: bool = false ) ​

Apply VFX Plays the VFX of the effect (crit: its hit was a critical strike: the crit VFX in place of the main one)

void cleanup_effect_vfx( instance: EffectInstance ) ​

Stop any VFX spawned by this effect (and take its materials off)

String get_duration_description() ​

Helper method to get duration description from TimeStrategy

String get_effect_description() ​

Get the effect description (to be overridden by child classes)

Array[Effect] get_child_effect_definitions( path: Array[int] = [] ) ​

The effects inside this one, flattened depth first (its children, then theirs): what the placeholders of its Description count. A plain effect has none

Array[int] get_direct_child_effect_ids() ​

The ids of the effects this effect applies itself (its children, the else effects of a conditional). A plain effect has none

Array[int] find_reference_loop( path: Array[int] = [] ) ​

The ids of an endless loop of effects that apply each other (A applies B applies A), starting and ending with the same id. Empty when there is none. A loop is cut at run time by the depth limit (GameplayConfig.max_effect_depth), but it will not do what was meant

String get_tooltip_text() ​

The text of the aura tooltip. The Description written for the effect when there is one (its <Effect1> placeholders count the child effects), otherwise the text the effect type writes itself. Ability tooltips keep using the type's text unless the ability says <EffectText1>: see EffectTextUtil

String get_editor_description() ​

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

bool has_vfx() ​

Check if effect has VFX configured

Array[VFXSelection] applied_vfx_selections( crit: bool = false ) ​

Every VFX the effect plays when it is applied: the main one (on a critical strike the crit one, when it has one), then the extra ones

Dictionary check_requirements( entity: Variant, context: Dictionary = {} ) ​

Does the entity the effect applies to meet every requirement of this effect? (failed_message is the reason of the first one it fails)

Array[GroupDefinition] get_group_definitions() ​

The groups of this effect that exist in the database

float get_charge_multiplier( effect_instance: EffectInstance, scales_with_charge: bool, minimum: float ) ​

The factor a drawn shot's charge puts on a value: 1 for a fully drawn shot (or an effect that does not scale), minimum for one released at once

bool counts_as_use( ability: AbilityInstance, abilities: AbilityComponent ) ​

Does this use of an ability count towards max_uses?