1.2.1 • Published 4 years ago

@ehsawyer/initiative-tracker v1.2.1

Weekly downloads
10
License
GPL-3.0-only
Repository
github
Last release
4 years ago

@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

Class that handles initiative tracking

Parameters

  • characters array The characters in the tracker
  • turn number The character position whose turn it is
  • round 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 character
  • name string The name of the character to be added
  • initiative string The character's initiative roll
  • dexterity string The character's dexterity score

editCharacter

Edits a character in the tracker

Parameters
  • name string The name of the character to be added
  • newname
  • initiative string The character's initiative roll
  • dexterity 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

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, default true)
1.2.1

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago