3dr

0.1.0-a • Public • Published

Dungeons and Dragons Dice Roller (3DR)

By Travis Stratton

Different Functions for the die roller include:

  • critDamage
  • d20Rolls
  • d20adv
  • d20disAdv
  • dieRoller
  • dieRollString
  • simpleRoll
  • splitDiceRollString

Basic Functions:

DiRoller

BasicUsage

simpleRoll(sides) // returns a single die roll no mods

//ex:
    simpleRoll(20) => 3;

dieRoller(count, sides, modifier) // mod is optional
result = [ die roll, modifier, total];

// ex:
    dieRoller(2, 6, 3) => [ [1,2], 3, 6 ] // 2d6 + 3

dieRollString(roll) // Converts the die rolls to a string

// ex:
    dieRollString([ [1,2], 3, 6 ]) => "(1, 2) + 3 = 6"

Readme

Keywords

none

Package Sidebar

Install

npm i 3dr

Weekly Downloads

3

Version

0.1.0-a

License

ISC

Unpacked Size

2.98 kB

Total Files

3

Last publish

Collaborators

  • tstrat