ReactiveDamageStatEffect ​
Inherits: StatEffect < Resource
Reactive damage effect - deals damage back to the attacker of a hit the owner received Examples: Damage reflection, Spiked Armor, Retaliation, Reflect Damage
Description ​
The stat points go through the formula slots (StatEffect). For FLAT the formula value is the damage; for PERCENT_OF_DAMAGE it is a percentage of the hit; HYBRID is the formula's flat damage plus a fixed percentage of the hit (percent_of_damage). The reflection goes through the real damage pipeline (CombatReactions.reflect) as the owner's own attack, so the owner's damage-done modifiers and critical strikes apply, and it is one reaction deeper than the hit it answers (see max_reflect_chain).
Properties ​
TriggerType | trigger_type | TriggerType.ON_DAMAGE_TAKEN |
String | required_trigger_tag | "" |
DamageScaling | damage_scaling | DamageScaling.HYBRID |
float | percent_of_damage | 10.0 |
CombatOptions.BasisChoice | basis | CombatOptions.BasisChoice.PROJECT_DEFAULT |
int | damage_type | 0 |
bool | can_be_avoided | false |
float | maximum_per_hit | 0.0 |
int | max_reflect_chain | -1 |
Methods ​
EffectType | get_effect_type() |
String | get_effect_category() |
bool | matches_hit( result: DamageResult ) |
float | calculate_damage_amount( stat_points: float, result: DamageResult, formula_context: FormulaContext = null ) |
int | get_chain_limit() |
String | get_trigger_description() |
String | get_scaling_description() |
String | get_short_description() |
String | get_detailed_description( stat_points: float ) |
Dictionary | get_preview_info( stat_points: float ) |
String | get_tooltip_text( stat_points: float ) |
Array[Dictionary] | validate() |
Enumerations ​
enum TriggerType ​
The options of trigger type: on damage taken, on block, on being hit.
- ON_DAMAGE_TAKEN =
0 - ON_BLOCK =
1
enum DamageScaling ​
The options of damage scaling: flat, percent of damage, hybrid.
- FLAT =
0 - PERCENT_OF_DAMAGE =
1
Property descriptions ​
Trigger Settings
TriggerType trigger_type = TriggerType.ON_DAMAGE_TAKEN ​
When the damage is dealt back: when the entity takes damage, blocks, or is hit
String required_trigger_tag = "" ​
ON_BLOCK only: the tag of the mitigate trigger that counts as a block (empty = any mitigate trigger)
Damage Settings
DamageScaling damage_scaling = DamageScaling.HYBRID ​
What the value means: the damage itself, a percentage of the hit, or the value plus a fixed percentage of the hit
float percent_of_damage = 10.0 ​
HYBRID only: the fixed percentage of the hit added to the formula's flat damage
CombatOptions.BasisChoice basis = CombatOptions.BasisChoice.PROJECT_DEFAULT ​
Which number of the hit the percentage is taken from. Project default: GameplayConfig, Damage Results
Damage Properties
int damage_type = 0 ​
The type of damage to deal (0 = the type of the hit being reflected)
bool can_be_avoided = false ​
Whether the reflection can be dodged or blocked by the attacker
float maximum_per_hit = 0.0 ​
Most one reflection can deal (0 = no limit)
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. -1 = the project default (GameplayConfig, Damage Results)
Method descriptions ​
EffectType get_effect_type() ​
========== EFFECT IDENTIFICATION ==========
String get_effect_category() ​
The group of the effect in the editor.
bool matches_hit( result: DamageResult ) ​
Does the resolved hit (received by the owner) trigger this effect?
float calculate_damage_amount( stat_points: float, result: DamageResult, formula_context: FormulaContext = null ) ​
How much damage to deal back for result (the hit received) with the owner's stat points
int get_chain_limit() ​
How many times reflected damage may bounce back and forth (the setting of the effect, else the one of the game).
String get_trigger_description() ​
========== DISPLAY ==========
String get_scaling_description() ​
A text about how the effect scales.
String get_short_description() ​
A one line text about what the effect does.
String get_detailed_description( stat_points: float ) ​
A text about what the effect does, with its values for a number of stat points.
Dictionary get_preview_info( stat_points: float ) ​
What the effect gives for a number of stat points, for the tooltip and the editor preview.
String get_tooltip_text( stat_points: float ) ​
The tooltip text of the effect for a number of stat points.
Array[Dictionary] validate() ​
========== VALIDATION ==========