Skip to content

CombatEvent ​

Inherits: RefCounted

One record of something that happened in a fight: a hit, a heal, an effect gained, a death, a cast. It is plain data: it holds ids and numbers (and the names as they were), never objects, so it converts to a dictionary and back. The CombatEventRecorder makes events, the combat session keeps them, and the message manager shows them as lines.

Variables ​

intsequence0
floatgame_hours0.0
KindkindKind.DAMAGE
intactor_id0
Stringactor_name""
inttarget_id0
Stringtarget_name""
intability_id0
Stringability_name""
intamount0
intdamage_type0
boolcritfalse
boolslainfalse
Stringline""
intdetail_override-1
PackedStringArraychannelsPackedStringArray()
Dictionarydetails{}

Methods ​

Detailminimum_detail()
Dictionaryto_dict()
CombatEventfrom_dict( source: Dictionary ) static
Stringcolor_of( event_kind: Kind ) static
Stringpersonalize( text: String, character_name: String ) static

Enumerations ​

enum Kind ​

What happened

  • DAMAGE = 0 - A hit that landed
  • HEALING = 1 - A heal
  • EFFECT_GAINED = 2 - A buff or debuff was gained
  • EFFECT_LOST = 3 - A buff or debuff ended
  • DEATH = 4 - Something died
  • CAST = 5 - An ability was used
  • INTERRUPT = 6 - A cast was interrupted
  • AVOID = 7 - A hit was missed, dodged or parried, or the target was immune
  • RESOURCE = 8 - (Detailed) a pool changed
  • COOLDOWN = 9 - (Detailed) a cooldown started
  • TARGET_CHANGE = 10 - (Detailed) something took another target
  • MOVEMENT = 11 - (Debug) an entity moved (sampled)
  • AI_DECISION = 12 - (Debug) the behavior of an NPC chose something
  • ABILITY_DENIED = 13 - (Detailed) an ability could not be used: on cooldown, no resource, out of range ...
  • EFFECT_UPDATED = 14 - (Detailed) a buff or debuff was refreshed or its stacks changed

enum Detail ​

How much of the fight is recorded (GameplayConfig.combat_log_detail)

  • OFF = 0 - Nothing
  • CRITICAL = 1 - Deaths, critical hits and kills
  • NORMAL = 2 - Damage, healing, avoids, casts, effects gained and lost (the default)
  • DETAILED = 3 - Everything about the effects, the pools, the cooldowns, the targets
  • DEBUG = 4 - Movement and the decisions of the AI: for designing and debugging a fight

Constants ​

  • Dictionary KIND_COLORS = { - The colour of the lines of each kind (the chat box uses it for the combat channels)

Variable descriptions ​

int sequence = 0 ​

The number of the event in the order they happened

float game_hours = 0.0 ​

The game time it happened at (ChronoManager.total_game_hours)

Kind kind = Kind.DAMAGE ​

No description yet.

int actor_id = 0 ​

Who did it (the unique id of the entity; 0 when it has none or nobody did it)

String actor_name = "" ​

No description yet.

int target_id = 0 ​

Who it happened to

String target_name = "" ​

No description yet.

int ability_id = 0 ​

The ability or effect involved (the id of its definition) and its name

String ability_name = "" ​

No description yet.

int amount = 0 ​

How much (damage done, healing applied)

int damage_type = 0 ​

The id of the damage type (damage only)

bool crit = false ​

No description yet.

bool slain = false ​

The hit killed the target

String line = "" ​

The line, in the third person ("Mira's [Slash] hit Wolf for 12"), made when the event was recorded

int detail_override = -1 ​

When set (a Detail value), the least detail that records this event, whatever its kind says: the same kind is Detailed for the party and Debug for the others

PackedStringArray channels = PackedStringArray() ​

The chat channels the event was shown in (combat_personal, combat_party, combat_friendly, combat_hostile)

Dictionary details = ​

What else the kind has to say: "blocked", "absorbed", "overheal", "outcome", "avoid_kind" ...

Method descriptions ​

Detail minimum_detail() ​

The least detail that records this kind of event. A critical hit or a kill counts as Critical, a plain hit as Normal

Dictionary to_dict() ​

The event as a dictionary (a save, a network, an export)

CombatEvent from_dict( source: Dictionary ) ​

An event from a dictionary

String color_of( event_kind: Kind ) ​

The colour of the line of an event of this kind (html, no #)

String personalize( text: String, character_name: String ) ​

The line from the point of view of a character: its name becomes "you" ("Your [Slash] hit Wolf for 12", "Wolf's [Bite] hit you for 7"). The names of the others stay