Skip to the content

Korokoroコロコロ

Roll mixed dice or type notation, compare exact probabilities, keep a history and replay seeded rolls.

Korokoro describes something small rolling in Japanese. About the name

Contents

Reference · Rolls and exact odds

DieRolltype

One die of a roll: the face it showed and what became of it.

Import it

import type { DieRoll } from "@johnmorrisdotca/korokoro";

Definition

type DieRoll = {
    face: number;
    status: DieStatus;
    exploded: boolean;
    die: number;
    group?: number;
    label?: string;
    value?: number;
    counts?: 1 | -1;
    critical?: "success" | "failure";
};

Members

NameTypeDescription
facenumber

The face it showed. A Fate die shows −1, 0 or 1.

statusDieStatus

Whether it counts, was dropped, or was thrown again.

explodedboolean

It showed its highest face and threw the die after it.

dienumber

Which of the dice asked for this one belongs to, from 0 and counted across the whole roll: a reroll or an explosion belongs to the die that caused it.

group (optional)number | undefined

Which kind of dice it is, from 0, in a roll of several kinds. Left out in a roll of one kind.

label (optional)string | undefined

What the face says, on a custom die. Left out of a numbered die.

value (optional)number | undefined

What the die is worth in the total when that is not its face: a custom face's value (0 for a face that is only words), a face raised or lowered by min or max, an extra die of a penetrating explosion with its one taken off. Left out of a die worth its face.

counts (optional)1 | -1 | undefined

In a roll that counts successes: 1 on a die that is a success, −1 on one that takes a success away. Left out of every other die. A compounding die's count is on the last die of its chain.

critical (optional)"success" | "failure" | undefined

A die marked by cs or cf. Left out of every other die.

Examples

import type { DieRoll } from "@johnmorrisdotca/korokoro";
import { DEFAULT_SPEC, readDice } from "@johnmorrisdotca/korokoro";
const value: DieRoll = readDice(DEFAULT_SPEC, [2, 5])![0]!;
console.log(value.face);
2

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/korokoro 1.16.0.