Skip to content

@dice-roller/rpg-dice-roller / dice / faceDie

Function: faceDie() ​

faceDie(faces, options?): FacesDieDefinition

Defined in: src/dice/presets.ts:45

A die with a list of faces, e.g. faceDie([1, 1, 2, 3, 5, 8]).

Repeated faces act as weights. The faces are copied and frozen, so changing the array afterwards doesn't change the die. Registered in the DieRegistry as face, with the faces as arguments.

Parameters ​

faces ​

readonly number[]

options? ​

DieOptions = {}

Returns ​

FacesDieDefinition

Throws ​

there are no faces, or a face isn't a finite number

MIT Licensed · Credits