本文へ移動

Korokoroコロコロ

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

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

目次

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

NotationProblem型

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

Dice notation, the way a character sheet writes it.

set = [times "#"] roll [ "#" label ] the roll thrown several times: 6#4d6dl1 times = 1 to 100 roll = dice { "+" dice } [bonus] dice = [count] "d" sides { modifier } count = 1 to 10 over the whole roll, and 1 when left out sides = 2 to 1000, "%" for 100, or "F" for a Fate die | number "{" face ":" weight { "," face ":" weight } "}" a loaded die | "[" face { "," face } "]" a custom die face = words [ "=" value ] [ "#" colour ] in a custom die; a number alone is worth itself modifier = "!" | "!!" | "!p" | "!!p" the dice explode: each a die of its own, compounding, penetrating, or both [ compare ] … on these faces and not only the highest: !>=5 | "r" [point] reroll until clear: r<3, r=1, r1, r>=5; "r" alone is the lowest face | "ro" [point] reroll once: ro<3, ro=1 | "kh" [n] | "kl" [n] keep the highest or lowest n (1 when left out); "k" and "b" are kh, "w" is kl | "dh" [n] | "dl" [n] drop the highest or lowest n; "d" alone is dl | "min" n | "max" n a die counts for at least, or at most, n | compare count successes: the total is how many dice meet it | "f" point with a count: each die meeting it takes a success away | "cs" [point] | "cf" [point] mark dice as critical successes or failures; alone, the highest and the lowest face | "sa" | "sd" | "s" show the dice sorted, ascending (or "s") or descending compare = ( "=" | "<" | ">" | "<=" | ">=" | "<>" ) number point = compare | "!=" number | number a bare number is "=" bonus = "+" or "-", then 0 to 99 label = up to 40 characters, saying what the roll is for; "[label]" in front of the roll is read too

Letters in either case, spaces anywhere between the parts. Up to four kinds of dice are added together, each with its own modifiers, and the bonus comes last. 6# in front throws the whole roll six times as a set (rollMany); it is a prefix so that it can never be read as arithmetic. A kind's modifiers may come in any order and each at most once; whatever order they are written in, a die is rerolled first, then explodes, and keeping or dropping is decided last. Exploding dice are not kept or dropped.

A loaded die is a numbered die with some faces weighted: d6{6:3} shows its 6 three times in eight, and every face not named weighs 1. A custom die is its faces: d[Yes,No,Maybe], d[Hit=1,Miss=0,Miss=0], and a face written twice comes up twice as often. Neither can be written, read or shared as a fair die: the braces and the brackets are part of its name. A custom die takes no modifiers.

r follows Roll20 and the dice libraries that follow it: it rerolls until the die is clear, and ro rerolls once. Until 1.4.0 this package's r rerolled once; parseNotation(text, { legacyReroll: true }) reads text written then.

インポート

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

定義

type NotationProblem = "shape" | "count" | "sides" | "bonus" | "twice" | "keep" | "reroll" | "explode" | "kinds" | "minus" | "times" | "custom" | "successes" | "clamp" | "marks" | "unique" | "math" | "fraction" | "zero" | "label" | "weights";

例

import type { NotationProblem } from "@johnmorrisdotca/korokoro";
const value: NotationProblem = "count";
console.log(value);
count

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

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

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