https://github.com/moderocky/dice
A library for dice-based operations.
https://github.com/moderocky/dice
Last synced: 3 months ago
JSON representation
A library for dice-based operations.
- Host: GitHub
- URL: https://github.com/moderocky/dice
- Owner: Moderocky
- License: mit
- Created: 2023-08-28T10:30:46.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2024-03-10T09:54:26.000Z (over 2 years ago)
- Last Synced: 2025-01-01T04:15:03.129Z (over 1 year ago)
- Language: Java
- Size: 24.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Citation: CITATION.cff
Awesome Lists containing this project
README
Dice
=====
### Opus #27
A library for dice-based operations.
## Features
### Dice
An X-sided die rolled Y times, in the format `XdY`. Alternatively, Y X-sided dice each rolled once.
Generates a score between `X` and `X*Y` (inclusively).
Examples: `1d20`, `1d6`, `2d8`.
### Bonus
A fixed numerical bonus on dice rolls, to be used in an aggregated score.
Examples: `1`, `-3`, `5`.
### Score
An aggregate of several dice with additional bonuses.
This can be simplified into its lowest common representation (e.g. `1d11+1` = `2d6`.)
Examples: `1d6+5`, `2d8+1d4-5`.
### Advantage
Any rolled object can be converted to an 'advantage' version.
When rolled, this will roll twice and return the higher of the two values.
### Disadvantage
Any rolled object can be converted to an 'disadvantage' version.
When rolled, this will roll twice and return the lower of the two values.