EncounterReaction ​
Inherits: Resource
EncounterReaction handles group-level responses to encounter events. Similar to CombatReaction but operates on the entire encounter group.
Properties ​
String | reaction_name | "New Reaction" |
TriggerEvent | trigger_event | TriggerEvent.DAMAGE_TAKEN |
bool | one_time | false |
float | cooldown | 0.0 |
float | time_seconds | 10.0 |
float | health_threshold_percent | 50.0 |
Array[EncounterAction] | actions | [] |
Array[EncounterCondition] | conditions | [] |
Variables ​
CombatSession | encounter_instance | null |
EncounterGroup | encounter_node | null |
float | cooldown_remaining | 0.0 |
bool | has_triggered | false |
float | time_passed_timer | 0.0 |
Methods ​
void | setup_encounter_reaction( system_hub: GameHost.SystemHub ) |
bool | can_trigger() |
bool | trigger() |
void | process( delta: float ) |
void | reset() |
String | get_trigger_event_name() |
void | cleanup() |
Enumerations ​
enum TriggerEvent ​
Trigger events for encounter reactions
- DAMAGE_TAKEN =
0- Any group member takes damage - DAMAGE_DEALT =
1- Any group member deals damage - ALLY_DIED =
2- Any group member dies - ENEMY_DIED =
3- Any enemy dies - ANY_DEATH =
4- Any entity (ally or enemy) dies - ALLY_EFFECT_GAINED =
5- Any group member gains an effect - ALLY_EFFECT_LOST =
6- Any group member loses an effect - ALLY_ABILITY_USED =
7- Any group member uses an ability - ENEMY_EFFECT_GAINED =
8- Any enemy gains an effect - ENEMY_EFFECT_LOST =
9- Any enemy loses an effect - ENEMY_ABILITY_USED =
10- Any enemy uses an ability - TIME_PASSED =
11- Timer-based trigger - GROUP_HEALTH_BELOW_PERCENT =
12- Combined group health below threshold
Property descriptions ​
String reaction_name = "New Reaction" ​
Name for this reaction (for debugging/editor display)
TriggerEvent trigger_event = TriggerEvent.DAMAGE_TAKEN ​
Event that triggers this reaction
bool one_time = false ​
Whether this reaction can only trigger once
float cooldown = 0.0 ​
Cooldown between reaction triggers (in seconds)
float time_seconds = 10.0 ​
Time in seconds for TIME_PASSED trigger
float health_threshold_percent = 50.0 ​
Health percentage threshold for GROUP_HEALTH_BELOW_PERCENT trigger
Array[EncounterAction] actions = [] ​
Actions to execute when this reaction triggers
Array[EncounterCondition] conditions = [] ​
Conditions that must be met for actions to execute
Variable descriptions ​
CombatSession encounter_instance = null ​
Internal state
EncounterGroup encounter_node = null ​
The encounter the reaction belongs to.
float cooldown_remaining = 0.0 ​
How many seconds until the reaction can fire again.
bool has_triggered = false ​
True once the reaction fired (for one that fires once).
float time_passed_timer = 0.0 ​
How many seconds have passed, for a reaction that waits.
Method descriptions ​
void setup_encounter_reaction( system_hub: GameHost.SystemHub ) ​
Setup this reaction with encounter instance reference
bool can_trigger() ​
Check if this reaction can trigger
bool trigger() ​
Trigger this reaction
void process( delta: float ) ​
Update cooldown timer and time-based triggers
void reset() ​
Reset reaction state
String get_trigger_event_name() ​
Get display name for trigger event
void cleanup() ​
Cleanup any resources