@ehsawyer/initiative-tracker v1.2.1
@ehsawyer/initiative-tracker
A lightweight combat tracker for tabletop games
Installation
Install with
npm i @ehsawyer/initiative-tracker
or
yarn add @ehsawyer/initiative-tracker
Documentation
Table of Contents
- Tracker
Tracker
Class that handles initiative tracking
Parameters
characters
array The characters in the trackerturn
number The character position whose turn it isround
number The current round
allCharacters
Get the amount of characters in the tracker
Returns string The amount of character in the tracker
characterCount
Get the amount of characters in the tracker
Returns string The amount of character in the tracker
round
Get the current round
Returns string The current round
turn
Get the current turn
Returns string The current turn
progress
Get the amount of characters in the tracker
Returns string The amount of character in the tracker
currentCharacter
Get the current character whose turn it is
Returns string The current character whose turn it is
turnIndex
Set the turn index
Parameters
index
integer The target index
roundIndex
Set the round index
Parameters
index
integer The target index
getCharacterOwnerID
Get the target character
Parameters
targetName
name
string The name of the target character
Returns string The target character
getCharacterIndex
Get the target character's index
Parameters
name
string The name of the target character
Returns string The target character's index
addCharacter
Adds a character to the tracker
Parameters
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
editCharacter
Edits a character in the tracker
Parameters
name
string The name of the character to be addednewname
initiative
string The character's initiative rolldexterity
string The character's dexterity score
removeCharacter
Removes a character from the tracker
Parameters
name
string The name of the character to be removed
userHasCharacter
Checks if a user already has a character
Parameters
userID
string The user's ID
listCharacters
Lists characters to console (Debug only)
nextTurn
Progresses to the next turn
startCombat
Starts Combat
sortTracker
Sorts the current turn order by rolled initiative and then the dexterity score of the characters
reset
Resets the tracker
Parameters
wipe
(optional, defaulttrue
)