Skip to content

DamageRedirectionEffect ​

Inherits: Effect < DatabaseResource < Resource

DamageRedirectionEffect redirects damage from the target to the originator. This creates "guardian" or "tank" mechanics where one entity takes damage for another.

Properties ​

floatpercentage_of_damage50.0
intmaximum_damage_per_redirect0
inttotal_damage_to_redirect0
boolredirect_tick_damagefalse
floatdamage_reduction_on_target0.0
intredirect_damage_type0
boolcan_redirect_be_avoidedtrue

Methods ​

voidspecific_effect_logic( effect_instance: EffectInstance )
Dictionaryprocess_damage_redirection( damage_amount: float, damage_type: int, damage_source: Entity, original_effect: EffectInstance, effect_instance: EffectInstance )
voidon_apply_finished( effect_instance: EffectInstance )
intget_damage_redirected( effect_instance: EffectInstance )
intget_remaining_redirect_capacity( effect_instance: EffectInstance )
floatget_redirection_preview( base_damage: float )
boolis_redirection_active( effect_instance: EffectInstance )
Entityget_guardian( effect_instance: EffectInstance )
Entityget_protected_target( effect_instance: EffectInstance )
boolis_entity_protected( entity: Entity, effect_instance: EffectInstance )
Stringget_effect_description()
Dictionaryget_relationship_info( effect_instance: EffectInstance )
Stringget_editor_description()

Property descriptions ​

float percentage_of_damage = 50.0 ​

Percentage of damage to redirect

int maximum_damage_per_redirect = 0 ​

Max damage per redirect (0 = unlimited)

int total_damage_to_redirect = 0 ​

Total damage cap before effect ends (0 = unlimited)

bool redirect_tick_damage = false ​

Whether to redirect DoT/tick damage

float damage_reduction_on_target = 0.0 ​

Additional damage reduction for original target (0-100)

int redirect_damage_type = 0 ​

Override damage type for redirected damage (empty = use original)

bool can_redirect_be_avoided = true ​

Whether redirected damage can be avoided by guardian

Method descriptions ​

void specific_effect_logic( effect_instance: EffectInstance ) ​

Applies the specific logic for this effect, setting up damage redirection

Dictionary process_damage_redirection( damage_amount: float, damage_type: int, damage_source: Entity, original_effect: EffectInstance, effect_instance: EffectInstance ) ​

Process damage redirection for a specific incoming damage event This is called by StatsComponent during damage processing, BEFORE pipeline calculations

void on_apply_finished( effect_instance: EffectInstance ) ​

Handles the finishing of the effect

int get_damage_redirected( effect_instance: EffectInstance ) ​

Gets the current amount of damage redirected for a specific effect instance

int get_remaining_redirect_capacity( effect_instance: EffectInstance ) ​

Gets the remaining damage that can be redirected for a specific effect instance

float get_redirection_preview( base_damage: float ) ​

Calculate potential redirection amount for preview/tooltip purposes

bool is_redirection_active( effect_instance: EffectInstance ) ​

Check if redirection effect is still active and has capacity

Entity get_guardian( effect_instance: EffectInstance ) ​

Get guardian entity for this redirection effect

Entity get_protected_target( effect_instance: EffectInstance ) ​

Get protected entity for this redirection effect

bool is_entity_protected( entity: Entity, effect_instance: EffectInstance ) ​

Check if an entity is protected by this redirection effect

String get_effect_description() ​

Generates effect description for tooltips

Dictionary get_relationship_info( effect_instance: EffectInstance ) ​

Get relationship info for UI display

String get_editor_description() ​

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