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,23 +1,21 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { requireCampaign } from "
|
|
3
|
-
import { readLength } from "
|
|
4
|
-
import { defineCommand } from "
|
|
5
|
-
import { directionHelp, directionName, distanceBetween, pointAlong, pointFrom, readDirection } from "
|
|
6
|
-
import { environmentAt, locate, pageNamed, parsePageReference, playerCharacters } from "
|
|
7
|
-
import { addDuration, formatGameDate, minutesBetween } from "
|
|
8
|
-
import { aroundLead, passedLines, passTime } from "
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { movePages } from "
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
// A list, or one text, as an MCP client may send it.
|
|
20
|
-
const textList = z.union([z.string(), z.array(z.string())]);
|
|
2
|
+
import { requireCampaign } from "../../campaign/index.js";
|
|
3
|
+
import { readLength } from "../../core/length.js";
|
|
4
|
+
import { defineCommand } from "../../core/registry.js";
|
|
5
|
+
import { directionHelp, directionName, distanceBetween, pointAlong, pointFrom, readDirection } from "../../map/index.js";
|
|
6
|
+
import { environmentAt, locate, mapKey, mapOf, pageNamed, parsePageReference, playerCharacters } from "../../pages/index.js";
|
|
7
|
+
import { addDuration, formatGameDate, minutesBetween } from "../../time/index.js";
|
|
8
|
+
import { aroundLead, passedLines, passTime } from "../shared/advance.js";
|
|
9
|
+
import { textList, textsOf } from "../shared/inputs.js";
|
|
10
|
+
import { journeyPoint, journeyStart, moversMap, moversNamed, moversPosition, readJourney, ridersOf, sameMovers, saveJourney, travelledSinceRest } from "../shared/journey.js";
|
|
11
|
+
import { movePages } from "../shared/moves.js";
|
|
12
|
+
import { timePassedLines } from "../shared/packages/code.js";
|
|
13
|
+
import { nearPlaces, pointText, positionOf, regionAt } from "../shared/positions.js";
|
|
14
|
+
import { dayHours, durationText, goingText, hoursText, isVehicleOnly, kindOf, lengthText, measuresOf, moversOf, noWayText, paceOf, partyLead, roadsOf, sameSpot, speedOf, stepEnd, stopOf, travellingParty, unknownOnRoad, wayFor, wayText, } from "../shared/roads.js";
|
|
15
|
+
import { readOpenScene } from "../shared/scene.js";
|
|
16
|
+
import { presentDate } from "../shared/time.js";
|
|
17
|
+
import { campaignSystem, campaignWorld, missingSystemHint } from "../shared/world.js";
|
|
18
|
+
import { acrossHint, crossedRoads, openLegs } from "./open.js";
|
|
21
19
|
export const travel = defineCommand({
|
|
22
20
|
name: "travel",
|
|
23
21
|
description: "Make a journey: whenever the party goes somewhere, use it instead of advance and move. "
|
|
@@ -343,7 +341,6 @@ function aroundLines(world, roads, from, point, measures, map = "") {
|
|
|
343
341
|
"No place is written here: to make it one, such as a camp, write <name>, type place, here.",
|
|
344
342
|
].filter((line) => line !== "");
|
|
345
343
|
}
|
|
346
|
-
/** The travellers (TRV-6): the characters named, or the party where the player character is; in the open, those of its journey. */
|
|
347
344
|
/** "Corrado stays in Roccalba: …": who travels leaves out the player character where they start, which who may not have meant (playtest 05). */
|
|
348
345
|
function stayingNote(world, travellers) {
|
|
349
346
|
const placeOf = (page) => locate(world, page).chain.find((holder) => holder.type === "place");
|
|
@@ -357,8 +354,9 @@ function stayingNote(world, travellers) {
|
|
|
357
354
|
}
|
|
358
355
|
return `${staying.map((pc) => pc.name).join(" and ")} ${staying.length === 1 ? "stays" : "stay"} in ${start.name}: who replaces the party; to go together, leave who out, or name the party too.`;
|
|
359
356
|
}
|
|
357
|
+
/** The travellers (TRV-6): the characters named, or the party where the player character is; in the open, those of its journey. */
|
|
360
358
|
function travellersOf(world, who, journey) {
|
|
361
|
-
const names = (
|
|
359
|
+
const names = textsOf(who);
|
|
362
360
|
if (names.length === 0) {
|
|
363
361
|
const party = travellingParty(world, partyLead(world, journey?.movers ?? [], "Give who, the characters who travel."), journey?.movers ?? []);
|
|
364
362
|
if (party.length === 0) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { requireCampaign } from "../campaign/index.js";
|
|
3
3
|
import { defineCommand } from "../core/registry.js";
|
|
4
|
-
import { stateCheckProblems } from "./
|
|
5
|
-
import { packageCodeProblems } from "./
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { stateCheckProblems } from "./shared/checks.js";
|
|
5
|
+
import { packageCodeProblems } from "./shared/packages/code.js";
|
|
6
|
+
import { campaignProblems } from "./shared/problems.js";
|
|
7
|
+
import { campaignWorld } from "./shared/world.js";
|
|
8
8
|
export const validate = defineCommand({
|
|
9
9
|
name: "validate",
|
|
10
10
|
description: "Check the whole campaign and say how to fix each problem. "
|
|
@@ -16,7 +16,7 @@ export const validate = defineCommand({
|
|
|
16
16
|
async run(input, context) {
|
|
17
17
|
const root = requireCampaign(context.folder);
|
|
18
18
|
// And what keeps an extension's code from being used, which only loading it tells (D-441).
|
|
19
|
-
return { problems: [...campaignProblems(root, campaignWorld(root, context), context), ...await packageCodeProblems(root, context
|
|
19
|
+
return { problems: [...campaignProblems(root, campaignWorld(root, context), context), ...await packageCodeProblems(root, context), ...stateCheckProblems(root, context)] };
|
|
20
20
|
},
|
|
21
21
|
format(result) {
|
|
22
22
|
if (result.problems.length === 0) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type LogEntry } from "
|
|
2
|
-
import { type World } from "
|
|
3
|
-
import type { GameDate } from "
|
|
4
|
-
import type { SeenEffect } from "
|
|
5
|
-
import { type Knowledge } from "
|
|
1
|
+
import { type LogEntry } from "../../core/log.ts";
|
|
2
|
+
import { type World } from "../../pages/index.ts";
|
|
3
|
+
import type { GameDate } from "../../time/index.ts";
|
|
4
|
+
import type { SeenEffect } from "../shared/effects.ts";
|
|
5
|
+
import { type Knowledge } from "../shared/knowledge.ts";
|
|
6
6
|
/** A quest as the journal shows it (VIEW-8). */
|
|
7
7
|
export interface ShownQuest {
|
|
8
8
|
name: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// The player's journal (D-367, VIEW-8, VIEW-9): the quests the player character knows, as a video game's quest log, with their goals, counters, clock and
|
|
2
2
|
// deadline; and the story by its scenes, as chapters, each with what the diary tells of it.
|
|
3
|
-
import { readLog } from "
|
|
4
|
-
import { comparableText } from "
|
|
5
|
-
import { goalsIn, links, textsIn } from "
|
|
6
|
-
import { knownSecretsApart, knownText } from "
|
|
7
|
-
import { measuresText, questMeasures } from "
|
|
3
|
+
import { readLog } from "../../core/log.js";
|
|
4
|
+
import { comparableText } from "../../core/text.js";
|
|
5
|
+
import { goalsIn, links, textsIn } from "../../pages/index.js";
|
|
6
|
+
import { knownSecretsApart, knownText } from "../shared/knowledge.js";
|
|
7
|
+
import { measuresText, questMeasures } from "../shared/quests.js";
|
|
8
8
|
// The story tells what happened at its hour; time passing is no fact of it, the hours of the facts show it.
|
|
9
9
|
const storyKinds = ["counter", "moved", "learned", "effect", "effect-ended", "back", "quest"];
|
|
10
10
|
const statuses = ["open", "done", "failed"];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type Page } from "
|
|
2
|
-
import { type Measures } from "
|
|
3
|
-
import type { PlaceSight } from "./
|
|
1
|
+
import { type Page } from "../../pages/index.ts";
|
|
2
|
+
import { type Measures } from "../shared/roads.ts";
|
|
3
|
+
import type { PlaceSight } from "./place.ts";
|
|
4
4
|
/** A point of a map, in km east and north of its centre; with the map it is on, by the place that holds it, none for the main map (POS-8). */
|
|
5
5
|
export interface MapPoint {
|
|
6
6
|
x: number;
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
// The world map as the player character knows it, for the dashboard (VIEW-7, D-316, D-318, D-320): the maps it knows; on each, the places it knows with their
|
|
2
2
|
// kind and where they are, the regions with their biome, the roads as far as it knows their stops, the party and its trail. Never a place it does not know,
|
|
3
3
|
// neither its name nor its point.
|
|
4
|
-
import { formatLength, trueImperialUnits } from "
|
|
5
|
-
import { readLog } from "
|
|
6
|
-
import { comparableText } from "
|
|
7
|
-
import { directionName, directionTo, distanceBetween } from "
|
|
8
|
-
import { environmentAt, locate, pagesWithName, parsePageReference, readStops } from "
|
|
9
|
-
import { shownImage } from "
|
|
10
|
-
import { moversMap, moversNamed, moversPosition, readJourney } from "
|
|
11
|
-
import { knowsPage } from "
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { campaignSystem } from "./game-world.js";
|
|
4
|
+
import { formatLength, trueImperialUnits } from "../../core/length.js";
|
|
5
|
+
import { readLog } from "../../core/log.js";
|
|
6
|
+
import { comparableText } from "../../core/text.js";
|
|
7
|
+
import { directionName, directionTo, distanceBetween } from "../../map/index.js";
|
|
8
|
+
import { environmentAt, locate, mapKey, mapOf, pagesWithName, parsePageReference, readStops } from "../../pages/index.js";
|
|
9
|
+
import { shownImage } from "../shared/images.js";
|
|
10
|
+
import { moversMap, moversNamed, moversPosition, readJourney } from "../shared/journey.js";
|
|
11
|
+
import { knowsPage } from "../shared/knowledge.js";
|
|
12
|
+
import { placedPosition, positionOf, regionsOf } from "../shared/positions.js";
|
|
13
|
+
import { kindOf, roadsOf, travellingParty } from "../shared/roads.js";
|
|
14
|
+
import { campaignSystem } from "../shared/world.js";
|
|
16
15
|
// How far a road toward a stop the character does not know is drawn, at most: a beginning, never where the stop is.
|
|
17
16
|
const stubMetres = 3000;
|
|
18
17
|
// How many places the chat lists.
|
|
@@ -67,6 +66,10 @@ export function mapText(map) {
|
|
|
67
66
|
...others,
|
|
68
67
|
].filter((block) => block !== "").join("\n");
|
|
69
68
|
}
|
|
69
|
+
/** A place's kind as the page writes it (POS-7), such as village; undefined when it has none, or an empty one (D-107). */
|
|
70
|
+
export function placeKind(page) {
|
|
71
|
+
return typeof page.fields.kind === "string" && page.fields.kind.trim() !== "" ? page.fields.kind.trim() : undefined;
|
|
72
|
+
}
|
|
70
73
|
/** A place as the map shows it; none for one neither drawn nor held by a place that is. Its distance from the party only on the party's map. */
|
|
71
74
|
function mapPlace(sight, roads, page, known, party) {
|
|
72
75
|
const { world } = sight;
|
|
@@ -264,7 +267,3 @@ function fromText(from, unit) {
|
|
|
264
267
|
function km(metres) {
|
|
265
268
|
return Math.round(metres / 10) / 100;
|
|
266
269
|
}
|
|
267
|
-
/** A place's kind as the page writes it (POS-7), such as village; undefined when it has none, or an empty one (D-107). */
|
|
268
|
-
export function placeKind(page) {
|
|
269
|
-
return typeof page.fields.kind === "string" && page.fields.kind.trim() !== "" ? page.fields.kind.trim() : undefined;
|
|
270
|
-
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { Context } from "
|
|
2
|
-
import type { Effect, EffectEnd } from "
|
|
3
|
-
import { type Page, type World } from "
|
|
4
|
-
import type { GameSystem } from "
|
|
5
|
-
import { type SeenEffect } from "
|
|
6
|
-
import { type Knowledge } from "
|
|
1
|
+
import type { Context } from "../../core/context.ts";
|
|
2
|
+
import type { Effect, EffectEnd } from "../../effects/index.ts";
|
|
3
|
+
import { type Page, type World } from "../../pages/index.ts";
|
|
4
|
+
import type { GameSystem } from "../../systems/index.ts";
|
|
5
|
+
import { type SeenEffect } from "../shared/effects.ts";
|
|
6
|
+
import { type Knowledge } from "../shared/knowledge.ts";
|
|
7
7
|
/** Someone at the place or in the scene as the player sees them: a name, or someone; their role and picture; for copies of a creature, how many. */
|
|
8
8
|
export interface ShownPerson {
|
|
9
9
|
name: string;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { formatStep } from "
|
|
2
|
-
import { files } from "
|
|
3
|
-
import { comparableText } from "
|
|
4
|
-
import { readCounter } from "
|
|
5
|
-
import { reachable, squareName, squaresApart, withoutMapBlock } from "
|
|
6
|
-
import { hiddenImageName } from "
|
|
7
|
-
import { environmentAt, isPlayerCharacter, locate, pagesWithName, pagesWithNameOrAlias, parsePageReference, placesAround } from "
|
|
8
|
-
import { effectsOf } from "
|
|
9
|
-
import { conditionMark, effectParts, keptEffects, systemNamed } from "
|
|
10
|
-
import { isTurnOf, movedThisTurn, sideOf, walkingSpeed } from "
|
|
11
|
-
import { placeGrid, placeLook, standing } from "
|
|
12
|
-
import { imageFile, ownImage, shownImage } from "
|
|
13
|
-
import { knownSecretsApart, knownText, knowsPage } from "
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
1
|
+
import { formatStep } from "../../core/length.js";
|
|
2
|
+
import { files } from "../../core/store.js";
|
|
3
|
+
import { comparableText } from "../../core/text.js";
|
|
4
|
+
import { readCounter } from "../../counters/index.js";
|
|
5
|
+
import { reachable, squareName, squaresApart, withoutMapBlock } from "../../grid/index.js";
|
|
6
|
+
import { hiddenImageName } from "../../images/index.js";
|
|
7
|
+
import { environmentAt, isPlayerCharacter, locate, pagesWithName, pagesWithNameOrAlias, parsePageReference, placesAround } from "../../pages/index.js";
|
|
8
|
+
import { effectsOf } from "../shared/effect-layer.js";
|
|
9
|
+
import { conditionMark, effectParts, keptEffects, systemNamed } from "../shared/effects.js";
|
|
10
|
+
import { isTurnOf, movedThisTurn, sideOf, walkingSpeed } from "../shared/grid-moves.js";
|
|
11
|
+
import { placeGrid, placeLook, standing } from "../shared/grids.js";
|
|
12
|
+
import { imageFile, ownImage, shownImage } from "../shared/images.js";
|
|
13
|
+
import { knownSecretsApart, knownText, knowsPage } from "../shared/knowledge.js";
|
|
14
|
+
import { pageCounters } from "../shared/page-counters.js";
|
|
15
|
+
import { measuresOf } from "../shared/roads.js";
|
|
16
|
+
import { copyPage, readOpenScene } from "../shared/scene.js";
|
|
17
|
+
import { tokenIcon } from "../shared/sheet.js";
|
|
18
|
+
import { turnMarks } from "../shared/turn-uses.js";
|
|
19
|
+
import { campaignSystem } from "../shared/world.js";
|
|
20
20
|
/** Where the player character is, as it knows it; none when it is in no place it knows, as in the open on a journey. */
|
|
21
21
|
export function shownPlace(sight) {
|
|
22
22
|
const { world, knowledge } = sight;
|
|
@@ -54,6 +54,95 @@ export function shownPlace(sight) {
|
|
|
54
54
|
...(grid === undefined ? {} : { map: shownGrid(sight, place, grid) }),
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
|
+
/** The open scene as the player sees it; none when no scene is open, or it cannot be read. */
|
|
58
|
+
export function shownScene(sight) {
|
|
59
|
+
const { scene } = readOpenScene(sight.root);
|
|
60
|
+
if (scene === undefined) {
|
|
61
|
+
return undefined;
|
|
62
|
+
}
|
|
63
|
+
const place = knownPage(sight, scene.place);
|
|
64
|
+
const characters = scene.with.map((link) => {
|
|
65
|
+
const name = parsePageReference(link).name;
|
|
66
|
+
const page = knownPage(sight, link);
|
|
67
|
+
const hostile = hostileMark(scene, name);
|
|
68
|
+
const written = pagesWithName(sight.world, name)[0];
|
|
69
|
+
const state = written === undefined ? {} : strangerState(sight, scene, written);
|
|
70
|
+
const image = strangerPicture(sight, name);
|
|
71
|
+
return page === undefined
|
|
72
|
+
? { name: seenName(scene, name), role: "other", stranger: true, ...(image === undefined ? {} : { image }), ...hostile, ...state }
|
|
73
|
+
: { ...person(sight, page), ...hostile, ...stateOf(sight, page) };
|
|
74
|
+
});
|
|
75
|
+
const creatures = [...new Set(Object.values(scene.copies).map((copy) => copy.creature))].map((creature) => {
|
|
76
|
+
const count = Object.values(scene.copies).filter((copy) => copy.creature === creature).length;
|
|
77
|
+
const page = knownPage(sight, creature);
|
|
78
|
+
// A kind the character does not know by the letter its copies have in the scene, as creature B, with more kinds (D-331).
|
|
79
|
+
const first = Object.keys(scene.copies).find((copy) => scene.copies[copy].creature === creature);
|
|
80
|
+
const name = first === undefined ? "creature" : strangerName(scene, first).replace(/\s*\d+$/, "");
|
|
81
|
+
// A kind is hostile when one of its copies is.
|
|
82
|
+
const hostile = Object.keys(scene.copies).some((copy) => scene.copies[copy].creature === creature && hostileMark(scene, copy).hostile === true) ? { hostile: true } : {};
|
|
83
|
+
// A kind of one copy shows its state; of more, each shows its own on the map and in Combat.
|
|
84
|
+
const state = count === 1 && first !== undefined ? stateOf(sight, copyPage(first, scene.copies[first])) : {};
|
|
85
|
+
const image = strangerPicture(sight, creature);
|
|
86
|
+
return page === undefined
|
|
87
|
+
? { name, role: "other", stranger: true, ...(image === undefined ? {} : { image }), count, ...hostile, ...state }
|
|
88
|
+
: { ...person(sight, page), count, ...hostile, ...state };
|
|
89
|
+
});
|
|
90
|
+
const turnName = (name) => shownTurn(sight, scene, name);
|
|
91
|
+
// What who acts has used of the turn, as marks beside them, for the party alone: a foe's are the master's to tell (TRN-4, D-453).
|
|
92
|
+
const acting = scene.turn;
|
|
93
|
+
const ours = acting !== undefined && sight.party.some((page) => comparableText(page.name) === comparableText(acting));
|
|
94
|
+
const marks = ours ? turnMarks(campaignSystem(sight.root, sight.context), scene, acting) : [];
|
|
95
|
+
return {
|
|
96
|
+
title: scene.title,
|
|
97
|
+
type: scene.type,
|
|
98
|
+
...(scene.opened === undefined ? {} : { since: scene.opened }),
|
|
99
|
+
...(scene.now === undefined ? {} : { now: scene.now }),
|
|
100
|
+
...(place === undefined ? {} : { place: place.name }),
|
|
101
|
+
who: [...characters, ...creatures],
|
|
102
|
+
...(scene.order === undefined ? {} : { order: scene.order.map(turnName) }),
|
|
103
|
+
...(scene.turn === undefined ? {} : { turn: turnName(scene.turn) }),
|
|
104
|
+
// The round only where the game has rounds (D-314 (3)): Ironsworn has none.
|
|
105
|
+
...(scene.round === undefined || campaignSystem(sight.root, sight.context)?.roundSeconds === undefined ? {} : { round: scene.round }),
|
|
106
|
+
...(marks.length === 0 ? {} : { marks }),
|
|
107
|
+
...(scene.type === "combat" ? { fighters: fightersOf(sight, scene) } : {}),
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Who is in the open scene, by the words the page gives them (D-416): a character by name when the character knows them, else by what it sees of them, else
|
|
112
|
+
* someone; a copy by its name when it knows its creature, else by what it sees of its kind and its number, else creature 1. Without the one left out, as whose view
|
|
113
|
+
* a character agent's is (VIEW-10).
|
|
114
|
+
*/
|
|
115
|
+
export function sceneNames(sight, leftOut) {
|
|
116
|
+
const { scene } = readOpenScene(sight.root);
|
|
117
|
+
const characters = scene === undefined ? [] : scene.with.map((link) => parsePageReference(link).name).filter((name) => leftOut === undefined || pagesWithName(sight.world, name)[0] !== leftOut);
|
|
118
|
+
const names = scene === undefined ? [] : [...characters, ...Object.keys(scene.copies)];
|
|
119
|
+
return scene === undefined ? [] : names.map((name) => shownTurn(sight, scene, name));
|
|
120
|
+
}
|
|
121
|
+
/** Whether someone of the party is down (D-516): at the value of the counter the system names, as hp 0, or below it; never the dead. */
|
|
122
|
+
export function isDown(world, system, page) {
|
|
123
|
+
const down = system?.down;
|
|
124
|
+
const value = readCounter(pageCounters(world, page)[down?.field ?? ""])?.value;
|
|
125
|
+
return down !== undefined && page.fields.status !== "dead" && value !== undefined && value <= down.value;
|
|
126
|
+
}
|
|
127
|
+
/** An effect on someone of the party as the player sees it: an end at someone's turn names them as the character knows them (VIEW-4), as creature 2. */
|
|
128
|
+
export function seenEffect(sight, effect) {
|
|
129
|
+
const end = effect.end;
|
|
130
|
+
const system = campaignSystem(sight.root, sight.context);
|
|
131
|
+
if (end === undefined || !("turn" in end)) {
|
|
132
|
+
return effectParts(sight.world, system, effect, sight.words);
|
|
133
|
+
}
|
|
134
|
+
const scene = readOpenScene(sight.root).scene ?? { copies: {} };
|
|
135
|
+
return effectParts(sight.world, system, { ...effect, end: { ...end, turn: shownTurn(sight, scene, end.turn) } }, sight.words);
|
|
136
|
+
}
|
|
137
|
+
/** The picture of one the character does not know, as strangerPicture gives it, for the scene and for the rolls (D-420, D-421). */
|
|
138
|
+
export function strangerImage(root, context, world, name) {
|
|
139
|
+
// A roll keeps a renamed page by its old name, among its aliases (D-417).
|
|
140
|
+
const page = name === undefined ? undefined : pagesWithNameOrAlias(world, parsePageReference(name).name)[0];
|
|
141
|
+
const file = page === undefined || page.system !== undefined ? undefined : imageFile(root, context, ownImage(page));
|
|
142
|
+
// By a name of its bytes: the file's own is the page's, which the character does not know.
|
|
143
|
+
const hidden = file === undefined ? undefined : hiddenImageName(file);
|
|
144
|
+
return file === undefined || hidden === undefined ? undefined : { file: hidden, version: Math.trunc(files().modified(file) ?? 0) };
|
|
145
|
+
}
|
|
57
146
|
/**
|
|
58
147
|
* A place's map as the player sees it (GRD-6): who stands where, the party and the characters the character knows by name, the others of the open scene as
|
|
59
148
|
* someone, its copies as the scene names them; a character it does not know outside the scene is not shown, as in VIEW-6.
|
|
@@ -139,70 +228,6 @@ function reachOf(sight, rules, measures, scene, self, grid) {
|
|
|
139
228
|
const left = speed === undefined ? 0 : speed / rules.square - movedThisTurn(scene);
|
|
140
229
|
return left <= 0 ? [] : reachable(grid, self.square, left + 1e-9, rules).filter((one) => one.cost > 0).map((one) => squareName(one.square));
|
|
141
230
|
}
|
|
142
|
-
/** The open scene as the player sees it; none when no scene is open, or it cannot be read. */
|
|
143
|
-
export function shownScene(sight) {
|
|
144
|
-
const { scene } = readOpenScene(sight.root);
|
|
145
|
-
if (scene === undefined) {
|
|
146
|
-
return undefined;
|
|
147
|
-
}
|
|
148
|
-
const place = knownPage(sight, scene.place);
|
|
149
|
-
const characters = scene.with.map((link) => {
|
|
150
|
-
const name = parsePageReference(link).name;
|
|
151
|
-
const page = knownPage(sight, link);
|
|
152
|
-
const hostile = hostileMark(scene, name);
|
|
153
|
-
const written = pagesWithName(sight.world, name)[0];
|
|
154
|
-
const state = written === undefined ? {} : strangerState(sight, scene, written);
|
|
155
|
-
const image = strangerPicture(sight, name);
|
|
156
|
-
return page === undefined
|
|
157
|
-
? { name: seenName(scene, name), role: "other", stranger: true, ...(image === undefined ? {} : { image }), ...hostile, ...state }
|
|
158
|
-
: { ...person(sight, page), ...hostile, ...stateOf(sight, page) };
|
|
159
|
-
});
|
|
160
|
-
const creatures = [...new Set(Object.values(scene.copies).map((copy) => copy.creature))].map((creature) => {
|
|
161
|
-
const count = Object.values(scene.copies).filter((copy) => copy.creature === creature).length;
|
|
162
|
-
const page = knownPage(sight, creature);
|
|
163
|
-
// A kind the character does not know by the letter its copies have in the scene, as creature B, with more kinds (D-331).
|
|
164
|
-
const first = Object.keys(scene.copies).find((copy) => scene.copies[copy].creature === creature);
|
|
165
|
-
const name = first === undefined ? "creature" : strangerName(scene, first).replace(/\s*\d+$/, "");
|
|
166
|
-
// A kind is hostile when one of its copies is.
|
|
167
|
-
const hostile = Object.keys(scene.copies).some((copy) => scene.copies[copy].creature === creature && hostileMark(scene, copy).hostile === true) ? { hostile: true } : {};
|
|
168
|
-
// A kind of one copy shows its state; of more, each shows its own on the map and in Combat.
|
|
169
|
-
const state = count === 1 && first !== undefined ? stateOf(sight, copyPage(first, scene.copies[first])) : {};
|
|
170
|
-
const image = strangerPicture(sight, creature);
|
|
171
|
-
return page === undefined
|
|
172
|
-
? { name, role: "other", stranger: true, ...(image === undefined ? {} : { image }), count, ...hostile, ...state }
|
|
173
|
-
: { ...person(sight, page), count, ...hostile, ...state };
|
|
174
|
-
});
|
|
175
|
-
const turnName = (name) => shownTurn(sight, scene, name);
|
|
176
|
-
// What who acts has used of the turn, as marks beside them, for the party alone: a foe's are the master's to tell (TRN-4, D-453).
|
|
177
|
-
const acting = scene.turn;
|
|
178
|
-
const ours = acting !== undefined && sight.party.some((page) => comparableText(page.name) === comparableText(acting));
|
|
179
|
-
const marks = ours ? turnMarks(campaignSystem(sight.root, sight.context), scene, acting) : [];
|
|
180
|
-
return {
|
|
181
|
-
title: scene.title,
|
|
182
|
-
type: scene.type,
|
|
183
|
-
...(scene.opened === undefined ? {} : { since: scene.opened }),
|
|
184
|
-
...(scene.now === undefined ? {} : { now: scene.now }),
|
|
185
|
-
...(place === undefined ? {} : { place: place.name }),
|
|
186
|
-
who: [...characters, ...creatures],
|
|
187
|
-
...(scene.order === undefined ? {} : { order: scene.order.map(turnName) }),
|
|
188
|
-
...(scene.turn === undefined ? {} : { turn: turnName(scene.turn) }),
|
|
189
|
-
// The round only where the game has rounds (D-314 (3)): Ironsworn has none.
|
|
190
|
-
...(scene.round === undefined || campaignSystem(sight.root, sight.context)?.roundSeconds === undefined ? {} : { round: scene.round }),
|
|
191
|
-
...(marks.length === 0 ? {} : { marks }),
|
|
192
|
-
...(scene.type === "combat" ? { fighters: fightersOf(sight, scene) } : {}),
|
|
193
|
-
};
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* Who is in the open scene, by the words the page gives them (D-416): a character by name when the character knows them, else by what it sees of them, else
|
|
197
|
-
* someone; a copy by its name when it knows its creature, else by what it sees of its kind and its number, else creature 1. Without the one left out, as whose view
|
|
198
|
-
* a character agent's is (VIEW-10).
|
|
199
|
-
*/
|
|
200
|
-
export function sceneNames(sight, leftOut) {
|
|
201
|
-
const { scene } = readOpenScene(sight.root);
|
|
202
|
-
const characters = scene === undefined ? [] : scene.with.map((link) => parsePageReference(link).name).filter((name) => leftOut === undefined || pagesWithName(sight.world, name)[0] !== leftOut);
|
|
203
|
-
const names = scene === undefined ? [] : [...characters, ...Object.keys(scene.copies)];
|
|
204
|
-
return scene === undefined ? [] : names.map((name) => shownTurn(sight, scene, name));
|
|
205
|
-
}
|
|
206
231
|
/** Everyone in a fight, in the order of the turns when there is one, else the characters then the copies; those the view cannot name are left out. */
|
|
207
232
|
function fightersOf(sight, scene) {
|
|
208
233
|
const names = scene.order ?? [...scene.with.map((link) => parsePageReference(link).name), ...Object.keys(scene.copies)];
|
|
@@ -245,22 +270,6 @@ function fighterOf(sight, scene, name) {
|
|
|
245
270
|
...(down ? { down: true } : {}),
|
|
246
271
|
};
|
|
247
272
|
}
|
|
248
|
-
/** Whether someone of the party is down (D-516): at the value of the counter the system names, as hp 0, or below it; never the dead. */
|
|
249
|
-
export function isDown(world, system, page) {
|
|
250
|
-
const down = system?.down;
|
|
251
|
-
const value = readCounter(pageCounters(world, page)[down?.field ?? ""])?.value;
|
|
252
|
-
return down !== undefined && page.fields.status !== "dead" && value !== undefined && value <= down.value;
|
|
253
|
-
}
|
|
254
|
-
/** An effect on someone of the party as the player sees it: an end at someone's turn names them as the character knows them (VIEW-4), as creature 2. */
|
|
255
|
-
export function seenEffect(sight, effect) {
|
|
256
|
-
const end = effect.end;
|
|
257
|
-
const system = campaignSystem(sight.root, sight.context);
|
|
258
|
-
if (end === undefined || !("turn" in end)) {
|
|
259
|
-
return effectParts(sight.world, system, effect, sight.words);
|
|
260
|
-
}
|
|
261
|
-
const scene = readOpenScene(sight.root).scene ?? { copies: {} };
|
|
262
|
-
return effectParts(sight.world, system, { ...effect, end: { ...end, turn: shownTurn(sight, scene, end.turn) } }, sight.words);
|
|
263
|
-
}
|
|
264
273
|
/**
|
|
265
274
|
* The state a token shows (D-419): what is on them, whether a condition keeps them from acting, whether they are at 0 as Combat tells it, or dead; the party in
|
|
266
275
|
* full, the others by what anyone sees (D-314).
|
|
@@ -353,15 +362,6 @@ function picture(sight, page) {
|
|
|
353
362
|
function strangerPicture(sight, name) {
|
|
354
363
|
return strangerImage(sight.root, sight.context, sight.world, name);
|
|
355
364
|
}
|
|
356
|
-
/** The picture of one the character does not know, as strangerPicture gives it, for the scene and for the rolls (D-420, D-421). */
|
|
357
|
-
export function strangerImage(root, context, world, name) {
|
|
358
|
-
// A roll keeps a renamed page by its old name, among its aliases (D-417).
|
|
359
|
-
const page = name === undefined ? undefined : pagesWithNameOrAlias(world, parsePageReference(name).name)[0];
|
|
360
|
-
const file = page === undefined || page.system !== undefined ? undefined : imageFile(root, context, ownImage(page));
|
|
361
|
-
// By a name of its bytes: the file's own is the page's, which the character does not know.
|
|
362
|
-
const hidden = file === undefined ? undefined : hiddenImageName(file);
|
|
363
|
-
return file === undefined || hidden === undefined ? undefined : { file: hidden, version: Math.trunc(files().modified(file) ?? 0) };
|
|
364
|
-
}
|
|
365
365
|
/** The page the character knows by a link or a name, of the campaign or of the system. */
|
|
366
366
|
function knownPage(sight, name) {
|
|
367
367
|
if (name === undefined) {
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import type { Mood } from "
|
|
3
|
-
import { type CoinSide, type NotationPart, type ThrownDie } from "
|
|
4
|
-
import type { ActVerb, SheetVerb, SystemWords } from "
|
|
5
|
-
import { type CalendarDay } from "
|
|
6
|
-
import { type PlayerSetting } from "
|
|
7
|
-
import { type
|
|
8
|
-
import { type
|
|
9
|
-
import { type
|
|
10
|
-
import { type
|
|
11
|
-
import { type
|
|
12
|
-
import { type
|
|
13
|
-
import { type
|
|
14
|
-
import { type
|
|
15
|
-
import { type
|
|
16
|
-
import { type
|
|
2
|
+
import type { Mood } from "../../core/mood.ts";
|
|
3
|
+
import { type CoinSide, type NotationPart, type ThrownDie } from "../../dice/index.ts";
|
|
4
|
+
import type { ActVerb, SheetVerb, SystemWords } from "../../systems/index.ts";
|
|
5
|
+
import { type CalendarDay } from "../../time/index.ts";
|
|
6
|
+
import { type PlayerSetting } from "../config.ts";
|
|
7
|
+
import { type ShownImport } from "../import/import.ts";
|
|
8
|
+
import { type SeenEffect } from "../shared/effects.ts";
|
|
9
|
+
import { type Mode } from "../shared/mode.ts";
|
|
10
|
+
import { type MoodMoment } from "../shared/moods.ts";
|
|
11
|
+
import { type ResetPoint, type SaveMode } from "../shared/saves.ts";
|
|
12
|
+
import { type SheetGroupData, type SheetValue } from "../shared/sheet.ts";
|
|
13
|
+
import { type ShownChapter, type ShownQuest, type ShownThought } from "./journal.ts";
|
|
14
|
+
import { type ShownMap } from "./map.ts";
|
|
15
|
+
import { type ShownPlace, type ShownScene } from "./place.ts";
|
|
16
|
+
import { type KnownEntry, type ShownCalendar, type ShownDocument } from "./world.ts";
|
|
17
17
|
/** A roll the player may see (D-279): theirs, or one the master showed; never a hidden one. */
|
|
18
18
|
export interface ShownRoll {
|
|
19
19
|
id: string;
|
|
@@ -221,7 +221,7 @@ export type ViewResult = {
|
|
|
221
221
|
kind: "unknown";
|
|
222
222
|
text: string;
|
|
223
223
|
};
|
|
224
|
-
export declare const view: import("
|
|
224
|
+
export declare const view: import("../../core/registry.ts").Command<z.ZodObject<{
|
|
225
225
|
page: z.ZodOptional<z.ZodString>;
|
|
226
226
|
diary: z.ZodOptional<z.ZodString>;
|
|
227
227
|
rolls: z.ZodOptional<z.ZodString>;
|
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
import { basename } from "node:path";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import { readSettings, requireCampaign } from "
|
|
4
|
-
import { lengthsInUnits } from "
|
|
5
|
-
import { readLog } from "
|
|
6
|
-
import { defineCommand } from "
|
|
7
|
-
import { comparableText, firstSentence, withArticle } from "
|
|
8
|
-
import { coinSides, notationParts } from "
|
|
9
|
-
import { readEffect } from "
|
|
10
|
-
import { readAmount } from "
|
|
11
|
-
import { declaredKind, entryPage, isPartyMember, isPlayerCharacter, locate, pagesWithName, pagesWithNameOrAlias, parsePageReference, playerCharacters, secretNames, systemPageNamed, textsIn } from "
|
|
12
|
-
import { formatGameDate } from "
|
|
13
|
-
import { setupQuestions, shownPlayerSettings } from "
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
3
|
+
import { readSettings, requireCampaign } from "../../campaign/index.js";
|
|
4
|
+
import { lengthsInUnits } from "../../core/length.js";
|
|
5
|
+
import { readLog } from "../../core/log.js";
|
|
6
|
+
import { defineCommand } from "../../core/registry.js";
|
|
7
|
+
import { comparableText, firstSentence, withArticle } from "../../core/text.js";
|
|
8
|
+
import { coinSides, notationParts } from "../../dice/index.js";
|
|
9
|
+
import { readEffect } from "../../effects/index.js";
|
|
10
|
+
import { readAmount } from "../../money/index.js";
|
|
11
|
+
import { declaredKind, entryPage, isPartyMember, isPlayerCharacter, locate, pagesWithName, pagesWithNameOrAlias, parsePageReference, playerCharacters, secretNames, systemPageNamed, textsIn, } from "../../pages/index.js";
|
|
12
|
+
import { formatGameDate } from "../../time/index.js";
|
|
13
|
+
import { setupQuestions, shownPlayerSettings } from "../config.js";
|
|
14
|
+
import { importShown } from "../import/import.js";
|
|
15
|
+
import { effectiveFields, effectsOf } from "../shared/effect-layer.js";
|
|
16
|
+
import { effectShown } from "../shared/effects.js";
|
|
17
|
+
import { shownImage } from "../shared/images.js";
|
|
18
|
+
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 { blockingMode, campaignMode, modes } from "../shared/mode.js";
|
|
21
|
+
import { campaignCoins } from "../shared/money.js";
|
|
22
|
+
import { lastMoment, livingMood, masterMood } from "../shared/moods.js";
|
|
23
|
+
import { countersText, lineCounters, lineExperience } from "../shared/page-counters.js";
|
|
24
|
+
import { campaignProblems } from "../shared/problems.js";
|
|
25
|
+
import { measuresOf } from "../shared/roads.js";
|
|
26
|
+
import { campaignSaves, loadRefusal, loadRule, mayGoBack, resetPoints, resetSave, saveMode, savesWhy, wentBackTo } from "../shared/saves.js";
|
|
27
|
+
import { readOpenScene } from "../shared/scene.js";
|
|
28
|
+
import { counterOf, experienceNeed, experienceProgress, sheetData, sheetGroup, sheetHeadline, sheetText, statBlock, tokenIcon } from "../shared/sheet.js";
|
|
29
|
+
import { thoughtsIn, thoughtsRule, thoughtsShown } from "../shared/thoughts.js";
|
|
30
|
+
import { calendarDayOf, readPresent } from "../shared/time.js";
|
|
31
|
+
import { fuelLeft } from "../shared/upkeep.js";
|
|
32
|
+
import { hasSheet } from "../shared/worked-out.js";
|
|
33
|
+
import { campaignSystem, campaignWorld, systemWordsOf } from "../shared/world.js";
|
|
34
|
+
import { questText, shownJournal } from "./journal.js";
|
|
35
|
+
import { mapText, shownMap } from "./map.js";
|
|
36
|
+
import { isDown, sceneNames, seenEffect, shownPlace, shownScene, strangerImage } from "./place.js";
|
|
37
|
+
import { knownDocuments, knownEntries, knownEntryText, shownCalendar } from "./world.js";
|
|
38
38
|
// How many lines of the diary the view gives when no number is asked.
|
|
39
39
|
const diaryLines = 10;
|
|
40
40
|
// How a player character is played while their player is away (D-480 (4)).
|
|
@@ -242,7 +242,7 @@ export const view = defineCommand({
|
|
|
242
242
|
kind: "overview",
|
|
243
243
|
campaign: settings.name,
|
|
244
244
|
...(settings.language === undefined ? {} : { language: settings.language }),
|
|
245
|
-
...(words === undefined ? {} : { words }),
|
|
245
|
+
...(words === undefined ? {} : { words: withPageTitles(words, world) }),
|
|
246
246
|
...(system === undefined || Object.keys(system.sheetVerbs).length === 0 ? {} : { verbs: system.sheetVerbs }),
|
|
247
247
|
...(system === undefined ? {} : { system: { name: system.name, title: system.title, ...(system.attribution === undefined ? {} : { attribution: system.attribution }) } }),
|
|
248
248
|
...(now === undefined ? {} : { now: formatGameDate(now) }),
|
|
@@ -349,6 +349,11 @@ function shownPage(root, context, world, knowledge, page, party) {
|
|
|
349
349
|
...(story === undefined ? {} : { story }),
|
|
350
350
|
};
|
|
351
351
|
}
|
|
352
|
+
/** The system's words for the page, with the names its translation gives its pages, as Palla di fuoco for Fireball, where its words do not name them (D-542). */
|
|
353
|
+
function withPageTitles(words, world) {
|
|
354
|
+
const titles = Object.fromEntries((world.system?.pages ?? []).flatMap((page) => (page.title === undefined ? [] : [[page.name, page.title]])));
|
|
355
|
+
return Object.keys(titles).length === 0 ? words : { ...words, words: { ...titles, ...words.words } };
|
|
356
|
+
}
|
|
352
357
|
/** "Known to Bruna alone: Ettore plays as not knowing it, though all at the screen may read it.": who knows a page, and how the others are played (VIEW-12). */
|
|
353
358
|
function whoKnowsText(who, unaware) {
|
|
354
359
|
const others = unaware.length === 0 ? "" : `: ${unaware.join(" and ")} ${unaware.length === 1 ? "plays" : "play"} as not knowing it, though all at the screen may read it`;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Context } from "
|
|
2
|
-
import { type World } from "
|
|
3
|
-
import { type CalendarMonth } from "
|
|
4
|
-
import { type Knowledge } from "
|
|
1
|
+
import type { Context } from "../../core/context.ts";
|
|
2
|
+
import { type World } from "../../pages/index.ts";
|
|
3
|
+
import { type CalendarMonth } from "../../time/index.ts";
|
|
4
|
+
import { type Knowledge } from "../shared/knowledge.ts";
|
|
5
5
|
/** A page the player character knows, as the World section lists it (VIEW-11): its name and type, a place's kind and the places that hold it, the opening of its text. */
|
|
6
6
|
export interface KnownEntry {
|
|
7
7
|
name: string;
|