rpg-engine 0.7.0 → 0.9.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/adventures/index.d.ts +1 -1
- package/dist/adventures/index.js +1 -1
- package/dist/adventures/source.js +13 -13
- package/dist/campaign/create-campaign.js +10 -1
- package/dist/campaign/host-files.d.ts +2 -1
- package/dist/campaign/host-files.js +11 -11
- package/dist/campaign/index.d.ts +1 -1
- package/dist/campaign/index.js +1 -1
- package/dist/campaign/settings.d.ts +55 -64
- package/dist/campaign/settings.js +171 -174
- package/dist/{cli.js → cli/cli.js} +3 -3
- package/dist/{command-line.d.ts → cli/command-line.d.ts} +1 -1
- package/dist/{command-line.js → cli/command-line.js} +21 -20
- package/dist/commands/advance.d.ts +1 -1
- package/dist/commands/advance.js +7 -7
- package/dist/commands/ask.d.ts +1 -8
- package/dist/commands/ask.js +16 -29
- package/dist/commands/{change.d.ts → change/change.d.ts} +2 -2
- package/dist/commands/{change.js → change/change.js} +46 -52
- package/dist/commands/{game-damage.d.ts → change/damage.d.ts} +2 -2
- package/dist/commands/{game-damage.js → change/damage.js} +3 -3
- package/dist/commands/{game-recipe-pace.d.ts → change/recipe-pace.d.ts} +2 -2
- package/dist/commands/{game-recipe-pace.js → change/recipe-pace.js} +4 -4
- package/dist/commands/config.d.ts +4 -4
- package/dist/commands/config.js +142 -138
- package/dist/commands/effect.d.ts +1 -1
- package/dist/commands/effect.js +11 -12
- package/dist/commands/find.d.ts +4 -4
- package/dist/commands/find.js +2 -2
- package/dist/commands/image.js +6 -6
- package/dist/commands/{import.d.ts → import/import.d.ts} +2 -2
- package/dist/commands/{import.js → import/import.js} +101 -101
- package/dist/commands/{game-import.d.ts → import/run.d.ts} +3 -3
- package/dist/commands/{game-import.js → import/run.js} +13 -12
- package/dist/commands/index.js +7 -7
- package/dist/commands/init.js +3 -3
- package/dist/commands/install.js +1 -1
- package/dist/commands/instructions.js +6 -6
- package/dist/commands/mode.d.ts +2 -2
- package/dist/commands/mode.js +8 -8
- package/dist/commands/mood.js +4 -4
- package/dist/commands/move.js +13 -20
- package/dist/commands/package.d.ts +2 -2
- package/dist/commands/package.js +138 -93
- package/dist/commands/rename.js +3 -3
- package/dist/commands/reveal.js +29 -18
- package/dist/commands/{roll.d.ts → roll/roll.d.ts} +4 -4
- package/dist/commands/{roll.js → roll/roll.js} +69 -69
- package/dist/commands/{game-tables.d.ts → roll/tables.d.ts} +2 -2
- package/dist/commands/{game-tables.js → roll/tables.js} +4 -4
- package/dist/commands/rules.d.ts +2 -2
- package/dist/commands/rules.js +17 -9
- package/dist/commands/save.d.ts +1 -1
- package/dist/commands/save.js +18 -18
- package/dist/commands/scene.d.ts +4 -4
- package/dist/commands/scene.js +31 -28
- package/dist/commands/{game-advance.d.ts → shared/advance.d.ts} +4 -4
- package/dist/commands/{game-advance.js → shared/advance.js} +27 -27
- package/dist/commands/{game-adventures.d.ts → shared/adventures.d.ts} +3 -3
- package/dist/commands/{game-adventures.js → shared/adventures.js} +20 -27
- package/dist/commands/{game-bonds.d.ts → shared/bonds.d.ts} +3 -3
- package/dist/commands/{game-bonds.js → shared/bonds.js} +2 -2
- package/dist/commands/{game-checks.d.ts → shared/checks.d.ts} +3 -3
- package/dist/commands/{game-checks.js → shared/checks.js} +7 -7
- package/dist/commands/{game-dice-pool.d.ts → shared/dice-pool.d.ts} +3 -3
- package/dist/commands/{game-dice-pool.js → shared/dice-pool.js} +19 -12
- package/dist/commands/{effect-layer.d.ts → shared/effect-layer.d.ts} +2 -2
- package/dist/commands/{effect-layer.js → shared/effect-layer.js} +12 -12
- package/dist/commands/{game-effects.d.ts → shared/effects.d.ts} +7 -7
- package/dist/commands/{game-effects.js → shared/effects.js} +19 -19
- package/dist/commands/{game-environment.d.ts → shared/environment.d.ts} +1 -1
- package/dist/commands/{game-environment.js → shared/environment.js} +3 -3
- package/dist/commands/{game-events.d.ts → shared/events.d.ts} +5 -5
- package/dist/commands/{game-events.js → shared/events.js} +20 -22
- package/dist/commands/{game-examples.d.ts → shared/examples.d.ts} +4 -8
- package/dist/commands/{game-examples.js → shared/examples.js} +23 -23
- package/dist/commands/{game-experience.d.ts → shared/experience.d.ts} +2 -2
- package/dist/commands/{game-experience.js → shared/experience.js} +8 -11
- package/dist/commands/{game-grid-moves.d.ts → shared/grid-moves.d.ts} +6 -6
- package/dist/commands/{game-grid-moves.js → shared/grid-moves.js} +5 -5
- package/dist/commands/{game-grids.d.ts → shared/grids.d.ts} +4 -9
- package/dist/commands/{game-grids.js → shared/grids.js} +20 -19
- package/dist/commands/{game-images.d.ts → shared/images.d.ts} +3 -3
- package/dist/commands/{game-images.js → shared/images.js} +7 -6
- package/dist/commands/shared/inputs.d.ts +9 -0
- package/dist/commands/shared/inputs.js +12 -0
- package/dist/commands/{game-journey.d.ts → shared/journey.d.ts} +4 -6
- package/dist/commands/{game-journey.js → shared/journey.js} +13 -15
- package/dist/commands/{game-knowledge.d.ts → shared/knowledge.d.ts} +15 -8
- package/dist/commands/{game-knowledge.js → shared/knowledge.js} +56 -44
- package/dist/{library-reader.js → commands/shared/library-reader.js} +4 -4
- package/dist/commands/{game-library.d.ts → shared/library.d.ts} +7 -4
- package/dist/commands/{game-library.js → shared/library.js} +70 -50
- package/dist/commands/{game-limits.d.ts → shared/limits.d.ts} +3 -3
- package/dist/commands/{game-limits.js → shared/limits.js} +3 -3
- package/dist/commands/{game-loot.d.ts → shared/loot.d.ts} +2 -2
- package/dist/commands/{game-loot.js → shared/loot.js} +3 -3
- package/dist/commands/{game-master-rolls.d.ts → shared/master-rolls.d.ts} +2 -2
- package/dist/commands/{game-master-rolls.js → shared/master-rolls.js} +6 -6
- package/dist/commands/{game-mode.d.ts → shared/mode.d.ts} +4 -6
- package/dist/commands/{game-mode.js → shared/mode.js} +10 -10
- package/dist/commands/{game-money.d.ts → shared/money.d.ts} +3 -3
- package/dist/commands/{game-money.js → shared/money.js} +4 -4
- package/dist/commands/{game-moods.d.ts → shared/moods.d.ts} +3 -3
- package/dist/commands/{game-moods.js → shared/moods.js} +3 -3
- package/dist/commands/{game-moves.d.ts → shared/moves.d.ts} +2 -2
- package/dist/commands/{game-moves.js → shared/moves.js} +5 -5
- package/dist/commands/{game-offers.d.ts → shared/offers.d.ts} +3 -3
- package/dist/commands/{game-offers.js → shared/offers.js} +9 -12
- package/dist/commands/{game-outside.d.ts → shared/outside.d.ts} +3 -3
- package/dist/commands/{game-outside.js → shared/outside.js} +9 -9
- package/dist/commands/{game-catalog.d.ts → shared/packages/catalog.d.ts} +1 -3
- package/dist/commands/{game-catalog.js → shared/packages/catalog.js} +17 -22
- package/dist/commands/{game-package-code.d.ts → shared/packages/code.d.ts} +10 -14
- package/dist/commands/{game-package-code.js → shared/packages/code.js} +156 -59
- package/dist/commands/{game-extension-list.d.ts → shared/packages/extensions.d.ts} +6 -6
- package/dist/commands/{game-extension-list.js → shared/packages/extensions.js} +43 -22
- package/dist/commands/{game-package-hooks.d.ts → shared/packages/hooks.d.ts} +3 -3
- package/dist/commands/{game-package-hooks.js → shared/packages/hooks.js} +3 -3
- package/dist/commands/{game-widgets.d.ts → shared/packages/widgets.d.ts} +6 -10
- package/dist/commands/{game-widgets.js → shared/packages/widgets.js} +57 -57
- package/dist/commands/{page-counters.d.ts → shared/page-counters.d.ts} +3 -3
- package/dist/commands/{page-counters.js → shared/page-counters.js} +5 -5
- package/dist/{page-words.d.ts → commands/shared/page-words.d.ts} +2 -2
- package/dist/{page-words.js → commands/shared/page-words.js} +5 -4
- package/dist/commands/{parts.d.ts → shared/parts.d.ts} +3 -3
- package/dist/commands/{parts.js → shared/parts.js} +4 -4
- package/dist/commands/{game-positions.d.ts → shared/positions.d.ts} +3 -5
- package/dist/commands/{game-positions.js → shared/positions.js} +6 -7
- package/dist/commands/{problems.d.ts → shared/problems.d.ts} +3 -3
- package/dist/commands/{problems.js → shared/problems.js} +21 -22
- package/dist/commands/{progression.d.ts → shared/progression.d.ts} +2 -2
- package/dist/commands/{progression.js → shared/progression.js} +4 -4
- package/dist/commands/{game-quests.d.ts → shared/quests.d.ts} +4 -4
- package/dist/commands/{game-quests.js → shared/quests.js} +6 -6
- package/dist/commands/{game-recipes.d.ts → shared/recipes.d.ts} +3 -3
- package/dist/commands/{game-recipes.js → shared/recipes.js} +3 -3
- package/dist/commands/{game-reminders.d.ts → shared/reminders.d.ts} +4 -4
- package/dist/commands/{game-reminders.js → shared/reminders.js} +4 -4
- package/dist/commands/{game-roads.d.ts → shared/roads.d.ts} +5 -5
- package/dist/commands/{game-roads.js → shared/roads.js} +43 -44
- package/dist/commands/{game-rules.d.ts → shared/rules.d.ts} +13 -5
- package/dist/commands/shared/rules.js +66 -0
- package/dist/commands/{game-saves.d.ts → shared/saves.d.ts} +4 -4
- package/dist/commands/{game-saves.js → shared/saves.js} +51 -51
- package/dist/commands/{game-scene.d.ts → shared/scene.d.ts} +13 -3
- package/dist/commands/{game-scene.js → shared/scene.js} +41 -13
- package/dist/commands/{sheet.d.ts → shared/sheet.d.ts} +5 -5
- package/dist/commands/{sheet.js → shared/sheet.js} +76 -76
- package/dist/commands/{game-stacks.d.ts → shared/stacks.d.ts} +2 -9
- package/dist/commands/{game-stacks.js → shared/stacks.js} +22 -22
- package/dist/commands/{game-theme.d.ts → shared/theme.d.ts} +3 -3
- package/dist/commands/{game-theme.js → shared/theme.js} +2 -2
- package/dist/commands/{game-thoughts.d.ts → shared/thoughts.d.ts} +2 -4
- package/dist/commands/{game-thoughts.js → shared/thoughts.js} +6 -8
- package/dist/commands/{game-thresholds.d.ts → shared/thresholds.d.ts} +1 -1
- package/dist/commands/{game-thresholds.js → shared/thresholds.js} +4 -4
- package/dist/commands/{game-time.d.ts → shared/time.d.ts} +4 -4
- package/dist/commands/{game-time.js → shared/time.js} +6 -6
- package/dist/commands/{game-turn-uses.d.ts → shared/turn-uses.d.ts} +3 -3
- package/dist/commands/{game-turn-uses.js → shared/turn-uses.js} +12 -15
- package/dist/commands/{game-upkeep.d.ts → shared/upkeep.d.ts} +3 -3
- package/dist/commands/{game-upkeep.js → shared/upkeep.js} +69 -57
- package/dist/commands/{game-voices.d.ts → shared/voices.d.ts} +1 -1
- package/dist/commands/{game-voices.js → shared/voices.js} +2 -2
- package/dist/commands/{worked-out.d.ts → shared/worked-out.d.ts} +3 -8
- package/dist/commands/{worked-out.js → shared/worked-out.js} +238 -238
- package/dist/commands/{game-world.d.ts → shared/world.d.ts} +5 -14
- package/dist/commands/{game-world.js → shared/world.js} +72 -76
- package/dist/commands/show.d.ts +4 -1
- package/dist/commands/show.js +36 -18
- package/dist/commands/status.d.ts +1 -1
- package/dist/commands/status.js +28 -28
- package/dist/commands/thoughts.js +3 -3
- package/dist/commands/trade.js +9 -10
- package/dist/commands/translate.d.ts +1 -1
- package/dist/commands/translate.js +3 -3
- package/dist/commands/{game-open.d.ts → travel/open.d.ts} +3 -3
- package/dist/commands/{game-open.js → travel/open.js} +4 -5
- package/dist/commands/{route.d.ts → travel/route.d.ts} +1 -1
- package/dist/commands/{route.js → travel/route.js} +9 -10
- package/dist/commands/{travel.d.ts → travel/travel.d.ts} +2 -2
- package/dist/commands/{travel.js → travel/travel.js} +19 -21
- package/dist/commands/validate.js +5 -5
- package/dist/commands/{game-view-journal.d.ts → view/journal.d.ts} +5 -5
- package/dist/commands/{game-view-journal.js → view/journal.js} +5 -5
- package/dist/commands/{game-view-map.d.ts → view/map.d.ts} +3 -3
- package/dist/commands/{game-view-map.js → view/map.js} +15 -16
- package/dist/commands/{game-view-place.d.ts → view/place.d.ts} +6 -6
- package/dist/commands/{game-view-place.js → view/place.js} +108 -108
- package/dist/commands/{view.d.ts → view/view.d.ts} +16 -16
- package/dist/commands/{view.js → view/view.js} +41 -36
- package/dist/commands/{game-view-world.d.ts → view/world.d.ts} +4 -4
- package/dist/commands/{game-view-world.js → view/world.js} +7 -7
- package/dist/commands/{game-here.d.ts → write/here.d.ts} +5 -3
- package/dist/commands/{game-here.js → write/here.js} +18 -12
- package/dist/commands/{write.d.ts → write/write.d.ts} +6 -6
- package/dist/commands/{write.js → write/write.js} +44 -41
- package/dist/confirm/confirm.d.ts +2 -0
- package/dist/confirm/confirm.js +15 -5
- package/dist/core/consents.d.ts +3 -2
- package/dist/core/consents.js +43 -4
- package/dist/core/context.d.ts +8 -6
- package/dist/core/context.js +4 -2
- package/dist/core/download.js +16 -5
- package/dist/core/files.d.ts +8 -1
- package/dist/core/files.js +53 -21
- package/dist/core/formula.d.ts +7 -2
- package/dist/core/formula.js +63 -66
- package/dist/core/instruction-parts.js +1 -1
- package/dist/core/mood.d.ts +0 -1
- package/dist/core/mood.js +3 -3
- package/dist/core/package-api.d.ts +11 -0
- package/dist/core/package-api.js +2 -1
- package/dist/core/package-declarations.d.ts +9 -9
- package/dist/core/package-declarations.js +3 -3
- package/dist/core/process-mark.d.ts +8 -0
- package/dist/core/process-mark.js +72 -0
- package/dist/core/registry.d.ts +5 -0
- package/dist/core/registry.js +10 -0
- package/dist/core/session-store.d.ts +0 -1
- package/dist/core/session-store.js +11 -14
- package/dist/core/store.d.ts +4 -0
- package/dist/core/store.js +29 -8
- package/dist/core/text.d.ts +4 -0
- package/dist/core/text.js +11 -2
- package/dist/core/yaml-file.js +2 -2
- package/dist/dashboard/{acts.js → acts/acts.js} +2 -2
- package/dist/dashboard/{act-names.js → acts/names.js} +1 -1
- package/dist/dashboard/{act-sheet.js → acts/sheet.js} +3 -3
- package/dist/dashboard/{act-strip.js → acts/strip.js} +2 -2
- package/dist/dashboard/app.js +13 -13
- package/dist/dashboard/asked.js +1 -1
- package/dist/dashboard/dice/burn.js +1 -1
- package/dist/dashboard/dice/stage.js +1 -1
- package/dist/dashboard/game-words.js +4 -4
- package/dist/dashboard/{guide-blocks.js → help/blocks.js} +1 -1
- package/dist/dashboard/{help.js → help/help.js} +6 -6
- package/dist/dashboard/journal.js +1 -1
- package/dist/dashboard/kit.js +6 -5
- package/dist/dashboard/labels.js +7 -3
- package/dist/dashboard/markdown.js +1 -1
- package/dist/dashboard/{ask-card.js → packages/ask-card.js} +6 -6
- package/dist/dashboard/{package-page.js → packages/package-page.js} +3 -3
- package/dist/dashboard/{packages.js → packages/packages.js} +12 -12
- package/dist/dashboard/{page-code.js → packages/page-code.js} +4 -4
- package/dist/dashboard/{extension-widgets.js → packages/widgets.js} +5 -5
- package/dist/dashboard/party.js +1 -1
- package/dist/dashboard/person-panel.js +2 -13
- package/dist/dashboard/{map-sheet.js → place/map-sheet.js} +4 -4
- package/dist/dashboard/{place-map-view.js → place/map-view.js} +11 -11
- package/dist/dashboard/scene.js +4 -4
- package/dist/dashboard/settings.js +1 -1
- package/dist/dashboard/sheet.js +4 -4
- package/dist/dashboard/text.js +6 -0
- package/dist/dashboard/top.js +2 -2
- package/dist/dashboard/turns.js +2 -2
- package/dist/dashboard/widgets.js +1 -1
- package/dist/dashboard/{world-calendar.js → world/calendar.js} +7 -7
- package/dist/dashboard/{lore.js → world/known.js} +1 -1
- package/dist/dashboard/{world-lore.js → world/lore.js} +9 -9
- package/dist/dashboard/{world-map.js → world/map.js} +1 -1
- package/dist/dashboard/{world.js → world/world.js} +14 -14
- package/dist/dice/evaluate.js +1 -1
- package/dist/dice/index.d.ts +2 -2
- package/dist/dice/index.js +2 -2
- package/dist/dice/notation.d.ts +2 -0
- package/dist/dice/notation.js +22 -4
- package/dist/documents/markup.js +2 -2
- package/dist/documents/read.js +29 -13
- package/dist/effects/effect.js +2 -5
- package/dist/extensions/extension.js +6 -8
- package/dist/extensions/index.d.ts +1 -4
- package/dist/extensions/index.js +1 -4
- package/dist/extensions/words.js +2 -1
- package/dist/{pictures → helpers}/briefs.js +17 -14
- package/dist/{pictures → helpers}/claude.js +8 -18
- package/dist/{pictures → helpers}/codex.js +3 -15
- package/dist/helpers/index.d.ts +7 -0
- package/dist/helpers/index.js +9 -0
- package/dist/{pictures/helpers.d.ts → helpers/programs.d.ts} +6 -1
- package/dist/{pictures/helpers.js → helpers/programs.js} +16 -2
- package/dist/images/images.js +7 -5
- package/dist/images/index.d.ts +1 -1
- package/dist/images/index.js +1 -1
- package/dist/importer/index.d.ts +1 -1
- package/dist/importer/index.js +1 -1
- package/dist/importer/work.d.ts +0 -2
- package/dist/importer/work.js +9 -30
- package/dist/instructions/index.d.ts +2 -0
- package/dist/instructions/index.js +10 -0
- package/dist/languages/index.d.ts +1 -1
- package/dist/languages/index.js +1 -1
- package/dist/languages/language-pack.js +15 -3
- package/dist/library/books.js +29 -83
- package/dist/{extensions → packages}/engine.d.ts +1 -1
- package/dist/{extensions → packages}/engine.js +1 -1
- package/dist/packages/index.d.ts +3 -0
- package/dist/packages/index.js +4 -0
- package/dist/{extensions/packages.d.ts → packages/npm.d.ts} +2 -0
- package/dist/{extensions/packages.js → packages/npm.js} +74 -45
- package/dist/page.d.ts +9 -11
- package/dist/page.js +1 -2
- package/dist/pages/check.js +31 -40
- package/dist/pages/containers.js +20 -20
- package/dist/pages/environment.js +15 -15
- package/dist/pages/index.d.ts +9 -9
- package/dist/pages/index.js +9 -9
- package/dist/pages/inheritance.d.ts +2 -1
- package/dist/pages/inheritance.js +24 -24
- package/dist/pages/load.js +7 -7
- package/dist/pages/maps.d.ts +20 -0
- package/dist/pages/maps.js +51 -1
- package/dist/pages/markdown.d.ts +2 -0
- package/dist/pages/markdown.js +110 -79
- package/dist/pages/page-file.d.ts +2 -1
- package/dist/pages/page-file.js +31 -29
- package/dist/pages/rename-page.d.ts +4 -1
- package/dist/pages/rename-page.js +7 -3
- package/dist/pages/{stack-entry.d.ts → stacks/entry.d.ts} +0 -2
- package/dist/pages/{stack-entry.js → stacks/entry.js} +2 -6
- package/dist/pages/{stacks.d.ts → stacks/kinds.d.ts} +8 -1
- package/dist/pages/{stacks.js → stacks/kinds.js} +36 -41
- package/dist/pages/{stack-writes.d.ts → stacks/writes.d.ts} +2 -2
- package/dist/pages/{stack-writes.js → stacks/writes.js} +32 -32
- package/dist/pages/system-pages.js +15 -15
- package/dist/pages/world.d.ts +4 -0
- package/dist/pages/world.js +52 -20
- package/dist/pages/write-page.js +35 -34
- package/dist/player-notes/index.d.ts +1 -1
- package/dist/player-notes/index.js +1 -1
- package/dist/rules/page-search.js +3 -4
- package/dist/rules/rule-book.js +1 -1
- package/dist/rules/search.js +21 -21
- package/dist/rules/shown.js +1 -3
- package/dist/saves/saves.d.ts +2 -2
- package/dist/saves/saves.js +15 -3
- package/dist/{bell-listener.js → server/bell-listener.js} +3 -3
- package/dist/server/dashboard/files.d.ts +59 -0
- package/dist/server/dashboard/files.js +326 -0
- package/dist/server/dashboard/index.d.ts +114 -0
- package/dist/server/dashboard/index.js +419 -0
- package/dist/server/dashboard/news.d.ts +39 -0
- package/dist/server/dashboard/news.js +390 -0
- package/dist/server/dashboard/player.d.ts +48 -0
- package/dist/server/dashboard/player.js +242 -0
- package/dist/server/dashboard/ports.d.ts +10 -0
- package/dist/server/dashboard/ports.js +15 -0
- package/dist/server/dashboard/writes.d.ts +58 -0
- package/dist/server/dashboard/writes.js +492 -0
- package/dist/{mcp-server.d.ts → server/mcp.d.ts} +2 -2
- package/dist/{mcp-server.js → server/mcp.js} +57 -42
- package/dist/systems/game-system.d.ts +5 -3
- package/dist/systems/game-system.js +178 -149
- package/dist/systems/index.d.ts +1 -1
- package/dist/systems/index.js +1 -1
- package/dist/{testing.d.ts → testing/index.d.ts} +6 -6
- package/dist/{testing.js → testing/index.js} +32 -18
- package/dist/{system-checks.js → testing/system-checks.js} +18 -12
- package/dist/themes/theme.d.ts +3 -3
- package/dist/themes/theme.js +14 -14
- package/dist/time/calendar.js +5 -2
- package/dist/triggers/trigger.js +5 -8
- package/instructions/dashboard-guide.md +2 -1
- package/instructions/play.md +1 -1
- package/package.json +5 -5
- package/dist/commands/game-maps.d.ts +0 -20
- package/dist/commands/game-maps.js +0 -51
- package/dist/commands/game-rules.js +0 -36
- package/dist/dashboard-server.d.ts +0 -47
- package/dist/dashboard-server.js +0 -1830
- package/dist/pictures/index.d.ts +0 -7
- package/dist/pictures/index.js +0 -9
- /package/dist/{cli.d.ts → cli/cli.d.ts} +0 -0
- /package/dist/{library-reader.d.ts → commands/shared/library-reader.d.ts} +0 -0
- /package/dist/commands/{notes.d.ts → shared/notes.d.ts} +0 -0
- /package/dist/commands/{notes.js → shared/notes.js} +0 -0
- /package/dist/dashboard/{guide-markdown.js → help/markdown.js} +0 -0
- /package/dist/dashboard/{pack-card.js → packages/card.js} +0 -0
- /package/dist/dashboard/{people.js → packages/people.js} +0 -0
- /package/dist/dashboard/{place-map.js → place/map.js} +0 -0
- /package/dist/dashboard/{calendar.js → world/days.js} +0 -0
- /package/dist/{pictures → helpers}/briefs.d.ts +0 -0
- /package/dist/{pictures → helpers}/chosen.d.ts +0 -0
- /package/dist/{pictures → helpers}/chosen.js +0 -0
- /package/dist/{pictures → helpers}/claude.d.ts +0 -0
- /package/dist/{pictures → helpers}/codex.d.ts +0 -0
- /package/dist/{pictures → helpers}/stop.d.ts +0 -0
- /package/dist/{pictures → helpers}/stop.js +0 -0
- /package/dist/{pictures → helpers}/svg.d.ts +0 -0
- /package/dist/{pictures → helpers}/svg.js +0 -0
- /package/dist/{extensions → packages}/tarball.d.ts +0 -0
- /package/dist/{extensions → packages}/tarball.js +0 -0
- /package/dist/{bell-listener.d.ts → server/bell-listener.d.ts} +0 -0
- /package/dist/{player-acts.d.ts → server/player-acts.d.ts} +0 -0
- /package/dist/{player-acts.js → server/player-acts.js} +0 -0
- /package/dist/{system-checks.d.ts → testing/system-checks.d.ts} +0 -0
|
@@ -1,14 +1,15 @@
|
|
|
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.
|
|
1
2
|
import { join, resolve } from "node:path";
|
|
2
|
-
import { campaignFileName, readCampaignData, readOneSetting, readTextSetting } from "
|
|
3
|
-
import { ourSystems } from "
|
|
4
|
-
import { files, isInside } from "
|
|
5
|
-
import { comparableText } from "
|
|
6
|
-
import { extensionWords } from "
|
|
7
|
-
import { languagePackFor, packSystemFolder } from "
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
3
|
+
import { campaignFileName, readCampaignData, readOneSetting, readTextSetting } from "../../campaign/index.js";
|
|
4
|
+
import { ourSystems } from "../../core/package-declarations.js";
|
|
5
|
+
import { files, isInside } from "../../core/store.js";
|
|
6
|
+
import { comparableText } from "../../core/text.js";
|
|
7
|
+
import { extensionWords } from "../../extensions/index.js";
|
|
8
|
+
import { languagePackFor, packSystemFolder } from "../../languages/index.js";
|
|
9
|
+
import { loadWorld, playerCharacters, searchSystemPages, worldFolderName } from "../../pages/index.js";
|
|
10
|
+
import { engineSettingValue, findCampaignSystem, findSystem, layeredSystemWords, readableSystems, rulesetSetting, systemContentFolders, systemWords, withSettings, } from "../../systems/index.js";
|
|
11
|
+
import { campaignExtensions, extensionSources, layeredParts } from "./packages/extensions.js";
|
|
12
|
+
import { homeSystemWords } from "./page-words.js";
|
|
12
13
|
/** The world of the campaign in `root`, with the pages of its game system when campaign.yaml names one that is installed (SYS-1, SYS-3). */
|
|
13
14
|
export function campaignWorld(root, context) {
|
|
14
15
|
// The same world until one of its pages or campaign.yaml changes: in a session, across calls (D-137). A game system does not change while the server runs.
|
|
@@ -28,11 +29,6 @@ export function campaignWorld(root, context) {
|
|
|
28
29
|
});
|
|
29
30
|
});
|
|
30
31
|
}
|
|
31
|
-
/** 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. */
|
|
32
|
-
function rigorPlayed(root, system) {
|
|
33
|
-
const value = engineSettingValue(system, (setting) => systemSettingValue(root, setting), "rigor", readTextSetting(root, "rigor"));
|
|
34
|
-
return typeof value === "string" ? value : undefined;
|
|
35
|
-
}
|
|
36
32
|
/**
|
|
37
33
|
* The game system's words in the campaign's language (D-403): its own, else those translated on the fly on this computer (D-406); with the names of the
|
|
38
34
|
* fields the campaign's extensions add, from their words, layered as their additions are (CAM-2, D-505).
|
|
@@ -71,43 +67,11 @@ export function campaignSystemWords(root, context) {
|
|
|
71
67
|
export function campaignSystem(root, context) {
|
|
72
68
|
return systemOf(root, context).system;
|
|
73
69
|
}
|
|
74
|
-
/**
|
|
75
|
-
* 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
|
|
76
|
-
* settings have it (DAT-10), read once until campaign.yaml changes: a call asks for it many times.
|
|
77
|
-
*/
|
|
78
|
-
function systemOf(root, context) {
|
|
79
|
-
// campaign.yaml, and the extensions' packages, whose parts and additions it gives.
|
|
80
|
-
return files().remember(`system ${resolve(root)}`, extensionSources(root, context), () => {
|
|
81
|
-
const name = readTextSetting(root, "system");
|
|
82
|
-
const found = name === undefined ? { refused: [] } : findCampaignSystem(context.systemFolders, name, systemLayers(root, context, readCampaignData(root)), readTextSetting(root, rulesetSetting));
|
|
83
|
-
// And the parts of the instructions of its extensions over its own (D-121).
|
|
84
|
-
const played = found.system === undefined ? undefined : withSettings(found.system, (setting) => readTextSetting(root, setting));
|
|
85
|
-
return played === undefined ? found : { ...found, system: { ...played, parts: layeredParts(played.parts, campaignExtensions(root, context).extensions) } };
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
70
|
/** What the campaign's extensions add to its game system, in the order campaign.yaml lists them, then the campaign's own additions, which win (CAM-2). */
|
|
89
71
|
export function systemLayers(root, context, campaign) {
|
|
90
72
|
const extensions = campaignExtensions(root, context).extensions.map((extension) => ({ from: extensionLayer(extension.name), data: extension.adds }));
|
|
91
73
|
return [...extensions, { from: campaignFileName, data: campaign }];
|
|
92
74
|
}
|
|
93
|
-
/** The layers over the campaign's system that it plays with, in order, and by name those left out because the system would not read with them (CAM-3). */
|
|
94
|
-
export function playedLayers(root, context) {
|
|
95
|
-
const refused = systemOf(root, context).refused.map((layer) => layer.from);
|
|
96
|
-
return { kept: systemLayers(root, context, readCampaignData(root)).filter((layer) => !refused.includes(layer.from)), refused };
|
|
97
|
-
}
|
|
98
|
-
/** The name of an extension's layer of additions, as messages give it. */
|
|
99
|
-
export function extensionLayer(name) {
|
|
100
|
-
return `the extension ${name}`;
|
|
101
|
-
}
|
|
102
|
-
/** The names an extension's words give the fields it adds; none when its words do not read, which validate names. */
|
|
103
|
-
function extensionFieldWords(extension, language) {
|
|
104
|
-
try {
|
|
105
|
-
return extensionWords(extension.folder, language)?.fields ?? {};
|
|
106
|
-
}
|
|
107
|
-
catch {
|
|
108
|
-
return {};
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
75
|
/** A setting the campaign's game system adds to the setup (DAT-10), by its name in any case; undefined when the system has none by that name. */
|
|
112
76
|
export function systemSetting(root, context, name) {
|
|
113
77
|
return campaignSystem(root, context)?.settings.find((setting) => comparableText(setting.name) === comparableText(name.trim()));
|
|
@@ -124,11 +88,6 @@ export function playedSettingValue(root, context, setting) {
|
|
|
124
88
|
export function playersOfTheGame(root, context) {
|
|
125
89
|
return playerCharacters(campaignWorld(root, context)).map((page) => page.name);
|
|
126
90
|
}
|
|
127
|
-
/** The value campaign.yaml gives a setting of the system, when it is one the system has (DAT-10). */
|
|
128
|
-
export function systemSettingValue(root, setting) {
|
|
129
|
-
const written = readTextSetting(root, setting.name);
|
|
130
|
-
return setting.values.find((value) => written !== undefined && comparableText(value.value) === comparableText(written))?.value;
|
|
131
|
-
}
|
|
132
91
|
/** "xp is not kept with advancement milestones": said when a field the campaign's settings leave out is written or changed (DAT-10); undefined for any other. */
|
|
133
92
|
export function leftOutNote(root, context, field) {
|
|
134
93
|
const setting = (campaignSystem(root, context)?.settings ?? []).find((candidate) => {
|
|
@@ -148,15 +107,6 @@ export function systemSettingProblems(root, context) {
|
|
|
148
107
|
}];
|
|
149
108
|
});
|
|
150
109
|
}
|
|
151
|
-
/** A setting as campaign.yaml writes it, of any kind; undefined when the file does not read, which validate reports on its own. */
|
|
152
|
-
function rawSetting(root, name) {
|
|
153
|
-
try {
|
|
154
|
-
return readOneSetting(root, name);
|
|
155
|
-
}
|
|
156
|
-
catch {
|
|
157
|
-
return undefined;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
110
|
/** "xp or milestones": the values of a setting of the system. */
|
|
161
111
|
export function valuesText(setting) {
|
|
162
112
|
const values = setting.values.map((value) => value.value);
|
|
@@ -194,20 +144,11 @@ export function systemProblems(root, context) {
|
|
|
194
144
|
fix: missingSystemFix(name, context),
|
|
195
145
|
}];
|
|
196
146
|
}
|
|
197
|
-
/** How a campaign gets the system it names that is not installed: one of ours with package install (D-513), else another of those installed, asked of the player. */
|
|
198
|
-
function missingSystemFix(name, context) {
|
|
199
|
-
const ours = ourSystems.find((one) => comparableText(one.name) === comparableText(name.trim()));
|
|
200
|
-
if (ours !== undefined) {
|
|
201
|
-
return `install it, one of RPG Engine's own, with package install ${ours.name}; until then, play on without its pages`;
|
|
202
|
-
}
|
|
203
|
-
const [first] = installedSystems(context.systemFolders);
|
|
204
|
-
return first === undefined ? "install the game system" : `ask the player which game you play, then config, setting system, value ${first.name}`;
|
|
205
|
-
}
|
|
206
147
|
/** The name of an installed game system, as it is installed; refused, with those that are, when none has it (D-167). */
|
|
207
148
|
export function installedSystemName(name, context, how) {
|
|
208
149
|
const system = findSystem(context.systemFolders, name);
|
|
209
150
|
if (system === undefined) {
|
|
210
|
-
const [first] =
|
|
151
|
+
const [first] = readableSystems(context.systemFolders);
|
|
211
152
|
const ours = ourSystems.find((one) => comparableText(one.name) === comparableText(name.trim()));
|
|
212
153
|
// One of ours is installed first, once the player wants it (D-513 (1)).
|
|
213
154
|
const example = ours !== undefined
|
|
@@ -219,11 +160,6 @@ export function installedSystemName(name, context, how) {
|
|
|
219
160
|
}
|
|
220
161
|
return system.name;
|
|
221
162
|
}
|
|
222
|
-
/** "Installed: 5e (the fifth edition, from the SRD 5.1)." */
|
|
223
|
-
function installedText(context) {
|
|
224
|
-
const systems = installedSystems(context.systemFolders);
|
|
225
|
-
return systems.length === 0 ? "No system is installed." : `Installed: ${systems.map((system) => `${system.name} (${system.title})`).join(", ")}.`;
|
|
226
|
-
}
|
|
227
163
|
/** " The campaign's system, Quinta edizione, is not installed, so none of its pages can be found: validate says how to fix it.": for a name not found (SYS-1). Empty otherwise. */
|
|
228
164
|
export function missingSystemHint(world) {
|
|
229
165
|
if (world.noSystem === true) {
|
|
@@ -311,3 +247,63 @@ export function countedByGame(system) {
|
|
|
311
247
|
const burning = Object.keys(system?.burning ?? {})[0];
|
|
312
248
|
return { upkeep: system?.upkeep !== undefined, ...(burning === undefined ? {} : { burning }) };
|
|
313
249
|
}
|
|
250
|
+
/** 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. */
|
|
251
|
+
function rigorPlayed(root, system) {
|
|
252
|
+
const value = engineSettingValue(system, (setting) => systemSettingValue(root, setting), "rigor", readTextSetting(root, "rigor"));
|
|
253
|
+
return typeof value === "string" ? value : undefined;
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* 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
|
|
257
|
+
* settings have it (DAT-10), read once until campaign.yaml changes: a call asks for it many times.
|
|
258
|
+
*/
|
|
259
|
+
function systemOf(root, context) {
|
|
260
|
+
// campaign.yaml, and the extensions' packages, whose parts and additions it gives.
|
|
261
|
+
return files().remember(`system ${resolve(root)}`, extensionSources(root, context), () => {
|
|
262
|
+
const name = readTextSetting(root, "system");
|
|
263
|
+
const found = name === undefined ? { refused: [] } : findCampaignSystem(context.systemFolders, name, systemLayers(root, context, readCampaignData(root)), readTextSetting(root, rulesetSetting));
|
|
264
|
+
// And the parts of the instructions of its extensions over its own (D-121).
|
|
265
|
+
const played = found.system === undefined ? undefined : withSettings(found.system, (setting) => readTextSetting(root, setting));
|
|
266
|
+
return played === undefined ? found : { ...found, system: { ...played, parts: layeredParts(played.parts, campaignExtensions(root, context).extensions) } };
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
/** The name of an extension's layer of additions, as messages give it. */
|
|
270
|
+
function extensionLayer(name) {
|
|
271
|
+
return `the extension ${name}`;
|
|
272
|
+
}
|
|
273
|
+
/** The names an extension's words give the fields it adds; none when its words do not read, which validate names. */
|
|
274
|
+
function extensionFieldWords(extension, language) {
|
|
275
|
+
try {
|
|
276
|
+
return extensionWords(extension.folder, language)?.fields ?? {};
|
|
277
|
+
}
|
|
278
|
+
catch {
|
|
279
|
+
return {};
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
/** The value campaign.yaml gives a setting of the system, when it is one the system has (DAT-10). */
|
|
283
|
+
function systemSettingValue(root, setting) {
|
|
284
|
+
const written = readTextSetting(root, setting.name);
|
|
285
|
+
return setting.values.find((value) => written !== undefined && comparableText(value.value) === comparableText(written))?.value;
|
|
286
|
+
}
|
|
287
|
+
/** A setting as campaign.yaml writes it, of any kind; undefined when the file does not read, which validate reports on its own. */
|
|
288
|
+
function rawSetting(root, name) {
|
|
289
|
+
try {
|
|
290
|
+
return readOneSetting(root, name);
|
|
291
|
+
}
|
|
292
|
+
catch {
|
|
293
|
+
return undefined;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
/** How a campaign gets the system it names that is not installed: one of ours with package install (D-513), else another of those installed, asked of the player. */
|
|
297
|
+
function missingSystemFix(name, context) {
|
|
298
|
+
const ours = ourSystems.find((one) => comparableText(one.name) === comparableText(name.trim()));
|
|
299
|
+
if (ours !== undefined) {
|
|
300
|
+
return `install it, one of RPG Engine's own, with package install ${ours.name}; until then, play on without its pages`;
|
|
301
|
+
}
|
|
302
|
+
const [first] = readableSystems(context.systemFolders);
|
|
303
|
+
return first === undefined ? "install the game system" : `ask the player which game you play, then config, setting system, value ${first.name}`;
|
|
304
|
+
}
|
|
305
|
+
/** "Installed: 5e (the fifth edition, from the SRD 5.1)." */
|
|
306
|
+
function installedText(context) {
|
|
307
|
+
const systems = readableSystems(context.systemFolders);
|
|
308
|
+
return systems.length === 0 ? "No system is installed." : `Installed: ${systems.map((system) => `${system.name} (${system.title})`).join(", ")}.`;
|
|
309
|
+
}
|
package/dist/commands/show.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export declare const show: import("../core/registry.ts").Command<z.ZodObject<{
|
|
|
8
8
|
type?: undefined;
|
|
9
9
|
path?: undefined;
|
|
10
10
|
system?: undefined;
|
|
11
|
+
title?: undefined;
|
|
11
12
|
hides?: undefined;
|
|
12
13
|
namesakes?: undefined;
|
|
13
14
|
section?: undefined;
|
|
@@ -41,6 +42,7 @@ export declare const show: import("../core/registry.ts").Command<z.ZodObject<{
|
|
|
41
42
|
type?: undefined;
|
|
42
43
|
path?: undefined;
|
|
43
44
|
system?: undefined;
|
|
45
|
+
title?: undefined;
|
|
44
46
|
hides?: undefined;
|
|
45
47
|
namesakes?: undefined;
|
|
46
48
|
section?: undefined;
|
|
@@ -69,9 +71,10 @@ export declare const show: import("../core/registry.ts").Command<z.ZodObject<{
|
|
|
69
71
|
knows?: undefined;
|
|
70
72
|
} | {
|
|
71
73
|
page: string;
|
|
72
|
-
type: "place" | "quest" | "creature" | "
|
|
74
|
+
type: "place" | "quest" | "creature" | "item" | "character" | "faction" | "event" | "topic" | undefined;
|
|
73
75
|
path: string;
|
|
74
76
|
system: string | undefined;
|
|
77
|
+
title: string | undefined;
|
|
75
78
|
hides: string | undefined;
|
|
76
79
|
namesakes: string[];
|
|
77
80
|
section: string | undefined;
|
package/dist/commands/show.js
CHANGED
|
@@ -2,18 +2,18 @@ import { z } from "zod";
|
|
|
2
2
|
import { requireCampaign } from "../campaign/index.js";
|
|
3
3
|
import { defineCommand } from "../core/registry.js";
|
|
4
4
|
import { comparableText, sameName, valueNamed, withArticle } from "../core/text.js";
|
|
5
|
-
import { backlinks, baseChain, findPage, formatFields, inheritedByBase, inheritedFields, isPartyMember, locate, namesakes, pageNamed,
|
|
5
|
+
import { backlinks, baseChain, findPage, formatFields, inheritedByBase, inheritedFields, isPartyMember, locate, namesakes, pageNamed, parsePageReference, playerCharacters, readSection, secretNames, sectionTitles, systemLabel, systemPageNamed, textParts, } from "../pages/index.js";
|
|
6
6
|
import { featureParts } from "../progression/index.js";
|
|
7
|
-
import { effectiveFields, effectsOf } from "./effect-layer.js";
|
|
8
|
-
import { surroundings, surroundingsText } from "./
|
|
9
|
-
import { holdsItems, isFallen, lootAdvice } from "./
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
7
|
+
import { effectiveFields, effectsOf } from "./shared/effect-layer.js";
|
|
8
|
+
import { surroundings, surroundingsText } from "./shared/environment.js";
|
|
9
|
+
import { holdsItems, isFallen, lootAdvice } from "./shared/loot.js";
|
|
10
|
+
import { skippedPagesNote } from "./shared/notes.js";
|
|
11
|
+
import { firstInChat } from "./shared/parts.js";
|
|
12
|
+
import { featureSource, progressionOf } from "./shared/progression.js";
|
|
13
|
+
import { closedScenes, copyLink, copyPage, lastClosedCopies, openSceneLog, readOpenScene, scenePlace } from "./shared/scene.js";
|
|
14
|
+
import { sheetFieldNames, sheetGroup, sheetGroupNames, sheetLines } from "./shared/sheet.js";
|
|
15
|
+
import { signedText, workedFields, workedLine, workedParts } from "./shared/worked-out.js";
|
|
16
|
+
import { campaignSystem, campaignWorld, missingSystemHint } from "./shared/world.js";
|
|
17
17
|
// A list longer than this shows its first items only (D-468).
|
|
18
18
|
const listedItems = 8;
|
|
19
19
|
export const show = defineCommand({
|
|
@@ -77,6 +77,7 @@ export const show = defineCommand({
|
|
|
77
77
|
type: page.type,
|
|
78
78
|
path: page.path,
|
|
79
79
|
system: page.system,
|
|
80
|
+
title: page.title,
|
|
80
81
|
hides: page.system === undefined && !isCopy && systemPageNamed(world, page.name) !== undefined ? world.system?.name : undefined,
|
|
81
82
|
// Acolyte (background) beside the creature Acolyte: the name alone leads here (SYS-2).
|
|
82
83
|
namesakes: isCopy || reference.section !== undefined ? [] : namesakes(world, page).map((other) => `${other.name}, ${other.system === undefined ? withArticle(other.type ?? "page") : systemLabel(other)}`),
|
|
@@ -86,7 +87,7 @@ export const show = defineCommand({
|
|
|
86
87
|
alsoCopy: !isCopy && copy !== undefined,
|
|
87
88
|
isIn: chain.map((holder) => holder.name),
|
|
88
89
|
alsoIn: alsoIn.map((holder) => holder.name),
|
|
89
|
-
around: page.type === "place" || page.type === "character" || isCopy ? surroundingsText(surroundings(world, isCopy ? scenePlace(world, scene
|
|
90
|
+
around: page.type === "place" || page.type === "character" || isCopy ? surroundingsText(surroundings(world, isCopy ? scenePlace(world, scene) : page)) : "",
|
|
90
91
|
sheet,
|
|
91
92
|
featureHint: sheet.length === 0 || group !== undefined ? undefined : featureHint(world, page),
|
|
92
93
|
onSheet: sheetFieldNames(world, system, page),
|
|
@@ -107,10 +108,11 @@ export const show = defineCommand({
|
|
|
107
108
|
parts: group.parts.filter((piece) => piece.text.split("\n").slice(1).some((line) => line.trim() !== "")).map((piece) => piece.name),
|
|
108
109
|
}))
|
|
109
110
|
: [],
|
|
110
|
-
|
|
111
|
+
// A system's page in the campaign's language where it has it, whole (D-542); a section as the system writes it.
|
|
112
|
+
text: group === undefined ? (part?.text ?? page.translated ?? page.body) : "",
|
|
111
113
|
linkedFrom: isCopy ? [] : backlinks(world, page).map((link) => ({ page: link.page.name, places: link.places })),
|
|
112
114
|
problems: world.problems,
|
|
113
|
-
loot: reference.section === undefined ? lootNote(world, system, page, chain) : undefined,
|
|
115
|
+
loot: reference.section === undefined ? (lootNote(world, system, page, chain) ?? fallenCopiesNote(root, world, system, page)) : undefined,
|
|
114
116
|
// What the character knows is view's, once in a chat (D-530): show holds what they have not found out.
|
|
115
117
|
knows: firstInChat(context, "show-knows") ? knowsNote : undefined,
|
|
116
118
|
};
|
|
@@ -135,6 +137,7 @@ export const show = defineCommand({
|
|
|
135
137
|
}
|
|
136
138
|
const header = [
|
|
137
139
|
title,
|
|
140
|
+
result.title === undefined ? "" : `Named in the campaign's language: ${result.title}.`,
|
|
138
141
|
result.hides === undefined ? "" : `This page hides the system ${result.hides}'s ${result.page}: links to that name lead here.`,
|
|
139
142
|
result.namesakes.length === 0 ? "" : `There is also ${result.namesakes.join("; ")}: show it by that name.`,
|
|
140
143
|
result.alsoCopy ? `${result.page} is also a copy in the open scene: change and write refuse both until the scene closes, which removes the copy, or the page is renamed.` : "",
|
|
@@ -181,6 +184,25 @@ function lootNote(world, system, page, chain) {
|
|
|
181
184
|
}
|
|
182
185
|
return isFallen(world, system, page) || holdsItems(world, page) ? `What is on or in ${page.name} is there to be found: ${lootAdvice}` : undefined;
|
|
183
186
|
}
|
|
187
|
+
/**
|
|
188
|
+
* The copies of a creature that fell in the last scene closed, gone with it, so that its page, which the master reads for what they carried, says so (D-530):
|
|
189
|
+
* while a player character is where that scene was, not in a fight elsewhere with another of its kind (Elena's loot3).
|
|
190
|
+
*/
|
|
191
|
+
function fallenCopiesNote(root, world, system, page) {
|
|
192
|
+
const last = lastClosedCopies(root);
|
|
193
|
+
if (page.type !== "creature" || !isThere(world, last.place)) {
|
|
194
|
+
return undefined;
|
|
195
|
+
}
|
|
196
|
+
const fallen = Object.entries(last.copies)
|
|
197
|
+
.filter(([name, copy]) => sameName([parsePageReference(copy.creature).name], page.name) !== undefined && isFallen(world, system, copyPage(name, copy)))
|
|
198
|
+
.map(([name]) => name);
|
|
199
|
+
return fallen.length === 0 ? undefined : `Fallen in the last scene, copies of ${page.name} that ended with it: ${fallen.join(", ")}. What they carried, as this page says, lies where they fell: ${lootAdvice}`;
|
|
200
|
+
}
|
|
201
|
+
/** Whether a player character is in the place named, or the place is not known: a scene in no place, or player characters in none. */
|
|
202
|
+
function isThere(world, place) {
|
|
203
|
+
const placesOfPlayers = playerCharacters(world).map((pc) => [pc, ...locate(world, pc).chain].find((holder) => holder.type === "place")).filter((found) => found !== undefined);
|
|
204
|
+
return place === undefined || placesOfPlayers.length === 0 || placesOfPlayers.some((found) => sameName([found.name], place) !== undefined);
|
|
205
|
+
}
|
|
184
206
|
/** The fields with a list longer than `listedItems` cut to its first ones and how to see them all, as knows of a well-travelled character (D-468). */
|
|
185
207
|
function cutLists(fields, page) {
|
|
186
208
|
return Object.fromEntries(Object.entries(fields).map(([field, value]) => [
|
|
@@ -197,10 +219,6 @@ function repeatsRead(world, worked) {
|
|
|
197
219
|
function nameWithSystem(page) {
|
|
198
220
|
return page.system === undefined ? page.name : `${page.name} (${page.system})`;
|
|
199
221
|
}
|
|
200
|
-
/** The place of the open scene, where its copies are (ENV-2); undefined when it has none, or none that exists. */
|
|
201
|
-
function scenePlace(world, place) {
|
|
202
|
-
return place === undefined ? undefined : pagesWithName(world, parsePageReference(place).name)[0];
|
|
203
|
-
}
|
|
204
222
|
/** "ac 15 (13 without)": the values the page's effects give, each with the one it reads without them (EFF-10). */
|
|
205
223
|
function coveredValues(world, page) {
|
|
206
224
|
const without = inheritedFields(world, page);
|
package/dist/commands/status.js
CHANGED
|
@@ -6,32 +6,32 @@ import { isInParty, isPartyMember, isPlayerCharacter, locate, pagesWithName, par
|
|
|
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 {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { effectShown, keptEffects } from "./
|
|
13
|
-
import { surroundings, surroundingsText } from "./
|
|
14
|
-
import { clocksToMove, dueAdvice, dueText, isDated, isDue, plannedEvents, plannedText, worldFacts } from "./
|
|
15
|
-
import { experienceOf, levelDueNote } from "./
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import { packageCodeProblems } from "./
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
9
|
+
import { importLine } from "./import/import.js";
|
|
10
|
+
import { allStateChecks, markStateChecksTold } from "./shared/checks.js";
|
|
11
|
+
import { effectiveFields, effectsOf } from "./shared/effect-layer.js";
|
|
12
|
+
import { effectShown, keptEffects } from "./shared/effects.js";
|
|
13
|
+
import { surroundings, surroundingsText } from "./shared/environment.js";
|
|
14
|
+
import { clocksToMove, dueAdvice, dueText, isDated, isDue, plannedEvents, plannedText, worldFacts } from "./shared/events.js";
|
|
15
|
+
import { experienceOf, levelDueNote } from "./shared/experience.js";
|
|
16
|
+
import { picturesNote } from "./shared/images.js";
|
|
17
|
+
import { journeyText, readJourney } from "./shared/journey.js";
|
|
18
|
+
import { campaignMode, campaignNote } from "./shared/mode.js";
|
|
19
|
+
import { campaignCoins } from "./shared/money.js";
|
|
20
|
+
import { livingMood, masterMood } from "./shared/moods.js";
|
|
21
|
+
import { heldSystemSettings, isFixedSetting, playedEngineSetting } from "./shared/offers.js";
|
|
22
|
+
import { installableSystems } from "./shared/packages/catalog.js";
|
|
23
|
+
import { packageCodeProblems } from "./shared/packages/code.js";
|
|
24
|
+
import { extensionsLine } from "./shared/packages/extensions.js";
|
|
25
|
+
import { countersText, pageCounters, partyCounters } from "./shared/page-counters.js";
|
|
26
|
+
import { adventurePart, firstInChat, situationPart } from "./shared/parts.js";
|
|
27
|
+
import { campaignProblems } from "./shared/problems.js";
|
|
28
|
+
import { adventureUnderWay, isTickedOpenQuest, openQuestText } from "./shared/quests.js";
|
|
29
|
+
import { measuresOf, roadsOf } from "./shared/roads.js";
|
|
30
|
+
import { interruptedLoad } from "./shared/saves.js";
|
|
31
|
+
import { closedScenes, copyCounters, copyPage, partyAwayText, readOpenScene } from "./shared/scene.js";
|
|
32
|
+
import { missingSheetFields, overLoad, sheetSummary } from "./shared/sheet.js";
|
|
33
|
+
import { datedText, problemText, readPresent } from "./shared/time.js";
|
|
34
|
+
import { campaignSystem, campaignWorld, countedByGame, playedSettingValue, systemInStatus } from "./shared/world.js";
|
|
35
35
|
import { translationOffer } from "./translate.js";
|
|
36
36
|
// Lists in the status show this many names, then say how many more there are and how to find them.
|
|
37
37
|
const shownNames = 3;
|
|
@@ -48,7 +48,7 @@ export const status = defineCommand({
|
|
|
48
48
|
input: z.object({}),
|
|
49
49
|
async run(input, context) {
|
|
50
50
|
const root = requireCampaign(context.folder);
|
|
51
|
-
const codeProblems = await packageCodeProblems(root, context
|
|
51
|
+
const codeProblems = await packageCodeProblems(root, context);
|
|
52
52
|
const settings = readSettings(root);
|
|
53
53
|
// An engine's setting as the game plays it, none where it plays one value alone, which is no choice to show (DAT-16).
|
|
54
54
|
const played = (name) => {
|
|
@@ -221,7 +221,7 @@ export const status = defineCommand({
|
|
|
221
221
|
result.mood === "neutral" ? "" : `Your mood is ${result.mood}: let your voice follow it.`,
|
|
222
222
|
...result.incompleteSheets,
|
|
223
223
|
...result.levelsDue,
|
|
224
|
-
namesLine("Also there", result.alsoThere, `show ${result.place}`),
|
|
224
|
+
namesLine("Also there", result.alsoThere, result.place === undefined ? "find" : `show ${result.place}`),
|
|
225
225
|
result.scene === undefined ? "" : `Scene: ${result.scene}`,
|
|
226
226
|
result.journey === undefined ? "" : `Journey: ${result.journey}`,
|
|
227
227
|
result.lastScenes.length === 0 ? "" : `Last scenes: ${result.lastScenes.join(" · ")}`,
|
|
@@ -3,9 +3,9 @@ import { requireCampaign } from "../campaign/index.js";
|
|
|
3
3
|
import { appendLogEntry } from "../core/log.js";
|
|
4
4
|
import { defineCommand } from "../core/registry.js";
|
|
5
5
|
import { isInParty, pageNamed } from "../pages/index.js";
|
|
6
|
-
import { thoughtsLength, thoughtsType } from "./
|
|
7
|
-
import { newDatedLogEntry } from "./
|
|
8
|
-
import { campaignWorld } from "./
|
|
6
|
+
import { thoughtsLength, thoughtsType } from "./shared/thoughts.js";
|
|
7
|
+
import { newDatedLogEntry } from "./shared/time.js";
|
|
8
|
+
import { campaignWorld } from "./shared/world.js";
|
|
9
9
|
export const thoughts = defineCommand({
|
|
10
10
|
name: "thoughts",
|
|
11
11
|
description: "Write a few lines in a companion's diary, when an output says it is due or after a moment that changed them, in their voice: "
|
package/dist/commands/trade.js
CHANGED
|
@@ -5,16 +5,15 @@ import { defineCommand } from "../core/registry.js";
|
|
|
5
5
|
import { comparableText } from "../core/text.js";
|
|
6
6
|
import { addCoins, changeFrom, formatAmount, isSafePurse, payCoins, readAmount, takeCoins, totalOf } from "../money/index.js";
|
|
7
7
|
import { applyMove, canHold, concernsPlayer, countedText, declaredKind, inheritedFields, isPartyMember, kindNamed, locate, MoveStopped, ownField, pageNamed, parsePageReference, readEntry, stackName, } from "../pages/index.js";
|
|
8
|
-
import { coinExamples } from "./
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
const textList = z.union([z.string(), z.array(z.string())]);
|
|
8
|
+
import { coinExamples } from "./shared/examples.js";
|
|
9
|
+
import { textList } from "./shared/inputs.js";
|
|
10
|
+
import { campaignCoins } from "./shared/money.js";
|
|
11
|
+
import { afterMoves, pagesPlan } from "./shared/moves.js";
|
|
12
|
+
import { skippedPagesNote } from "./shared/notes.js";
|
|
13
|
+
import { copyName, readOpenScene } from "./shared/scene.js";
|
|
14
|
+
import { heldStack, logStackSteps, stackEdits, stackMoveSteps, stackStepText, unequipKinds } from "./shared/stacks.js";
|
|
15
|
+
import { newDatedLogEntry } from "./shared/time.js";
|
|
16
|
+
import { campaignWorld, missingSystemHint } from "./shared/world.js";
|
|
18
17
|
export const trade = defineCommand({
|
|
19
18
|
name: "trade",
|
|
20
19
|
description: "Buy, sell or barter in one go: what page gives and what it gets, items and money both ways, with the change in coins. "
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import type { Context } from "../core/context.ts";
|
|
3
|
-
import { type ChatBatch } from "
|
|
3
|
+
import { type ChatBatch } from "./shared/page-words.ts";
|
|
4
4
|
export declare const translate: import("../core/registry.ts").Command<z.ZodObject<{
|
|
5
5
|
phrases: z.ZodOptional<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodString>, z.ZodString]>>;
|
|
6
6
|
}, z.core.$strip>, {
|
|
@@ -2,9 +2,9 @@ import { z } from "zod";
|
|
|
2
2
|
import { readSettings, requireCampaign } from "../campaign/index.js";
|
|
3
3
|
import { appendLogEntry } from "../core/log.js";
|
|
4
4
|
import { defineCommand } from "../core/registry.js";
|
|
5
|
-
import { chatBatch, keepChatAnswer, languageName, shipsLanguage } from "
|
|
6
|
-
import { newDatedLogEntry } from "./
|
|
7
|
-
import { campaignSystem } from "./
|
|
5
|
+
import { chatBatch, keepChatAnswer, languageName, shipsLanguage } from "./shared/page-words.js";
|
|
6
|
+
import { newDatedLogEntry } from "./shared/time.js";
|
|
7
|
+
import { campaignSystem } from "./shared/world.js";
|
|
8
8
|
export const translate = defineCommand({
|
|
9
9
|
name: "translate",
|
|
10
10
|
description: "Translate the player's dashboard into the campaign's language yourself, in the chat. "
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type Page, type Position, type World } from "
|
|
2
|
-
import type { GameSystem } from "
|
|
3
|
-
import { type Measures, type Roads } from "
|
|
1
|
+
import { type Page, type Position, type World } from "../../pages/index.ts";
|
|
2
|
+
import type { GameSystem } from "../../systems/index.ts";
|
|
3
|
+
import { type Measures, type Roads } from "../shared/roads.ts";
|
|
4
4
|
/** A leg of a straight line across country: the region it runs in, none in the open, its length in metres and the metres a minute at the pace there. */
|
|
5
5
|
export interface OpenLeg {
|
|
6
6
|
region?: Page;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
// Travel off the roads (D-259, TRV-12, TRV-13): a straight line across the regions of the map, each with its terrain, and the roads it crosses.
|
|
2
|
-
import { crossingAlong, distanceBetween, pointAlong } from "
|
|
3
|
-
import { pagesWithName } from "
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { lengthText, terrainFactor } from "./game-roads.js";
|
|
2
|
+
import { crossingAlong, distanceBetween, pointAlong } from "../../map/index.js";
|
|
3
|
+
import { mapKey, pagesWithName } from "../../pages/index.js";
|
|
4
|
+
import { placedPosition, positionOf, regionAt, relationText } from "../shared/positions.js";
|
|
5
|
+
import { lengthText, terrainFactor } from "../shared/roads.js";
|
|
7
6
|
// The line is judged every this many metres: a region smaller than this may be missed, which the master can always say.
|
|
8
7
|
const sampleMetres = 250;
|
|
9
8
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const route: import("
|
|
2
|
+
export declare const route: import("../../core/registry.ts").Command<z.ZodObject<{
|
|
3
3
|
to: z.ZodString;
|
|
4
4
|
from: z.ZodOptional<z.ZodString>;
|
|
5
5
|
pace: z.ZodOptional<z.ZodString>;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { requireCampaign } from "
|
|
3
|
-
import { defineCommand } from "
|
|
4
|
-
import { distanceBetween } from "
|
|
5
|
-
import { locate, pageNamed, parsePageReference } from "
|
|
6
|
-
import { journeyStart, moversPosition, readJourney } from "
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { campaignSystem, campaignWorld, missingSystemHint } from "./game-world.js";
|
|
2
|
+
import { requireCampaign } from "../../campaign/index.js";
|
|
3
|
+
import { defineCommand } from "../../core/registry.js";
|
|
4
|
+
import { distanceBetween } from "../../map/index.js";
|
|
5
|
+
import { locate, mapKey, pageNamed, parsePageReference } from "../../pages/index.js";
|
|
6
|
+
import { journeyStart, moversPosition, readJourney } from "../shared/journey.js";
|
|
7
|
+
import { pointText, positionOf } from "../shared/positions.js";
|
|
8
|
+
import { dayHours, durationText, goingText, lengthText, measuresOf, moversOf, noWayText, paceOf, partyLead, roadsOf, sameSpot, stopOf, travellingParty, unknownOnRoad, wayFor, wayText } from "../shared/roads.js";
|
|
9
|
+
import { campaignSystem, campaignWorld, missingSystemHint } from "../shared/world.js";
|
|
10
|
+
import { acrossHint, openLegs } from "./open.js";
|
|
12
11
|
export const route = defineCommand({
|
|
13
12
|
name: "route",
|
|
14
13
|
description: "How far a place is by road, and how long the journey takes: the stops and roads of the quickest way, the distance and the days, at the party's pace or another. "
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { type TimePassed } from "
|
|
2
|
+
import { type TimePassed } from "../shared/advance.ts";
|
|
3
3
|
/** How a travel ended (TRV-7, TRV-12): at a place, at the end of a distance in the open, at an event, at the end of the day's travel, or before it began. */
|
|
4
4
|
type Ending = {
|
|
5
5
|
kind: "arrived";
|
|
@@ -37,7 +37,7 @@ interface TravelResult {
|
|
|
37
37
|
time?: TimePassed;
|
|
38
38
|
notes: string[];
|
|
39
39
|
}
|
|
40
|
-
export declare const travel: import("
|
|
40
|
+
export declare const travel: import("../../core/registry.ts").Command<z.ZodObject<{
|
|
41
41
|
to: z.ZodOptional<z.ZodString>;
|
|
42
42
|
across: z.ZodOptional<z.ZodBoolean>;
|
|
43
43
|
toward: z.ZodOptional<z.ZodString>;
|