DiceGroup型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Some dice of one kind, with their own rules: the 2d20kh1 of
2d20kh1+1d4. The optional fields are left out of a group that does not
use them.
インポート
import type { DiceGroup } from "@johnmorrisdotca/korokoro";
定義
type DiceGroup = {
count: number;
sides: Sides;
keep: Keep;
keepCount?: number;
explode?: true;
reroll?: number;
rerollUntil?: number;
rerollWhen?: Compare;
rerollUntilWhen?: Compare;
explodeWhen?: Compare;
explodeKind?: ExplodeKind;
floor?: number;
ceiling?: number;
success?: Compare;
failure?: Compare;
critical?: Compare;
fumble?: Compare;
sort?: "ascending" | "descending";
unique?: true;
faces?: CustomFace[];
weights?: number[];
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
count | number | How many dice: at least 1, and no more than |
sides | Sides | The kind of die: 2 to 1000 sides, or "F" for a Fate die. |
keep | Keep | Which dice count towards the total. |
keepCount (省略可) | number | undefined | How many dice |
explode (省略可) | true | undefined | A die showing its highest face throws another, which may do the same. Left out when the dice do not explode. |
reroll (省略可) | number | undefined | A die showing this face or lower is thrown again, once, and the new face stands: |
rerollUntil (省略可) | number | undefined | A die showing this face or lower is thrown again until it shows more, up to |
rerollWhen (省略可) | Compare | undefined | A die meeting this is thrown again, once: |
rerollUntilWhen (省略可) | Compare | undefined | A die meeting this is thrown again until it does not, up to |
explodeWhen (省略可) | Compare | undefined | With |
explodeKind (省略可) | ExplodeKind | undefined | With |
floor (省略可) | number | undefined | The least a die counts for: a face below it counts as it. |
ceiling (省略可) | number | undefined | The most a die counts for: a face above it counts as it. |
success (省略可) | Compare | undefined | The dice are counted, not added: each die meeting this is one success, and the total is how many. |
failure (省略可) | Compare | undefined | With |
critical (省略可) | Compare | undefined | Dice meeting this are marked as critical successes. Only a mark: the total is the same. |
fumble (省略可) | Compare | undefined | Dice meeting this are marked as critical failures. Only a mark. |
sort (省略可) | "ascending" | "descending" | undefined | The order the dice are shown in: |
unique (省略可) | true | undefined | The dice all show different faces: each is thrown from the faces not yet showing, which comes to the same as rerolling any duplicate until there is none. |
faces (省略可) | CustomFace[] | undefined | A custom die: its faces, in order, and |
weights (省略可) | number[] | undefined | A loaded die: how heavily each face is weighted, from the lowest face up,
where a fair die has every face at 1. |
例
import type { DiceGroup } from "@johnmorrisdotca/korokoro";
const value: DiceGroup = { count: 2, sides: 6, keep: "all" };
console.log(value.count);2出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。