diff --git a/GETTING_STARTED.md b/GETTING_STARTED.md index 3e0b61af..eea7b09f 100644 --- a/GETTING_STARTED.md +++ b/GETTING_STARTED.md @@ -1,5 +1,7 @@ # Getting Started +## 12/19/24 Note: This documentation is still broadly accurate, but may contain small errors. I am going through and updating this as we speak, feel free to reach out for any usability questions + ## Insalling Add `randsum` to your package.json, or copy and paste one of these: @@ -119,26 +121,24 @@ roll({ See the [Randsum Dice Notation](https://github.com/RANDSUM/randsum-ts/blob/main/RANDSUM_DICE_NOTATION.md) for more usage information. -One note on Custom Sides: whenever your roll includes custom dice sides, `total` will return `0`. This is because we can't meaningfully calculate the numerical total of a set of strings! This will return zero if _any_ dice pool in the roll is custom. - For example: ```ts -roll('2d20') -// total = 1-20 +import { rollCustomFaces } from 'randsum' -roll({ - sides: ['h', 't'], +rollCustomFaces('2d20') + +rollCustomFaces({ + faces: ['h', 't'], quantity: 4 -}) // total = 0 - -roll([ - { - sides: ['h', 't'], - quantity: 4 - }, - '2d20' -]) // total = 0 +}) / + rollCustomFaces([ + { + faces: ['h', 't'], + quantity: 4 + }, + '2d20' + ]) ``` ### Advanced Usage diff --git a/RANDSUM_DICE_NOTATION.md b/RANDSUM_DICE_NOTATION.md index 88fcc4eb..73970357 100644 --- a/RANDSUM_DICE_NOTATION.md +++ b/RANDSUM_DICE_NOTATION.md @@ -78,9 +78,10 @@ In `randsum` : ```js // Roll 6 two-sided die with the sides "H" and "T" +import { rollCustomFaces } from 'randsum' -roll('6d{HT}') -roll({ +rollCustomFaces('6d{HT}') +rollCustomFaces({ sides: ['H', 'T'], quantity: 6 }) diff --git a/README.md b/README.md index 13405560..d05c6737 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,10 @@ roll({ quantity: 4, sides: 6, modifiers: { drop: { lowest: true } } }) roll('4d6L') // Roll 4 Fudge dice -roll({ quantity: 4, sides: ['+', '+', '-', '-', ' ', ' '] }) + +import { rollCustomFaces } from 'randsum' + +rollCustomFaces({ quantity: 4, faces: ['+', '+', '-', '-', ' ', ' '] }) // Roll a single D20 import { D20 } from 'randsum' @@ -60,7 +63,9 @@ const D120 = new D(120) D120.roll() //'heads' or 'tails'? -const Coin = new D(['heads', 'tails']) +import { CustomFacesD } from 'randsum' + +const Coin = new CustomFacesD(['heads', 'tails']) Coin.roll() ``` diff --git a/bun.lockb b/bun.lockb index 125fa9e6..f4d70548 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 570139d2..cbf8795e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "randsum", - "version": "7.1.0", + "version": "8.0.0", "private": false, "author": "Alex Jarvis", "icon": "https://raw.githubusercontent.com/RANDSUM/randsum-ts/main/icon.webp", @@ -74,7 +74,7 @@ "size-limit": "^11.1.6", "typescript": "^5.7.2", "typescript-eslint": "^8.18.2", - "typedoc": "^0.27.5" + "typedoc": "^0.27.6" }, "dependencies": { "uuid": "^11.0.3"