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 ​
float | percentage_of_damage | 50.0 |
int | maximum_damage_per_redirect | 0 |
int | total_damage_to_redirect | 0 |
bool | redirect_tick_damage | false |
float | damage_reduction_on_target | 0.0 |
int | redirect_damage_type | 0 |
bool | can_redirect_be_avoided | true |
Methods ​
void | specific_effect_logic( effect_instance: EffectInstance ) |
Dictionary | process_damage_redirection( damage_amount: float, damage_type: int, damage_source: Entity, original_effect: EffectInstance, effect_instance: EffectInstance ) |
void | on_apply_finished( effect_instance: EffectInstance ) |
int | get_damage_redirected( effect_instance: EffectInstance ) |
int | get_remaining_redirect_capacity( effect_instance: EffectInstance ) |
float | get_redirection_preview( base_damage: float ) |
bool | is_redirection_active( effect_instance: EffectInstance ) |
Entity | get_guardian( effect_instance: EffectInstance ) |
Entity | get_protected_target( effect_instance: EffectInstance ) |
bool | is_entity_protected( entity: Entity, effect_instance: EffectInstance ) |
String | get_effect_description() |
Dictionary | get_relationship_info( effect_instance: EffectInstance ) |
String | get_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.