Reference · Rolls and exact odds
specOffunction
A spec from its kinds of dice and a bonus, brought into range.
Import it
import { specOf } from "@johnmorrisdotca/korokoro";
Definition
function specOf(groups: readonly Partial<DiceGroup>[], modifier?: number): RollSpec
Parameters
| Name | Type | Description |
|---|---|---|
groups | readonly Partial<DiceGroup>[] | The dice groups to combine, in order. |
modifier (optional) | number | The bonus added after the dice totals. |
Returns
RollSpec
A spec from its kinds of dice and a bonus, brought into range.
Examples
import { specOf } from "@johnmorrisdotca/korokoro";
import { formatNotation } from "@johnmorrisdotca/korokoro";
console.log(formatNotation(specOf([{ count: 2, sides: 6 }, { count: 1, sides: 8 }], 3)));2d6+1d8+3What it prints (run when this page was built)