Skip to content

DamageReflectEffect ​

Inherits: Effect < DatabaseResource < Resource

DamageReflectEffect reflects a portion of damage taken back to the attacker.

Properties ​

floatpercentage_of_damage50.0
intmaximum_damage_per_reflect0
inttotal_damage_to_reflect0
intreflect_damage_type0
boolcan_reflect_be_avoidedtrue
CombatOptions.BasisChoicereflect_basisCombatOptions.BasisChoice.PROJECT_DEFAULT
intmax_reflect_chain-1

Methods ​

voidspecific_effect_logic( effect_instance: EffectInstance )
voidon_apply_finished( effect_instance: EffectInstance )
floatget_damage_reflected( effect_instance: EffectInstance )
intget_remaining_reflect_capacity( effect_instance: EffectInstance )
floatget_reflection_preview( base_damage: float )
boolis_reflect_active( effect_instance: EffectInstance )
Stringget_effect_description()
Stringget_editor_description()

Property descriptions ​

float percentage_of_damage = 50.0 ​

The percent of damage to reflect back

int maximum_damage_per_reflect = 0 ​

The maximum amount of damage that can be reflected per hit (0 = no limit)

int total_damage_to_reflect = 0 ​

The total amount of damage that can be reflected from effect (0 = no limit)

int reflect_damage_type = 0 ​

Damage type for reflected damage (empty = use original type)

bool can_reflect_be_avoided = true ​

Whether reflected damage can be avoided by the attacker

CombatOptions.BasisChoice reflect_basis = CombatOptions.BasisChoice.PROJECT_DEFAULT ​

Which number of the hit the reflection is taken from. HEALTH_ONLY reflects only what reached health (not what shields absorbed); AFTER_TAKEN also counts the shield-absorbed part. Project default: GameplayConfig, Damage Results

int max_reflect_chain = -1 ​

How many reactions deep a hit may be and still be reflected. 1: a normal hit is reflected, a reflection is never reflected again. Higher values let reflections ping-pong between two damage reflection users that many times. -1 = the project default (GameplayConfig, Damage Results)

Method descriptions ​

void specific_effect_logic( effect_instance: EffectInstance ) ​

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

void on_apply_finished( effect_instance: EffectInstance ) ​

Handles the finishing of the effect, cleaning up tracking data

float get_damage_reflected( effect_instance: EffectInstance ) ​

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

int get_remaining_reflect_capacity( effect_instance: EffectInstance ) ​

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

float get_reflection_preview( base_damage: float ) ​

Calculate potential reflection amount for preview/tooltip purposes

bool is_reflect_active( effect_instance: EffectInstance ) ​

Check if damage reflection effect is still active and has capacity

String get_effect_description() ​

Generates effect description for tooltips

String get_editor_description() ​

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