rpg-engine 0.2.1 → 0.3.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/README.md +3 -3
- package/dist/adventures/index.d.ts +3 -0
- package/dist/adventures/index.js +5 -0
- package/dist/adventures/manifest.d.ts +39 -0
- package/dist/adventures/manifest.js +89 -0
- package/dist/adventures/placement.d.ts +4 -0
- package/dist/adventures/placement.js +14 -0
- package/dist/adventures/source.d.ts +21 -0
- package/dist/adventures/source.js +108 -0
- package/dist/bell-listener.d.ts +9 -0
- package/dist/bell-listener.js +83 -0
- package/dist/campaign/create-campaign.d.ts +3 -2
- package/dist/campaign/create-campaign.js +5 -5
- package/dist/campaign/host-files.d.ts +23 -6
- package/dist/campaign/host-files.js +130 -40
- package/dist/campaign/index.d.ts +2 -2
- package/dist/campaign/index.js +2 -2
- package/dist/campaign/settings.d.ts +33 -2
- package/dist/campaign/settings.js +49 -12
- package/dist/cli.js +10 -1
- package/dist/command-line.js +20 -2
- package/dist/commands/advance.js +6 -2
- package/dist/commands/ask.d.ts +11 -4
- package/dist/commands/ask.js +249 -23
- package/dist/commands/change.d.ts +29 -0
- package/dist/commands/change.js +260 -41
- package/dist/commands/config.d.ts +6 -3
- package/dist/commands/config.js +179 -79
- package/dist/commands/effect.js +38 -9
- package/dist/commands/game-advance.d.ts +11 -2
- package/dist/commands/game-advance.js +22 -7
- package/dist/commands/game-adventures.d.ts +70 -0
- package/dist/commands/game-adventures.js +418 -0
- package/dist/commands/game-bonds.d.ts +9 -0
- package/dist/commands/game-bonds.js +84 -0
- package/dist/commands/game-catalog.d.ts +36 -0
- package/dist/commands/game-catalog.js +122 -0
- package/dist/commands/game-checks.d.ts +17 -0
- package/dist/commands/game-checks.js +128 -0
- package/dist/commands/game-damage.d.ts +18 -0
- package/dist/commands/game-damage.js +74 -0
- package/dist/commands/game-effects.d.ts +5 -0
- package/dist/commands/game-effects.js +2 -2
- package/dist/commands/game-events.js +8 -4
- package/dist/commands/game-experience.js +2 -2
- package/dist/commands/game-extensions.d.ts +8 -1
- package/dist/commands/game-extensions.js +8 -3
- package/dist/commands/game-grid-moves.d.ts +4 -1
- package/dist/commands/game-grid-moves.js +8 -2
- package/dist/commands/game-hit-dice.d.ts +39 -0
- package/dist/commands/game-hit-dice.js +120 -0
- package/dist/commands/game-import.d.ts +11 -0
- package/dist/commands/game-import.js +154 -0
- package/dist/commands/game-journey.d.ts +6 -2
- package/dist/commands/game-journey.js +17 -6
- package/dist/commands/game-knowledge.d.ts +56 -6
- package/dist/commands/game-knowledge.js +152 -23
- package/dist/commands/game-library.d.ts +112 -0
- package/dist/commands/game-library.js +388 -0
- package/dist/commands/game-limits.d.ts +7 -0
- package/dist/commands/game-limits.js +67 -0
- package/dist/commands/game-mode.js +3 -3
- package/dist/commands/game-moves.d.ts +14 -1
- package/dist/commands/game-moves.js +24 -9
- package/dist/commands/game-recipe-pace.d.ts +6 -0
- package/dist/commands/game-recipe-pace.js +25 -0
- package/dist/commands/game-recipes.js +10 -3
- package/dist/commands/game-reminders.d.ts +3 -3
- package/dist/commands/game-reminders.js +10 -5
- package/dist/commands/game-roads.d.ts +11 -4
- package/dist/commands/game-roads.js +89 -26
- package/dist/commands/game-saves.d.ts +12 -0
- package/dist/commands/game-saves.js +44 -5
- package/dist/commands/game-scene.js +3 -1
- package/dist/commands/game-stacks.d.ts +78 -0
- package/dist/commands/game-stacks.js +198 -0
- package/dist/commands/game-system-code.d.ts +25 -0
- package/dist/commands/game-system-code.js +165 -0
- package/dist/commands/game-thoughts.d.ts +25 -0
- package/dist/commands/game-thoughts.js +57 -0
- package/dist/commands/game-turn-uses.d.ts +33 -0
- package/dist/commands/game-turn-uses.js +137 -0
- package/dist/commands/game-upkeep.d.ts +20 -0
- package/dist/commands/game-upkeep.js +190 -0
- package/dist/commands/game-view-journal.d.ts +14 -1
- package/dist/commands/game-view-journal.js +5 -2
- package/dist/commands/game-view-map.d.ts +3 -0
- package/dist/commands/game-view-map.js +5 -1
- package/dist/commands/game-view-place.d.ts +22 -3
- package/dist/commands/game-view-place.js +61 -24
- package/dist/commands/game-view-world.d.ts +98 -0
- package/dist/commands/game-view-world.js +98 -0
- package/dist/commands/game-voices.d.ts +5 -0
- package/dist/commands/game-voices.js +13 -0
- package/dist/commands/game-widgets.d.ts +66 -0
- package/dist/commands/game-widgets.js +274 -0
- package/dist/commands/game-world.d.ts +8 -1
- package/dist/commands/game-world.js +23 -3
- package/dist/commands/image.js +2 -3
- package/dist/commands/import.d.ts +47 -0
- package/dist/commands/import.js +390 -0
- package/dist/commands/index.js +6 -0
- package/dist/commands/init.js +2 -2
- package/dist/commands/install.js +2 -1
- package/dist/commands/instructions.js +26 -1
- package/dist/commands/mode.js +3 -1
- package/dist/commands/move.d.ts +2 -0
- package/dist/commands/move.js +86 -12
- package/dist/commands/package.d.ts +57 -3
- package/dist/commands/package.js +304 -49
- package/dist/commands/parts.d.ts +3 -0
- package/dist/commands/parts.js +5 -0
- package/dist/commands/problems.js +6 -0
- package/dist/commands/rename.js +3 -0
- package/dist/commands/reveal.js +12 -7
- package/dist/commands/roll.d.ts +2 -0
- package/dist/commands/roll.js +23 -7
- package/dist/commands/route.js +4 -5
- package/dist/commands/rules.d.ts +3 -0
- package/dist/commands/rules.js +38 -6
- package/dist/commands/save.d.ts +1 -1
- package/dist/commands/save.js +2 -2
- package/dist/commands/scene.d.ts +10 -1
- package/dist/commands/scene.js +146 -29
- package/dist/commands/sheet.d.ts +47 -6
- package/dist/commands/sheet.js +179 -33
- package/dist/commands/show.d.ts +33 -0
- package/dist/commands/show.js +19 -2
- package/dist/commands/status.d.ts +9 -3
- package/dist/commands/status.js +59 -17
- package/dist/commands/thoughts.d.ts +11 -0
- package/dist/commands/thoughts.js +54 -0
- package/dist/commands/trade.d.ts +17 -0
- package/dist/commands/trade.js +273 -0
- package/dist/commands/travel.d.ts +2 -0
- package/dist/commands/travel.js +40 -14
- package/dist/commands/validate.js +2 -1
- package/dist/commands/view.d.ts +99 -2
- package/dist/commands/view.js +273 -57
- package/dist/commands/worked-out.d.ts +16 -0
- package/dist/commands/worked-out.js +108 -13
- package/dist/commands/write.d.ts +1 -0
- package/dist/commands/write.js +93 -21
- package/dist/confirm/confirm.d.ts +35 -0
- package/dist/confirm/confirm.js +94 -0
- package/dist/confirm/index.d.ts +1 -0
- package/dist/confirm/index.js +3 -0
- package/dist/core/archive-paths.d.ts +8 -0
- package/dist/core/archive-paths.js +39 -0
- package/dist/core/context.d.ts +127 -5
- package/dist/core/context.js +4 -3
- package/dist/core/download.d.ts +2 -0
- package/dist/core/download.js +31 -0
- package/dist/core/field-kind.d.ts +4 -3
- package/dist/core/field-kind.js +4 -3
- package/dist/core/files.d.ts +10 -0
- package/dist/core/files.js +58 -2
- package/dist/core/formula.d.ts +3 -1
- package/dist/core/formula.js +13 -2
- package/dist/core/progression-rule.d.ts +2 -0
- package/dist/core/version.d.ts +2 -0
- package/dist/core/version.js +7 -0
- package/dist/dashboard/act-names.js +27 -0
- package/dist/dashboard/act-sheet.js +100 -0
- package/dist/dashboard/act-strip.js +49 -0
- package/dist/dashboard/acts.js +140 -0
- package/dist/dashboard/address.js +16 -12
- package/dist/dashboard/api.js +140 -10
- package/dist/dashboard/app.js +370 -41
- package/dist/dashboard/asked.js +297 -19
- package/dist/dashboard/calendar.js +56 -0
- package/dist/dashboard/card.js +13 -12
- package/dist/dashboard/coins.js +13 -0
- package/dist/dashboard/death-save.js +67 -0
- package/dist/dashboard/dice/pool.js +22 -0
- package/dist/dashboard/dice/roller.js +1 -1
- package/dist/dashboard/dice/stage.js +12 -4
- package/dist/dashboard/dice/tray.js +28 -15
- package/dist/dashboard/dying.js +46 -0
- package/dist/dashboard/extension-widgets.js +160 -0
- package/dist/dashboard/game-words.js +33 -4
- package/dist/dashboard/guide/ar.md +105 -100
- package/dist/dashboard/guide/cs.md +111 -106
- package/dist/dashboard/guide/da.md +95 -90
- package/dist/dashboard/guide/de.md +93 -88
- package/dist/dashboard/guide/el.md +110 -105
- package/dist/dashboard/guide/en.md +21 -16
- package/dist/dashboard/guide/es.md +79 -74
- package/dist/dashboard/guide/fi.md +99 -94
- package/dist/dashboard/guide/fr.md +83 -78
- package/dist/dashboard/guide/he.md +109 -104
- package/dist/dashboard/guide/hi.md +103 -98
- package/dist/dashboard/guide/hu.md +113 -108
- package/dist/dashboard/guide/is.md +102 -97
- package/dist/dashboard/guide/it.md +22 -17
- package/dist/dashboard/guide/ja.md +108 -103
- package/dist/dashboard/guide/ko.md +113 -108
- package/dist/dashboard/guide/nb.md +95 -90
- package/dist/dashboard/guide/nl.md +89 -84
- package/dist/dashboard/guide/pl.md +104 -99
- package/dist/dashboard/guide/pt.md +82 -77
- package/dist/dashboard/guide/ro.md +113 -108
- package/dist/dashboard/guide/ru.md +109 -104
- package/dist/dashboard/guide/sv.md +96 -91
- package/dist/dashboard/guide/tr.md +102 -97
- package/dist/dashboard/guide/uk.md +113 -108
- package/dist/dashboard/guide/zh.md +110 -105
- package/dist/dashboard/guide-markdown.js +4 -0
- package/dist/dashboard/help.js +4 -5
- package/dist/dashboard/i18n/ar.json +361 -16
- package/dist/dashboard/i18n/cs.json +361 -16
- package/dist/dashboard/i18n/da.json +361 -16
- package/dist/dashboard/i18n/de.json +361 -16
- package/dist/dashboard/i18n/el.json +361 -16
- package/dist/dashboard/i18n/es.json +361 -16
- package/dist/dashboard/i18n/fi.json +361 -16
- package/dist/dashboard/i18n/fr.json +361 -16
- package/dist/dashboard/i18n/he.json +361 -16
- package/dist/dashboard/i18n/hi.json +361 -16
- package/dist/dashboard/i18n/hu.json +361 -16
- package/dist/dashboard/i18n/is.json +361 -16
- package/dist/dashboard/i18n/it.json +363 -18
- package/dist/dashboard/i18n/ja.json +361 -16
- package/dist/dashboard/i18n/ko.json +361 -16
- package/dist/dashboard/i18n/nb.json +361 -16
- package/dist/dashboard/i18n/nl.json +361 -16
- package/dist/dashboard/i18n/pl.json +361 -16
- package/dist/dashboard/i18n/pt.json +361 -16
- package/dist/dashboard/i18n/ro.json +361 -16
- package/dist/dashboard/i18n/ru.json +361 -16
- package/dist/dashboard/i18n/sv.json +361 -16
- package/dist/dashboard/i18n/tr.json +361 -16
- package/dist/dashboard/i18n/uk.json +361 -16
- package/dist/dashboard/i18n/zh.json +361 -16
- package/dist/dashboard/icons.js +38 -4
- package/dist/dashboard/journal.js +203 -49
- package/dist/dashboard/labels.js +42 -4
- package/dist/dashboard/languages.js +2 -2
- package/dist/dashboard/layout.js +35 -0
- package/dist/dashboard/lore.js +44 -0
- package/dist/dashboard/markdown.js +136 -30
- package/dist/dashboard/master.js +2 -2
- package/dist/dashboard/notes.js +5 -5
- package/dist/dashboard/notices.js +24 -4
- package/dist/dashboard/packages.js +678 -0
- package/dist/dashboard/pages.js +0 -8
- package/dist/dashboard/party.js +17 -4
- package/dist/dashboard/place-map-view.js +47 -9
- package/dist/dashboard/rolls.js +35 -93
- package/dist/dashboard/save-outcome.js +42 -0
- package/dist/dashboard/saves.js +14 -11
- package/dist/dashboard/scene.js +114 -20
- package/dist/dashboard/settings.js +70 -12
- package/dist/dashboard/setup.js +4 -4
- package/dist/dashboard/sheet.js +123 -19
- package/dist/dashboard/spend.js +115 -0
- package/dist/dashboard/status.js +22 -10
- package/dist/dashboard/story.js +6 -6
- package/dist/dashboard/style.css +8047 -3468
- package/dist/dashboard/table.js +145 -0
- package/dist/dashboard/tabs.js +34 -0
- package/dist/dashboard/text.js +19 -1
- package/dist/dashboard/top.js +91 -31
- package/dist/dashboard/turns.js +150 -0
- package/dist/dashboard/widgets.js +21 -14
- package/dist/dashboard/world-calendar.js +101 -0
- package/dist/dashboard/world-lore.js +231 -0
- package/dist/dashboard/world.js +87 -29
- package/dist/dashboard-server.d.ts +10 -1
- package/dist/dashboard-server.js +738 -26
- package/dist/documents/index.d.ts +2 -0
- package/dist/documents/index.js +5 -0
- package/dist/documents/markup.d.ts +10 -0
- package/dist/documents/markup.js +124 -0
- package/dist/documents/ocr.d.ts +9 -0
- package/dist/documents/ocr.js +101 -0
- package/dist/documents/png.d.ts +9 -0
- package/dist/documents/png.js +75 -0
- package/dist/documents/read.d.ts +54 -0
- package/dist/documents/read.js +375 -0
- package/dist/extensions/api.d.ts +91 -9
- package/dist/extensions/extension.d.ts +28 -2
- package/dist/extensions/extension.js +49 -11
- package/dist/extensions/index.d.ts +5 -3
- package/dist/extensions/index.js +4 -2
- package/dist/extensions/packages.d.ts +13 -4
- package/dist/extensions/packages.js +114 -16
- package/dist/extensions/tarball.d.ts +6 -0
- package/dist/extensions/tarball.js +87 -0
- package/dist/extensions/words.d.ts +13 -0
- package/dist/extensions/words.js +42 -0
- package/dist/importer/index.d.ts +1 -0
- package/dist/importer/index.js +3 -0
- package/dist/importer/work.d.ts +132 -0
- package/dist/importer/work.js +306 -0
- package/dist/index.d.ts +3 -1
- package/dist/instructions/index.d.ts +7 -0
- package/dist/instructions/index.js +10 -0
- package/dist/languages/index.d.ts +1 -0
- package/dist/languages/index.js +3 -0
- package/dist/languages/language-pack.d.ts +32 -0
- package/dist/languages/language-pack.js +86 -0
- package/dist/library/books.d.ts +76 -0
- package/dist/library/books.js +378 -0
- package/dist/library/folders.d.ts +11 -0
- package/dist/library/folders.js +70 -0
- package/dist/library/index.d.ts +3 -0
- package/dist/library/index.js +5 -0
- package/dist/library/language.d.ts +2 -0
- package/dist/library/language.js +40 -0
- package/dist/library-reader.d.ts +7 -0
- package/dist/library-reader.js +36 -0
- package/dist/mcp-server.js +90 -7
- package/dist/money/index.d.ts +1 -1
- package/dist/money/index.js +1 -1
- package/dist/money/money.d.ts +6 -0
- package/dist/money/money.js +11 -0
- package/dist/page-words.js +4 -1
- package/dist/pages/check.d.ts +5 -0
- package/dist/pages/check.js +111 -5
- package/dist/pages/containers.d.ts +19 -1
- package/dist/pages/containers.js +50 -7
- package/dist/pages/index.d.ts +8 -5
- package/dist/pages/index.js +8 -5
- package/dist/pages/load.d.ts +11 -0
- package/dist/pages/load.js +69 -0
- package/dist/pages/markdown.d.ts +7 -0
- package/dist/pages/markdown.js +27 -3
- package/dist/pages/page-file.d.ts +2 -0
- package/dist/pages/page-file.js +28 -5
- package/dist/pages/rename-page.js +3 -2
- package/dist/pages/stack-entry.d.ts +47 -0
- package/dist/pages/stack-entry.js +83 -0
- package/dist/pages/stack-writes.d.ts +22 -0
- package/dist/pages/stack-writes.js +128 -0
- package/dist/pages/stacks.d.ts +52 -0
- package/dist/pages/stacks.js +168 -0
- package/dist/pages/standard-fields.js +1 -1
- package/dist/pages/system-pages.d.ts +5 -2
- package/dist/pages/system-pages.js +11 -5
- package/dist/pages/world.d.ts +29 -3
- package/dist/pages/world.js +66 -12
- package/dist/pages/write-page.js +15 -6
- package/dist/pictures/chosen.d.ts +5 -1
- package/dist/pictures/chosen.js +12 -3
- package/dist/pictures/claude.d.ts +3 -1
- package/dist/pictures/claude.js +38 -0
- package/dist/pictures/codex.d.ts +3 -1
- package/dist/pictures/codex.js +32 -0
- package/dist/pictures/helpers.d.ts +10 -0
- package/dist/pictures/helpers.js +53 -6
- package/dist/pictures/index.d.ts +5 -4
- package/dist/pictures/index.js +5 -4
- package/dist/pictures/stop.d.ts +2 -0
- package/dist/pictures/stop.js +18 -0
- package/dist/player-acts.d.ts +27 -0
- package/dist/player-acts.js +56 -0
- package/dist/rules/index.d.ts +1 -0
- package/dist/rules/index.js +3 -1
- package/dist/rules/page-search.d.ts +36 -0
- package/dist/rules/page-search.js +216 -0
- package/dist/rules/search.d.ts +7 -0
- package/dist/rules/search.js +2 -2
- package/dist/scene/scene.d.ts +2 -0
- package/dist/scene/scene.js +1 -0
- package/dist/systems/game-system.d.ts +161 -4
- package/dist/systems/game-system.js +237 -34
- package/dist/systems/index.d.ts +3 -1
- package/dist/systems/index.js +3 -1
- package/dist/systems/system-code.d.ts +97 -0
- package/dist/systems/system-code.js +62 -0
- package/dist/systems/system-folders.d.ts +11 -0
- package/dist/systems/system-folders.js +11 -0
- package/dist/systems/words.d.ts +2 -0
- package/dist/systems/words.js +3 -3
- package/instructions/author.md +1 -1
- package/instructions/buttons-physical-dice.md +1 -1
- package/instructions/buttons.md +1 -1
- package/instructions/character.md +15 -0
- package/instructions/combat.md +3 -1
- package/instructions/core.md +4 -4
- package/instructions/dashboard.md +4 -4
- package/instructions/import.md +14 -0
- package/instructions/mentor-hints.md +1 -1
- package/instructions/party.md +11 -0
- package/instructions/play.md +5 -5
- package/instructions/session-zero.md +1 -1
- package/instructions/setup.md +1 -1
- package/instructions/voices-always.md +1 -0
- package/instructions/voices-important.md +1 -0
- package/instructions/voices.md +14 -0
- package/package.json +6 -2
- package/systems/5e/LICENSE.md +1 -1
- package/systems/5e/dist/dying.js +193 -0
- package/systems/5e/dist/index.js +3 -0
- package/systems/5e/images/abacus.svg +1 -0
- package/systems/5e/images/acid-tube.svg +1 -0
- package/systems/5e/images/animal-hide.svg +1 -0
- package/systems/5e/images/anvil.svg +1 -0
- package/systems/5e/images/arrow-cluster.svg +1 -0
- package/systems/5e/images/backpack.svg +1 -0
- package/systems/5e/images/bagpipes.svg +1 -0
- package/systems/5e/images/barbed-spear.svg +1 -0
- package/systems/5e/images/barrel.svg +1 -0
- package/systems/5e/images/basket.svg +1 -0
- package/systems/5e/images/battle-axe.svg +1 -0
- package/systems/5e/images/beer-horn.svg +1 -0
- package/systems/5e/images/belt-buckles.svg +1 -0
- package/systems/5e/images/bird-scepter.svg +1 -0
- package/systems/5e/images/blanket.svg +1 -0
- package/systems/5e/images/book-cover.svg +1 -0
- package/systems/5e/images/boots.svg +1 -0
- package/systems/5e/images/bottle-vapors.svg +1 -0
- package/systems/5e/images/bow-arrow.svg +1 -0
- package/systems/5e/images/bowl-spiral.svg +1 -0
- package/systems/5e/images/bracer.svg +1 -0
- package/systems/5e/images/broadsword.svg +1 -0
- package/systems/5e/images/broom.svg +1 -0
- package/systems/5e/images/bullets.svg +1 -0
- package/systems/5e/images/caltrops.svg +1 -0
- package/systems/5e/images/camp-cooking-pot.svg +1 -0
- package/systems/5e/images/campfire.svg +1 -0
- package/systems/5e/images/camping-tent.svg +1 -0
- package/systems/5e/images/candle-flame.svg +1 -0
- package/systems/5e/images/candle-light.svg +1 -0
- package/systems/5e/images/canoe.svg +1 -0
- package/systems/5e/images/cape.svg +1 -0
- package/systems/5e/images/caravel.svg +1 -0
- package/systems/5e/images/card-pick.svg +1 -0
- package/systems/5e/images/chain-mail.svg +1 -0
- package/systems/5e/images/chained-arrow-heads.svg +1 -0
- package/systems/5e/images/chariot.svg +1 -0
- package/systems/5e/images/chest.svg +1 -0
- package/systems/5e/images/chisel.svg +1 -0
- package/systems/5e/images/claw-hammer.svg +1 -0
- package/systems/5e/images/colombian-statue.svg +1 -0
- package/systems/5e/images/cooking-pot.svg +1 -0
- package/systems/5e/images/crescent-staff.svg +1 -0
- package/systems/5e/images/crossbow.svg +1 -0
- package/systems/5e/images/crossed-chains.svg +1 -0
- package/systems/5e/images/crowbar.svg +1 -0
- package/systems/5e/images/crystal-ball.svg +1 -0
- package/systems/5e/images/crystal-cluster.svg +1 -0
- package/systems/5e/images/crystal-eye.svg +1 -0
- package/systems/5e/images/cubes.svg +1 -0
- package/systems/5e/images/dart.svg +1 -0
- package/systems/5e/images/dice-six-faces-five.svg +1 -0
- package/systems/5e/images/dragon-orb.svg +1 -0
- package/systems/5e/images/drakkar.svg +1 -0
- package/systems/5e/images/drum.svg +1 -0
- package/systems/5e/images/empty-wood-bucket-handle.svg +1 -0
- package/systems/5e/images/eye-shield.svg +1 -0
- package/systems/5e/images/fairy-wand.svg +1 -0
- package/systems/5e/images/feather.svg +1 -0
- package/systems/5e/images/feathered-wing.svg +1 -0
- package/systems/5e/images/fire-bottle.svg +1 -0
- package/systems/5e/images/fire-gem.svg +1 -0
- package/systems/5e/images/first-aid-kit.svg +1 -0
- package/systems/5e/images/fishing-hook.svg +1 -0
- package/systems/5e/images/fishing-net.svg +1 -0
- package/systems/5e/images/fishing-pole.svg +1 -0
- package/systems/5e/images/fist.svg +1 -0
- package/systems/5e/images/flail.svg +1 -0
- package/systems/5e/images/flanged-mace.svg +1 -0
- package/systems/5e/images/flat-hammer.svg +1 -0
- package/systems/5e/images/flint-spark.svg +1 -0
- package/systems/5e/images/floating-crystal.svg +1 -0
- package/systems/5e/images/flute.svg +1 -0
- package/systems/5e/images/galleon.svg +1 -0
- package/systems/5e/images/gauntlet.svg +1 -0
- package/systems/5e/images/gem-necklace.svg +1 -0
- package/systems/5e/images/gem-pendant.svg +1 -0
- package/systems/5e/images/gems.svg +1 -0
- package/systems/5e/images/gladius.svg +1 -0
- package/systems/5e/images/glaive.svg +1 -0
- package/systems/5e/images/glass-ball.svg +1 -0
- package/systems/5e/images/gloves.svg +1 -0
- package/systems/5e/images/gold-scarab.svg +1 -0
- package/systems/5e/images/grain-bundle.svg +1 -0
- package/systems/5e/images/halberd.svg +1 -0
- package/systems/5e/images/hand-saw.svg +1 -0
- package/systems/5e/images/handheld-fan.svg +1 -0
- package/systems/5e/images/harp.svg +1 -0
- package/systems/5e/images/hatchet.svg +1 -0
- package/systems/5e/images/headband-knot.svg +1 -0
- package/systems/5e/images/health-potion.svg +1 -0
- package/systems/5e/images/heart-bottle.svg +1 -0
- package/systems/5e/images/herbs-bundle.svg +1 -0
- package/systems/5e/images/hole-ladder.svg +1 -0
- package/systems/5e/images/holy-symbol.svg +1 -0
- package/systems/5e/images/holy-water.svg +1 -0
- package/systems/5e/images/honey-jar.svg +1 -0
- package/systems/5e/images/hood.svg +1 -0
- package/systems/5e/images/horseshoe.svg +1 -0
- package/systems/5e/images/hourglass.svg +1 -0
- package/systems/5e/images/hunting-horn.svg +1 -0
- package/systems/5e/images/jester-hat.svg +1 -0
- package/systems/5e/images/jug.svg +1 -0
- package/systems/5e/images/katana.svg +1 -0
- package/systems/5e/images/key-lock.svg +1 -0
- package/systems/5e/images/kitchen-scale.svg +1 -0
- package/systems/5e/images/knapsack.svg +1 -0
- package/systems/5e/images/ladder.svg +1 -0
- package/systems/5e/images/lantern.svg +1 -0
- package/systems/5e/images/leather-armor.svg +1 -0
- package/systems/5e/images/leather-boot.svg +1 -0
- package/systems/5e/images/leather-vest.svg +1 -0
- package/systems/5e/images/light-backpack.svg +1 -0
- package/systems/5e/images/light-helm.svg +1 -0
- package/systems/5e/images/locked-box.svg +1 -0
- package/systems/5e/images/locked-fortress.svg +1 -0
- package/systems/5e/images/lockpicks.svg +1 -0
- package/systems/5e/images/lunar-wand.svg +1 -0
- package/systems/5e/images/lyre.svg +1 -0
- package/systems/5e/images/magic-lamp.svg +1 -0
- package/systems/5e/images/magnifying-glass.svg +1 -0
- package/systems/5e/images/mail-shirt.svg +1 -0
- package/systems/5e/images/manacles.svg +1 -0
- package/systems/5e/images/marbles.svg +1 -0
- package/systems/5e/images/meat.svg +1 -0
- package/systems/5e/images/medal.svg +1 -0
- package/systems/5e/images/mirror-mirror.svg +1 -0
- package/systems/5e/images/mountain-climbing.svg +1 -0
- package/systems/5e/images/oil-can.svg +1 -0
- package/systems/5e/images/old-lantern.svg +1 -0
- package/systems/5e/images/old-wagon.svg +1 -0
- package/systems/5e/images/orb-wand.svg +1 -0
- package/systems/5e/images/oyster-pearl.svg +1 -0
- package/systems/5e/images/paint-brush.svg +1 -0
- package/systems/5e/images/painted-pottery.svg +1 -0
- package/systems/5e/images/palette.svg +1 -0
- package/systems/5e/images/paper.svg +1 -0
- package/systems/5e/images/pencil.svg +1 -0
- package/systems/5e/images/perfume-bottle.svg +1 -0
- package/systems/5e/images/pilgrim-hat.svg +1 -0
- package/systems/5e/images/pipes.svg +1 -0
- package/systems/5e/images/plain-arrow.svg +1 -0
- package/systems/5e/images/plain-dagger.svg +1 -0
- package/systems/5e/images/poison-bottle.svg +1 -0
- package/systems/5e/images/powder-bag.svg +1 -0
- package/systems/5e/images/prayer-beads.svg +1 -0
- package/systems/5e/images/pulley-hook.svg +1 -0
- package/systems/5e/images/quill-ink.svg +1 -0
- package/systems/5e/images/quill.svg +1 -0
- package/systems/5e/images/quiver.svg +1 -0
- package/systems/5e/images/red-carpet.svg +1 -0
- package/systems/5e/images/ring.svg +1 -0
- package/systems/5e/images/ringing-bell.svg +1 -0
- package/systems/5e/images/robe.svg +1 -0
- package/systems/5e/images/rope-coil.svg +1 -0
- package/systems/5e/images/round-bottom-flask.svg +1 -0
- package/systems/5e/images/round-potion.svg +1 -0
- package/systems/5e/images/rune-stone.svg +1 -0
- package/systems/5e/images/saddle.svg +1 -0
- package/systems/5e/images/scale-mail.svg +1 -0
- package/systems/5e/images/scroll-unfurled.svg +1 -0
- package/systems/5e/images/secret-book.svg +1 -0
- package/systems/5e/images/sewing-needle.svg +1 -0
- package/systems/5e/images/shield.svg +1 -0
- package/systems/5e/images/shirt-button.svg +1 -0
- package/systems/5e/images/sickle.svg +1 -0
- package/systems/5e/images/siege-ram.svg +1 -0
- package/systems/5e/images/skull-staff.svg +1 -0
- package/systems/5e/images/sleeping-bag.svg +1 -0
- package/systems/5e/images/sling.svg +1 -0
- package/systems/5e/images/slippers.svg +1 -0
- package/systems/5e/images/small-fishing-sailboat.svg +1 -0
- package/systems/5e/images/smoking-orb.svg +1 -0
- package/systems/5e/images/soap.svg +1 -0
- package/systems/5e/images/spade.svg +1 -0
- package/systems/5e/images/sparkling-sabre.svg +1 -0
- package/systems/5e/images/spell-book.svg +1 -0
- package/systems/5e/images/spiked-armor.svg +1 -0
- package/systems/5e/images/spiked-mace.svg +1 -0
- package/systems/5e/images/spikes.svg +1 -0
- package/systems/5e/images/spinning-wheel.svg +1 -0
- package/systems/5e/images/spyglass.svg +1 -0
- package/systems/5e/images/steampunk-goggles.svg +1 -0
- package/systems/5e/images/stone-block.svg +1 -0
- package/systems/5e/images/stone-pile.svg +1 -0
- package/systems/5e/images/stone-sphere.svg +1 -0
- package/systems/5e/images/straight-pipe.svg +1 -0
- package/systems/5e/images/swap-bag.svg +1 -0
- package/systems/5e/images/thor-hammer.svg +1 -0
- package/systems/5e/images/thrown-spear.svg +1 -0
- package/systems/5e/images/tiara.svg +1 -0
- package/systems/5e/images/tied-scroll.svg +1 -0
- package/systems/5e/images/tinker.svg +1 -0
- package/systems/5e/images/torch.svg +1 -0
- package/systems/5e/images/totem.svg +1 -0
- package/systems/5e/images/trap-mask.svg +1 -0
- package/systems/5e/images/treasure-map.svg +1 -0
- package/systems/5e/images/tribal-pendant.svg +1 -0
- package/systems/5e/images/trident.svg +1 -0
- package/systems/5e/images/two-handed-sword.svg +1 -0
- package/systems/5e/images/vial.svg +1 -0
- package/systems/5e/images/violin.svg +1 -0
- package/systems/5e/images/war-axe.svg +1 -0
- package/systems/5e/images/war-pick.svg +1 -0
- package/systems/5e/images/warhammer.svg +1 -0
- package/systems/5e/images/water-bottle.svg +1 -0
- package/systems/5e/images/waterskin.svg +1 -0
- package/systems/5e/images/wavy-chains.svg +1 -0
- package/systems/5e/images/wax-seal.svg +1 -0
- package/systems/5e/images/wheelbarrow.svg +1 -0
- package/systems/5e/images/whip.svg +1 -0
- package/systems/5e/images/whistle.svg +1 -0
- package/systems/5e/images/wing-cloak.svg +1 -0
- package/systems/5e/images/winged-scepter.svg +1 -0
- package/systems/5e/images/wizard-staff.svg +1 -0
- package/systems/5e/images/wolf-trap.svg +1 -0
- package/systems/5e/images/wood-canoe.svg +1 -0
- package/systems/5e/images/wood-club.svg +1 -0
- package/systems/5e/instructions/import.md +1 -0
- package/systems/5e/instructions/play.md +5 -0
- package/systems/5e/instructions/session-zero.md +1 -1
- package/systems/5e/package.json +11 -0
- package/systems/5e/system.yaml +231 -31
- package/systems/5e/words/ar.yaml +74 -0
- package/systems/5e/words/cs.yaml +74 -0
- package/systems/5e/words/da.yaml +74 -0
- package/systems/5e/words/de.yaml +74 -0
- package/systems/5e/words/el.yaml +74 -0
- package/systems/5e/words/en.yaml +20 -0
- package/systems/5e/words/es.yaml +74 -0
- package/systems/5e/words/fi.yaml +74 -0
- package/systems/5e/words/fr.yaml +74 -0
- package/systems/5e/words/he.yaml +74 -0
- package/systems/5e/words/hi.yaml +74 -0
- package/systems/5e/words/hu.yaml +74 -0
- package/systems/5e/words/is.yaml +74 -0
- package/systems/5e/words/it.yaml +84 -1
- package/systems/5e/words/ja.yaml +74 -0
- package/systems/5e/words/ko.yaml +74 -0
- package/systems/5e/words/nb.yaml +74 -0
- package/systems/5e/words/nl.yaml +74 -0
- package/systems/5e/words/pl.yaml +74 -0
- package/systems/5e/words/pt.yaml +74 -0
- package/systems/5e/words/ro.yaml +74 -0
- package/systems/5e/words/ru.yaml +74 -0
- package/systems/5e/words/sv.yaml +74 -0
- package/systems/5e/words/tr.yaml +74 -0
- package/systems/5e/words/uk.yaml +74 -0
- package/systems/5e/words/zh.yaml +74 -0
- package/systems/5e/world/creatures/Aboleth.md +1 -0
- package/systems/5e/world/creatures/Adult Black Dragon.md +2 -0
- package/systems/5e/world/creatures/Adult Blue Dragon.md +2 -0
- package/systems/5e/world/creatures/Adult Brass Dragon.md +2 -0
- package/systems/5e/world/creatures/Adult Bronze Dragon.md +2 -0
- package/systems/5e/world/creatures/Adult Copper Dragon.md +2 -0
- package/systems/5e/world/creatures/Adult Gold Dragon.md +2 -0
- package/systems/5e/world/creatures/Adult Green Dragon.md +2 -0
- package/systems/5e/world/creatures/Adult Red Dragon.md +2 -0
- package/systems/5e/world/creatures/Adult Silver Dragon.md +2 -0
- package/systems/5e/world/creatures/Adult White Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient Black Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient Blue Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient Brass Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient Bronze Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient Copper Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient Gold Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient Green Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient Red Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient Silver Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient White Dragon.md +2 -0
- package/systems/5e/world/creatures/Androsphinx.md +1 -0
- package/systems/5e/world/creatures/Dwarf.md +1 -0
- package/systems/5e/world/creatures/Gynosphinx.md +1 -0
- package/systems/5e/world/creatures/Kraken.md +1 -0
- package/systems/5e/world/creatures/Lich.md +2 -0
- package/systems/5e/world/creatures/Mummy Lord.md +1 -0
- package/systems/5e/world/creatures/Solar.md +1 -0
- package/systems/5e/world/creatures/Tarrasque.md +2 -0
- package/systems/5e/world/creatures/Unicorn.md +1 -0
- package/systems/5e/world/creatures/Vampire.md +2 -0
- package/systems/5e/world/items/Abacus.md +1 -0
- package/systems/5e/world/items/Acid.md +1 -0
- package/systems/5e/world/items/Adamantine Armor.md +1 -0
- package/systems/5e/world/items/Alchemist's Fire.md +1 -0
- package/systems/5e/world/items/Alchemist's Supplies.md +1 -0
- package/systems/5e/world/items/Ammunition, +1, +2, or +3.md +1 -0
- package/systems/5e/world/items/Amulet of Health.md +2 -0
- package/systems/5e/world/items/Amulet of Proof against Detection and Location.md +1 -0
- package/systems/5e/world/items/Amulet of the Planes.md +1 -0
- package/systems/5e/world/items/Amulet.md +1 -0
- package/systems/5e/world/items/Animated Shield.md +1 -0
- package/systems/5e/world/items/Antitoxin.md +1 -0
- package/systems/5e/world/items/Apparatus of the Crab.md +1 -0
- package/systems/5e/world/items/Armor of Invulnerability.md +2 -0
- package/systems/5e/world/items/Armor of Resistance.md +1 -0
- package/systems/5e/world/items/Armor of Vulnerability.md +1 -0
- package/systems/5e/world/items/Armor, +1, +2, or +3.md +1 -0
- package/systems/5e/world/items/Arrow of Slaying.md +1 -0
- package/systems/5e/world/items/Arrow-Catching Shield.md +1 -0
- package/systems/5e/world/items/Arrows.md +2 -0
- package/systems/5e/world/items/Backpack.md +1 -0
- package/systems/5e/world/items/Bag of Beans.md +1 -0
- package/systems/5e/world/items/Bag of Devouring.md +1 -0
- package/systems/5e/world/items/Bag of Holding.md +3 -0
- package/systems/5e/world/items/Bag of Tricks.md +1 -0
- package/systems/5e/world/items/Bagpipes.md +1 -0
- package/systems/5e/world/items/Ball Bearings.md +1 -0
- package/systems/5e/world/items/Barding.md +1 -0
- package/systems/5e/world/items/Barrel.md +1 -0
- package/systems/5e/world/items/Basic Poison.md +1 -0
- package/systems/5e/world/items/Basket.md +1 -0
- package/systems/5e/world/items/Battleaxe.md +1 -0
- package/systems/5e/world/items/Bead of Force.md +1 -0
- package/systems/5e/world/items/Bedroll.md +1 -0
- package/systems/5e/world/items/Bell.md +1 -0
- package/systems/5e/world/items/Belt of Dwarvenkind.md +1 -0
- package/systems/5e/world/items/Belt of Giant Strength.md +1 -0
- package/systems/5e/world/items/Berserker Axe.md +1 -0
- package/systems/5e/world/items/Bit and Bridle.md +1 -0
- package/systems/5e/world/items/Blanket.md +1 -0
- package/systems/5e/world/items/Block and Tackle.md +1 -0
- package/systems/5e/world/items/Blowgun Needles.md +2 -0
- package/systems/5e/world/items/Blowgun.md +1 -0
- package/systems/5e/world/items/Book.md +1 -0
- package/systems/5e/world/items/Boots of Elvenkind.md +1 -0
- package/systems/5e/world/items/Boots of Levitation.md +1 -0
- package/systems/5e/world/items/Boots of Speed.md +1 -0
- package/systems/5e/world/items/Boots of Striding and Springing.md +1 -0
- package/systems/5e/world/items/Boots of the Winterlands.md +2 -0
- package/systems/5e/world/items/Bowl of Commanding Water Elementals.md +1 -0
- package/systems/5e/world/items/Bracers of Archery.md +1 -0
- package/systems/5e/world/items/Bracers of Defense.md +1 -0
- package/systems/5e/world/items/Brazier of Commanding Fire Elementals.md +1 -0
- package/systems/5e/world/items/Breastplate.md +1 -0
- package/systems/5e/world/items/Brewer's Supplies.md +1 -0
- package/systems/5e/world/items/Brooch of Shielding.md +2 -0
- package/systems/5e/world/items/Broom of Flying.md +1 -0
- package/systems/5e/world/items/Bucket.md +1 -0
- package/systems/5e/world/items/Bullseye Lantern.md +1 -0
- package/systems/5e/world/items/Burglar's Pack.md +3 -0
- package/systems/5e/world/items/Calligrapher's Supplies.md +1 -0
- package/systems/5e/world/items/Caltrops.md +1 -0
- package/systems/5e/world/items/Candle of Invocation.md +1 -0
- package/systems/5e/world/items/Candle.md +1 -0
- package/systems/5e/world/items/Cape of the Mountebank.md +1 -0
- package/systems/5e/world/items/Carpenter's Tools.md +1 -0
- package/systems/5e/world/items/Carpet of Flying.md +1 -0
- package/systems/5e/world/items/Carriage.md +1 -0
- package/systems/5e/world/items/Cart.md +1 -0
- package/systems/5e/world/items/Cartographer's Tools.md +1 -0
- package/systems/5e/world/items/Censer of Controlling Air Elementals.md +1 -0
- package/systems/5e/world/items/Chain Mail.md +2 -0
- package/systems/5e/world/items/Chain Shirt.md +1 -0
- package/systems/5e/world/items/Chain.md +1 -0
- package/systems/5e/world/items/Chalk.md +1 -0
- package/systems/5e/world/items/Chariot.md +1 -0
- package/systems/5e/world/items/Chest.md +1 -0
- package/systems/5e/world/items/Chime of Opening.md +1 -0
- package/systems/5e/world/items/Circlet of Blasting.md +1 -0
- package/systems/5e/world/items/Climber's Kit.md +1 -0
- package/systems/5e/world/items/Cloak of Arachnida.md +2 -0
- package/systems/5e/world/items/Cloak of Displacement.md +1 -0
- package/systems/5e/world/items/Cloak of Elvenkind.md +1 -0
- package/systems/5e/world/items/Cloak of Protection.md +3 -0
- package/systems/5e/world/items/Cloak of the Bat.md +1 -0
- package/systems/5e/world/items/Cloak of the Manta Ray.md +1 -0
- package/systems/5e/world/items/Club.md +1 -0
- package/systems/5e/world/items/Cobbler's Tools.md +1 -0
- package/systems/5e/world/items/Common Clothes.md +1 -0
- package/systems/5e/world/items/Component Pouch.md +1 -0
- package/systems/5e/world/items/Cook's Utensils.md +1 -0
- package/systems/5e/world/items/Costume Clothes.md +1 -0
- package/systems/5e/world/items/Crossbow Bolt Case.md +1 -0
- package/systems/5e/world/items/Crossbow Bolts.md +2 -0
- package/systems/5e/world/items/Crowbar.md +1 -0
- package/systems/5e/world/items/Crystal Ball.md +1 -0
- package/systems/5e/world/items/Crystal.md +1 -0
- package/systems/5e/world/items/Cube of Force.md +2 -0
- package/systems/5e/world/items/Cubic Gate.md +2 -0
- package/systems/5e/world/items/Dagger of Venom.md +1 -0
- package/systems/5e/world/items/Dagger.md +1 -0
- package/systems/5e/world/items/Dancing Sword.md +1 -0
- package/systems/5e/world/items/Dart.md +1 -0
- package/systems/5e/world/items/Decanter of Endless Water.md +1 -0
- package/systems/5e/world/items/Deck of Illusions.md +1 -0
- package/systems/5e/world/items/Deck of Many Things.md +1 -0
- package/systems/5e/world/items/Defender.md +1 -0
- package/systems/5e/world/items/Demon Armor.md +1 -0
- package/systems/5e/world/items/Dice Set.md +1 -0
- package/systems/5e/world/items/Dimensional Shackles.md +1 -0
- package/systems/5e/world/items/Diplomat's Pack.md +3 -0
- package/systems/5e/world/items/Disguise Kit.md +1 -0
- package/systems/5e/world/items/Dragon Scale Mail.md +1 -0
- package/systems/5e/world/items/Dragon Slayer.md +1 -0
- package/systems/5e/world/items/Drum.md +1 -0
- package/systems/5e/world/items/Dulcimer.md +1 -0
- package/systems/5e/world/items/Dungeoneer's Pack.md +3 -0
- package/systems/5e/world/items/Dust of Disappearance.md +1 -0
- package/systems/5e/world/items/Dust of Dryness.md +1 -0
- package/systems/5e/world/items/Dust of Sneezing and Choking.md +1 -0
- package/systems/5e/world/items/Dwarven Plate.md +1 -0
- package/systems/5e/world/items/Dwarven Thrower.md +1 -0
- package/systems/5e/world/items/Efficient Quiver.md +1 -0
- package/systems/5e/world/items/Efreeti Bottle.md +1 -0
- package/systems/5e/world/items/Elemental Gem.md +1 -0
- package/systems/5e/world/items/Elven Chain.md +1 -0
- package/systems/5e/world/items/Emblem.md +1 -0
- package/systems/5e/world/items/Entertainer's Pack.md +3 -0
- package/systems/5e/world/items/Eversmoking Bottle.md +1 -0
- package/systems/5e/world/items/Exotic Saddle.md +1 -0
- package/systems/5e/world/items/Explorer's Pack.md +3 -0
- package/systems/5e/world/items/Eyes of Charming.md +1 -0
- package/systems/5e/world/items/Eyes of Minute Seeing.md +1 -0
- package/systems/5e/world/items/Eyes of the Eagle.md +1 -0
- package/systems/5e/world/items/Feather Token.md +1 -0
- package/systems/5e/world/items/Feed.md +1 -0
- package/systems/5e/world/items/Figurine of Wondrous Power.md +1 -0
- package/systems/5e/world/items/Fine Clothes.md +1 -0
- package/systems/5e/world/items/Fishing Tackle.md +1 -0
- package/systems/5e/world/items/Flail.md +1 -0
- package/systems/5e/world/items/Flame Tongue.md +1 -0
- package/systems/5e/world/items/Flask or Tankard.md +1 -0
- package/systems/5e/world/items/Flute.md +1 -0
- package/systems/5e/world/items/Folding Boat.md +1 -0
- package/systems/5e/world/items/Forgery Kit.md +1 -0
- package/systems/5e/world/items/Frost Brand.md +2 -0
- package/systems/5e/world/items/Galley.md +1 -0
- package/systems/5e/world/items/Gauntlets of Ogre Power.md +2 -0
- package/systems/5e/world/items/Gem of Brightness.md +2 -0
- package/systems/5e/world/items/Gem of Seeing.md +2 -0
- package/systems/5e/world/items/Giant Slayer.md +1 -0
- package/systems/5e/world/items/Glaive.md +1 -0
- package/systems/5e/world/items/Glamoured Studded Leather.md +1 -0
- package/systems/5e/world/items/Glass Bottle.md +1 -0
- package/systems/5e/world/items/Glassblower's Tools.md +1 -0
- package/systems/5e/world/items/Gloves of Missile Snaring.md +1 -0
- package/systems/5e/world/items/Gloves of Swimming and Climbing.md +1 -0
- package/systems/5e/world/items/Goggles of Night.md +1 -0
- package/systems/5e/world/items/Grappling Hook.md +1 -0
- package/systems/5e/world/items/Greataxe.md +1 -0
- package/systems/5e/world/items/Greatclub.md +1 -0
- package/systems/5e/world/items/Greatsword.md +1 -0
- package/systems/5e/world/items/Halberd.md +1 -0
- package/systems/5e/world/items/Half Plate Armor.md +1 -0
- package/systems/5e/world/items/Hammer of Thunderbolts.md +2 -0
- package/systems/5e/world/items/Hammer.md +1 -0
- package/systems/5e/world/items/Hand Crossbow.md +1 -0
- package/systems/5e/world/items/Handaxe.md +1 -0
- package/systems/5e/world/items/Handy Haversack.md +3 -0
- package/systems/5e/world/items/Hat of Disguise.md +1 -0
- package/systems/5e/world/items/Headband of Intellect.md +2 -0
- package/systems/5e/world/items/Healer's Kit.md +1 -0
- package/systems/5e/world/items/Heavy Crossbow.md +1 -0
- package/systems/5e/world/items/Helm of Brilliance.md +1 -0
- package/systems/5e/world/items/Helm of Comprehending Languages.md +1 -0
- package/systems/5e/world/items/Helm of Telepathy.md +1 -0
- package/systems/5e/world/items/Helm of Teleportation.md +2 -0
- package/systems/5e/world/items/Hempen Rope.md +1 -0
- package/systems/5e/world/items/Herbalism Kit.md +1 -0
- package/systems/5e/world/items/Hide Armor.md +1 -0
- package/systems/5e/world/items/Holy Avenger.md +1 -0
- package/systems/5e/world/items/Holy Water.md +1 -0
- package/systems/5e/world/items/Hooded Lantern.md +1 -0
- package/systems/5e/world/items/Horn of Blasting.md +1 -0
- package/systems/5e/world/items/Horn of Valhalla.md +1 -0
- package/systems/5e/world/items/Horn.md +1 -0
- package/systems/5e/world/items/Horseshoes of Speed.md +1 -0
- package/systems/5e/world/items/Horseshoes of a Zephyr.md +1 -0
- package/systems/5e/world/items/Hourglass.md +1 -0
- package/systems/5e/world/items/Hunting Trap.md +1 -0
- package/systems/5e/world/items/Immovable Rod.md +1 -0
- package/systems/5e/world/items/Ink Pen.md +1 -0
- package/systems/5e/world/items/Ink.md +1 -0
- package/systems/5e/world/items/Instant Fortress.md +1 -0
- package/systems/5e/world/items/Ioun Stone.md +1 -0
- package/systems/5e/world/items/Iron Bands of Binding.md +1 -0
- package/systems/5e/world/items/Iron Flask.md +1 -0
- package/systems/5e/world/items/Iron Pot.md +1 -0
- package/systems/5e/world/items/Iron Spikes.md +2 -0
- package/systems/5e/world/items/Javelin of Lightning.md +1 -0
- package/systems/5e/world/items/Javelin.md +1 -0
- package/systems/5e/world/items/Jeweler's Tools.md +1 -0
- package/systems/5e/world/items/Jug or Pitcher.md +1 -0
- package/systems/5e/world/items/Keelboat.md +1 -0
- package/systems/5e/world/items/Ladder.md +1 -0
- package/systems/5e/world/items/Lamp.md +1 -0
- package/systems/5e/world/items/Lance.md +1 -0
- package/systems/5e/world/items/Lantern of Revealing.md +1 -0
- package/systems/5e/world/items/Leather Armor.md +1 -0
- package/systems/5e/world/items/Leatherworker's Tools.md +1 -0
- package/systems/5e/world/items/Light Crossbow.md +1 -0
- package/systems/5e/world/items/Light Hammer.md +1 -0
- package/systems/5e/world/items/Lock.md +1 -0
- package/systems/5e/world/items/Longbow.md +1 -0
- package/systems/5e/world/items/Longship.md +1 -0
- package/systems/5e/world/items/Longsword.md +1 -0
- package/systems/5e/world/items/Luck Blade.md +1 -0
- package/systems/5e/world/items/Lute.md +1 -0
- package/systems/5e/world/items/Lyre.md +1 -0
- package/systems/5e/world/items/Mace of Disruption.md +1 -0
- package/systems/5e/world/items/Mace of Smiting.md +1 -0
- package/systems/5e/world/items/Mace of Terror.md +2 -0
- package/systems/5e/world/items/Mace.md +1 -0
- package/systems/5e/world/items/Magnifying Glass.md +1 -0
- package/systems/5e/world/items/Manacles.md +1 -0
- package/systems/5e/world/items/Mantle of Spell Resistance.md +1 -0
- package/systems/5e/world/items/Manual of Bodily Health.md +1 -0
- package/systems/5e/world/items/Manual of Gainful Exercise.md +1 -0
- package/systems/5e/world/items/Manual of Golems.md +1 -0
- package/systems/5e/world/items/Manual of Quickness of Action.md +1 -0
- package/systems/5e/world/items/Map or Scroll Case.md +1 -0
- package/systems/5e/world/items/Marvelous Pigments.md +1 -0
- package/systems/5e/world/items/Mason's Tools.md +1 -0
- package/systems/5e/world/items/Maul.md +1 -0
- package/systems/5e/world/items/Medallion of Thoughts.md +2 -0
- package/systems/5e/world/items/Merchant's Scale.md +1 -0
- package/systems/5e/world/items/Mess Kit.md +1 -0
- package/systems/5e/world/items/Military Saddle.md +1 -0
- package/systems/5e/world/items/Miner's Pick.md +1 -0
- package/systems/5e/world/items/Mirror of Life Trapping.md +1 -0
- package/systems/5e/world/items/Mithral Armor.md +1 -0
- package/systems/5e/world/items/Morningstar.md +1 -0
- package/systems/5e/world/items/Navigator's Tools.md +1 -0
- package/systems/5e/world/items/Necklace of Adaptation.md +1 -0
- package/systems/5e/world/items/Necklace of Fireballs.md +1 -0
- package/systems/5e/world/items/Necklace of Prayer Beads.md +1 -0
- package/systems/5e/world/items/Net.md +1 -0
- package/systems/5e/world/items/Nine Lives Stealer.md +1 -0
- package/systems/5e/world/items/Oathbow.md +1 -0
- package/systems/5e/world/items/Oil of Etherealness.md +1 -0
- package/systems/5e/world/items/Oil of Sharpness.md +1 -0
- package/systems/5e/world/items/Oil of Slipperiness.md +1 -0
- package/systems/5e/world/items/Oil.md +1 -0
- package/systems/5e/world/items/Orb of Dragonkind.md +2 -0
- package/systems/5e/world/items/Orb.md +1 -0
- package/systems/5e/world/items/Pack Saddle.md +1 -0
- package/systems/5e/world/items/Padded Armor.md +1 -0
- package/systems/5e/world/items/Painter's Supplies.md +1 -0
- package/systems/5e/world/items/Pan Flute.md +1 -0
- package/systems/5e/world/items/Paper.md +1 -0
- package/systems/5e/world/items/Parchment.md +1 -0
- package/systems/5e/world/items/Pearl of Power.md +1 -0
- package/systems/5e/world/items/Perfume.md +1 -0
- package/systems/5e/world/items/Periapt of Health.md +1 -0
- package/systems/5e/world/items/Periapt of Proof against Poison.md +1 -0
- package/systems/5e/world/items/Periapt of Wound Closure.md +1 -0
- package/systems/5e/world/items/Philter of Love.md +1 -0
- package/systems/5e/world/items/Pike.md +1 -0
- package/systems/5e/world/items/Pipes of Haunting.md +1 -0
- package/systems/5e/world/items/Pipes of the Sewers.md +1 -0
- package/systems/5e/world/items/Piton.md +1 -0
- package/systems/5e/world/items/Plate Armor of Etherealness.md +1 -0
- package/systems/5e/world/items/Plate Armor.md +2 -0
- package/systems/5e/world/items/Playing Card Set.md +1 -0
- package/systems/5e/world/items/Poisoner's Kit.md +1 -0
- package/systems/5e/world/items/Pole.md +1 -0
- package/systems/5e/world/items/Portable Hole.md +2 -0
- package/systems/5e/world/items/Portable Ram.md +1 -0
- package/systems/5e/world/items/Potion of Animal Friendship.md +1 -0
- package/systems/5e/world/items/Potion of Clairvoyance.md +1 -0
- package/systems/5e/world/items/Potion of Climbing.md +1 -0
- package/systems/5e/world/items/Potion of Diminution.md +1 -0
- package/systems/5e/world/items/Potion of Flying.md +1 -0
- package/systems/5e/world/items/Potion of Gaseous Form.md +1 -0
- package/systems/5e/world/items/Potion of Giant Strength.md +1 -0
- package/systems/5e/world/items/Potion of Growth.md +1 -0
- package/systems/5e/world/items/Potion of Healing.md +1 -0
- package/systems/5e/world/items/Potion of Heroism.md +1 -0
- package/systems/5e/world/items/Potion of Invisibility.md +1 -0
- package/systems/5e/world/items/Potion of Mind Reading.md +1 -0
- package/systems/5e/world/items/Potion of Poison.md +1 -0
- package/systems/5e/world/items/Potion of Resistance.md +1 -0
- package/systems/5e/world/items/Potion of Speed.md +1 -0
- package/systems/5e/world/items/Potion of Water Breathing.md +1 -0
- package/systems/5e/world/items/Potter's Tools.md +1 -0
- package/systems/5e/world/items/Pouch.md +1 -0
- package/systems/5e/world/items/Priest's Pack.md +3 -0
- package/systems/5e/world/items/Quarterstaff.md +1 -0
- package/systems/5e/world/items/Quiver.md +1 -0
- package/systems/5e/world/items/Rapier.md +1 -0
- package/systems/5e/world/items/Rations.md +1 -0
- package/systems/5e/world/items/Reliquary.md +1 -0
- package/systems/5e/world/items/Restorative Ointment.md +1 -0
- package/systems/5e/world/items/Riding Saddle.md +1 -0
- package/systems/5e/world/items/Ring Mail.md +1 -0
- package/systems/5e/world/items/Ring of Animal Influence.md +2 -0
- package/systems/5e/world/items/Ring of Djinni Summoning.md +1 -0
- package/systems/5e/world/items/Ring of Elemental Command.md +2 -0
- package/systems/5e/world/items/Ring of Evasion.md +2 -0
- package/systems/5e/world/items/Ring of Feather Falling.md +1 -0
- package/systems/5e/world/items/Ring of Free Action.md +1 -0
- package/systems/5e/world/items/Ring of Invisibility.md +1 -0
- package/systems/5e/world/items/Ring of Jumping.md +1 -0
- package/systems/5e/world/items/Ring of Mind Shielding.md +1 -0
- package/systems/5e/world/items/Ring of Protection.md +3 -0
- package/systems/5e/world/items/Ring of Regeneration.md +1 -0
- package/systems/5e/world/items/Ring of Resistance.md +1 -0
- package/systems/5e/world/items/Ring of Shooting Stars.md +2 -0
- package/systems/5e/world/items/Ring of Spell Storing.md +1 -0
- package/systems/5e/world/items/Ring of Spell Turning.md +1 -0
- package/systems/5e/world/items/Ring of Swimming.md +1 -0
- package/systems/5e/world/items/Ring of Telekinesis.md +1 -0
- package/systems/5e/world/items/Ring of Three Wishes.md +1 -0
- package/systems/5e/world/items/Ring of Warmth.md +2 -0
- package/systems/5e/world/items/Ring of Water Walking.md +1 -0
- package/systems/5e/world/items/Ring of X-ray Vision.md +1 -0
- package/systems/5e/world/items/Ring of the Ram.md +2 -0
- package/systems/5e/world/items/Robe of Eyes.md +1 -0
- package/systems/5e/world/items/Robe of Scintillating Colors.md +2 -0
- package/systems/5e/world/items/Robe of Stars.md +1 -0
- package/systems/5e/world/items/Robe of Useful Items.md +1 -0
- package/systems/5e/world/items/Robe of the Archmagi.md +3 -0
- package/systems/5e/world/items/Robes.md +1 -0
- package/systems/5e/world/items/Rod of Absorption.md +1 -0
- package/systems/5e/world/items/Rod of Alertness.md +1 -0
- package/systems/5e/world/items/Rod of Lordly Might.md +1 -0
- package/systems/5e/world/items/Rod of Rulership.md +1 -0
- package/systems/5e/world/items/Rod of Security.md +1 -0
- package/systems/5e/world/items/Rod.md +1 -0
- package/systems/5e/world/items/Rope of Climbing.md +1 -0
- package/systems/5e/world/items/Rope of Entanglement.md +1 -0
- package/systems/5e/world/items/Rowboat.md +1 -0
- package/systems/5e/world/items/Sack.md +1 -0
- package/systems/5e/world/items/Saddlebags.md +1 -0
- package/systems/5e/world/items/Sailing Ship.md +1 -0
- package/systems/5e/world/items/Scale Mail.md +1 -0
- package/systems/5e/world/items/Scarab of Protection.md +2 -0
- package/systems/5e/world/items/Scholar's Pack.md +3 -0
- package/systems/5e/world/items/Scimitar of Speed.md +1 -0
- package/systems/5e/world/items/Scimitar.md +1 -0
- package/systems/5e/world/items/Sealing Wax.md +1 -0
- package/systems/5e/world/items/Shawm.md +1 -0
- package/systems/5e/world/items/Shield of Missile Attraction.md +2 -0
- package/systems/5e/world/items/Shield, +1, +2, or +3.md +1 -0
- package/systems/5e/world/items/Shield.md +1 -0
- package/systems/5e/world/items/Shortbow.md +1 -0
- package/systems/5e/world/items/Shortsword.md +1 -0
- package/systems/5e/world/items/Shovel.md +1 -0
- package/systems/5e/world/items/Sickle.md +1 -0
- package/systems/5e/world/items/Signal Whistle.md +1 -0
- package/systems/5e/world/items/Signet Ring.md +1 -0
- package/systems/5e/world/items/Silk Rope.md +1 -0
- package/systems/5e/world/items/Sled.md +1 -0
- package/systems/5e/world/items/Sledgehammer.md +1 -0
- package/systems/5e/world/items/Sling Bullets.md +2 -0
- package/systems/5e/world/items/Sling.md +1 -0
- package/systems/5e/world/items/Slippers of Spider Climbing.md +1 -0
- package/systems/5e/world/items/Smith's Tools.md +1 -0
- package/systems/5e/world/items/Soap.md +1 -0
- package/systems/5e/world/items/Sovereign Glue.md +1 -0
- package/systems/5e/world/items/Spear.md +1 -0
- package/systems/5e/world/items/Spell Scroll.md +1 -0
- package/systems/5e/world/items/Spellbook.md +1 -0
- package/systems/5e/world/items/Spellguard Shield.md +1 -0
- package/systems/5e/world/items/Sphere of Annihilation.md +1 -0
- package/systems/5e/world/items/Splint Armor.md +2 -0
- package/systems/5e/world/items/Sprig of Mistletoe.md +1 -0
- package/systems/5e/world/items/Spyglass.md +1 -0
- package/systems/5e/world/items/Staff of Charming.md +1 -0
- package/systems/5e/world/items/Staff of Fire.md +3 -0
- package/systems/5e/world/items/Staff of Frost.md +3 -0
- package/systems/5e/world/items/Staff of Healing.md +2 -0
- package/systems/5e/world/items/Staff of Power.md +5 -0
- package/systems/5e/world/items/Staff of Striking.md +2 -0
- package/systems/5e/world/items/Staff of Swarming Insects.md +2 -0
- package/systems/5e/world/items/Staff of Thunder and Lightning.md +1 -0
- package/systems/5e/world/items/Staff of Withering.md +2 -0
- package/systems/5e/world/items/Staff of the Magi.md +3 -0
- package/systems/5e/world/items/Staff of the Python.md +1 -0
- package/systems/5e/world/items/Staff of the Woodlands.md +2 -0
- package/systems/5e/world/items/Staff.md +1 -0
- package/systems/5e/world/items/Steel Mirror.md +1 -0
- package/systems/5e/world/items/Stone of Controlling Earth Elementals.md +1 -0
- package/systems/5e/world/items/Stone of Good Luck.md +4 -0
- package/systems/5e/world/items/Studded Leather Armor.md +1 -0
- package/systems/5e/world/items/Sun Blade.md +1 -0
- package/systems/5e/world/items/Sword of Life Stealing.md +1 -0
- package/systems/5e/world/items/Sword of Sharpness.md +1 -0
- package/systems/5e/world/items/Sword of Wounding.md +1 -0
- package/systems/5e/world/items/Talisman of Pure Good.md +2 -0
- package/systems/5e/world/items/Talisman of Ultimate Evil.md +2 -0
- package/systems/5e/world/items/Talisman of the Sphere.md +1 -0
- package/systems/5e/world/items/Thieves' Tools.md +1 -0
- package/systems/5e/world/items/Tinderbox.md +1 -0
- package/systems/5e/world/items/Tinker's Tools.md +1 -0
- package/systems/5e/world/items/Tome of Clear Thought.md +1 -0
- package/systems/5e/world/items/Tome of Leadership and Influence.md +1 -0
- package/systems/5e/world/items/Tome of Understanding.md +1 -0
- package/systems/5e/world/items/Torch.md +1 -0
- package/systems/5e/world/items/Totem.md +1 -0
- package/systems/5e/world/items/Traveler's Clothes.md +1 -0
- package/systems/5e/world/items/Trident of Fish Command.md +2 -0
- package/systems/5e/world/items/Trident.md +1 -0
- package/systems/5e/world/items/Two-Person Tent.md +1 -0
- package/systems/5e/world/items/Unarmed Strike.md +1 -0
- package/systems/5e/world/items/Universal Solvent.md +1 -0
- package/systems/5e/world/items/Vial.md +1 -0
- package/systems/5e/world/items/Vicious Weapon.md +1 -0
- package/systems/5e/world/items/Viol.md +1 -0
- package/systems/5e/world/items/Vorpal Sword.md +1 -0
- package/systems/5e/world/items/Wagon.md +1 -0
- package/systems/5e/world/items/Wand of Binding.md +2 -0
- package/systems/5e/world/items/Wand of Enemy Detection.md +2 -0
- package/systems/5e/world/items/Wand of Fear.md +2 -0
- package/systems/5e/world/items/Wand of Fireballs.md +2 -0
- package/systems/5e/world/items/Wand of Lightning Bolts.md +2 -0
- package/systems/5e/world/items/Wand of Magic Detection.md +2 -0
- package/systems/5e/world/items/Wand of Magic Missiles.md +2 -0
- package/systems/5e/world/items/Wand of Paralysis.md +2 -0
- package/systems/5e/world/items/Wand of Polymorph.md +2 -0
- package/systems/5e/world/items/Wand of Secrets.md +2 -0
- package/systems/5e/world/items/Wand of Web.md +2 -0
- package/systems/5e/world/items/Wand of Wonder.md +2 -0
- package/systems/5e/world/items/Wand of the War Mage, +1, +2, or +3.md +1 -0
- package/systems/5e/world/items/Wand.md +1 -0
- package/systems/5e/world/items/War Pick.md +1 -0
- package/systems/5e/world/items/Warhammer.md +1 -0
- package/systems/5e/world/items/Warship.md +1 -0
- package/systems/5e/world/items/Waterskin.md +1 -0
- package/systems/5e/world/items/Weapon, +1, +2, or +3.md +1 -0
- package/systems/5e/world/items/Weaver's Tools.md +1 -0
- package/systems/5e/world/items/Well of Many Worlds.md +1 -0
- package/systems/5e/world/items/Whetstone.md +1 -0
- package/systems/5e/world/items/Whip.md +1 -0
- package/systems/5e/world/items/Wind Fan.md +1 -0
- package/systems/5e/world/items/Winged Boots.md +1 -0
- package/systems/5e/world/items/Wings of Flying.md +1 -0
- package/systems/5e/world/items/Woodcarver's Tools.md +1 -0
- package/systems/5e/world/items/Wooden Staff.md +1 -0
- package/systems/5e/world/items/Yew Wand.md +1 -0
- package/systems/free/instructions/play.md +5 -0
- package/systems/free/instructions/session-zero.md +1 -0
- package/systems/free/system.yaml +12 -0
- package/dist/dashboard/combat.js +0 -72
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
interface ThoughtsResult {
|
|
3
|
+
who: string;
|
|
4
|
+
date?: string;
|
|
5
|
+
text: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const thoughts: import("../core/registry.ts").Command<z.ZodObject<{
|
|
8
|
+
page: z.ZodString;
|
|
9
|
+
text: z.ZodString;
|
|
10
|
+
}, z.core.$strip>, ThoughtsResult>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { requireCampaign } from "../campaign/index.js";
|
|
3
|
+
import { appendLogEntry } from "../core/log.js";
|
|
4
|
+
import { defineCommand } from "../core/registry.js";
|
|
5
|
+
import { isInParty, pageNamed } from "../pages/index.js";
|
|
6
|
+
import { thoughtsLength, thoughtsType } from "./game-thoughts.js";
|
|
7
|
+
import { newDatedLogEntry } from "./game-time.js";
|
|
8
|
+
import { campaignWorld } from "./game-world.js";
|
|
9
|
+
export const thoughts = defineCommand({
|
|
10
|
+
name: "thoughts",
|
|
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: "
|
|
12
|
+
+ "how they took what happened, whom they trust or fear now, what they mean to do; never what happened, which the log keeps, and nothing they hide from the others. "
|
|
13
|
+
+ "From their agent, its Writes line as it is. The player reads it on the dashboard, and view as gives them their last lines back. "
|
|
14
|
+
+ 'Example: Mira "I no longer trust Corrado, since he lied to Agata. I will watch him."',
|
|
15
|
+
group: "game",
|
|
16
|
+
positionals: ["page", "text"],
|
|
17
|
+
input: z.object({
|
|
18
|
+
page: z.string().describe("the companion's page"),
|
|
19
|
+
text: z.string().describe(`their lines, at most ${thoughtsLength} characters`),
|
|
20
|
+
}),
|
|
21
|
+
run(input, context) {
|
|
22
|
+
const root = requireCampaign(context.folder);
|
|
23
|
+
const page = companionPage(campaignWorld(root, context), input.page.trim());
|
|
24
|
+
const text = input.text.trim().replace(/\s*\n\s*/g, " ").normalize("NFC");
|
|
25
|
+
// Characters as a reader counts them: an emoji is one.
|
|
26
|
+
const length = [...text].length;
|
|
27
|
+
if (text === "") {
|
|
28
|
+
throw new Error(`Give the lines ${page.name} writes. Nothing written.`);
|
|
29
|
+
}
|
|
30
|
+
if (length > thoughtsLength) {
|
|
31
|
+
throw new Error(`These lines are ${length} characters, the diary takes ${thoughtsLength}: keep how ${page.name} feels and what they mean to do, leave out what happened. Nothing written.`);
|
|
32
|
+
}
|
|
33
|
+
const entry = newDatedLogEntry(root, context, thoughtsType, "public", { page: page.name, text });
|
|
34
|
+
appendLogEntry(root, entry);
|
|
35
|
+
return { who: page.name, ...(entry.date === undefined ? {} : { date: entry.date }), text };
|
|
36
|
+
},
|
|
37
|
+
format(result) {
|
|
38
|
+
return `${result.who}'s diary${result.date === undefined ? "" : `, ${result.date}`}: ${result.text}`;
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
/** The companion whose diary it is (DIA-1); stops the command for any other page. */
|
|
42
|
+
function companionPage(world, name) {
|
|
43
|
+
const page = pageNamed(world, name);
|
|
44
|
+
if (page === undefined) {
|
|
45
|
+
throw new Error(`There is no page ${name}: give a companion's name, or look for it with find. Nothing written.`);
|
|
46
|
+
}
|
|
47
|
+
if (page.type !== "character" || page.fields.role !== "companion" || page.system !== undefined) {
|
|
48
|
+
throw new Error(`${page.name} is not a companion of the party: only companions keep a diary. Nothing written.`);
|
|
49
|
+
}
|
|
50
|
+
if (!isInParty(page)) {
|
|
51
|
+
throw new Error(`${page.name} is dead: the dead keep no diary. Nothing written.`);
|
|
52
|
+
}
|
|
53
|
+
return page;
|
|
54
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const trade: import("../core/registry.ts").Command<z.ZodObject<{
|
|
3
|
+
page: z.ZodString;
|
|
4
|
+
with: z.ZodString;
|
|
5
|
+
gives: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
6
|
+
gets: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
7
|
+
why: z.ZodOptional<z.ZodString>;
|
|
8
|
+
}, z.core.$strip>, {
|
|
9
|
+
page: string;
|
|
10
|
+
with: string;
|
|
11
|
+
gave: string[];
|
|
12
|
+
got: string[];
|
|
13
|
+
stacks: string[];
|
|
14
|
+
purses: string[];
|
|
15
|
+
moved: string[];
|
|
16
|
+
problems: string[];
|
|
17
|
+
}>;
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { requireCampaign } from "../campaign/index.js";
|
|
3
|
+
import { appendLogEntry } from "../core/log.js";
|
|
4
|
+
import { defineCommand } from "../core/registry.js";
|
|
5
|
+
import { comparableText } from "../core/text.js";
|
|
6
|
+
import { addCoins, changeFrom, formatAmount, isSafePurse, payCoins, readAmount, takeCoins, totalOf } from "../money/index.js";
|
|
7
|
+
import { applyMove, canHold, concernsPlayer, countedText, declaredKind, inheritedFields, isPartyMember, kindNamed, locate, MoveStopped, ownField, pageNamed, parsePageReference, readEntry, stackName, } from "../pages/index.js";
|
|
8
|
+
import { campaignCoins } from "./game-money.js";
|
|
9
|
+
import { afterMoves, pagesPlan } from "./game-moves.js";
|
|
10
|
+
import { copyName, readOpenScene } from "./game-scene.js";
|
|
11
|
+
import { heldStack, logStackSteps, stackEdits, stackMoveSteps, stackStepText, unequipKinds } from "./game-stacks.js";
|
|
12
|
+
import { newDatedLogEntry } from "./game-time.js";
|
|
13
|
+
import { campaignWorld, missingSystemHint } from "./game-world.js";
|
|
14
|
+
import { skippedPagesNote } from "./notes.js";
|
|
15
|
+
// A list, or one text, as an MCP client may send it.
|
|
16
|
+
const textList = z.union([z.string(), z.array(z.string())]);
|
|
17
|
+
export const trade = defineCommand({
|
|
18
|
+
name: "trade",
|
|
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. "
|
|
20
|
+
+ "with is the merchant, a character, or the shop, a place that holds its goods: what is taken comes from there. "
|
|
21
|
+
+ "Each entry is money in the campaign's coins, a kind with how many, or an item with a story of its own; never a character. "
|
|
22
|
+
+ 'If one side lacks what it gives, nothing changes. Example: page Ettore, with Bottega di Ugo, gives "2 gp", gets ["Torch 5", "Hempen Rope"].',
|
|
23
|
+
group: "game",
|
|
24
|
+
positionals: ["page"],
|
|
25
|
+
input: z.object({
|
|
26
|
+
page: z.string().describe("who trades, usually the player character"),
|
|
27
|
+
with: z.string().describe("the other side: a merchant, or a shop, a place that holds its goods"),
|
|
28
|
+
gives: textList.optional().describe('what page gives: money such as "2 gp", kinds with how many such as Torch 5, items such as Mazza di Matteo'),
|
|
29
|
+
gets: textList.optional().describe("what page gets, written the same way"),
|
|
30
|
+
why: z.string().optional().describe("what the trade is, such as bought torches at the market"),
|
|
31
|
+
}),
|
|
32
|
+
run(input, context) {
|
|
33
|
+
const root = requireCampaign(context.folder);
|
|
34
|
+
const world = campaignWorld(root, context);
|
|
35
|
+
const { scene } = readOpenScene(root);
|
|
36
|
+
const side = (name) => sideNamed(world, scene === undefined ? undefined : copyName(world, scene, parsePageReference(name).name), name);
|
|
37
|
+
const [buyer, seller] = [side(input.page), side(input.with)];
|
|
38
|
+
if (buyer === seller) {
|
|
39
|
+
throw new Error(`${buyer.name} would trade with itself: give the other side in with. Nothing changed.`);
|
|
40
|
+
}
|
|
41
|
+
const { coins } = campaignCoins(root, context);
|
|
42
|
+
const gives = handed(world, coins, buyer, seller, listOf(input.gives), "page");
|
|
43
|
+
const gets = handed(world, coins, seller, buyer, listOf(input.gets), "with");
|
|
44
|
+
if (gives.money === undefined && gets.money === undefined && gives.stacks.length + gives.pages.length + gets.stacks.length + gets.pages.length === 0) {
|
|
45
|
+
throw new Error(`Give what ${buyer.name} gives, gives, and what it gets, gets, such as gives "2 gp", gets "Torch 5". Nothing changed.`);
|
|
46
|
+
}
|
|
47
|
+
if (gives.money !== undefined && gets.money !== undefined) {
|
|
48
|
+
throw new Error(`Money goes one way in a trade: give only the difference, on one side. To change coins, use change with to. Nothing changed.`);
|
|
49
|
+
}
|
|
50
|
+
const payment = gives.money !== undefined ? pay(world, coins, buyer, seller, gives.money) : gets.money !== undefined ? pay(world, coins, seller, buyer, gets.money) : [];
|
|
51
|
+
const why = input.why?.trim() === "" ? undefined : input.why;
|
|
52
|
+
// Pages, stacks and purses in one plan, checked whole before anything is written, each file written once (STK-9).
|
|
53
|
+
const parts = [{ plan: pagesPlan(world, gives.pages, seller), destination: seller }, { plan: pagesPlan(world, gets.pages, buyer), destination: buyer }];
|
|
54
|
+
const steps = stackMoveSteps(world, [...gives.stacks, ...gets.stacks]).filter((step) => step.before !== step.after);
|
|
55
|
+
const purses = payment.map((step) => ({ holder: step.side, field: step.field, remove: [], add: [], set: { [ownField(step.side, step.field) ?? step.field]: formatAmount(step.after, coins ?? []) } }));
|
|
56
|
+
const plan = { edits: [...parts.flatMap((part) => part.plan.edits), ...stackEdits(steps), ...purses], moving: parts.flatMap((part) => part.plan.moving), once: true };
|
|
57
|
+
const written = applyTrade(root, context, world, plan, { steps, payment, coins, why });
|
|
58
|
+
const done = afterMoves(root, context, world, written, parts.filter((part) => part.plan.edits.length > 0));
|
|
59
|
+
const gone = steps.filter((step) => step.after === 0).map((step) => step.kind);
|
|
60
|
+
const unequipped = gone.length === 0 ? [] : unequipKinds(done.world, gone).notes;
|
|
61
|
+
return {
|
|
62
|
+
page: buyer.name,
|
|
63
|
+
with: seller.name,
|
|
64
|
+
gave: entriesOf(gives, coins),
|
|
65
|
+
got: entriesOf(gets, coins),
|
|
66
|
+
stacks: steps.length === 0 ? [] : [`${steps.map(stackStepText).join("; ")}.`],
|
|
67
|
+
purses: payment.map((step) => purseText(step, coins)),
|
|
68
|
+
moved: [...done.notes, ...unequipped],
|
|
69
|
+
problems: world.problems,
|
|
70
|
+
};
|
|
71
|
+
},
|
|
72
|
+
format(result) {
|
|
73
|
+
const gave = result.gave.length === 0 ? "nothing" : result.gave.join(", ");
|
|
74
|
+
const got = result.got.length === 0 ? "nothing" : result.got.join(", ");
|
|
75
|
+
const lines = [`${result.page} gave ${result.with} ${gave}, and got ${got}.`, ...result.stacks, ...result.purses, ...result.moved];
|
|
76
|
+
return [lines.join("\n"), skippedPagesNote(result.problems)].filter((block) => block !== "").join("\n\n");
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
/** A side of a trade: a character, an item or a place of the campaign that holds items (STK-7); never a copy in the scene, which holds nothing. */
|
|
80
|
+
function sideNamed(world, copy, name) {
|
|
81
|
+
if (copy !== undefined) {
|
|
82
|
+
throw new Error(`${copy} is a copy in the open scene, which holds nothing to trade: one who trades is a character. Nothing changed.`);
|
|
83
|
+
}
|
|
84
|
+
const page = pageNamed(world, parsePageReference(name).name);
|
|
85
|
+
if (page === undefined) {
|
|
86
|
+
throw new Error(`There is no page named ${parsePageReference(name).name}: a side of a trade is a character, or a place that holds its goods.${missingSystemHint(world)} Nothing changed.`);
|
|
87
|
+
}
|
|
88
|
+
if (page.system !== undefined || !canHold(page.type, "item")) {
|
|
89
|
+
throw new Error(`${page.name} holds no items, so it does not trade: a side is a character, an item or a place of the campaign. Nothing changed.`);
|
|
90
|
+
}
|
|
91
|
+
return page;
|
|
92
|
+
}
|
|
93
|
+
/** The entries given, as a list or one text, each without quotes around it, as a model may send "\"2 gp\"". */
|
|
94
|
+
function listOf(value) {
|
|
95
|
+
return (value === undefined ? [] : typeof value === "string" ? [value] : value).map((entry) => entry.trim().replace(/^"(.*)"$/s, "$1").trim()).filter((entry) => entry !== "");
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* What a side hands over, read entry by entry (STK-7): money in the campaign's coins, a kind with how many, taken from the side's stack (STK-4), or an item with a story
|
|
99
|
+
* of its own inside the side. Refused, before anything is written, when the side lacks it.
|
|
100
|
+
*/
|
|
101
|
+
function handed(world, coins, giver, taker, entries, side) {
|
|
102
|
+
const result = { stacks: [], pages: [] };
|
|
103
|
+
for (const entry of entries) {
|
|
104
|
+
const money = coins === undefined ? undefined : readAmount(entry, coins);
|
|
105
|
+
if (money !== undefined) {
|
|
106
|
+
if (result.money !== undefined) {
|
|
107
|
+
throw new Error(`Give the money ${giver.name} hands over as one amount, such as "2 gp 5 sp". Nothing changed.`);
|
|
108
|
+
}
|
|
109
|
+
result.money = money;
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
const { name, count } = goodsOf(entry);
|
|
113
|
+
const kind = kindNamed(world, giver, name);
|
|
114
|
+
if (kind !== undefined) {
|
|
115
|
+
// A merchant's goods are often in the shop it stands in: the trade is with the shop, while one of the party first takes them in hand.
|
|
116
|
+
const instead = (container, inside) => inside || isPartyMember(giver) ? `move, page ${kind.name}, from ${container.name}, to ${giver.name}, then trade` : side === "with" ? `trade with ${container.name}` : `trade, page ${container.name}`;
|
|
117
|
+
// The same kind written twice on a side counts once, with both counts (STK-7).
|
|
118
|
+
const known = result.stacks.find((move) => move.kind === kind);
|
|
119
|
+
const held = known?.from ?? heldStack(world, giver, kind, instead, count);
|
|
120
|
+
const total = (known?.count ?? 0) + count;
|
|
121
|
+
if (total > held.stack.count) {
|
|
122
|
+
throw new Error(`${giver.name} has ${held.stack.count} ${stackName(held.stack)}: cannot give ${total}. Nothing changed.`);
|
|
123
|
+
}
|
|
124
|
+
if (known === undefined) {
|
|
125
|
+
result.stacks.push({ kind, from: held, to: taker, count });
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
known.count = total;
|
|
129
|
+
}
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
result.pages.push(goodsPage(world, giver, name, count, coins, entry));
|
|
133
|
+
}
|
|
134
|
+
return result;
|
|
135
|
+
}
|
|
136
|
+
/** The name and count of an entry of goods: [[Torch]] 5, Torch 5 or 5 Torch; a name alone is 1. */
|
|
137
|
+
function goodsOf(entry) {
|
|
138
|
+
const read = readEntry(entry);
|
|
139
|
+
if (read.shape === "stack") {
|
|
140
|
+
return { name: read.page, count: read.count };
|
|
141
|
+
}
|
|
142
|
+
if (read.shape === "other") {
|
|
143
|
+
throw new Error(`"${entry}" is no count of goods: give a kind and how many, such as "${read.page} 3", or an item by its name. Nothing changed.`);
|
|
144
|
+
}
|
|
145
|
+
if (read.shape === "link") {
|
|
146
|
+
return { name: read.page, count: 1 };
|
|
147
|
+
}
|
|
148
|
+
const counted = countedText(entry);
|
|
149
|
+
return counted ?? { name: entry, count: 1 };
|
|
150
|
+
}
|
|
151
|
+
/** An item with a story of its own that a side gives: a page of the campaign inside it, given whole; never a character (STK-7). */
|
|
152
|
+
function goodsPage(world, giver, name, count, coins, entry) {
|
|
153
|
+
const page = pageNamed(world, name);
|
|
154
|
+
if (page === undefined) {
|
|
155
|
+
const money = coins === undefined ? "" : ` Money is in the campaign's coins, such as "2 ${coins[0].name}".`;
|
|
156
|
+
const list = entry.includes(",") ? ` For more than one, give a list, such as ["Torch 2", "Hempen Rope"].` : "";
|
|
157
|
+
throw new Error(`"${entry}" is neither money nor a kind nor an item that ${giver.name} has. The system's kinds go by their English names, as find shows them.${list}${money} Nothing changed.`);
|
|
158
|
+
}
|
|
159
|
+
if (page.type === "character") {
|
|
160
|
+
throw new Error(`${page.name} is a character, who is never traded: pay for a mount with trade, then make it the party's with write and move. Nothing changed.`);
|
|
161
|
+
}
|
|
162
|
+
if (count !== 1 || page.type !== "item" || page.system !== undefined) {
|
|
163
|
+
throw new Error(`${page.name} is no kind counted in stacks${count === 1 ? "" : `, so it cannot be given ${count} times`}: give it by name, alone. Nothing changed.`);
|
|
164
|
+
}
|
|
165
|
+
if (!locate(world, page).chain.includes(giver)) {
|
|
166
|
+
throw new Error(`${page.name} is not in ${giver.name}, so ${giver.name} cannot give it: move it there first, or trade with where it is. Nothing changed.`);
|
|
167
|
+
}
|
|
168
|
+
return page;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* The purses a payment changes (STK-8): the payer pays as at an inn (MON-5); a payee with a purse gets the coins handed over and gives the change from what it had, else
|
|
172
|
+
* the trade is refused. A side without a purse pays and gets without counting, but one of the party, who pays only with what it has.
|
|
173
|
+
*/
|
|
174
|
+
function pay(world, coins, payer, payee, price) {
|
|
175
|
+
if (coins === undefined) {
|
|
176
|
+
throw new Error("The campaign has no coins, so no money changes hands: write the price as goods. Nothing changed.");
|
|
177
|
+
}
|
|
178
|
+
const from = purseOf(world, coins, payer);
|
|
179
|
+
const to = purseOf(world, coins, payee);
|
|
180
|
+
if (from === undefined && isPartyMember(payer)) {
|
|
181
|
+
throw new Error(`${payer.name} has no money to pay ${formatAmount(price, coins)}. Nothing changed.`);
|
|
182
|
+
}
|
|
183
|
+
const payment = from === undefined ? undefined : payCoins(from.purse, price, coins);
|
|
184
|
+
if (from !== undefined && payment === undefined) {
|
|
185
|
+
throw new Error(`${payer.name} has ${from.field} ${formatAmount(from.purse, coins)}: cannot pay ${formatAmount(price, coins)}. Nothing changed.`);
|
|
186
|
+
}
|
|
187
|
+
// The coins handed over: what left the purse and the change that came back, or the price itself from a purse not counted.
|
|
188
|
+
const handedOver = from === undefined || payment === undefined ? price : addCoins(takeCoins(from.purse, payment.purse), payment.back);
|
|
189
|
+
const owed = totalOf(handedOver, coins) - totalOf(price, coins);
|
|
190
|
+
const paid = from === undefined || payment === undefined ? [] : [{ side: payer, field: from.field, before: from.purse, after: payment.purse, given: handedOver, back: payment.back }];
|
|
191
|
+
if (to === undefined && !isPartyMember(payee)) {
|
|
192
|
+
return paid;
|
|
193
|
+
}
|
|
194
|
+
const change = owed === 0 ? {} : to === undefined ? undefined : changeFrom(to.purse, owed, coins);
|
|
195
|
+
if (change === undefined) {
|
|
196
|
+
const field = to?.field ?? "money";
|
|
197
|
+
// The change in as few coins as can be, from a purse that lacks none.
|
|
198
|
+
const owedCoins = formatAmount(changeFrom(Object.fromEntries(coins.map((coin) => [coin.name, owed])), owed, coins) ?? {}, coins);
|
|
199
|
+
throw new Error(`${payee.name} has not the coins to give ${owedCoins} of change for the ${formatAmount(handedOver, coins)} ${payer.name} hands over. If the master says ${payee.name} has them, `
|
|
200
|
+
+ `give them first, such as change ${payee.name}, ${field}, by "+${owedCoins}"; or pay with other coins. Nothing changed.`);
|
|
201
|
+
}
|
|
202
|
+
const received = { side: payee, field: to?.field ?? "money", ...(to === undefined ? {} : { before: to.purse }), after: takeCoins(addCoins(to?.purse ?? {}, handedOver), change) };
|
|
203
|
+
const payerAfter = payment === undefined ? undefined : addCoins(takeCoins(payment.purse, payment.back), change);
|
|
204
|
+
if (![received.after, payerAfter ?? {}].every((purse) => isSafePurse(purse, coins))) {
|
|
205
|
+
throw new Error("A purse would be too large to count exactly. Nothing changed.");
|
|
206
|
+
}
|
|
207
|
+
return [...paid.map((step) => ({ ...step, after: payerAfter ?? step.after, back: change })), received];
|
|
208
|
+
}
|
|
209
|
+
/** A side's purse (STK-8): its field money, or its only field that holds an amount; none when it has none. Refused when it has several and none is money. */
|
|
210
|
+
function purseOf(world, coins, side) {
|
|
211
|
+
const purses = Object.entries(inheritedFields(world, side)).flatMap(([field, value]) => {
|
|
212
|
+
const purse = declaredKind(world, field) === undefined ? readAmount(value, coins) : undefined;
|
|
213
|
+
return purse === undefined ? [] : [{ field, purse }];
|
|
214
|
+
});
|
|
215
|
+
const named = purses.find((purse) => comparableText(purse.field) === "money");
|
|
216
|
+
if (named === undefined && purses.length > 1) {
|
|
217
|
+
throw new Error(`${side.name} holds money in ${purses.map((purse) => purse.field).join(" and ")}: a trade pays from the field money. Name one money, or pay with change. Nothing changed.`);
|
|
218
|
+
}
|
|
219
|
+
return named ?? purses[0];
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Writes a trade's plan (STK-9), then the lines in the log of its stacks and purses (STK-12, MON-4), public when they concern the player. Stopped halfway, the lines of what was
|
|
223
|
+
* written are still logged, then the stop, with the calls that finish it, is said.
|
|
224
|
+
*/
|
|
225
|
+
function applyTrade(root, context, world, plan, done) {
|
|
226
|
+
const log = (written) => {
|
|
227
|
+
logStackSteps(root, context, world, done.steps.filter((step) => written(step.container)), done.why);
|
|
228
|
+
for (const step of done.payment.filter((candidate) => written(candidate.side))) {
|
|
229
|
+
const list = done.coins ?? [];
|
|
230
|
+
const data = {
|
|
231
|
+
page: step.side.name,
|
|
232
|
+
field: step.field,
|
|
233
|
+
before: step.before === undefined ? "0" : formatAmount(step.before, list),
|
|
234
|
+
after: formatAmount(step.after, list),
|
|
235
|
+
given: amountText(step.given, done.coins),
|
|
236
|
+
back: amountText(step.back, done.coins),
|
|
237
|
+
why: done.why,
|
|
238
|
+
};
|
|
239
|
+
appendLogEntry(root, newDatedLogEntry(root, context, "counter-changed", concernsPlayer(world, step.side) ? "public" : "hidden", data));
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
try {
|
|
243
|
+
const after = applyMove(world, plan);
|
|
244
|
+
log(() => true);
|
|
245
|
+
return after;
|
|
246
|
+
}
|
|
247
|
+
catch (error) {
|
|
248
|
+
if (error instanceof MoveStopped) {
|
|
249
|
+
log((page) => error.written.includes(page.path));
|
|
250
|
+
}
|
|
251
|
+
throw error;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
/** "Ettore: money 2 gp → 1 gp 5 sp (1 gp given, 5 sp back)": a purse that changed. */
|
|
255
|
+
function purseText(step, coins) {
|
|
256
|
+
const list = coins ?? [];
|
|
257
|
+
const before = step.before === undefined ? `0 ${list[0]?.name ?? ""}` : formatAmount(step.before, list);
|
|
258
|
+
const how = [amountText(step.given, coins), amountText(step.back, coins)];
|
|
259
|
+
const note = how[0] === undefined ? "" : ` (${how[0]} given${how[1] === undefined ? "" : `, ${how[1]} back`})`;
|
|
260
|
+
return `${step.side.name}: ${step.field} ${before} → ${formatAmount(step.after, list)}${note}.`;
|
|
261
|
+
}
|
|
262
|
+
/** Coins as text, or undefined for none. */
|
|
263
|
+
function amountText(purse, coins) {
|
|
264
|
+
return purse === undefined || coins === undefined || Object.values(purse).every((count) => count === 0) ? undefined : formatAmount(purse, coins);
|
|
265
|
+
}
|
|
266
|
+
/** What a side handed over, as the output names it: the money, the pieces and the items. */
|
|
267
|
+
function entriesOf(given, coins) {
|
|
268
|
+
return [
|
|
269
|
+
...(given.money === undefined || coins === undefined ? [] : [formatAmount(given.money, coins)]),
|
|
270
|
+
...given.stacks.map((move) => `${move.count} ${stackName(move.from.stack)}`),
|
|
271
|
+
...given.pages.map((page) => page.name),
|
|
272
|
+
];
|
|
273
|
+
}
|
package/dist/commands/travel.js
CHANGED
|
@@ -3,17 +3,16 @@ import { requireCampaign } from "../campaign/index.js";
|
|
|
3
3
|
import { readLength } from "../core/length.js";
|
|
4
4
|
import { defineCommand } from "../core/registry.js";
|
|
5
5
|
import { directionHelp, directionName, distanceBetween, pointAlong, pointFrom, readDirection } from "../map/index.js";
|
|
6
|
-
import { environmentAt, locate, pageNamed, parsePageReference } from "../pages/index.js";
|
|
6
|
+
import { environmentAt, locate, pageNamed, parsePageReference, playerCharacters } from "../pages/index.js";
|
|
7
7
|
import { addDuration, formatGameDate, minutesBetween } from "../time/index.js";
|
|
8
8
|
import { aroundLead, passedLines, passTime } from "./game-advance.js";
|
|
9
9
|
import { timePassedLines } from "./game-extensions.js";
|
|
10
|
-
import { journeyPoint, journeyStart, moversMap, moversNamed, moversPosition, readJourney, sameMovers, saveJourney, travelledSinceRest } from "./game-journey.js";
|
|
11
|
-
import { playerCharacter } from "./game-knowledge.js";
|
|
10
|
+
import { journeyPoint, journeyStart, moversMap, moversNamed, moversPosition, readJourney, ridersOf, sameMovers, saveJourney, travelledSinceRest } from "./game-journey.js";
|
|
12
11
|
import { mapKey, mapOf } from "./game-maps.js";
|
|
13
12
|
import { movePages } from "./game-moves.js";
|
|
14
13
|
import { acrossHint, crossedRoads, openLegs } from "./game-open.js";
|
|
15
14
|
import { nearPlaces, pointText, positionOf, regionAt } from "./game-positions.js";
|
|
16
|
-
import { dayHours, durationText, goingText, hoursText, isVehicleOnly, kindOf, lengthText, measuresOf, moversOf, noWayText, paceOf, roadsOf, sameSpot, speedOf, stepEnd, stopOf, travellingParty, unknownOnRoad, wayFor, wayText, } from "./game-roads.js";
|
|
15
|
+
import { dayHours, durationText, goingText, hoursText, isVehicleOnly, kindOf, lengthText, measuresOf, moversOf, noWayText, paceOf, partyLead, roadsOf, sameSpot, speedOf, stepEnd, stopOf, travellingParty, unknownOnRoad, wayFor, wayText, } from "./game-roads.js";
|
|
17
16
|
import { readOpenScene } from "./game-scene.js";
|
|
18
17
|
import { presentDate } from "./game-time.js";
|
|
19
18
|
import { campaignSystem, campaignWorld, missingSystemHint } from "./game-world.js";
|
|
@@ -24,7 +23,7 @@ export const travel = defineCommand({
|
|
|
24
23
|
description: "Make a journey: whenever the party goes somewhere, use it instead of advance and move. "
|
|
25
24
|
+ "By road it takes the quickest way, in the vehicle the party is in if any; off the roads, across and toward go through the regions and their terrain. "
|
|
26
25
|
+ "It moves the travellers and lets the time pass, stopping on arrival, at an event that comes due and at the end of the day's travel; travel again goes on from there. "
|
|
27
|
-
+ "
|
|
26
|
+
+ "When others go with the party, name in who everyone who goes, the party too: companions, hirelings, mounts; a vehicle goes with those in it. "
|
|
28
27
|
+ "Example: to Rocca; or to Torre, across; or toward west, distance 12 km.",
|
|
29
28
|
group: "game",
|
|
30
29
|
positionals: ["to"],
|
|
@@ -33,7 +32,7 @@ export const travel = defineCommand({
|
|
|
33
32
|
across: z.boolean().optional().describe("go to the place straight across country, off the roads; both need a position"),
|
|
34
33
|
toward: z.string().optional().describe("off the roads, one way to go instead of a place: a point of the compass, such as west or NNE"),
|
|
35
34
|
distance: z.string().optional().describe("with toward, how far, such as 12 km; if left out, until the day's travel ends"),
|
|
36
|
-
who: textList.optional().describe("who travels; if left out, the party where the player character is, with the vehicle they are in"),
|
|
35
|
+
who: textList.optional().describe("who travels; if left out, the party where the player character is, with the vehicle they are in; given, when the player characters are apart"),
|
|
37
36
|
pace: z.string().optional().describe("one of the game's paces, such as fast or slow, or a speed, such as 4.5 km; if left out, the game's usual pace, or the one the journey had"),
|
|
38
37
|
hours: z.union([z.number(), z.string()]).optional().describe("the hours of travel today, when they differ from the game's: more for a forced march, 24 for a ship with its crew, 8 for a boat the party rows"),
|
|
39
38
|
}),
|
|
@@ -53,8 +52,10 @@ export const travel = defineCommand({
|
|
|
53
52
|
const measures = measuresOf(root, system);
|
|
54
53
|
const journey = readJourney(root);
|
|
55
54
|
const travellers = travellersOf(world, input.who, journey);
|
|
56
|
-
const
|
|
57
|
-
const
|
|
55
|
+
const staying = input.who === undefined ? "" : stayingNote(world, travellers);
|
|
56
|
+
const { movers, vehicle } = moversOf(world, system, travellers);
|
|
57
|
+
const riders = ridersOf(world, movers);
|
|
58
|
+
const ownJourney = journey !== undefined && sameMovers(world, journey, movers) ? journey : undefined;
|
|
58
59
|
checkOtherJourney(world, roads, journey, movers);
|
|
59
60
|
const before = travelledSinceRest(ownJourney, now);
|
|
60
61
|
// Hours given hold until the next rest (TRV-8).
|
|
@@ -65,7 +66,7 @@ export const travel = defineCommand({
|
|
|
65
66
|
const call = plan.goal.to === undefined ? `travel toward ${plan.goal.heading}` : `travel to ${plan.goal.to.name}${plan.goal.across ? ", across" : ""}`;
|
|
66
67
|
// A forced march is the walkers' rule, past the game's hours: a vehicle that goes only by water has none.
|
|
67
68
|
const marching = (vehicle === undefined || !isVehicleOnly(world, system, vehicle)) && plan.hours >= (system?.travel?.hours ?? 8);
|
|
68
|
-
const told = { who: namesText(travellers), goal, call, way: plan.way, going: plan.going, hours: plan.hours, beyond: marching ? system?.travel?.beyond : undefined };
|
|
69
|
+
const told = { who: namesText(travellers), alone: travellers.length === 1, goal, call, way: plan.way, going: plan.going, hours: plan.hours, beyond: marching ? system?.travel?.beyond : undefined };
|
|
69
70
|
if (before >= plan.hours * 60) {
|
|
70
71
|
return { ...told, reached: [], date: formatGameDate(now), travelled: before, hoursLeft: 0, ending: { kind: "spent" }, around: [], notes: [] };
|
|
71
72
|
}
|
|
@@ -74,7 +75,7 @@ export const travel = defineCommand({
|
|
|
74
75
|
world = walked.world;
|
|
75
76
|
const { stop, here, covered, date } = walked;
|
|
76
77
|
const travelled = before + minutesBetween(now, date);
|
|
77
|
-
const kept = { movers: movers.map((page) => page.name), pace: plan.pace, last: date, travelled, hours: given };
|
|
78
|
+
const kept = { movers: movers.map((page) => page.name), riders, pace: plan.pace, last: date, travelled, hours: given };
|
|
78
79
|
const point = stop === undefined ? (here !== undefined && "at" in here ? here.at : undefined) : "at" in stop.spot ? stop.spot.at : undefined;
|
|
79
80
|
const total = { metres: plan.legs.reduce((sum, leg) => sum + leg.length, 0), minutes: plan.legs.reduce((sum, leg) => sum + leg.length / leg.metresAMinute, 0) };
|
|
80
81
|
const headingLeft = plan.goal.heading !== undefined && input.distance !== undefined ? total.metres - covered.metres : undefined;
|
|
@@ -92,10 +93,20 @@ export const travel = defineCommand({
|
|
|
92
93
|
const time = merged === undefined ? undefined : { ...merged, around: merged.passed >= 60 ? aroundLead(world) : undefined, extensionLines };
|
|
93
94
|
// A passage's conditions are its page's text, the master's to judge (ROA-8).
|
|
94
95
|
const passages = (plan.passages ?? []).map((name) => `The way goes through ${name}, a passage to another map: read its page for when and how it opens.`);
|
|
95
|
-
return {
|
|
96
|
+
return {
|
|
97
|
+
...told,
|
|
98
|
+
reached: walked.reached,
|
|
99
|
+
date: formatGameDate(date),
|
|
100
|
+
travelled,
|
|
101
|
+
hoursLeft: Math.max(0, plan.hours * 60 - travelled),
|
|
102
|
+
ending,
|
|
103
|
+
around,
|
|
104
|
+
time,
|
|
105
|
+
notes: [...passages, ...walked.notes, ...(staying === "" ? [] : [staying])],
|
|
106
|
+
};
|
|
96
107
|
},
|
|
97
108
|
format(result) {
|
|
98
|
-
const head = `${result.who} ${result.ending.kind === "spent" ? "would travel" : "travel"} ${result.goal}, ${result.going}: ${result.way}.`;
|
|
109
|
+
const head = `${result.who} ${result.ending.kind === "spent" ? "would travel" : result.alone ? "travels" : "travel"} ${result.goal}, ${result.going}: ${result.way}.`;
|
|
99
110
|
const passed = result.reached.length === 0 ? "" : `Passed ${result.reached.join(", ")}.`;
|
|
100
111
|
const then = ` Then go on: ${result.call}.`;
|
|
101
112
|
const done = result.ending.kind === "arrived" || result.ending.kind === "reached";
|
|
@@ -173,7 +184,7 @@ function walk(root, context, start, movers, plan, now, left, why) {
|
|
|
173
184
|
* One journey at a time (TRV-9): another group stopped between places, on a road or in the open, would lose where it is; refused, with what to do instead.
|
|
174
185
|
*/
|
|
175
186
|
function checkOtherJourney(world, roads, journey, movers) {
|
|
176
|
-
if (journey === undefined || sameMovers(journey, movers)) {
|
|
187
|
+
if (journey === undefined || sameMovers(world, journey, movers)) {
|
|
177
188
|
return;
|
|
178
189
|
}
|
|
179
190
|
const others = moversNamed(world, journey);
|
|
@@ -333,10 +344,23 @@ function aroundLines(world, roads, from, point, measures, map = "") {
|
|
|
333
344
|
].filter((line) => line !== "");
|
|
334
345
|
}
|
|
335
346
|
/** The travellers (TRV-6): the characters named, or the party where the player character is; in the open, those of its journey. */
|
|
347
|
+
/** "Corrado stays in Roccalba: …": who travels leaves out the player character where they start, which who may not have meant (playtest 05). */
|
|
348
|
+
function stayingNote(world, travellers) {
|
|
349
|
+
const placeOf = (page) => locate(world, page).chain.find((holder) => holder.type === "place");
|
|
350
|
+
const start = travellers[0] === undefined ? undefined : placeOf(travellers[0]);
|
|
351
|
+
// Every player character left behind where they start (VIEW-12).
|
|
352
|
+
const players = playerCharacters(world);
|
|
353
|
+
const living = players.filter((pc) => pc.fields.status !== "dead");
|
|
354
|
+
const staying = (living.length > 0 ? living : players.slice(0, 1)).filter((pc) => !travellers.includes(pc) && start !== undefined && placeOf(pc)?.path === start.path);
|
|
355
|
+
if (start === undefined || staying.length === 0) {
|
|
356
|
+
return "";
|
|
357
|
+
}
|
|
358
|
+
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
|
+
}
|
|
336
360
|
function travellersOf(world, who, journey) {
|
|
337
361
|
const names = (typeof who === "string" ? [who] : (who ?? [])).filter((name) => name.trim() !== "");
|
|
338
362
|
if (names.length === 0) {
|
|
339
|
-
const party = travellingParty(world,
|
|
363
|
+
const party = travellingParty(world, partyLead(world, journey?.movers ?? [], "Give who, the characters who travel."), journey?.movers ?? []);
|
|
340
364
|
if (party.length === 0) {
|
|
341
365
|
throw new Error("There is no player character to travel: give who, the characters who travel. Nothing changed.");
|
|
342
366
|
}
|
|
@@ -451,6 +475,8 @@ function mergedTimes(times) {
|
|
|
451
475
|
newDays: times.reduce((sum, time) => sum + time.newDays, 0),
|
|
452
476
|
clocks: [...new Set(times.flatMap((time) => time.clocks))],
|
|
453
477
|
newDayPart: times.map((time) => time.newDayPart).find((part) => part !== "") ?? "",
|
|
478
|
+
// What the party used up at every midnight of every leg (UPK-1).
|
|
479
|
+
upkeep: times.flatMap((time) => time.upkeep ?? []),
|
|
454
480
|
};
|
|
455
481
|
}
|
|
456
482
|
function namesText(pages) {
|
|
@@ -1,6 +1,7 @@
|
|
|
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 "./game-checks.js";
|
|
4
5
|
import { extensionCodeProblems } from "./game-extensions.js";
|
|
5
6
|
import { campaignWorld } from "./game-world.js";
|
|
6
7
|
import { campaignProblems } from "./problems.js";
|
|
@@ -15,7 +16,7 @@ export const validate = defineCommand({
|
|
|
15
16
|
async run(input, context) {
|
|
16
17
|
const root = requireCampaign(context.folder);
|
|
17
18
|
// And what keeps an extension's code from being used, which only loading it tells (D-441).
|
|
18
|
-
return { problems: [...campaignProblems(root, campaignWorld(root, context), context), ...await extensionCodeProblems(root, context, [])] };
|
|
19
|
+
return { problems: [...campaignProblems(root, campaignWorld(root, context), context), ...await extensionCodeProblems(root, context, []), ...stateCheckProblems(root, context)] };
|
|
19
20
|
},
|
|
20
21
|
format(result) {
|
|
21
22
|
if (result.problems.length === 0) {
|