Track the sorted turn order of this combat encounter
Record the current round, turn, and tokenId to understand changes in the encounter state
Track the previous round, turn, and tokenId to understand changes in the encounter state
Debounce changes to the composition of the Combat encounter to de-duplicate multiple concurrent Combatant changes. If this is the currently viewed encounter, re-render the CombatTracker application.
The configuration setting used to record Combat preferences
Get the Combatant who has the current turn.
Get the Combatant who has the next turn.
Return the object of settings which modify the Combat Tracker behavior
Has this combat encounter been started?
Is this combat active in the current scene?
Set the current Combat encounter as active within the Scene. Deactivate all other Combat encounters within the viewed Scene and set this one as active
Get a Combatant using its Token id
The id of the Token for which to acquire the combatant
Begin the combat encounter, advancing to round 1 and turn 1
Advance the combat to the next round
Rewind the combat to the previous round
Advance the combat to the next turn
Rewind the combat to the previous turn
Display a dialog querying the GM whether they wish to end the combat encounter and empty the tracker
Toggle whether this combat is linked to the scene or globally available.
Reset all combatant initiative scores, setting the turn back to zero
Roll initiative for one or multiple Combatants within the Combat document
A Combatant id or Array of ids for which to roll
Additional options which modify how initiative rolls are created or presented.
A promise which resolves to the updated Combat document once updates are complete.
Roll initiative for all combatants which have not already rolled
Roll initiative for all non-player actors who have not already rolled
Assign initiative for a single Combatant within the Combat encounter. Update the Combat turn order to maintain the same combatant as the current turn.
The combatant ID for which to set initiative
A specific initiative value to set
Return the Array of combatants sorted into initiative order, breaking ties alphabetically by name.
Update active effect durations for all actors present in this Combat encounter.
Loads the registered Combat Theme (if any) and plays the requested type of sound. If multiple exist for that type, one is chosen at random.
The announcement that should be played: "startEncounter", "nextUp", or "yourTurn".
Define how the array of Combatants is sorted in the displayed list of the tracker. This method can be overridden by a system or module which needs to display combatants in an alternative order. The default sorting rules sort in descending order of initiative using combatant IDs for tiebreakers.
Refresh the Token HUD under certain circumstances.
A list of Combatant documents that were added or removed.
Manage the execution of Combat lifecycle events. This method orchestrates the execution of four events in the following order, as applicable:
A workflow that occurs at the end of each Combat Turn. This workflow occurs after the Combat document update, prior round information exists in this.previous. This can be overridden to implement system-specific combat tracking behaviors. This method only executes for one designated GM user. If no GM users are present this method will not be called.
The Combatant whose turn just ended
A workflow that occurs at the end of each Combat Round. This workflow occurs after the Combat document update, prior round information exists in this.previous. This can be overridden to implement system-specific combat tracking behaviors. This method only executes for one designated GM user. If no GM users are present this method will not be called.
A workflow that occurs at the start of each Combat Round. This workflow occurs after the Combat document update, new round information exists in this.current. This can be overridden to implement system-specific combat tracking behaviors. This method only executes for one designated GM user. If no GM users are present this method will not be called.
A workflow that occurs at the start of each Combat Turn. This workflow occurs after the Combat document update, new turn information exists in this.current. This can be overridden to implement system-specific combat tracking behaviors. This method only executes for one designated GM user. If no GM users are present this method will not be called.
The Combatant whose turn just started
Update the previous turn data. Compare the state with the new current state. Only update the previous state if there is a difference.
A cloned copy of the current history state before changes
The client-side Combat document which extends the common BaseCombat model.
ClientDocumentMixin
{@link documents.Combats} The world-level collection of Combat documents
Combatant The Combatant embedded document which exists within a Combat document
{@link CombatConfig} The Combat configuration application