#dnd #dice #ttrpg #parser #command-parser

genesys-dice-command-parser

A library for parsing basic Genesys dice roll commands

2 releases

0.1.1 May 18, 2022
0.1.0 May 17, 2022

#8 in #command-parser


Used in genesys-dice-roller

MIT license

14KB
252 lines

This crate provides functionality for the basic parsing of dice roll commands e.g. yyypp, 2g1y2p, difficulty difficulty ability proficiency. Given some input it will produce a DiceRoll struct which can be used to then calculate a result.


Dice Command Parser

This library parses a simple Genesys dice roll string (also works for Star Wars FFG RPG) and produces a representation of the dice that should be rolled and its modifier.

Example input: 2g1r1p, yyypp, difficulty difficulty ability proficiency etc.

Dependencies

~1–1.7MB
~34K SLoC