A lightweight combat tracker for tabletop games
Install with
npm i @ehsawyer/initiative-tracker
or
yarn add @ehsawyer/initiative-tracker
- Tracker
Class that handles initiative tracking
characters
array The characters in the trackerturn
number The character position whose turn it isround
number The current round
Get the amount of characters in the tracker
Returns string The amount of character in the tracker
Get the amount of characters in the tracker
Returns string The amount of character in the tracker
Get the current round
Returns string The current round
Get the current turn
Returns string The current turn
Get the amount of characters in the tracker
Returns string The amount of character in the tracker
Get the current character whose turn it is
Returns string The current character whose turn it is
Set the turn index
index
integer The target index
Set the round index
index
integer The target index
Get the target character
targetName
name
string The name of the target character
Returns string The target character
Get the target character's index
name
string The name of the target character
Returns string The target character's index
Adds a character to the tracker
userID
string The ID of the user responsible for controlling the charactername
string The name of the character to be addedinitiative
string The character's initiative rolldexterity
string The character's dexterity score
Edits a character in the tracker
name
string The name of the character to be addednewname
initiative
string The character's initiative rolldexterity
string The character's dexterity score
Removes a character from the tracker
name
string The name of the character to be removed
Checks if a user already has a character
userID
string The user's ID
Lists characters to console (Debug only)
Progresses to the next turn
Starts Combat
Sorts the current turn order by rolled initiative and then the dexterity score of the characters
Resets the tracker
wipe
(optional, defaulttrue
)