rollMany関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Throw the same dice several times in one go, as ability scores are rolled:
4d6dl1 six times. The rolls are drawn one after another from the one
source, so a seed replays the whole set, and each is an ordinary roll that
says which set it belongs to. times is the spec's own unless given, from
1 to MAX_TIMES.
インポート
import { rollMany } from "@johnmorrisdotca/korokoro";
定義
function rollMany(spec: Partial<RollSpec>, times?: number, source?: RandomSource, when?: number | RollOptions): RollSet
引数
| 名前 | 型 | 説明 |
|---|---|---|
spec | Partial<RollSpec> | Dice counts, sides, rules and modifier; omitted fields use the documented defaults. |
times (省略可) | number | undefined | The number of independent repeats. |
source (省略可) | RandomSource | A source of unsigned 32-bit integers; crypto by default where optional. |
when (省略可) | number | RollOptions | Epoch milliseconds, or roll options including the time and maximum dice. |
戻り値
RollSet
Throw the same dice several times in one go, as ability scores are rolled: 4d6dl1 six times. The rolls are drawn one after another from the one source, so a seed replays the whole set, and each is an ordinary roll that says which set it belongs to. times is the spec's own unless given, from 1 to MAX_TIMES.
例
import { rollMany } from "@johnmorrisdotca/korokoro";
import { normalizeSpec, seededSource } from "@johnmorrisdotca/korokoro";
const spec = normalizeSpec({ count: 2, sides: 6 });
console.log(rollMany(spec, 3, seededSource("table"), 0).rolls.length);3出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。