本文へ移動

Korokoroコロコロ

ダイスを組み合わせて振り、ダイス表記を読み取り、正確な確率を調べます。履歴の保存やシードを指定した再現もできます。

「コロコロ」は、小さなものが転がる様子を表す言葉です。 名前について(英語)

目次

リファレンス · ロールと正確な確率

DieRoll型

リファレンスの説明と例は英語です。見出しと目次は日本語です。

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

インポート

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

定義

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

メンバー

名前型説明
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 (省略可)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 (省略可)string | undefined

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

value (省略可)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 (省略可)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 (省略可)"success" | "failure" | undefined

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

例

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

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/korokoro 1.16.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。