Stats型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Everything worth saying about a history of rolls. Pure: a history in, numbers out.
インポート
import type { Stats } from "@johnmorrisdotca/korokoro";
定義
type Stats = {
rolls: number;
heldRolls: number;
diceThrown: number;
luck: number | null;
longestHot: number;
longestCold: number;
currentStreak: number;
matches: number;
naturalTwenties: number;
naturalOnes: number;
faces: FaceStats | null;
totals: TotalStats | null;
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
rolls | number | How many rolls the history holds. |
heldRolls | number | How many of those rolls held some dice from the roll before. They count their new dice, and are left out of luck, streaks, matches and totals. |
diceThrown | number | How many dice those rolls threw, rerolled and exploded dice included, held dice not. |
luck | number | null | Mean of each roll's luck (0 to 1); 0.5 is exactly as lucky as the dice promise. Null with no rolls. |
longestHot | number | The longest run of rolls above their average, and below it. |
longestCold | number | |
currentStreak | number | The run the history ends on: positive above average, negative below, 0 on the average. |
matches | number | Rolls of two or more dice all showing the same face. A roll that rerolled or exploded a die is not counted. |
naturalTwenties | number | A d20's natural 20 and natural 1, counted on the dice that were kept. |
naturalOnes | number | |
faces | FaceStats | null | Each face of the focus die. Null when no focus was given. |
totals | TotalStats | null | The totals of the focus spec. Null when no focus was given. |
例
import type { Stats } from "@johnmorrisdotca/korokoro";
import { statsOf } from "@johnmorrisdotca/korokoro";
const value: Stats = statsOf([]);
console.log(value.rolls);0出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。