Skip to content

AbilityReflectEffect ​

Inherits: Effect < DatabaseResource < Resource

A reflective ward: abilities that other entities target at the holder can be sent back at their caster.

Description ​

It is an interception, not a reaction: when an ability is about to apply its effects to the holder, AbilityInstance.apply_ability_effects asks the holder's active reflect effects (try_reflect); a reflected ability applies all its effects to its own caster instead. Only abilities aimed at the holder as a target are reflected (enemy, ally and any-entity targeting): area and point abilities, abilities the holder casts itself and abilities from allies (when Only Hostile is on) pass through. See docs/systems/effects-and-abilities.md, section 10.

Properties ​

floatreflect_chance100.0
intcharges1
Array[int]ability_schools[]
boolonly_hostiletrue

Methods ​

voidspecific_effect_logic( effect_instance: EffectInstance )
booltry_reflect( effect_instance: EffectInstance, ability: AbilityInstance )
Stringget_effect_description()
Stringget_editor_description()

Property descriptions ​

Reflect

float reflect_chance = 100.0 ​

Chance (percent) that a qualifying ability is reflected

int charges = 1 ​

How many abilities the ward reflects before it breaks (0 = until it ends)

Array[int] ability_schools = [] ​

Only abilities of these schools are reflected (none ticked = all schools)

bool only_hostile = true ​

Reflect only abilities cast by hostile entities (a friendly heal is not sent back)

Method descriptions ​

void specific_effect_logic( effect_instance: EffectInstance ) ​

What the effect does to its target when it is applied.

bool try_reflect( effect_instance: EffectInstance, ability: AbilityInstance ) ​

Does this ward reflect this ability? Rolls the chance and uses a charge (the ward ends with the last one)

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.