CalculationTriggerStatEffect ​
Inherits: StatEffect < Resource
Effect that rolls a percentage chance to set trigger tags in calculations Examples: Critical Strike, Dodge, Parry, Block Always rolls when the calculation runs - no separate trigger type needed
Properties ​
Array[CalculationBase.CalculationType] | target_calculations | [] |
TriggerTagDefinition | tag_definition | |
String | trigger_tag | "" |
SpecialEffectAnimation | special_effect_animation | SpecialEffectAnimation.NONE |
String | special_effect_message | "": |
TriggerRecord.Kind | kind | TriggerRecord.Kind.NONE |
String | log_phrase | "": |
Array[int] | affects_damage_types | [] |
Methods ​
EffectType | get_effect_type() |
String | get_effect_category() |
String | get_tag() |
TriggerRecord.Kind | get_kind() |
float | get_base_magnitude() |
bool | applies_to_context( context: Dictionary ) |
bool | affects_calculation( calc_type: CalculationBase.CalculationType ) |
float | get_effective_trigger_chance( stat_points: float, formula_context: FormulaContext = null ) |
Dictionary | roll_trigger( stat_points: float, formula_context: FormulaContext = null, chance_bonus: float = 0.0, always: bool = false ) |
Dictionary | apply_to_calculation( current_value: float, stat_points: float, context: Dictionary = {}, formula_context: FormulaContext = null, rules: TriggerRuleSet = null ) |
TriggerRecord | create_record( stat_id: int, stat_name: String, magnitude: float = 0.0 ) |
Dictionary | get_preview_info( stat_points: float ) |
String | get_short_description() |
String | get_tooltip_text( stat_points: float ) |
bool | has_special_effect() |
bool | is_visual_mitigation_trigger() |
Array[Dictionary] | validate() |
Enumerations ​
enum SpecialEffectAnimation ​
The options of special effect animation: none, hit, dodge, block.
- NONE =
0 - HIT =
1 - DODGE =
2
Constants ​
floatPREVIEW_POINTS =1000.0- Stat points the validation checks the chance at
Property descriptions ​
Trigger Settings
Array[CalculationBase.CalculationType] target_calculations = [] ​
Which calculations this affects (empty = all)
TriggerTagDefinition tag_definition ​
Optional: the tag this trigger rolls, as a definition (kind, animation, message, log phrase, base magnitude come from it). Without one the inline tag, kind and presentation below are used (older resources)
String trigger_tag = "" ​
Tag to set in context (e.g., "critical_strike_triggered")
Special Effect
SpecialEffectAnimation special_effect_animation = SpecialEffectAnimation.NONE ​
The animation played when the trigger fires
String special_effect_message = "": ​
No description yet.
Outcome
TriggerRecord.Kind kind = TriggerRecord.Kind.NONE ​
What this trigger IS. AVOID (dodge, parry): when it fires the hit does nothing at all, no modifier is needed. MITIGATE (block): sets the tag; modifiers that require it reduce the hit. BOOST (critical strike): sets the tag; modifiers that require it increase the hit. NONE: only sets the tag. AVOID only acts on damage taken.
String log_phrase = "": ​
Combat log phrase when this trigger fires. Placeholders: {attacker} {target} {ability} {damage}. Example for Dodge: "{target} dodged {attacker}'s {ability}". Empty = the default for the kind
Damage Type Restrictions
Array[int] affects_damage_types = [] ​
Empty = affects all damage types
Method descriptions ​
EffectType get_effect_type() ​
========== EFFECT IDENTIFICATION ==========
String get_effect_category() ​
The group of the effect in the editor.
String get_tag() ​
The word modifiers and procs match on: the definition's, else the inline trigger tag
TriggerRecord.Kind get_kind() ​
What the trigger is (avoid, mitigate, boost, none): the definition's, else the inline kind
float get_base_magnitude() ​
The magnitude the tag carries before rules and stats add to it
bool applies_to_context( context: Dictionary ) ​
========== CONTEXT VALIDATION ==========
bool affects_calculation( calc_type: CalculationBase.CalculationType ) ​
========== TARGET VALIDATION ==========
float get_effective_trigger_chance( stat_points: float, formula_context: FormulaContext = null ) ​
========== TRIGGER CHANCE CALCULATION ==========
Dictionary roll_trigger( stat_points: float, formula_context: FormulaContext = null, chance_bonus: float = 0.0, always: bool = false ) ​
Rolls whether the trigger fires. Gives the result with the chance used. Always forces it to fire.
Dictionary apply_to_calculation( current_value: float, stat_points: float, context: Dictionary = {}, formula_context: FormulaContext = null, rules: TriggerRuleSet = null ) ​
========== EFFECT APPLICATION ==========
TriggerRecord create_record( stat_id: int, stat_name: String, magnitude: float = 0.0 ) ​
The record a DamageResult / HealingResult keeps when this trigger fires
Dictionary get_preview_info( stat_points: float ) ​
========== DISPLAY ==========
String get_short_description() ​
A one line text about what the effect does.
String get_tooltip_text( stat_points: float ) ​
The tooltip text of the effect for a number of stat points.
bool has_special_effect() ​
========== SPECIAL EFFECT HELPERS ==========
bool is_visual_mitigation_trigger() ​
Is this a trigger that shows on screen as a dodge, a parry or a block?
Array[Dictionary] validate() ​
========== VALIDATION ==========