0.1.0-a • Published 5 years ago

3dr v0.1.0-a

Weekly downloads
33
License
ISC
Repository
github
Last release
5 years ago

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"