Skip to content

ThreatUtility ​

Inherits: RefCounted

Threat in one place: who gets threat on whom, from damage, from healing and from effects, with the redirects (misdirection) applied. An NPC keeps its threat in its threat table (ThreatTableComponent). Only NPCs have one; threat on anything else is ignored. See docs/systems/ability-mechanics-plan.md, section 6.

Methods ​

voidadd_threat( source: Variant, victim: Variant, amount: float ) static
voidadd_threat_to_many( source: Variant, victims: Array, amount: float ) static
Array[NPC]get_engaged_enemies( entity: Entity, reference: Entity, combat_manager: CombatManager ) static
voidapply_heal_threat( result: HealingResult, combat_manager: CombatManager ) static

Method descriptions ​

void add_threat( source: Variant, victim: Variant, amount: float ) ​

Threat of source on one NPC. The redirect of the source (a misdirection) is applied

void add_threat_to_many( source: Variant, victims: Array, amount: float ) ​

The same amount of threat on several NPCs: one action of the source (a misdirection that lasts N actions counts it once)

Array[NPC] get_engaged_enemies( entity: Entity, reference: Entity, combat_manager: CombatManager ) ​

The hostile NPCs with a threat table that are fighting with this entity (its encounter), hostile to reference

void apply_heal_threat( result: HealingResult, combat_manager: CombatManager ) ​

Healing makes threat on the enemies fighting the healed entity (when the healer is on its side): the effective healing times the project's multiplier (GameplayConfig, Combat, Threat) or the heal effect's own, split between those enemies