rpg-engine 0.18.0 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/change/change.d.ts +1 -0
- package/dist/commands/change/recipe-pace.d.ts +5 -0
- package/dist/commands/change/recipe-pace.js +23 -6
- package/dist/commands/change/recipe.d.ts +2 -0
- package/dist/commands/change/recipe.js +5 -3
- package/dist/commands/shared/time/advance.d.ts +2 -0
- package/dist/commands/shared/time/advance.js +4 -1
- package/dist/commands/shared/time/dawn.d.ts +9 -0
- package/dist/commands/shared/time/dawn.js +40 -0
- package/dist/commands/travel/travel.js +2 -0
- package/dist/core/packages/declarations.d.ts +2 -2
- package/dist/core/packages/declarations.js +2 -2
- package/dist/systems/game-system.d.ts +2 -0
- package/dist/systems/read.js +6 -0
- package/dist/systems/schema.d.ts +1 -0
- package/dist/systems/schema.js +1 -0
- package/instructions/play.md +1 -1
- package/package.json +2 -2
|
@@ -2,5 +2,10 @@ import type { Context } from "../../core/context.ts";
|
|
|
2
2
|
import type { Recipe } from "../../systems/index.ts";
|
|
3
3
|
/** Why a page gains nothing from a recipe it had too recently (RST-1), as "Ettore had a long rest at day 2, 08:00: …"; undefined when it may have it. */
|
|
4
4
|
export declare function tooSoonNote(root: string, recipe: Recipe, page: string): string | undefined;
|
|
5
|
+
/**
|
|
6
|
+
* When the last advance ended now and was shorter than the rest, as a night of 6h10 for a long rest of 8h (D-500): "The last advance covered 6h 10m (day 1,
|
|
7
|
+
* 23:50 → day 2, 06:00) …"; undefined otherwise. A watch split into advances may trip it, hence the "if".
|
|
8
|
+
*/
|
|
9
|
+
export declare function shortRestNote(root: string, recipe: Recipe): string | undefined;
|
|
5
10
|
/** Writes in the log that a recipe gave a page something, when the system counts how often it may (RST-1). */
|
|
6
11
|
export declare function logRecipeApplied(root: string, context: Context, recipe: Recipe, page: string, visibility: "public" | "hidden"): void;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { appendLogEntry, readLog } from "../../core/log.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { addDuration, formatDuration, formatGameDate, minutesBetween, readDuration, readGameDate } from "../../time/index.js";
|
|
3
|
+
import { lastApplied, recipeAppliedType } from "../shared/time/dawn.js";
|
|
4
4
|
import { newDatedLogEntry, readPresent } from "../shared/time/time.js";
|
|
5
|
-
const appliedType = "recipe-applied";
|
|
6
5
|
/** Why a page gains nothing from a recipe it had too recently (RST-1), as "Ettore had a long rest at day 2, 08:00: …"; undefined when it may have it. */
|
|
7
6
|
export function tooSoonNote(root, recipe, page) {
|
|
8
7
|
const every = recipe.oncePer === undefined ? undefined : readDuration(recipe.oncePer);
|
|
@@ -10,16 +9,34 @@ export function tooSoonNote(root, recipe, page) {
|
|
|
10
9
|
if (every === undefined || now === undefined) {
|
|
11
10
|
return undefined;
|
|
12
11
|
}
|
|
13
|
-
const
|
|
14
|
-
const then = last === undefined ? undefined : readGameDate(last.date);
|
|
12
|
+
const then = lastApplied(root, recipe, page);
|
|
15
13
|
if (then === undefined || minutesBetween(then, now) >= every) {
|
|
16
14
|
return undefined;
|
|
17
15
|
}
|
|
18
16
|
return `${page} had a ${recipe.name} at ${formatGameDate(then)}, and gains nothing from another before ${formatGameDate(addDuration(then, every))}: one in ${recipe.oncePer}.`;
|
|
19
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* When the last advance ended now and was shorter than the rest, as a night of 6h10 for a long rest of 8h (D-500): "The last advance covered 6h 10m (day 1,
|
|
20
|
+
* 23:50 → day 2, 06:00) …"; undefined otherwise. A watch split into advances may trip it, hence the "if".
|
|
21
|
+
*/
|
|
22
|
+
export function shortRestNote(root, recipe) {
|
|
23
|
+
const lasts = recipe.lasts === undefined ? undefined : readDuration(recipe.lasts);
|
|
24
|
+
const now = readPresent(root).date;
|
|
25
|
+
const last = readLog(root).filter((entry) => entry.type === "time-advanced").at(-1);
|
|
26
|
+
const from = last === undefined ? undefined : readGameDate(String(last.data.from));
|
|
27
|
+
const to = last === undefined ? undefined : readGameDate(String(last.data.to));
|
|
28
|
+
if (lasts === undefined || now === undefined || from === undefined || to === undefined || minutesBetween(to, now) !== 0) {
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
const covered = minutesBetween(from, to);
|
|
32
|
+
if (covered <= 0 || covered >= lasts) {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
return `The last advance covered ${formatDuration(covered)} (${formatGameDate(from)} → ${formatGameDate(to)}) of the ${recipe.name}'s ${recipe.lasts}: if it began at ${formatGameDate(from)}, it ends at ${formatGameDate(addDuration(from, lasts))}; advance the other ${formatDuration(lasts - covered)} before anyone acts.`;
|
|
36
|
+
}
|
|
20
37
|
/** Writes in the log that a recipe gave a page something, when the system counts how often it may (RST-1). */
|
|
21
38
|
export function logRecipeApplied(root, context, recipe, page, visibility) {
|
|
22
39
|
if (recipe.oncePer !== undefined) {
|
|
23
|
-
appendLogEntry(root, newDatedLogEntry(root, context,
|
|
40
|
+
appendLogEntry(root, newDatedLogEntry(root, context, recipeAppliedType, visibility, { page, recipe: recipe.name }));
|
|
24
41
|
}
|
|
25
42
|
}
|
|
@@ -41,6 +41,7 @@ export declare function recipeResult(root: string, context: Context, world: Worl
|
|
|
41
41
|
outcomes: RecipeOutcome[];
|
|
42
42
|
rules: string[];
|
|
43
43
|
lasts?: string;
|
|
44
|
+
short?: string;
|
|
44
45
|
buttons?: boolean;
|
|
45
46
|
physical?: boolean;
|
|
46
47
|
spent?: string;
|
|
@@ -55,6 +56,7 @@ export declare function recipeText(result: {
|
|
|
55
56
|
outcomes: RecipeOutcome[];
|
|
56
57
|
rules: string[];
|
|
57
58
|
lasts?: string;
|
|
59
|
+
short?: string;
|
|
58
60
|
buttons?: boolean;
|
|
59
61
|
physical?: boolean;
|
|
60
62
|
}): string;
|
|
@@ -15,7 +15,7 @@ import { carriedCounters, effectsAtRecipe, notBroughtBack, partyPages, recipeCho
|
|
|
15
15
|
import { newDatedLogEntry } from "../shared/time/time.js";
|
|
16
16
|
import { counterStep } from "./amounts.js";
|
|
17
17
|
import { applyStep, holderNamed, pageHolder, stepNotes } from "./holder.js";
|
|
18
|
-
import { logRecipeApplied, tooSoonNote } from "./recipe-pace.js";
|
|
18
|
+
import { logRecipeApplied, shortRestNote, tooSoonNote } from "./recipe-pace.js";
|
|
19
19
|
/**
|
|
20
20
|
* A recipe of the game system applied to a page, or to the living player characters and the companions with them (DAT-4). Every page is checked before any
|
|
21
21
|
* is written.
|
|
@@ -52,7 +52,9 @@ export function recipeResult(root, context, world, input) {
|
|
|
52
52
|
});
|
|
53
53
|
// Where the dashboard serves a page, the player spends their dice there with ask (ASK-14); with physical dice, they roll their own (ASK-8).
|
|
54
54
|
const physical = readSettings(root).dice === "physical";
|
|
55
|
-
|
|
55
|
+
// A night advanced shorter than the rest, as 6h10 for a long rest of 8h (D-500): said, not refused, since the rest may have begun earlier.
|
|
56
|
+
const short = shortRestNote(root, recipe);
|
|
57
|
+
return { recipe: recipe.name, system: system.name, outcomes, rules: recipe.rules, lasts: recipe.lasts, short, buttons: context.page?.spendDice !== undefined, physical };
|
|
56
58
|
}
|
|
57
59
|
/**
|
|
58
60
|
* A recipe applied to one page (DAT-4): the effects that last until one of its occasions end first (DAT-5), then each field it names goes to its maximum or to
|
|
@@ -151,7 +153,7 @@ export function recipeText(result) {
|
|
|
151
153
|
// A refused rest has no hours to advance (D-500).
|
|
152
154
|
const hours = result.outcomes.every((outcome) => outcome.barred)
|
|
153
155
|
? ""
|
|
154
|
-
: `The game date did not move: apply a rest once its hours${result.lasts === undefined ? "" : ` (${result.lasts})`} have passed; if they have not yet, advance them now.`;
|
|
156
|
+
: result.short ?? `The game date did not move: apply a rest once its hours${result.lasts === undefined ? "" : ` (${result.lasts})`} have passed; if they have not yet, advance them now.`;
|
|
155
157
|
const text = [title, ...lines, rules, hours].filter((line) => line !== "").join("\n");
|
|
156
158
|
return [text, ...notes.filter((note) => note.includes("\n"))].join("\n\n");
|
|
157
159
|
}
|
|
@@ -32,6 +32,8 @@ export interface TimePassed {
|
|
|
32
32
|
diary?: string;
|
|
33
33
|
/** What the party used up at each midnight passed, under the rigor «rules» (UPK-1, UPK-2). */
|
|
34
34
|
upkeep?: string[];
|
|
35
|
+
/** What comes back at the dawn it went through, and who had no rest of a night (D-571, RST-2). */
|
|
36
|
+
dawn?: string[];
|
|
35
37
|
/** The day of the calendar reached, when the campaign has one (TIM-8): 15 April, spring. */
|
|
36
38
|
calendar?: string;
|
|
37
39
|
/** What the campaign's extensions said of the time passed, such as the weather of a new morning (D-436). */
|
|
@@ -10,6 +10,7 @@ import { shortList, skippedPagesNote } from "../notes.js";
|
|
|
10
10
|
import { surroundings, surroundingsText } from "../places/environment.js";
|
|
11
11
|
import { endedByDate, endEffects } from "../scene/effects.js";
|
|
12
12
|
import { readOpenScene } from "../scene/scene.js";
|
|
13
|
+
import { dawnLines } from "./dawn.js";
|
|
13
14
|
import { clocksToMove, dueAdvice, dueEvents, dueText, isDated, plannedEvents, plannedText } from "./events.js";
|
|
14
15
|
import { calendarDayOf, newDatedLogEntry } from "./time.js";
|
|
15
16
|
import { dailyUpkeep } from "./upkeep.js";
|
|
@@ -50,7 +51,8 @@ export function passTime(root, context, world, now, wanted, why, requested) {
|
|
|
50
51
|
const newDayPart = result.clocks.length === 0 ? "" : situationPart("new-day", context, campaignSystem(root, context));
|
|
51
52
|
const upkeep = passed > 0 ? dailyUpkeep(root, context, campaignSystem(root, context), result.newDays) : [];
|
|
52
53
|
const diary = result.newDays > 0 ? diaryDueLine(root, context, world) : "";
|
|
53
|
-
|
|
54
|
+
const dawn = passed > 0 ? dawnLines(root, world, campaignSystem(root, context), now, reached) : [];
|
|
55
|
+
return { ...result, ended, around, newDayPart, ...(upkeep.length === 0 ? {} : { upkeep }), ...(dawn.length === 0 ? {} : { dawn }), ...(diary === "" ? {} : { diary }) };
|
|
54
56
|
}
|
|
55
57
|
/**
|
|
56
58
|
* What outputs say after time passed, line by line: the effects ended, the events due with how to play them and `then`, what to do after them, those still due,
|
|
@@ -67,6 +69,7 @@ export function passedLines(result, then) {
|
|
|
67
69
|
clocksLine(result.newDays, result.to, result.clocks),
|
|
68
70
|
result.newDayPart,
|
|
69
71
|
...(result.upkeep ?? []),
|
|
72
|
+
...(result.dawn ?? []),
|
|
70
73
|
result.diary ?? "",
|
|
71
74
|
...(result.extensionLines ?? []),
|
|
72
75
|
result.unreadable.length === 0 ? "" : `Time does not stop at these planned events, whose date is not a game date: ${result.unreadable.join(" · ")}. Give each one a game date with write.`,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { World } from "../../../pages/index.ts";
|
|
2
|
+
import type { GameSystem, Recipe } from "../../../systems/index.ts";
|
|
3
|
+
import { type GameDate } from "../../../time/index.ts";
|
|
4
|
+
/** The type of the log's line that says a recipe gave a page something (RST-1). */
|
|
5
|
+
export declare const recipeAppliedType = "recipe-applied";
|
|
6
|
+
/** The lines of a dawn this passing of time went through, the last when it went through more; none without one, or when nothing is to say. */
|
|
7
|
+
export declare function dawnLines(root: string, world: World, system: GameSystem | undefined, from: GameDate, to: GameDate): string[];
|
|
8
|
+
/** When a page last had a recipe that gave it something (RST-1); undefined when never. */
|
|
9
|
+
export declare function lastApplied(root: string, recipe: Recipe, page: string): GameDate | undefined;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// What comes back at dawn (D-571, RST-2): when time passes through the system's dawn, what the party carries below its maximum, which its text brings back, and
|
|
2
|
+
// who of the party had no rest of a night in its time, which the master gives if they slept. The engine gives nothing by itself.
|
|
3
|
+
import { readLog } from "../../../core/log.js";
|
|
4
|
+
import { comparableText } from "../../../core/text.js";
|
|
5
|
+
import { formatGameDate, minutesBetween, readDuration, readGameDate } from "../../../time/index.js";
|
|
6
|
+
import { carriedCounters, partyPages } from "./recipes.js";
|
|
7
|
+
/** The type of the log's line that says a recipe gave a page something (RST-1). */
|
|
8
|
+
export const recipeAppliedType = "recipe-applied";
|
|
9
|
+
/** The lines of a dawn this passing of time went through, the last when it went through more; none without one, or when nothing is to say. */
|
|
10
|
+
export function dawnLines(root, world, system, from, to) {
|
|
11
|
+
const dawn = system?.dawn === undefined ? undefined : lastDawn(from, to, system.dawn);
|
|
12
|
+
if (system === undefined || dawn === undefined) {
|
|
13
|
+
return [];
|
|
14
|
+
}
|
|
15
|
+
const members = partyPages(world);
|
|
16
|
+
const carried = members.flatMap((member) => carriedCounters(world, member).map((counter) => `${counter} (${member.name})`));
|
|
17
|
+
const unrested = system.recipes.filter((recipe) => recipe.oncePer !== undefined && recipe.lasts !== undefined).flatMap((recipe) => unrestedLine(root, recipe, members, to));
|
|
18
|
+
const counters = carried.length === 0 ? "" : ` Below their maximum, what the party carries: ${carried.join(" · ")}; what comes back at dawn, its text says: give it with change.`;
|
|
19
|
+
return counters === "" && unrested.length === 0 ? [] : [`Dawn came at ${formatGameDate(dawn)}.${counters}`, ...unrested];
|
|
20
|
+
}
|
|
21
|
+
/** When a page last had a recipe that gave it something (RST-1); undefined when never. */
|
|
22
|
+
export function lastApplied(root, recipe, page) {
|
|
23
|
+
const last = readLog(root).filter((entry) => entry.type === recipeAppliedType && comparableText(String(entry.data.page)) === comparableText(page) && entry.data.recipe === recipe.name).at(-1);
|
|
24
|
+
return last === undefined ? undefined : readGameDate(last.date);
|
|
25
|
+
}
|
|
26
|
+
/** The last dawn after `from` and up to `to`; undefined when none falls there. */
|
|
27
|
+
function lastDawn(from, to, minute) {
|
|
28
|
+
const day = (to.minute ?? 0) >= minute ? to.day : to.day - 1;
|
|
29
|
+
const dawn = { day, minute };
|
|
30
|
+
return day >= 1 && minutesBetween(from, dawn) > 0 ? dawn : undefined;
|
|
31
|
+
}
|
|
32
|
+
/** "No long rest in the last 24h: …", for those of the party who had none in its time (RST-1); none when all had one. */
|
|
33
|
+
function unrestedLine(root, recipe, members, now) {
|
|
34
|
+
const every = readDuration(recipe.oncePer ?? "") ?? 0;
|
|
35
|
+
const missing = members.flatMap((member) => {
|
|
36
|
+
const last = lastApplied(root, recipe, member.name);
|
|
37
|
+
return last === undefined ? [`${member.name} (none yet)`] : minutesBetween(last, now) >= every ? [`${member.name} (last at ${formatGameDate(last)})`] : [];
|
|
38
|
+
});
|
|
39
|
+
return missing.length === 0 ? [] : [`No ${recipe.name} in the last ${recipe.oncePer}: ${missing.join(", ")}. If they slept, give it with change and the recipe ${recipe.name}.`];
|
|
40
|
+
}
|
|
@@ -476,6 +476,8 @@ function mergedTimes(times) {
|
|
|
476
476
|
newDayPart: times.map((time) => time.newDayPart).find((part) => part !== "") ?? "",
|
|
477
477
|
// What the party used up at every midnight of every leg (UPK-1).
|
|
478
478
|
upkeep: times.flatMap((time) => time.upkeep ?? []),
|
|
479
|
+
// The last dawn of the journey, as an advance through more than one says it (RST-2).
|
|
480
|
+
dawn: times.map((time) => time.dawn ?? []).findLast((lines) => lines.length > 0) ?? [],
|
|
479
481
|
};
|
|
480
482
|
}
|
|
481
483
|
function namesText(pages) {
|
|
@@ -5,9 +5,9 @@ export type { CardPage, FigureSize };
|
|
|
5
5
|
* The version of the API a package is made for, which its package.json names as rpg-engine.api: the contract its code is given and what its extension.yaml or
|
|
6
6
|
* system.yaml may declare. It goes up with every addition an older engine would refuse or misread, and the engine reads a range (D-515, D-549): 2 added the widgets, 3 an extension's
|
|
7
7
|
* additions to the game system and asking the player, 4 the code in the dashboard's page, 5 one contract for every kind of package, 6 the fields of
|
|
8
|
-
* knowledge of a game system (sheet-knowledge), 7 what a page carries and the pictures of the dashboard's states, 8 where a game system's oracle says yes.
|
|
8
|
+
* knowledge of a game system (sheet-knowledge), 7 what a page carries and the pictures of the dashboard's states, 8 where a game system's oracle says yes, 9 a game system's dawn.
|
|
9
9
|
*/
|
|
10
|
-
export declare const packageApi =
|
|
10
|
+
export declare const packageApi = 9;
|
|
11
11
|
/**
|
|
12
12
|
* Our game systems (D-513): the name a campaign gives each, which package install takes alone, its package, and what it is; the setup offers them even when
|
|
13
13
|
* npm does not answer. A list of names, as our scope is, never a game's code; Ironsworn joins it once it is playable.
|
|
@@ -6,9 +6,9 @@ import { cardPages } from "./api.js";
|
|
|
6
6
|
* The version of the API a package is made for, which its package.json names as rpg-engine.api: the contract its code is given and what its extension.yaml or
|
|
7
7
|
* system.yaml may declare. It goes up with every addition an older engine would refuse or misread, and the engine reads a range (D-515, D-549): 2 added the widgets, 3 an extension's
|
|
8
8
|
* additions to the game system and asking the player, 4 the code in the dashboard's page, 5 one contract for every kind of package, 6 the fields of
|
|
9
|
-
* knowledge of a game system (sheet-knowledge), 7 what a page carries and the pictures of the dashboard's states, 8 where a game system's oracle says yes.
|
|
9
|
+
* knowledge of a game system (sheet-knowledge), 7 what a page carries and the pictures of the dashboard's states, 8 where a game system's oracle says yes, 9 a game system's dawn.
|
|
10
10
|
*/
|
|
11
|
-
export const packageApi =
|
|
11
|
+
export const packageApi = 9;
|
|
12
12
|
/**
|
|
13
13
|
* Our game systems (D-513): the name a campaign gives each, which package install takes alone, its package, and what it is; the setup offers them even when
|
|
14
14
|
* npm does not answer. A list of names, as our scope is, never a game's code; Ironsworn joins it once it is playable.
|
|
@@ -233,6 +233,8 @@ export interface GameSystem {
|
|
|
233
233
|
coinMetals: Record<string, string>;
|
|
234
234
|
/** How long a round lasts, in seconds (D-187, DAT-7). */
|
|
235
235
|
roundSeconds?: number;
|
|
236
|
+
/** The minute of the day dawn comes at, as 360 for 06:00, when the system has one (D-571, RST-2): what comes back at dawn, an advance through it names. */
|
|
237
|
+
dawn?: number;
|
|
236
238
|
/** How many metres its mile and foot are worth, when it has its own (D-262): outputs in imperial use them. */
|
|
237
239
|
imperial?: ImperialUnits;
|
|
238
240
|
/**
|
package/dist/systems/read.js
CHANGED
|
@@ -187,6 +187,7 @@ export function readSystem(folder, name, layers = [], ruleset) {
|
|
|
187
187
|
coins: data.coins,
|
|
188
188
|
coinMetals: data["coin-metals"] ?? {},
|
|
189
189
|
roundSeconds: data.round === undefined ? undefined : Number.parseInt(data.round, 10),
|
|
190
|
+
...(data.dawn === undefined ? {} : { dawn: minuteOfDay(data.dawn) }),
|
|
190
191
|
...(data.imperial === undefined ? {} : { imperial: { mile: readLength(data.imperial.mile) ?? 0, foot: readLength(data.imperial.foot) ?? 0 } }),
|
|
191
192
|
...(data.imperial?.pound === undefined ? {} : { pound: Number.parseFloat(data.imperial.pound) }),
|
|
192
193
|
...(data["length-unit"] === undefined ? {} : { lengthUnit: data["length-unit"] }),
|
|
@@ -469,3 +470,8 @@ function downRule(at) {
|
|
|
469
470
|
const [field, value] = at.split(" ");
|
|
470
471
|
return { field, value: Number(value) };
|
|
471
472
|
}
|
|
473
|
+
/** An hour as the schema took it, as 06:00, in minutes since midnight. */
|
|
474
|
+
function minuteOfDay(hour) {
|
|
475
|
+
const [hours, minutes] = hour.split(":").map(Number);
|
|
476
|
+
return (hours ?? 0) * 60 + (minutes ?? 0);
|
|
477
|
+
}
|
package/dist/systems/schema.d.ts
CHANGED
|
@@ -72,6 +72,7 @@ export declare const systemSchema: z.ZodObject<{
|
|
|
72
72
|
coins: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>;
|
|
73
73
|
"coin-metals": z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
74
74
|
round: z.ZodOptional<z.ZodString>;
|
|
75
|
+
dawn: z.ZodOptional<z.ZodString>;
|
|
75
76
|
imperial: z.ZodOptional<z.ZodObject<{
|
|
76
77
|
mile: z.ZodString;
|
|
77
78
|
foot: z.ZodString;
|
package/dist/systems/schema.js
CHANGED
|
@@ -99,6 +99,7 @@ export const systemSchema = z.object({
|
|
|
99
99
|
coins: z.union([z.string().min(1), z.record(z.string(), z.unknown())]).optional(),
|
|
100
100
|
"coin-metals": z.record(z.string().min(1), z.string().min(1), { error: "write it as a map, each coin with its metal, such as {gp: gold, sp: silver}" }).optional(),
|
|
101
101
|
round: z.string().regex(/^[1-9]\d* seconds?$/, 'write it as "6 seconds"').optional(),
|
|
102
|
+
dawn: z.string().regex(/^([01]?\d|2[0-3]):[0-5]\d$/, 'write it as the hour, such as "06:00"').optional(),
|
|
102
103
|
imperial: z.object({ mile: lengthSchema, foot: lengthSchema, pound: z.string().regex(/^\d+(\.\d+)? kg$/, { error: "write it in kilograms, such as 0.5 kg" }).optional() }).strict().optional(),
|
|
103
104
|
"length-unit": z.string().min(1).optional(),
|
|
104
105
|
"bonus-lists": z.array(z.string().min(1)).optional(),
|
package/instructions/play.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
The story is on. Besides the tools above:
|
|
4
4
|
|
|
5
|
-
- `move`: whenever someone or something goes somewhere, before you narrate it: the party (a journey: `travel`), a person who leaves, whoever climbs into a cart or gets out of it to act, an item given or taken.
|
|
5
|
+
- `move`: whenever someone or something goes somewhere, before you narrate it: the party (a journey: `travel`, and how long it takes: `route`, before anyone says it), a person who leaves, whoever climbs into a cart or gets out of it to act, an item given or taken.
|
|
6
6
|
- `advance`: whenever time passes in the story, in a scene too, before you narrate it: once for a stretch of the story, not for each gesture. When it stops at an event, do as it says, and write the traces where they will be found. A rest the game system has a recipe for, whenever the characters take it: its hours with `advance`, then `change` with the recipe.
|
|
7
7
|
- `scene`: open one when a scene of any kind starts, not only a fight, with the type it is, and close it when it ends: a chase, a heist, a ritual or a race is a challenge; a deal that matters, social. Whoever the character does not know or recognize comes in with `seen`, two or three words of what they see, until `reveal` gives the name.
|
|
8
8
|
- `effect`: every condition or effect on someone (frightened, a curse, a form), how long it lasts and who keeps it alive; it ends by itself.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rpg-engine",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0",
|
|
4
4
|
"description": "Play a tabletop role-playing game with an AI as your game master: the AI tells the story; RPG Engine remembers the world, rolls the dice and keeps the accounts.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
11
11
|
"rpg-engine": {
|
|
12
12
|
"kind": "engine",
|
|
13
|
-
"api":
|
|
13
|
+
"api": 9
|
|
14
14
|
},
|
|
15
15
|
"exports": {
|
|
16
16
|
".": {
|