Reference · Rolls and exact odds
totalOffunction
The kept faces added up, plus the bonus.
Import it
import { totalOf } from "@johnmorrisdotca/korokoro";
Definition
function totalOf(faces: readonly number[], kept: readonly boolean[], modifier: number): number
Parameters
| Name | Type | Description |
|---|---|---|
faces | readonly number[] | Physical face values, in the order thrown. |
kept | readonly boolean[] | A mask saying which dice count towards the total. |
modifier | number | The bonus added after the dice totals. |
Returns
number
The kept faces added up, plus the bonus.
Examples
import { totalOf } from "@johnmorrisdotca/korokoro";
console.log(totalOf([2, 5], [true, true], 3));10What it prints (run when this page was built)