rpg-engine 0.13.0 → 0.14.1
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/README.md +2 -0
- package/dist/campaign/choices.d.ts +30 -0
- package/dist/campaign/choices.js +84 -0
- package/dist/campaign/index.d.ts +4 -1
- package/dist/campaign/index.js +4 -1
- package/dist/campaign/last-choices.d.ts +6 -0
- package/dist/campaign/last-choices.js +34 -0
- package/dist/campaign/levels.d.ts +50 -0
- package/dist/campaign/levels.js +189 -0
- package/dist/campaign/settings.d.ts +35 -13
- package/dist/campaign/settings.js +20 -51
- package/dist/commands/ask.d.ts +8 -0
- package/dist/commands/ask.js +2 -1
- package/dist/commands/change/change.js +6 -4
- package/dist/commands/choices.d.ts +64 -0
- package/dist/commands/choices.js +216 -0
- package/dist/commands/config.d.ts +8 -1
- package/dist/commands/config.js +165 -21
- package/dist/commands/index.js +2 -0
- package/dist/commands/init.d.ts +1 -0
- package/dist/commands/init.js +8 -4
- package/dist/commands/rename.js +8 -3
- package/dist/commands/save.d.ts +1 -1
- package/dist/commands/shared/experience.d.ts +9 -2
- package/dist/commands/shared/experience.js +42 -7
- package/dist/commands/shared/knowledge.d.ts +2 -0
- package/dist/commands/shared/knowledge.js +5 -0
- package/dist/commands/shared/mode.js +10 -3
- package/dist/commands/shared/offers.d.ts +3 -1
- package/dist/commands/shared/offers.js +6 -1
- package/dist/commands/shared/rules.js +5 -1
- package/dist/commands/shared/time.d.ts +6 -0
- package/dist/commands/shared/time.js +35 -3
- package/dist/commands/shared/upkeep.js +3 -3
- package/dist/commands/shared/world.js +7 -4
- package/dist/commands/status.d.ts +2 -0
- package/dist/commands/status.js +15 -7
- package/dist/commands/view/view.js +10 -7
- package/dist/commands/write/write.js +5 -2
- package/dist/dashboard/address.js +8 -1
- package/dist/dashboard/api.js +20 -0
- package/dist/dashboard/app.js +18 -6
- package/dist/dashboard/choices.js +343 -0
- package/dist/dashboard/guide/ar.md +12 -10
- package/dist/dashboard/guide/cs.md +12 -10
- package/dist/dashboard/guide/da.md +13 -11
- package/dist/dashboard/guide/de.md +12 -10
- package/dist/dashboard/guide/el.md +14 -12
- package/dist/dashboard/guide/en.md +11 -9
- package/dist/dashboard/guide/es.md +12 -10
- package/dist/dashboard/guide/fi.md +12 -10
- package/dist/dashboard/guide/fr.md +12 -10
- package/dist/dashboard/guide/he.md +12 -10
- package/dist/dashboard/guide/hi.md +12 -10
- package/dist/dashboard/guide/hu.md +12 -10
- package/dist/dashboard/guide/is.md +13 -11
- package/dist/dashboard/guide/it.md +12 -10
- package/dist/dashboard/guide/ja.md +12 -10
- package/dist/dashboard/guide/ko.md +14 -12
- package/dist/dashboard/guide/nb.md +13 -11
- package/dist/dashboard/guide/nl.md +12 -10
- package/dist/dashboard/guide/pl.md +12 -10
- package/dist/dashboard/guide/pt.md +12 -10
- package/dist/dashboard/guide/ro.md +12 -10
- package/dist/dashboard/guide/ru.md +12 -10
- package/dist/dashboard/guide/sv.md +12 -10
- package/dist/dashboard/guide/tr.md +12 -10
- package/dist/dashboard/guide/uk.md +13 -11
- package/dist/dashboard/guide/zh.md +12 -10
- package/dist/dashboard/i18n/ar.json +80 -0
- package/dist/dashboard/i18n/cs.json +80 -0
- package/dist/dashboard/i18n/da.json +80 -0
- package/dist/dashboard/i18n/de.json +80 -0
- package/dist/dashboard/i18n/el.json +80 -0
- package/dist/dashboard/i18n/es.json +80 -0
- package/dist/dashboard/i18n/fi.json +80 -0
- package/dist/dashboard/i18n/fr.json +80 -0
- package/dist/dashboard/i18n/he.json +80 -0
- package/dist/dashboard/i18n/hi.json +80 -0
- package/dist/dashboard/i18n/hu.json +80 -0
- package/dist/dashboard/i18n/is.json +80 -0
- package/dist/dashboard/i18n/it.json +80 -0
- package/dist/dashboard/i18n/ja.json +80 -0
- package/dist/dashboard/i18n/ko.json +80 -0
- package/dist/dashboard/i18n/nb.json +80 -0
- package/dist/dashboard/i18n/nl.json +80 -0
- package/dist/dashboard/i18n/pl.json +80 -0
- package/dist/dashboard/i18n/pt.json +80 -0
- package/dist/dashboard/i18n/ro.json +80 -0
- package/dist/dashboard/i18n/ru.json +80 -0
- package/dist/dashboard/i18n/sv.json +80 -0
- package/dist/dashboard/i18n/tr.json +80 -0
- package/dist/dashboard/i18n/uk.json +80 -0
- package/dist/dashboard/i18n/zh.json +80 -0
- package/dist/dashboard/icons.js +4 -0
- package/dist/dashboard/labels.js +32 -0
- package/dist/dashboard/party.js +13 -5
- package/dist/dashboard/settings.js +89 -40
- package/dist/dashboard/setup.js +1 -1
- package/dist/dashboard/sheet.js +3 -2
- package/dist/dashboard/style.css +744 -6
- package/dist/dashboard/top.js +8 -4
- package/dist/server/dashboard/choices.d.ts +41 -0
- package/dist/server/dashboard/choices.js +176 -0
- package/dist/server/dashboard/index.js +17 -1
- package/dist/time/game-date.d.ts +9 -0
- package/dist/time/game-date.js +9 -0
- package/dist/time/index.d.ts +1 -1
- package/dist/time/index.js +1 -1
- package/instructions/dashboard-guide.md +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// What the campaign's game system offers of the engine's settings (DAT-16), the settings of its own that a value asks (DAT-17), and the parts its values choose (DAT-18).
|
|
2
|
-
import { readSettings, settingNames } from "../../campaign/index.js";
|
|
2
|
+
import { customLevel, customLevels, customSettings, readOneSetting, readSettings, settingNames } from "../../campaign/index.js";
|
|
3
3
|
import { sameWord } from "../../core/text.js";
|
|
4
4
|
import { engineOfferings, engineSettingValue, heldSettings, offeredEngineValues, playedValueOf, readableSystems } from "../../systems/index.js";
|
|
5
5
|
import { partText } from "./parts.js";
|
|
@@ -17,6 +17,11 @@ export function offeredValues(root, context, name) {
|
|
|
17
17
|
export function playedEngineSetting(root, context, name) {
|
|
18
18
|
return engineSettingValue(campaignSystem(root, context), played(root, context), name, readSettings(root)[name]);
|
|
19
19
|
}
|
|
20
|
+
/** The level the campaign plays an item of the rigor at (DAT-16, T-132): the rigor played, or the item's own when it is custom; undefined while it is to be asked. */
|
|
21
|
+
export function playedRigor(root, context, item) {
|
|
22
|
+
const rigor = playedEngineSetting(root, context, "rigor");
|
|
23
|
+
return rigor === customLevel ? customLevels("rigor", readOneSetting(root, customSettings.rigor))[item] : typeof rigor === "string" ? rigor : undefined;
|
|
24
|
+
}
|
|
20
25
|
/** Whether the game plays an engine's setting with one value alone (DAT-16): no choice, never asked nor shown to the player. */
|
|
21
26
|
export function isFixedSetting(root, context, name) {
|
|
22
27
|
return offeredValues(root, context, name)?.length === 1;
|
|
@@ -67,7 +67,11 @@ function translatedBook(book, translations, system, words) {
|
|
|
67
67
|
const aliased = files.flatMap((file) => {
|
|
68
68
|
const own = book.filter((section) => section.file === file);
|
|
69
69
|
const other = translated.filter((section) => section.file === file);
|
|
70
|
-
|
|
70
|
+
if (isParallel(own, other, words)) {
|
|
71
|
+
return other.map((section, index) => ({ ...section, alias: own[index].path }));
|
|
72
|
+
}
|
|
73
|
+
// A chapter whose sections do not match still has its own title: the system's outputs name it so.
|
|
74
|
+
return other.map((section, index) => (index === 0 && own.length > 0 && section.level === own[0].level ? { ...section, alias: own[0].path } : section));
|
|
71
75
|
});
|
|
72
76
|
return [...book.filter((section) => !files.includes(section.file)), ...aliased].sort((first, second) => (first.file < second.file ? -1 : first.file > second.file ? 1 : 0));
|
|
73
77
|
}
|
|
@@ -21,6 +21,12 @@ export declare function problemText(problem: Problem): string;
|
|
|
21
21
|
export declare function newDatedLogEntry(root: string, context: Context, type: string, visibility: LogEntry["visibility"], data: Record<string, unknown>): LogEntry;
|
|
22
22
|
/** The problems of the game time: a state.yaml that cannot give the game date, a calendar or its start that do not read. The planned events have their own (eventProblems). */
|
|
23
23
|
export declare function timeProblems(root: string, context: Context): Problem[];
|
|
24
|
+
/**
|
|
25
|
+
* The game time to let pass before a new session (D-133): when at least an hour of real time has passed since the last move and the game time runs between
|
|
26
|
+
* sessions, the real time gone, the game time it makes and how to let it pass; nothing when the game time stops between sessions, the default. A move is the
|
|
27
|
+
* master's: a page changed by hand or the player's change on the dashboard between sessions is none.
|
|
28
|
+
*/
|
|
29
|
+
export declare function timeBetweenSessions(root: string, context: Context, now: GameDate): string | undefined;
|
|
24
30
|
/** The campaign's calendar (TIM-8): campaign.yaml's, else an extension's, else the core's real months; and its start. Read once until campaign.yaml changes. */
|
|
25
31
|
export declare function campaignCalendar(root: string, context: Context): CampaignCalendar;
|
|
26
32
|
/** The day of the calendar that a game day falls on; undefined without a calendar or its start. */
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
// The game time as several commands use it: the present date from state.yaml, the log lines stamped with it, and the calendar that shows it.
|
|
2
2
|
import { resolve } from "node:path";
|
|
3
3
|
import { campaignFileName, readOneSetting, readState, readTextSetting } from "../../campaign/index.js";
|
|
4
|
-
import { newLogEntry } from "../../core/log.js";
|
|
4
|
+
import { newLogEntry, readLog } from "../../core/log.js";
|
|
5
5
|
import { files } from "../../core/store.js";
|
|
6
6
|
import { isEmptyField } from "../../pages/index.js";
|
|
7
|
-
import { calendarDay, formatCalendarDay, formatGameDate, readCalendar, readCalendarStart, readGameDate, realCalendar } from "../../time/index.js";
|
|
7
|
+
import { calendarDay, formatCalendarDay, formatDuration, formatGameDate, lastGameDay, minutesBetween, readBetweenSessions, readCalendar, readCalendarStart, readGameDate, realCalendar, } from "../../time/index.js";
|
|
8
8
|
import { campaignExtensions, extensionSources } from "./packages/extensions.js";
|
|
9
|
+
// The setting of the game time between sessions (D-133).
|
|
10
|
+
const betweenSessionsSetting = "between-sessions";
|
|
9
11
|
/** The present of the game: its date, or the problem that keeps state.yaml from giving one; neither before the game has a date. */
|
|
10
12
|
export function readPresent(root) {
|
|
11
13
|
let text;
|
|
@@ -41,7 +43,26 @@ export function newDatedLogEntry(root, context, type, visibility, data) {
|
|
|
41
43
|
/** The problems of the game time: a state.yaml that cannot give the game date, a calendar or its start that do not read. The planned events have their own (eventProblems). */
|
|
42
44
|
export function timeProblems(root, context) {
|
|
43
45
|
const { problem } = readPresent(root);
|
|
44
|
-
return [...(problem === undefined ? [] : [problem]), ...campaignCalendar(root, context).problems];
|
|
46
|
+
return [...(problem === undefined ? [] : [problem]), ...campaignCalendar(root, context).problems, ...betweenSessionsProblems(root)];
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The game time to let pass before a new session (D-133): when at least an hour of real time has passed since the last move and the game time runs between
|
|
50
|
+
* sessions, the real time gone, the game time it makes and how to let it pass; nothing when the game time stops between sessions, the default. A move is the
|
|
51
|
+
* master's: a page changed by hand or the player's change on the dashboard between sessions is none.
|
|
52
|
+
*/
|
|
53
|
+
export function timeBetweenSessions(root, context, now) {
|
|
54
|
+
const written = readTextSetting(root, betweenSessionsSetting);
|
|
55
|
+
const rate = written === undefined ? undefined : readBetweenSessions(written);
|
|
56
|
+
const last = readLog(root).findLast((entry) => entry.by !== "outside" && entry.by !== "player");
|
|
57
|
+
const realMinutes = last === undefined ? 0 : Math.floor((context.now().getTime() - Date.parse(last.at)) / 60_000);
|
|
58
|
+
if (rate === undefined || rate === "stops" || !(realMinutes >= 60)) {
|
|
59
|
+
return undefined;
|
|
60
|
+
}
|
|
61
|
+
// No further than the last day the game counts, which advance would refuse.
|
|
62
|
+
const gameMinutes = Math.min(Math.floor((realMinutes / rate.real) * rate.game), minutesBetween(now, { day: lastGameDay }));
|
|
63
|
+
return gameMinutes < 1 ? undefined : `${formatDuration(realMinutes)} of real time since the last move, and between sessions the game time runs `
|
|
64
|
+
+ `${formatDuration(rate.game)} per ${formatDuration(rate.real)}: if this is a new session, call advance by ${formatDuration(gameMinutes)} before you open it, `
|
|
65
|
+
+ "and let the opening tell what the world did meanwhile.";
|
|
45
66
|
}
|
|
46
67
|
/** The campaign's calendar (TIM-8): campaign.yaml's, else an extension's, else the core's real months; and its start. Read once until campaign.yaml changes. */
|
|
47
68
|
export function campaignCalendar(root, context) {
|
|
@@ -57,6 +78,17 @@ export function datedText(root, context, date) {
|
|
|
57
78
|
const day = calendarDayOf(root, context, date.day);
|
|
58
79
|
return day === undefined ? formatGameDate(date) : `${formatGameDate(date)} (${formatCalendarDay(day)})`;
|
|
59
80
|
}
|
|
81
|
+
/** A between-sessions setting that does not read as stops or a rate: the game time stops between sessions until it is fixed. */
|
|
82
|
+
function betweenSessionsProblems(root) {
|
|
83
|
+
const written = readTextSetting(root, betweenSessionsSetting);
|
|
84
|
+
return written === undefined || readBetweenSessions(written) !== undefined
|
|
85
|
+
? []
|
|
86
|
+
: [{
|
|
87
|
+
path: campaignFileName,
|
|
88
|
+
message: `between-sessions: "${written}" is neither stops nor a rate of game time to real time, so the game time stops between sessions.`,
|
|
89
|
+
fix: "set it with config between-sessions, such as 1d per 7d, or stops",
|
|
90
|
+
}];
|
|
91
|
+
}
|
|
60
92
|
function readCampaignCalendar(root, context) {
|
|
61
93
|
const problem = (error, fix) => ({ path: campaignFileName, message: error instanceof Error ? error.message : String(error), fix });
|
|
62
94
|
const { calendar: brought, problems } = extensionsCalendar(root, context);
|
|
@@ -6,7 +6,7 @@ import { formatAmount, payCoins, readAmount, totalOf } from "../../money/index.j
|
|
|
6
6
|
import { baseChain, heldStacksOfKind, kindNamed, locate, writePage } from "../../pages/index.js";
|
|
7
7
|
import { effectiveFields } from "./effect-layer.js";
|
|
8
8
|
import { campaignCoins } from "./money.js";
|
|
9
|
-
import {
|
|
9
|
+
import { playedRigor } from "./offers.js";
|
|
10
10
|
import { firstInChat } from "./parts.js";
|
|
11
11
|
import { partyPages } from "./recipes.js";
|
|
12
12
|
import { writeStacks } from "./stacks.js";
|
|
@@ -18,8 +18,8 @@ const settlementKinds = ["city", "town", "village", "inn"];
|
|
|
18
18
|
/** The upkeep of each midnight passed (UPK-1–UPK-3), for the party members who keep a sheet, under the rigor «rules» or «simulation»; the lines that say it. */
|
|
19
19
|
export function dailyUpkeep(root, context, system, days) {
|
|
20
20
|
const upkeep = system?.upkeep;
|
|
21
|
-
// As the game plays it: one that fixes it to smooth counts nothing (DAT-16).
|
|
22
|
-
const rigor =
|
|
21
|
+
// As the game plays it: one that fixes it to smooth counts nothing (DAT-16); a custom one, by its food (T-132).
|
|
22
|
+
const rigor = playedRigor(root, context, "food");
|
|
23
23
|
if (upkeep === undefined || days <= 0 || (rigor !== "rules" && rigor !== "simulation")) {
|
|
24
24
|
return [];
|
|
25
25
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// The campaign's world and game system as the commands read them: the system with the layers over it, the settings it plays with, and the world built from both.
|
|
2
2
|
import { join, resolve } from "node:path";
|
|
3
|
-
import { campaignFileName, readCampaignData, readOneSetting, readTextSetting } from "../../campaign/index.js";
|
|
3
|
+
import { campaignFileName, customLevel, customLevels, customSettings, readCampaignData, readOneSetting, readTextSetting } from "../../campaign/index.js";
|
|
4
4
|
import { ourSystems } from "../../core/package-declarations.js";
|
|
5
5
|
import { files, isInside } from "../../core/store.js";
|
|
6
6
|
import { comparableText } from "../../core/text.js";
|
|
@@ -255,12 +255,15 @@ export function languageName(code) {
|
|
|
255
255
|
/** What the game system counts itself, for a rigor's meaning (UPK-1, UPK-3): the day's food, and what burns, by its first name. */
|
|
256
256
|
export function countedByGame(system) {
|
|
257
257
|
const burning = Object.keys(system?.burning ?? {})[0];
|
|
258
|
-
return { upkeep: system?.upkeep !== undefined, ...(burning === undefined ? {} : { burning }) };
|
|
258
|
+
return { upkeep: system?.upkeep !== undefined, lifestyle: system?.upkeep?.lifestyle !== undefined, ...(burning === undefined ? {} : { burning }) };
|
|
259
259
|
}
|
|
260
|
-
/**
|
|
260
|
+
/**
|
|
261
|
+
* The rigor as the game plays it (DAT-16): with the values of the system's settings as campaign.yaml writes them, as the world reads before its players; a custom
|
|
262
|
+
* one as the level of its load, the item formulas read it for (T-132).
|
|
263
|
+
*/
|
|
261
264
|
function rigorPlayed(root, system) {
|
|
262
265
|
const value = engineSettingValue(system, (setting) => systemSettingValue(root, setting), "rigor", readTextSetting(root, "rigor"));
|
|
263
|
-
return typeof value === "string" ? value : undefined;
|
|
266
|
+
return value === customLevel ? customLevels("rigor", readOneSetting(root, customSettings.rigor)).load : typeof value === "string" ? value : undefined;
|
|
264
267
|
}
|
|
265
268
|
/**
|
|
266
269
|
* The game system campaign.yaml names, with what its extensions and then the campaign add to it (CAM-2), and the layers left out with why (CAM-3), as its
|
|
@@ -46,6 +46,7 @@ export declare const status: import("../core/registry.ts").Command<z.ZodObject<{
|
|
|
46
46
|
sceneCounts: string;
|
|
47
47
|
openQuests: string[];
|
|
48
48
|
now: string | undefined;
|
|
49
|
+
betweenSessions: string | undefined;
|
|
49
50
|
dateProblem: string | undefined;
|
|
50
51
|
datedEvents: boolean;
|
|
51
52
|
dueEvents: string[];
|
|
@@ -58,6 +59,7 @@ export declare const status: import("../core/registry.ts").Command<z.ZodObject<{
|
|
|
58
59
|
halfLoaded: number | undefined;
|
|
59
60
|
sheet: SheetSummary | undefined;
|
|
60
61
|
incompleteSheets: string[];
|
|
62
|
+
choices: string[];
|
|
61
63
|
levelsDue: string[];
|
|
62
64
|
}>;
|
|
63
65
|
export {};
|
package/dist/commands/status.js
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import { houseRulesFolderName, readSettings, requireCampaign, settingMeaning } from "../campaign/index.js";
|
|
3
|
+
import { customSettings, houseRulesFolderName, readOneSetting, readSettings, requireCampaign, settingMeaning } from "../campaign/index.js";
|
|
4
4
|
import { defineCommand } from "../core/registry.js";
|
|
5
5
|
import { isInParty, isPartyMember, isPlayerCharacter, locate, pagesWithName, parsePageReference, playerCharacters } from "../pages/index.js";
|
|
6
6
|
import { bookTitles, readRuleBook } from "../rules/index.js";
|
|
7
7
|
import { sceneTypes } from "../scene/index.js";
|
|
8
8
|
import { rulesetSetting } from "../systems/index.js";
|
|
9
|
+
import { choicesNotes } from "./choices.js";
|
|
9
10
|
import { importLine } from "./import/import.js";
|
|
10
11
|
import { allStateChecks, markStateChecksTold } from "./shared/checks.js";
|
|
11
12
|
import { effectiveFields, effectsOf } from "./shared/effect-layer.js";
|
|
12
13
|
import { effectShown, keptEffects } from "./shared/effects.js";
|
|
13
14
|
import { surroundings, surroundingsText } from "./shared/environment.js";
|
|
14
15
|
import { clocksToMove, dueAdvice, dueText, isDated, isDue, plannedEvents, plannedText, worldFacts } from "./shared/events.js";
|
|
15
|
-
import { experienceOf, levelDueNote } from "./shared/experience.js";
|
|
16
|
+
import { experienceOf, levelDueNote, levelWay } from "./shared/experience.js";
|
|
16
17
|
import { picturesNote } from "./shared/images.js";
|
|
17
18
|
import { journeyText, readJourney } from "./shared/journey.js";
|
|
18
19
|
import { campaignMode, campaignNote } from "./shared/mode.js";
|
|
19
20
|
import { campaignCoins } from "./shared/money.js";
|
|
20
21
|
import { livingMood, masterMood } from "./shared/moods.js";
|
|
21
|
-
import { heldSystemSettings, isFixedSetting, playedEngineSetting } from "./shared/offers.js";
|
|
22
|
+
import { heldSystemSettings, isFixedSetting, playedEngineSetting, playedRigor } from "./shared/offers.js";
|
|
22
23
|
import { installableSystems } from "./shared/packages/catalog.js";
|
|
23
24
|
import { packageCodeProblems } from "./shared/packages/code.js";
|
|
24
25
|
import { extensionsLine } from "./shared/packages/extensions.js";
|
|
@@ -30,7 +31,7 @@ import { measuresOf, roadsOf } from "./shared/roads.js";
|
|
|
30
31
|
import { interruptedLoad } from "./shared/saves.js";
|
|
31
32
|
import { closedScenes, copyCounters, copyPage, partyAwayText, readOpenScene } from "./shared/scene.js";
|
|
32
33
|
import { missingSheetFields, overLoad, sheetSummary } from "./shared/sheet.js";
|
|
33
|
-
import { datedText, problemText, readPresent } from "./shared/time.js";
|
|
34
|
+
import { datedText, problemText, readPresent, timeBetweenSessions } from "./shared/time.js";
|
|
34
35
|
import { campaignSystem, campaignWorld, countedByGame, playedSettingValue, systemInStatus } from "./shared/world.js";
|
|
35
36
|
import { translationOffer } from "./translate.js";
|
|
36
37
|
// Lists in the status show this many names, then say how many more there are and how to find them.
|
|
@@ -55,7 +56,8 @@ export const status = defineCommand({
|
|
|
55
56
|
const value = isFixedSetting(root, context, name) ? undefined : playedEngineSetting(root, context, name);
|
|
56
57
|
return typeof value === "string" ? value : undefined;
|
|
57
58
|
};
|
|
58
|
-
|
|
59
|
+
// The load is counted by its own level when the rigor is custom (T-132).
|
|
60
|
+
const rigor = playedRigor(root, context, "load");
|
|
59
61
|
const world = campaignWorld(root, context);
|
|
60
62
|
const characters = world.pages.filter((page) => page.type === "character");
|
|
61
63
|
const players = playerCharacters(world);
|
|
@@ -124,7 +126,7 @@ export const status = defineCommand({
|
|
|
124
126
|
// What the chosen difficulty and rigor mean in play, one line each (D-263).
|
|
125
127
|
meanings: ["difficulty", "rigor"].flatMap((name) => {
|
|
126
128
|
const value = played(name);
|
|
127
|
-
const meaning = settingMeaning(name, value, countedByGame(system));
|
|
129
|
+
const meaning = settingMeaning(name, value, countedByGame(system), readOneSetting(root, customSettings[name]));
|
|
128
130
|
return meaning === undefined ? [] : [`${name.charAt(0).toUpperCase()}${name.slice(1)} ${value}: ${meaning}.`];
|
|
129
131
|
}),
|
|
130
132
|
// Before play, what the next mode needs and how to enter it; in play, the settings still missing (MOD-7).
|
|
@@ -169,6 +171,8 @@ export const status = defineCommand({
|
|
|
169
171
|
sceneCounts: sceneCounts(closed),
|
|
170
172
|
openQuests: openQuests(world, now),
|
|
171
173
|
now: now === undefined ? undefined : datedText(root, context, now),
|
|
174
|
+
// In play, the game time to let pass when the last move is an hour old or more and the time runs between sessions (D-133).
|
|
175
|
+
betweenSessions: mode === "play" && now !== undefined ? timeBetweenSessions(root, context, now) : undefined,
|
|
172
176
|
dateProblem: present.problem === undefined ? undefined : problemText(present.problem),
|
|
173
177
|
datedEvents: events.some(isDated),
|
|
174
178
|
dueEvents: due.map(dueText),
|
|
@@ -189,7 +193,9 @@ export const status = defineCommand({
|
|
|
189
193
|
return missing.length === 0 ? [] : [`${characterName(page)}'s sheet still lacks, by these names: ${missing.join(", ")}.`];
|
|
190
194
|
}),
|
|
191
195
|
// A level the points reach, until the classes rise (PRO-6).
|
|
192
|
-
|
|
196
|
+
// The choices on the player's dashboard (D-556).
|
|
197
|
+
choices: choicesNotes(root, context, world, system),
|
|
198
|
+
levelsDue: characters.filter(isInParty).flatMap((page) => levelDueNote(characterName(page), experienceOf(world, effectiveFields(world, page)), page.fields.role === "companion", levelWay(root, context, page.name)) ?? []),
|
|
193
199
|
};
|
|
194
200
|
},
|
|
195
201
|
format(result) {
|
|
@@ -210,6 +216,7 @@ export const status = defineCommand({
|
|
|
210
216
|
result.extensions,
|
|
211
217
|
result.houseRules.length === 0 ? "" : `House rules (rules): ${result.houseRules.join(", ")}`,
|
|
212
218
|
timeLine(result),
|
|
219
|
+
result.betweenSessions ?? "",
|
|
213
220
|
...(result.players.length === 0 ? [`No player character yet.${sheetNote(result.sheet)}`] : result.players.map((member) => `PC: ${member.name}${whereabouts(member)}${memberCounters(member)}`)),
|
|
214
221
|
...result.around.map((one) => `Around ${one.who.join(" and ")}: ${one.text}`),
|
|
215
222
|
namesLine("Companions", result.companions.map(companion), "find text companion, type character", "; "),
|
|
@@ -220,6 +227,7 @@ export const status = defineCommand({
|
|
|
220
227
|
result.mood === "neutral" ? "" : `Your mood is ${result.mood}: let your voice follow it.`,
|
|
221
228
|
...result.incompleteSheets,
|
|
222
229
|
...result.levelsDue,
|
|
230
|
+
...result.choices,
|
|
223
231
|
namesLine("Also there", result.alsoThere, result.place === undefined ? "find" : `show ${result.place}`),
|
|
224
232
|
result.scene === undefined ? "" : `Scene: ${result.scene}`,
|
|
225
233
|
result.journey === undefined ? "" : `Journey: ${result.journey}`,
|
|
@@ -10,13 +10,14 @@ import { readEffect } from "../../effects/index.js";
|
|
|
10
10
|
import { readAmount } from "../../money/index.js";
|
|
11
11
|
import { declaredKind, entryPage, isPartyMember, isPlayerCharacter, locate, pagesWithName, pagesWithNameOrAlias, parsePageReference, playerCharacters, secretNames, systemPageNamed, textsIn, } from "../../pages/index.js";
|
|
12
12
|
import { formatGameDate } from "../../time/index.js";
|
|
13
|
+
import { offeredPages } from "../choices.js";
|
|
13
14
|
import { setupQuestions, shownPlayerSettings } from "../config.js";
|
|
14
15
|
import { importShown } from "../import/import.js";
|
|
15
16
|
import { effectiveFields, effectsOf } from "../shared/effect-layer.js";
|
|
16
17
|
import { effectShown } from "../shared/effects.js";
|
|
17
18
|
import { shownImage } from "../shared/images.js";
|
|
18
19
|
import { readJourney } from "../shared/journey.js";
|
|
19
|
-
import { discoveredSecrets, knowledgeOf, knownIntroduction, knownPart, knownSecretsApart, knownText, knowsPage, pageKnownBy, playerKnowledge, playerStory, scenesLivedBy, secretKnownBy } from "../shared/knowledge.js";
|
|
20
|
+
import { discoveredSecrets, knowledgeOf, knownIntroduction, knownPart, knownSecretsApart, knownText, knowsPage, pageKnownBy, playerKnowledge, playerStory, scenesLivedBy, secretKnownBy, withPagesKnown, } from "../shared/knowledge.js";
|
|
20
21
|
import { blockingMode, campaignMode, modes } from "../shared/mode.js";
|
|
21
22
|
import { campaignCoins } from "../shared/money.js";
|
|
22
23
|
import { lastMoment, livingMood, masterMood } from "../shared/moods.js";
|
|
@@ -155,28 +156,30 @@ export const view = defineCommand({
|
|
|
155
156
|
throw new Error("Give page or diary, not both: diary goes with the whole view.");
|
|
156
157
|
}
|
|
157
158
|
const reference = parsePageReference(input.page);
|
|
158
|
-
|
|
159
|
+
// The player reads the pages their choices waiting offer, to choose (VIEW-2); never a character agent.
|
|
160
|
+
const readable = input.as === undefined ? withPagesKnown(knowledge, offeredPages(root, world)) : knowledge;
|
|
161
|
+
const page = knownPage(world, readable, reference.name);
|
|
159
162
|
const system = campaignSystem(root, context);
|
|
160
163
|
if (page === undefined) {
|
|
161
|
-
return { kind: "unknown", text: `${knowerText(
|
|
164
|
+
return { kind: "unknown", text: `${knowerText(readable)} ${reference.name}.` };
|
|
162
165
|
}
|
|
163
166
|
// The sheet of the one whose view it is, and of the party when they are of it (VIEW-3, VIEW-10).
|
|
164
167
|
const party = page === pc || (isPartyMember(pc) && isPartyMember(page));
|
|
165
168
|
if (reference.section !== undefined && reference.section !== "") {
|
|
166
|
-
const part = knownPart(world,
|
|
169
|
+
const part = knownPart(world, readable, page, reference.section);
|
|
167
170
|
// A group of the sheet of the character or a companion, as show gives it (DAT-2).
|
|
168
171
|
const group = part === undefined && party ? sheetGroup(world, system, page, reference.section) : undefined;
|
|
169
172
|
if (part === undefined && group === undefined) {
|
|
170
|
-
return { kind: "unknown", text: `${
|
|
173
|
+
return { kind: "unknown", text: `${readable.each === undefined ? `${pc.name} knows nothing` : "No player character knows anything"} of ${page.name} called ${reference.section}.` };
|
|
171
174
|
}
|
|
172
175
|
// Who knows the secret, or the page, when not all the player characters do (VIEW-12).
|
|
173
176
|
const secret = secretNames(page.body).find((name) => comparableText(name) === comparableText(reference.section ?? ""));
|
|
174
|
-
const knownBy = part === undefined ? undefined : secret === undefined ? pageKnownBy(
|
|
177
|
+
const knownBy = part === undefined ? undefined : secret === undefined ? pageKnownBy(readable, page) : secretKnownBy(readable, page, secret);
|
|
175
178
|
return { kind: "section", title: `${page.name}#${group?.name ?? reference.section}`, lines: group?.lines ?? [], text: part ?? "", ...(knownBy === undefined ? {} : { knownBy }) };
|
|
176
179
|
}
|
|
177
180
|
// The system's pages it shows, in the campaign's language where the system has no translation (D-539).
|
|
178
181
|
wantTexts(root, context, world, [page]);
|
|
179
|
-
return shownPage(root, context, world,
|
|
182
|
+
return shownPage(root, context, world, readable, page, party);
|
|
180
183
|
}
|
|
181
184
|
const { coins } = campaignCoins(root, context);
|
|
182
185
|
const system = campaignSystem(root, context);
|
|
@@ -12,7 +12,7 @@ import { featureParts, mergedFeatures } from "../../progression/index.js";
|
|
|
12
12
|
import { bondNotes, checkBonds } from "../shared/bonds.js";
|
|
13
13
|
import { effectiveFields, effectsField } from "../shared/effect-layer.js";
|
|
14
14
|
import { conditionNotes, consequencesNotes, eventFieldsProblem, fireEvents, heldNote, nowDueNote, plannedEventDateProblem } from "../shared/events.js";
|
|
15
|
-
import { experienceOf, leastNotes, newLevelNotes } from "../shared/experience.js";
|
|
15
|
+
import { experienceOf, leastNotes, levelWay, newLevelNotes, settleChoices } from "../shared/experience.js";
|
|
16
16
|
import { gridNotes } from "../shared/grids.js";
|
|
17
17
|
import { questPictureNote } from "../shared/images.js";
|
|
18
18
|
import { fieldValues } from "../shared/inputs.js";
|
|
@@ -161,7 +161,10 @@ export const write = defineCommand({
|
|
|
161
161
|
const [before, after] = [existing === undefined ? undefined : experienceOf(world, effectiveFields(world, existing)), experienceOf(now, effectiveFields(now, page))];
|
|
162
162
|
const companion = page.fields.role === "companion";
|
|
163
163
|
const levelUp = () => situationPart("level-up", context, system);
|
|
164
|
-
|
|
164
|
+
if (changed && isPartyMember(page)) {
|
|
165
|
+
settleChoices(root, page.name, before, after);
|
|
166
|
+
}
|
|
167
|
+
const levels = changed && isPartyMember(page) ? [...newLevelNotes(page.name, before, after, companion, levelUp, levelWay(root, context, page.name)), ...leastNotes(page.name, before, after)] : [];
|
|
165
168
|
const leftOut = changed ? changedFieldNames(fields).flatMap((field) => leftOutNote(root, context, field) ?? []) : [];
|
|
166
169
|
const opened = newQuestNotes(existing, page);
|
|
167
170
|
const picture = opened.length === 0 ? undefined : questPictureNote(root, context, now, page);
|
|
@@ -8,11 +8,13 @@ export const sections = ["party", "scene", "journal", "world"];
|
|
|
8
8
|
export const menuPages = ["saves", "help", "settings", "packages", "about"];
|
|
9
9
|
/** A package's own page, as #/pkg/<package>/<name>, reached from its row in Packages and by its address (D-511). */
|
|
10
10
|
export const packagePages = "pkg";
|
|
11
|
+
/** The choices the master prepared for one of the party, as #/choices/Bruna, with an option's page open, as #/choices/Bruna/Sonno (D-556): the Party's own. */
|
|
12
|
+
export const choicesPage = "choices";
|
|
11
13
|
/** The address a hash says, as #/party/Ettore; the sheet for none or one the page does not know. */
|
|
12
14
|
export function readAddress(hash) {
|
|
13
15
|
const [, written = "", ...rest] = hash.replace(/^#/, "").split("/");
|
|
14
16
|
const first = written === "combat" ? "scene" : written;
|
|
15
|
-
const section = [...sections, ...menuPages, packagePages].find((candidate) => candidate === first) ?? "party";
|
|
17
|
+
const section = [...sections, ...menuPages, packagePages, choicesPage].find((candidate) => candidate === first) ?? "party";
|
|
16
18
|
const sheet = first === "party" || first === "character";
|
|
17
19
|
const known = section === first;
|
|
18
20
|
const tab = sheet || !known ? "" : decoded(rest[0] ?? "");
|
|
@@ -23,6 +25,10 @@ export function readAddress(hash) {
|
|
|
23
25
|
export function sectionAddress(section, tab, name) {
|
|
24
26
|
return [`#/${section}`, ...(tab === undefined ? [] : [encodeURIComponent(tab)]), ...(tab === undefined || name === undefined ? [] : [encodeURIComponent(name)])].join("/");
|
|
25
27
|
}
|
|
28
|
+
/** The address of someone's choices, as #/choices/Bruna, or of an option's page among them, as #/choices/Bruna/Sonno: whose they are in the tab's place. */
|
|
29
|
+
export function choicesAddress(who, page) {
|
|
30
|
+
return sectionAddress(choicesPage, who, page);
|
|
31
|
+
}
|
|
26
32
|
/** A section's name as the page writes it, in its language: Scene. */
|
|
27
33
|
export function sectionLabel(section) {
|
|
28
34
|
const labels = {
|
|
@@ -36,6 +42,7 @@ export function sectionLabel(section) {
|
|
|
36
42
|
packages: t("Packages"),
|
|
37
43
|
about: t("About"),
|
|
38
44
|
pkg: t("Packages"),
|
|
45
|
+
choices: t("Party"),
|
|
39
46
|
};
|
|
40
47
|
return labels[section];
|
|
41
48
|
}
|
package/dist/dashboard/api.js
CHANGED
|
@@ -272,6 +272,26 @@ export async function answer(asked, reply) {
|
|
|
272
272
|
const response = await fetch("/api/answer", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(body) });
|
|
273
273
|
return response.status === 202;
|
|
274
274
|
}
|
|
275
|
+
/** The choices the master prepared for the player (D-556), and whether the player rolls their own dice. */
|
|
276
|
+
export async function readChoices() {
|
|
277
|
+
return await readJson("/api/choices");
|
|
278
|
+
}
|
|
279
|
+
// The player's choices reach the game one after another, in the order they were made.
|
|
280
|
+
let choosing = Promise.resolve();
|
|
281
|
+
/** Sends a change of a set of choices, after those sent before: the choices as they are now, "changed" when the game turned it down, or undefined when the game is away. */
|
|
282
|
+
export async function changeChoices(change) {
|
|
283
|
+
const sent = choosing.then(async () => {
|
|
284
|
+
try {
|
|
285
|
+
const response = await fetch("/api/choices", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(change) });
|
|
286
|
+
return response.ok ? await response.json() : response.status === 409 ? "changed" : undefined;
|
|
287
|
+
}
|
|
288
|
+
catch {
|
|
289
|
+
return undefined;
|
|
290
|
+
}
|
|
291
|
+
});
|
|
292
|
+
choosing = sent;
|
|
293
|
+
return sent;
|
|
294
|
+
}
|
|
275
295
|
/** The sentences said on the page that the master has not heard yet, those heard lately, and whether this chat hears one at once (D-495). */
|
|
276
296
|
export async function readActs() {
|
|
277
297
|
const response = await fetch("/api/act");
|
package/dist/dashboard/app.js
CHANGED
|
@@ -8,10 +8,11 @@ import { PlayerActsContext } from "./acts/names.js";
|
|
|
8
8
|
import { ActSheet } from "./acts/sheet.js";
|
|
9
9
|
import { ActStrip } from "./acts/strip.js";
|
|
10
10
|
import { readAddress, sectionAddress } from "./address.js";
|
|
11
|
-
import { answer, closeCard, readActs, readAsked, readGameTheme, readModules, readView, readWidgets, sayAct, sendSeen, withdrawAct } from "./api.js";
|
|
11
|
+
import { answer, closeCard, readActs, readAsked, readChoices, readGameTheme, readModules, readView, readWidgets, sayAct, sendSeen, withdrawAct } from "./api.js";
|
|
12
12
|
import { AskedDice } from "./asked-dice.js";
|
|
13
13
|
import { AskedBanner } from "./asked.js";
|
|
14
14
|
import { useMedia } from "./card.js";
|
|
15
|
+
import { choicesOf, ChoicesPage, waits } from "./choices.js";
|
|
15
16
|
import { flies } from "./dice/pool.js";
|
|
16
17
|
import { DiceTray } from "./dice/tray.js";
|
|
17
18
|
import { PageFoot } from "./footer.js";
|
|
@@ -68,6 +69,8 @@ function App() {
|
|
|
68
69
|
const [thrown, setThrown] = useState();
|
|
69
70
|
// The roll whose dice are in the air: its line comes into the rolls only as they go (D-300).
|
|
70
71
|
const [held, setHeld] = useState();
|
|
72
|
+
// The last roll whose dice landed: a roll thrown and not landed yet is in the air.
|
|
73
|
+
const [landed, setLanded] = useState();
|
|
71
74
|
const [fresh, setFresh] = useState(new Set());
|
|
72
75
|
// How many of the last rolls the page reads: more when the player asks for older ones (D-302).
|
|
73
76
|
const rollsAsked = useRef(firstRolls);
|
|
@@ -150,7 +153,12 @@ function App() {
|
|
|
150
153
|
setModules((before) => (JSON.stringify(before) === JSON.stringify(read) ? before : read));
|
|
151
154
|
}, () => undefined);
|
|
152
155
|
try {
|
|
153
|
-
const [first, askedNow, actsNow] = await Promise.all([
|
|
156
|
+
const [first, askedNow, actsNow, choicesNow] = await Promise.all([
|
|
157
|
+
readView(undefined, rollsAsked.current),
|
|
158
|
+
readAsked().catch(() => undefined),
|
|
159
|
+
readActs().catch(() => undefined),
|
|
160
|
+
readChoices().catch(() => undefined),
|
|
161
|
+
]);
|
|
154
162
|
const asked = askedNow === undefined ? undefined : askedNow.asked ?? undefined;
|
|
155
163
|
// With more than one player character, a question for one elsewhere puts them in the foreground: the place, the map and the squares are theirs (VIEW-12).
|
|
156
164
|
const here = first.kind === "overview" && (first.place?.here ?? []).some((one) => one.name === asked?.who);
|
|
@@ -260,6 +268,7 @@ function App() {
|
|
|
260
268
|
problems: overview.kind === "overview" ? overview.problems : undefined,
|
|
261
269
|
importing: overview.kind === "overview" || overview.kind === "none" ? overview.importing : undefined,
|
|
262
270
|
textsTranslating: overview.kind === "overview" ? overview.textsTranslating : undefined,
|
|
271
|
+
choices: choicesNow ?? before.choices,
|
|
263
272
|
}, holding.current !== undefined));
|
|
264
273
|
}
|
|
265
274
|
}
|
|
@@ -607,7 +616,7 @@ function App() {
|
|
|
607
616
|
setFree([]);
|
|
608
617
|
writeFree(shown.campaign, []);
|
|
609
618
|
} }, shown.campaign));
|
|
610
|
-
return (_jsx(ModulesContext.Provider, { value: modules, children: _jsx(PeopleContext.Provider, { value: people, children: _jsx(RequestedRoll.Provider, { value: requested, children: _jsx(WidgetsContext.Provider, { value: pageWidgets, children: _jsx(PlayerActsContext.Provider, { value: playerActs, children: _jsxs("div", { class: live ? "page" : "page stale", children: [!inSetup && (_jsx(Top, { campaign: shown.campaign, product: productName, system: shown.system === undefined ? undefined : systemNameLabel(shown.system.name), now: shown.now, calendar: shown.calendar, path: shown.place === undefined ? undefined : [...shown.place.within, shown.place.name], live: live, mood: shown.masterMood, moment: moment, asleep: !live && shown.readAt !== undefined, section: address.section, fight: fight, yourTurn: yourTurn, turnName: turnName, ownPages: ownPages, ownShown: address.section === "pkg" && address.tab !== undefined && address.name !== undefined ? ownKey({ package: address.tab, name: address.name }) : undefined })), inSetup && _jsx(SetupCorner, { live: live }), _jsx(Notices, { notices: notices }), live && shown.pack !== undefined && (_jsx(AskCard, { card: shown.pack, name: several ? playerNamed(shown.party, shown.pack.asked?.who)?.name ?? turnName : undefined, widget: widgets.find((widget) => widget.id === shown.pack?.widget), onAnswer: (index) => void answerPack(index), onWords: sayPack, onClose: closePack }, shown.pack.key)), live && shown.pack === undefined && shown.asked?.spend !== undefined && !inCard(shown.asked) && (_jsx(AskedDice, { asked: shown.asked, spend: shown.asked.spend, flying: holding.current?.roll.id, onSpend: (field) => answerSpend(shown.asked?.id, { spend: field }), onDone: async (focused) => {
|
|
619
|
+
return (_jsx(ModulesContext.Provider, { value: modules, children: _jsx(PeopleContext.Provider, { value: people, children: _jsx(RequestedRoll.Provider, { value: requested, children: _jsx(WidgetsContext.Provider, { value: pageWidgets, children: _jsx(PlayerActsContext.Provider, { value: playerActs, children: _jsxs("div", { class: live ? "page" : "page stale", children: [!inSetup && (_jsx(Top, { campaign: shown.campaign, product: productName, system: shown.system === undefined ? undefined : systemNameLabel(shown.system.name), now: shown.now, calendar: shown.calendar, path: shown.place === undefined ? undefined : [...shown.place.within, shown.place.name], live: live, mood: shown.masterMood, moment: moment, asleep: !live && shown.readAt !== undefined, section: address.section === "choices" ? "party" : address.section, choices: (shown.choices?.sets ?? []).some(waits), fight: fight, yourTurn: yourTurn, turnName: turnName, ownPages: ownPages, ownShown: address.section === "pkg" && address.tab !== undefined && address.name !== undefined ? ownKey({ package: address.tab, name: address.name }) : undefined })), inSetup && _jsx(SetupCorner, { live: live }), _jsx(Notices, { notices: notices }), live && shown.pack !== undefined && (_jsx(AskCard, { card: shown.pack, name: several ? playerNamed(shown.party, shown.pack.asked?.who)?.name ?? turnName : undefined, widget: widgets.find((widget) => widget.id === shown.pack?.widget), onAnswer: (index) => void answerPack(index), onWords: sayPack, onClose: closePack }, shown.pack.key)), live && shown.pack === undefined && shown.asked?.spend !== undefined && !inCard(shown.asked) && (_jsx(AskedDice, { asked: shown.asked, spend: shown.asked.spend, flying: holding.current?.roll.id, onSpend: (field) => answerSpend(shown.asked?.id, { spend: field }), onDone: async (focused) => {
|
|
611
620
|
const taken = await answerSpend(shown.asked?.id, 0);
|
|
612
621
|
if (taken && focused) {
|
|
613
622
|
focusAfterCard();
|
|
@@ -615,7 +624,7 @@ function App() {
|
|
|
615
624
|
return taken;
|
|
616
625
|
} }, shown.asked.id)), live && shown.pack === undefined && shown.asked && shown.asked.spend === undefined && !inCard(shown.asked) && (_jsx(AskedBanner, { asked: shown.asked, yourTurn: yourTurn && (asker === undefined || asker.name === turnOf?.name), who: asker, turnName: turnName, map: shown.place?.map, place: shown.place?.name, answered: answering === shown.asked.id, onAnswered: () => void read() })), inSetup
|
|
617
626
|
? _jsx(SetupView, { setup: setup })
|
|
618
|
-
: (_jsxs(_Fragment, { children: [live && yourTurn && address.section !== "scene" && shown.asked === undefined && shown.pack === undefined && (_jsxs("a", { class: "turn-notice", href: sectionAddress("scene"), children: [_jsx(Icon, { name: "combat" }), _jsxs("span", { children: [turnWords(turnName), shown.openScene?.round !== undefined && _jsx("span", { class: "turn-notice-round", children: ` · ${t("Round {round}", { round: shown.openScene.round })}` })] }), _jsx("span", { class: "turn-notice-go", children: t("Go to the scene") })] })), _jsx(Notices, { notices: importing }), !table && _jsx(QuestEndings, { version: shown.version, campaign: shown.campaign }), address.section === "party" && _jsx(PartyStrip, { party: shown.party, chosen: shown.chosen, scene: shown.openScene }), _jsxs("div", { class: "body", children: [_jsxs("main", { children: [address.section === "about" && _jsx(About, { product: productName, system: shown.system }), address.section === "help" && _jsx(Help, {}), !table && address.section === "scene" && _jsx(FollowedQuests, { version: shown.version, campaign: shown.campaign }), address.section === "scene" && (_jsx(SceneView, { place: shown.place, scene: shown.openScene, actor: actor, foreground: shown.foreground, several: several, party: shown.party, turnsBeside: table, onShowCard: (name) => {
|
|
627
|
+
: (_jsxs(_Fragment, { children: [live && yourTurn && address.section !== "scene" && shown.asked === undefined && shown.pack === undefined && (_jsxs("a", { class: "turn-notice", href: sectionAddress("scene"), children: [_jsx(Icon, { name: "combat" }), _jsxs("span", { children: [turnWords(turnName), shown.openScene?.round !== undefined && _jsx("span", { class: "turn-notice-round", children: ` · ${t("Round {round}", { round: shown.openScene.round })}` })] }), _jsx("span", { class: "turn-notice-go", children: t("Go to the scene") })] })), _jsx(Notices, { notices: importing }), !table && _jsx(QuestEndings, { version: shown.version, campaign: shown.campaign }), address.section === "party" && (_jsx(PartyStrip, { party: shown.party, chosen: shown.chosen, scene: shown.openScene, waiting: new Map((shown.choices?.sets ?? []).filter(waits).map((set) => [set.who, set.title])) })), _jsxs("div", { class: "body", children: [_jsxs("main", { children: [address.section === "about" && _jsx(About, { product: productName, system: shown.system }), address.section === "help" && _jsx(Help, {}), !table && address.section === "scene" && _jsx(FollowedQuests, { version: shown.version, campaign: shown.campaign }), address.section === "scene" && (_jsx(SceneView, { place: shown.place, scene: shown.openScene, actor: actor, foreground: shown.foreground, several: several, party: shown.party, turnsBeside: table, onShowCard: (name) => {
|
|
619
628
|
handed.current = { who: name, turn: turnKey(shown.openScene) };
|
|
620
629
|
void read();
|
|
621
630
|
}, own: {
|
|
@@ -623,7 +632,7 @@ function App() {
|
|
|
623
632
|
cards: shown.cards,
|
|
624
633
|
version: shown.version,
|
|
625
634
|
onRoll: throwFromSheet,
|
|
626
|
-
} })), address.section === "world" && _jsx(WorldView, { version: shown.version, lead: lead, players: many ? players : undefined, tab: address.tab, item: address.name }), address.section === "settings" && _jsx(SettingsView, { version: shown.version, several: many }), address.section === "saves" && _jsx(SavesView, { version: shown.version, campaign: shown.campaign, several: many }), address.section === "packages" && _jsx(PackagesPage, { version: shown.version, tab: address.tab }), address.section === "pkg" && _jsx(PackagePage, { name: address.tab, page: address.name }), address.section === "journal" && _jsx(JournalView, { version: shown.version, campaign: shown.campaign, tab: address.tab, item: address.name }), address.section === "party" && member && (_jsx(PlayerActsContext.Provider, { value: member.role === "pc" || playerActs === undefined ? playerActs : { ...playerActs, actions: {} }, children: _jsx(MemberSheet, { member: member, headline: shown.headline, sheet: shown.sheet, cards: shown.cards, text: shown.text, knownBy: shown.knownBy, story: shown.story, version: shown.version, onRoll: throwFromSheet, scene: shown.openScene }, member.name) }))] }), table
|
|
635
|
+
} })), address.section === "world" && _jsx(WorldView, { version: shown.version, lead: lead, players: many ? players : undefined, tab: address.tab, item: address.name }), address.section === "settings" && _jsx(SettingsView, { version: shown.version, several: many }), address.section === "saves" && _jsx(SavesView, { version: shown.version, campaign: shown.campaign, several: many }), address.section === "packages" && _jsx(PackagesPage, { version: shown.version, tab: address.tab }), address.section === "pkg" && _jsx(PackagePage, { name: address.tab, page: address.name }), address.section === "choices" && (_jsx(ChoicesPage, { who: address.tab, open: address.name, choices: shown.choices, member: shown.party.find((one) => one.name === address.tab), version: shown.version, flying: thrown !== undefined && thrown.id !== landed ? thrown : undefined, onChanged: (choices) => setShown((before) => ({ ...before, choices })) })), address.section === "journal" && _jsx(JournalView, { version: shown.version, campaign: shown.campaign, tab: address.tab, item: address.name }), address.section === "party" && member && (_jsx(PlayerActsContext.Provider, { value: member.role === "pc" || playerActs === undefined ? playerActs : { ...playerActs, actions: {} }, children: _jsx(MemberSheet, { member: member, headline: shown.headline, sheet: shown.sheet, cards: shown.cards, text: shown.text, knownBy: shown.knownBy, story: shown.story, version: shown.version, onRoll: throwFromSheet, scene: shown.openScene, choices: choicesOf(shown.choices, member.name) }, member.name) }))] }), table
|
|
627
636
|
? (_jsxs(PlayTable, { entering: tableMoved, onFold: () => {
|
|
628
637
|
setTableMoved(true);
|
|
629
638
|
setTableAway(true);
|
|
@@ -633,7 +642,10 @@ function App() {
|
|
|
633
642
|
setTableMoved(true);
|
|
634
643
|
setTableAway(false);
|
|
635
644
|
} }))
|
|
636
|
-
: (_jsxs(_Fragment, { children: [_jsx(WidgetCards, { place: "side" }), rolls] }))] }), _jsx(PageFoot, { product: productName, system: shown.system })] })), _jsx(DiceTray, { requested: thrown, sheetThrow: sheetThrow, party: shown.party, ...(shown.campaign === undefined ? {} : { campaign: shown.campaign }), onLanded:
|
|
645
|
+
: (_jsxs(_Fragment, { children: [_jsx(WidgetCards, { place: "side" }), rolls] }))] }), _jsx(PageFoot, { product: productName, system: shown.system })] })), _jsx(DiceTray, { requested: thrown, sheetThrow: sheetThrow, party: shown.party, ...(shown.campaign === undefined ? {} : { campaign: shown.campaign }), onLanded: (roll) => {
|
|
646
|
+
land(roll);
|
|
647
|
+
setLanded(roll);
|
|
648
|
+
}, onShown: (id) => {
|
|
637
649
|
setHeld((now) => (now === id ? undefined : now));
|
|
638
650
|
if (thrown?.id === id) {
|
|
639
651
|
react(thrown, shown.party);
|