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,98 @@
|
|
|
1
|
+
import type { Context } from "../core/context.ts";
|
|
2
|
+
import { type World } from "../pages/index.ts";
|
|
3
|
+
import { type CalendarMonth } from "../time/index.ts";
|
|
4
|
+
import { type Knowledge } from "./game-knowledge.ts";
|
|
5
|
+
/** A page the player character knows, as the World section lists it (VIEW-11): its name and type, a place's kind and the places that hold it, the opening of its text. */
|
|
6
|
+
export interface KnownEntry {
|
|
7
|
+
name: string;
|
|
8
|
+
type: string;
|
|
9
|
+
/** A place's kind, as the map gives it (VIEW-7). */
|
|
10
|
+
kind?: string;
|
|
11
|
+
/** For a place, the places that hold it that the character knows, the nearest first (VIEW-7). */
|
|
12
|
+
within?: string[];
|
|
13
|
+
/** The first paragraph of its introduction as the character knows it (VIEW-3), as the page writes it. */
|
|
14
|
+
summary: string;
|
|
15
|
+
picture?: {
|
|
16
|
+
file: string;
|
|
17
|
+
version: number;
|
|
18
|
+
};
|
|
19
|
+
/** A companion of the party. */
|
|
20
|
+
companion?: true;
|
|
21
|
+
/** With more than one player character, those who know it, when not all of them do (VIEW-12). */
|
|
22
|
+
knownBy?: string[];
|
|
23
|
+
}
|
|
24
|
+
/** A document the player character has or read (VIEW-11): an item with document, such as letter or map, its text as the character knows it (VIEW-3) and its picture. */
|
|
25
|
+
export interface ShownDocument {
|
|
26
|
+
name: string;
|
|
27
|
+
/** What it is, as the page writes it: letter, notice, map… */
|
|
28
|
+
document: string;
|
|
29
|
+
text: string;
|
|
30
|
+
picture?: {
|
|
31
|
+
file: string;
|
|
32
|
+
version: number;
|
|
33
|
+
};
|
|
34
|
+
/** The character carries it now; with more than one player character, one of them does. */
|
|
35
|
+
carried: boolean;
|
|
36
|
+
/** With more than one player character, the one who carries it (VIEW-12). */
|
|
37
|
+
carrier?: string;
|
|
38
|
+
/** With more than one player character, those who know it, when not all of them do (VIEW-12). */
|
|
39
|
+
knownBy?: string[];
|
|
40
|
+
}
|
|
41
|
+
/** The calendar as the player character knows it (VIEW-11, TIM-8): today, the months when the story has a calendar, the deadlines of its quests and the days of its scenes. */
|
|
42
|
+
export interface ShownCalendar {
|
|
43
|
+
/** Now, as a game date: day 3, 14:20. */
|
|
44
|
+
now?: string;
|
|
45
|
+
/** Today's game day, from 1. */
|
|
46
|
+
today?: number;
|
|
47
|
+
/** The months in order, when the story has a calendar start. */
|
|
48
|
+
months?: CalendarMonth[];
|
|
49
|
+
/** Today as a day of the calendar: the day of its month, the month by its place in months, its season, the year when the start gave one. */
|
|
50
|
+
date?: {
|
|
51
|
+
day: number;
|
|
52
|
+
month: number;
|
|
53
|
+
season?: string;
|
|
54
|
+
year?: number;
|
|
55
|
+
};
|
|
56
|
+
/** The deadlines of the open quests the character knows, the soonest first: each with its game day and the minutes left, below zero once passed. */
|
|
57
|
+
deadlines: {
|
|
58
|
+
quest: string;
|
|
59
|
+
main: boolean;
|
|
60
|
+
date: string;
|
|
61
|
+
day: number;
|
|
62
|
+
minutes?: number;
|
|
63
|
+
}[];
|
|
64
|
+
/** The scenes of the story, in order, by the game day they opened on: their number from the first, their title, and their place as the character knows it. */
|
|
65
|
+
scenes: {
|
|
66
|
+
day: number;
|
|
67
|
+
number: number;
|
|
68
|
+
title: string;
|
|
69
|
+
place?: string;
|
|
70
|
+
}[];
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* The pages the character knows, out of itself, its quests, which the journal has, its documents, which have their own list, and the game system's (VIEW-11);
|
|
74
|
+
* an item only when its own text tells something.
|
|
75
|
+
*/
|
|
76
|
+
export declare function knownEntries(root: string, context: Context, world: World, knowledge: Knowledge): KnownEntry[];
|
|
77
|
+
/** The documents the character knows, the items with document (VIEW-11): those it carries first, then by name. */
|
|
78
|
+
export declare function knownDocuments(root: string, context: Context, world: World, knowledge: Knowledge): ShownDocument[];
|
|
79
|
+
/** The calendar of the World section (VIEW-11), from the journal: its quests, with their deadlines, and its chapters, the last first, with their numbers and dates. */
|
|
80
|
+
export declare function shownCalendar(root: string, context: Context, journal: {
|
|
81
|
+
quests: {
|
|
82
|
+
name: string;
|
|
83
|
+
status: string;
|
|
84
|
+
main: boolean;
|
|
85
|
+
deadline?: {
|
|
86
|
+
date: string;
|
|
87
|
+
minutes?: number;
|
|
88
|
+
};
|
|
89
|
+
}[];
|
|
90
|
+
chapters: {
|
|
91
|
+
title?: string;
|
|
92
|
+
number?: number;
|
|
93
|
+
date?: string;
|
|
94
|
+
place?: string;
|
|
95
|
+
}[];
|
|
96
|
+
}): ShownCalendar;
|
|
97
|
+
/** "Varro (character): An alchemist of the ford.": a known page in the chat's words, with the first sentence of what the character knows of it. */
|
|
98
|
+
export declare function knownEntryText(entry: KnownEntry): string;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { firstSentence } from "../core/text.js";
|
|
2
|
+
import { isPartyMember, isPlayerCharacter, locate, withoutFencedBlocks } from "../pages/index.js";
|
|
3
|
+
import { formatGameDate, readGameDate } from "../time/index.js";
|
|
4
|
+
import { shownImage } from "./game-images.js";
|
|
5
|
+
import { knownIntroduction, knownText, knowsPage, pageKnownBy, writesKnownText } from "./game-knowledge.js";
|
|
6
|
+
import { calendarDayOf, campaignCalendar, readPresent } from "./game-time.js";
|
|
7
|
+
import { placeKind } from "./game-view-map.js";
|
|
8
|
+
/**
|
|
9
|
+
* The pages the character knows, out of itself, its quests, which the journal has, its documents, which have their own list, and the game system's (VIEW-11);
|
|
10
|
+
* an item only when its own text tells something.
|
|
11
|
+
*/
|
|
12
|
+
export function knownEntries(root, context, world, knowledge) {
|
|
13
|
+
const known = (base) => knowsPage(knowledge, base);
|
|
14
|
+
return [...knowledge.pages]
|
|
15
|
+
.filter((page) => !isPlayerCharacter(page) && page.system === undefined && page.type !== "quest")
|
|
16
|
+
.filter((page) => page.type !== "item" || (documentOf(page) === undefined && writesKnownText(knowledge, page)))
|
|
17
|
+
.map((page) => {
|
|
18
|
+
const kind = page.type === "place" ? placeKind(page) : undefined;
|
|
19
|
+
const within = page.type === "place" ? locate(world, page).chain.filter(known).map((holder) => holder.name) : [];
|
|
20
|
+
const picture = shownImage(root, context, world, page, known);
|
|
21
|
+
// The opening of its prose: a map's block says nothing as a line.
|
|
22
|
+
const summary = withoutFencedBlocks(knownIntroduction(world, knowledge, page)).trim().split(/\n\s*\n/)[0].trim();
|
|
23
|
+
const knownBy = pageKnownBy(knowledge, page);
|
|
24
|
+
return {
|
|
25
|
+
name: page.name,
|
|
26
|
+
type: page.type ?? "page",
|
|
27
|
+
...(kind === undefined ? {} : { kind }),
|
|
28
|
+
...(within.length === 0 ? {} : { within }),
|
|
29
|
+
summary,
|
|
30
|
+
...(picture === undefined ? {} : { picture }),
|
|
31
|
+
...(page.type === "character" && page.fields.role === "companion" && isPartyMember(page) ? { companion: true } : {}),
|
|
32
|
+
...(knownBy === undefined ? {} : { knownBy }),
|
|
33
|
+
};
|
|
34
|
+
})
|
|
35
|
+
.sort((one, other) => one.name.localeCompare(other.name));
|
|
36
|
+
}
|
|
37
|
+
/** The documents the character knows, the items with document (VIEW-11): those it carries first, then by name. */
|
|
38
|
+
export function knownDocuments(root, context, world, knowledge) {
|
|
39
|
+
const known = (base) => knowsPage(knowledge, base);
|
|
40
|
+
return [...knowledge.pages].flatMap((page) => {
|
|
41
|
+
const document = page.system === undefined ? documentOf(page) : undefined;
|
|
42
|
+
if (document === undefined) {
|
|
43
|
+
return [];
|
|
44
|
+
}
|
|
45
|
+
const picture = shownImage(root, context, world, page, known);
|
|
46
|
+
// Who carries it, of the player characters (VIEW-12).
|
|
47
|
+
const chain = locate(world, page).chain;
|
|
48
|
+
const carrier = (knowledge.each?.map((one) => one.pc) ?? [knowledge.pc]).find((player) => chain.includes(player));
|
|
49
|
+
const knownBy = pageKnownBy(knowledge, page);
|
|
50
|
+
return [{
|
|
51
|
+
name: page.name,
|
|
52
|
+
document,
|
|
53
|
+
text: knownText(world, knowledge, page),
|
|
54
|
+
...(picture === undefined ? {} : { picture }),
|
|
55
|
+
carried: carrier !== undefined,
|
|
56
|
+
...(carrier === undefined || knowledge.each === undefined ? {} : { carrier: carrier.name }),
|
|
57
|
+
...(knownBy === undefined ? {} : { knownBy }),
|
|
58
|
+
}];
|
|
59
|
+
}).sort((one, other) => Number(other.carried) - Number(one.carried) || one.name.localeCompare(other.name));
|
|
60
|
+
}
|
|
61
|
+
/** The calendar of the World section (VIEW-11), from the journal: its quests, with their deadlines, and its chapters, the last first, with their numbers and dates. */
|
|
62
|
+
export function shownCalendar(root, context, journal) {
|
|
63
|
+
const now = readPresent(root).date;
|
|
64
|
+
const today = now === undefined ? undefined : calendarDayOf(root, context, now.day);
|
|
65
|
+
const { calendar } = campaignCalendar(root, context);
|
|
66
|
+
const month = today === undefined ? -1 : calendar.months.findIndex((one) => one.name === today.month);
|
|
67
|
+
const scenes = journal.chapters.toReversed().flatMap((chapter) => {
|
|
68
|
+
const day = readGameDate(chapter.date)?.day;
|
|
69
|
+
return day === undefined || chapter.number === undefined ? [] : [{ day, number: chapter.number, title: chapter.title ?? "", ...(chapter.place === undefined ? {} : { place: chapter.place }) }];
|
|
70
|
+
});
|
|
71
|
+
// The soonest first, by the hour of the day too, which the minutes left give only once the game has a date.
|
|
72
|
+
const minute = (date) => readGameDate(date)?.minute ?? 0;
|
|
73
|
+
return {
|
|
74
|
+
...(now === undefined ? {} : { now: formatGameDate(now), today: now.day }),
|
|
75
|
+
...(today === undefined || month === -1
|
|
76
|
+
? {}
|
|
77
|
+
: {
|
|
78
|
+
months: calendar.months,
|
|
79
|
+
date: { day: today.day, month, ...(today.season === undefined ? {} : { season: today.season }), ...(today.year === undefined ? {} : { year: today.year }) },
|
|
80
|
+
}),
|
|
81
|
+
deadlines: journal.quests.flatMap(({ name, status, main, deadline }) => {
|
|
82
|
+
const date = status === "open" && deadline !== undefined ? readGameDate(deadline.date) : undefined;
|
|
83
|
+
return date === undefined || deadline === undefined ? [] : [{ quest: name, main, date: deadline.date, day: date.day, ...(deadline.minutes === undefined ? {} : { minutes: deadline.minutes }) }];
|
|
84
|
+
}).sort((one, other) => one.day - other.day || minute(one.date) - minute(other.date)),
|
|
85
|
+
scenes,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
/** "Varro (character): An alchemist of the ford.": a known page in the chat's words, with the first sentence of what the character knows of it. */
|
|
89
|
+
export function knownEntryText(entry) {
|
|
90
|
+
const summary = firstSentence(entry.summary.replace(/\s*\n\s*/g, " "));
|
|
91
|
+
const knownBy = entry.knownBy === undefined ? "" : `, known to ${entry.knownBy.join(" and ")} alone`;
|
|
92
|
+
return `${entry.name} (${entry.kind ?? (entry.companion === true ? "companion" : entry.type)}${entry.within === undefined ? "" : `, in ${entry.within.join(" › ")}`}${knownBy})${summary === "" ? "" : `: ${summary}`}`;
|
|
93
|
+
}
|
|
94
|
+
/** What an item is as a document, such as letter: its document field; undefined for anything else. */
|
|
95
|
+
function documentOf(page) {
|
|
96
|
+
const value = page.type === "item" ? page.fields.document : undefined;
|
|
97
|
+
return typeof value === "string" && value.trim() !== "" ? value.trim() : undefined;
|
|
98
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Context } from "../core/context.ts";
|
|
2
|
+
/** Whether the character agent voices the characters (D-490): in Claude Code, in a chat that has it, unless the master voices every character. */
|
|
3
|
+
export declare function agentVoices(root: string, context: Context): boolean;
|
|
4
|
+
/** The part Voices, when and how to call the character agent, for a campaign in play; none where the agent does not voice the characters. */
|
|
5
|
+
export declare function voicesPart(root: string, context: Context): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Who voices the characters (D-490): the character agent, where the chat has it, or the master.
|
|
2
|
+
import { readSettings } from "../campaign/index.js";
|
|
3
|
+
import { voicesInstructions } from "../instructions/index.js";
|
|
4
|
+
// The name Claude Code gives itself to the MCP server: the host whose campaign has the character agent as an agent (D-490).
|
|
5
|
+
const claudeCode = "claude-code";
|
|
6
|
+
/** Whether the character agent voices the characters (D-490): in Claude Code, in a chat that has it, unless the master voices every character. */
|
|
7
|
+
export function agentVoices(root, context) {
|
|
8
|
+
return context.host?.() === claudeCode && context.characterAgent === true && readSettings(root).voices !== "master";
|
|
9
|
+
}
|
|
10
|
+
/** The part Voices, when and how to call the character agent, for a campaign in play; none where the agent does not voice the characters. */
|
|
11
|
+
export function voicesPart(root, context) {
|
|
12
|
+
return agentVoices(root, context) ? voicesInstructions(readSettings(root).voices ?? "auto") : "";
|
|
13
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { Context } from "../core/context.ts";
|
|
2
|
+
import type { Problem } from "../core/problem.ts";
|
|
3
|
+
import { type Widget, type WidgetPage, type WidgetPlace, type WidgetText, type WidgetValue } from "../extensions/index.ts";
|
|
4
|
+
/** Where a widget stands: a place of the dashboard, with its page for a card in one, and its order among the cards there; or off. */
|
|
5
|
+
export interface WidgetSpot {
|
|
6
|
+
place: WidgetPlace | "off";
|
|
7
|
+
page?: WidgetPage;
|
|
8
|
+
order: number;
|
|
9
|
+
}
|
|
10
|
+
/** A widget as the dashboard shows it (D-502): which it is, whose, its title in the campaign's language, where it stands and where its extension puts it, its icon, what it shows now. */
|
|
11
|
+
export interface ShownWidget extends WidgetSpot {
|
|
12
|
+
/** Its extension's name and its own, as campaign.yaml names it: weather.today. */
|
|
13
|
+
id: string;
|
|
14
|
+
extension: string;
|
|
15
|
+
/** The extension's title, as Settings names whose it is. */
|
|
16
|
+
from: string;
|
|
17
|
+
title: string;
|
|
18
|
+
own: WidgetSpot;
|
|
19
|
+
/** The path of its icon. */
|
|
20
|
+
icon?: string;
|
|
21
|
+
/** What it shows now; none while it has nothing to show, or is off. */
|
|
22
|
+
shows?: ShownContent;
|
|
23
|
+
/** Why it shows nothing, for whoever made it: its code failed, or gave what the dashboard does not show. */
|
|
24
|
+
problem?: string;
|
|
25
|
+
}
|
|
26
|
+
/** What a widget shows, as the page draws it: its words in the campaign's language, its icons as their paths, its pictures as files. */
|
|
27
|
+
export interface ShownContent {
|
|
28
|
+
icon?: string;
|
|
29
|
+
chip?: WidgetText;
|
|
30
|
+
says?: WidgetText;
|
|
31
|
+
note?: WidgetText;
|
|
32
|
+
parts?: ShownPart[];
|
|
33
|
+
}
|
|
34
|
+
/** A part of a widget's card as the page draws it: a lead's icon as its path, a picture as the file of its extension the dashboard serves. */
|
|
35
|
+
export type ShownPart = Exclude<NonNullable<Widget["parts"]>[number], {
|
|
36
|
+
lead: WidgetText;
|
|
37
|
+
} | {
|
|
38
|
+
image: string;
|
|
39
|
+
}> | {
|
|
40
|
+
lead: WidgetText;
|
|
41
|
+
icon?: string;
|
|
42
|
+
value?: WidgetValue;
|
|
43
|
+
} | {
|
|
44
|
+
image: {
|
|
45
|
+
extension: string;
|
|
46
|
+
file: string;
|
|
47
|
+
version: number;
|
|
48
|
+
};
|
|
49
|
+
alt: WidgetText;
|
|
50
|
+
};
|
|
51
|
+
/** The places a campaign may put a widget in, in campaign.yaml: top, side, a page, which is a card in that page, or off. */
|
|
52
|
+
export declare const widgetSpots: readonly [...("top" | "side")[], "scene", "sheet", "world", "journal", "off"];
|
|
53
|
+
/**
|
|
54
|
+
* The widgets of the campaign's extensions, in the order of the extensions and of their widgets, each where it stands and with what its hook shows now. The
|
|
55
|
+
* hooks run together, within one time for all; one that takes longer shows nothing this time, and is not called again while it works.
|
|
56
|
+
*/
|
|
57
|
+
export declare function campaignWidgets(root: string, context: Context): Promise<ShownWidget[]>;
|
|
58
|
+
/** What keeps the words of the campaign's extensions from being read in its language, for validate: the file, and how to fix it (D-502). */
|
|
59
|
+
export declare function extensionWordsProblems(root: string, context: Context): Problem[];
|
|
60
|
+
/** The widgets of the campaign's extensions by the names campaign.yaml gives them, as weather.today, with where each extension puts it. */
|
|
61
|
+
export declare function campaignWidgetNames(root: string, context: Context): Record<string, WidgetSpot>;
|
|
62
|
+
/**
|
|
63
|
+
* Where campaign.yaml would put the widgets it names, checked before it is written: each a widget of the campaign's extensions, each place one of those the
|
|
64
|
+
* dashboard has. It throws what is wrong, and how to write it.
|
|
65
|
+
*/
|
|
66
|
+
export declare function checkWidgetSpots(root: string, context: Context, entries: Record<string, unknown>): void;
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
// The widgets of the campaign's extensions on the dashboard (D-502): where each stands, as its extension.yaml puts it and campaign.yaml moves it, and what its
|
|
2
|
+
// code's hook shows now, checked and kept short, in the campaign's language. The extension's state never reaches the page: only what its hook gives.
|
|
3
|
+
import { basename } from "node:path";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
import { campaignFileName, readOneSetting, readTextSetting } from "../campaign/index.js";
|
|
6
|
+
import { files } from "../core/store.js";
|
|
7
|
+
import { comparableText } from "../core/text.js";
|
|
8
|
+
import { extensionWords, widgetPages, widgetPlaces, wordIn, } from "../extensions/index.js";
|
|
9
|
+
import { findImage } from "../images/index.js";
|
|
10
|
+
import { campaignExtensions } from "./game-extension-list.js";
|
|
11
|
+
import { extensionCode, gameViewOf } from "./game-extensions.js";
|
|
12
|
+
/** The places a campaign may put a widget in, in campaign.yaml: top, side, a page, which is a card in that page, or off. */
|
|
13
|
+
export const widgetSpots = [...widgetPlaces.filter((place) => place !== "page"), ...widgetPages, "off"];
|
|
14
|
+
// How long the hooks may take, all together, before the page goes on without those still at work, and the most a widget may give, as JSON.
|
|
15
|
+
const hookTime = 2000;
|
|
16
|
+
const mostShown = 12_000;
|
|
17
|
+
// The hooks still at work, by campaign, extension and widget: a reading that comes meanwhile waits on the same call, never calls again.
|
|
18
|
+
const working = new Map();
|
|
19
|
+
/**
|
|
20
|
+
* The widgets of the campaign's extensions, in the order of the extensions and of their widgets, each where it stands and with what its hook shows now. The
|
|
21
|
+
* hooks run together, within one time for all; one that takes longer shows nothing this time, and is not called again while it works.
|
|
22
|
+
*/
|
|
23
|
+
export async function campaignWidgets(root, context) {
|
|
24
|
+
const spots = campaignSpots(root);
|
|
25
|
+
const language = readTextSetting(root, "language");
|
|
26
|
+
let timer;
|
|
27
|
+
const late = new Promise((done) => {
|
|
28
|
+
timer = setTimeout(() => done("late"), hookTime).unref();
|
|
29
|
+
});
|
|
30
|
+
const reading = [];
|
|
31
|
+
for (const extension of campaignExtensions(root, context).extensions) {
|
|
32
|
+
const words = wordsOf(extension, language);
|
|
33
|
+
const code = extension.widgets.length === 0 ? undefined : extensionCode(extension).then((loaded) => ({ loaded }), (error) => ({ error: messageOf(error) }));
|
|
34
|
+
for (const widget of extension.widgets) {
|
|
35
|
+
const id = `${extension.name}.${widget.name}`;
|
|
36
|
+
const own = ownSpot(widget);
|
|
37
|
+
const given = Object.entries(spots).find(([name]) => comparableText(name) === comparableText(id))?.[1];
|
|
38
|
+
const spot = given === undefined ? own : spotOf(given, own);
|
|
39
|
+
const base = {
|
|
40
|
+
id,
|
|
41
|
+
extension: extension.name,
|
|
42
|
+
from: words.read?.title ?? extension.title,
|
|
43
|
+
title: wordIn(words.read, widget.title),
|
|
44
|
+
...spot,
|
|
45
|
+
own,
|
|
46
|
+
...(widget.icon === undefined ? {} : { icon: extension.icons[widget.icon] }),
|
|
47
|
+
...(words.problem === undefined ? {} : { problem: words.problem }),
|
|
48
|
+
};
|
|
49
|
+
if (spot.place === "off" || code === undefined) {
|
|
50
|
+
reading.push(Promise.resolve(base));
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
reading.push(code.then((loaded) => widgetNow(root, context, extension, widget.name, base, loaded, words.read, late)));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
try {
|
|
57
|
+
return await Promise.all(reading);
|
|
58
|
+
}
|
|
59
|
+
finally {
|
|
60
|
+
clearTimeout(timer);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/** What keeps the words of the campaign's extensions from being read in its language, for validate: the file, and how to fix it (D-502). */
|
|
64
|
+
export function extensionWordsProblems(root, context) {
|
|
65
|
+
const language = readTextSetting(root, "language");
|
|
66
|
+
return campaignExtensions(root, context).extensions.flatMap((extension) => {
|
|
67
|
+
const problem = wordsOf(extension, language).problem;
|
|
68
|
+
return problem === undefined ? [] : [{ path: campaignFileName, message: problem, fix: `or install it again with package install ${extension.name}` }];
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
/** A widget with what its hook shows now, or why it shows nothing: its code, a hook it lacks, a hook that failed or was late, what it gave. */
|
|
72
|
+
async function widgetNow(root, context, extension, name, base, loaded, words, late) {
|
|
73
|
+
const hook = "error" in loaded ? undefined : loaded.loaded?.widgets?.[name];
|
|
74
|
+
if (hook === undefined) {
|
|
75
|
+
const problem = "error" in loaded ? `its code cannot be used: ${loaded.error}` : loaded.loaded === undefined ? "its code does not run in this campaign" : `its code gives nothing for the widget ${name}`;
|
|
76
|
+
return { ...base, problem };
|
|
77
|
+
}
|
|
78
|
+
try {
|
|
79
|
+
const answer = await Promise.race([hookCall(root, extension, name, () => hook(gameViewOf(root, context, extension))), late]);
|
|
80
|
+
if (answer === "late") {
|
|
81
|
+
return { ...base, problem: `it gave nothing in ${hookTime / 1000} seconds` };
|
|
82
|
+
}
|
|
83
|
+
const shows = answer === undefined ? undefined : shownContent(extension, words, answer);
|
|
84
|
+
return { ...base, ...(shows === undefined ? {} : { shows }) };
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
return { ...base, problem: messageOf(error) };
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
/** A hook's call, or the one already at work for the same widget of the same campaign. */
|
|
91
|
+
function hookCall(root, extension, widget, call) {
|
|
92
|
+
const key = `${root}|${extension.package}@${extension.version}|${widget}`;
|
|
93
|
+
const running = working.get(key);
|
|
94
|
+
if (running !== undefined) {
|
|
95
|
+
return running;
|
|
96
|
+
}
|
|
97
|
+
const started = Promise.resolve().then(call).finally(() => working.delete(key));
|
|
98
|
+
working.set(key, started);
|
|
99
|
+
return started;
|
|
100
|
+
}
|
|
101
|
+
/** The widgets of the campaign's extensions by the names campaign.yaml gives them, as weather.today, with where each extension puts it. */
|
|
102
|
+
export function campaignWidgetNames(root, context) {
|
|
103
|
+
return Object.fromEntries(campaignExtensions(root, context).extensions.flatMap((extension) => extension.widgets.map((widget) => [`${extension.name}.${widget.name}`, ownSpot(widget)])));
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Where campaign.yaml would put the widgets it names, checked before it is written: each a widget of the campaign's extensions, each place one of those the
|
|
107
|
+
* dashboard has. It throws what is wrong, and how to write it.
|
|
108
|
+
*/
|
|
109
|
+
export function checkWidgetSpots(root, context, entries) {
|
|
110
|
+
const known = Object.keys(campaignWidgetNames(root, context));
|
|
111
|
+
for (const [name, value] of Object.entries(entries)) {
|
|
112
|
+
if (!known.some((one) => comparableText(one) === comparableText(name))) {
|
|
113
|
+
const names = known.length === 0 ? "the campaign's extensions have none" : `the campaign's are ${known.join(", ")}`;
|
|
114
|
+
throw new Error(`There is no widget ${name}: ${names}. Write one as ${known[0] ?? "weather.today"}: side. Nothing changed.`);
|
|
115
|
+
}
|
|
116
|
+
if (!spotSchema.safeParse(value).success) {
|
|
117
|
+
// Of a place written as its parts, what is wrong with them, as an order that is no whole number.
|
|
118
|
+
const issue = value !== null && typeof value === "object" ? spotObject.safeParse(value).error?.issues[0] : undefined;
|
|
119
|
+
const why = issue === undefined ? "" : ` Here ${[...issue.path, ""].join(" ")}${issue.message}.`;
|
|
120
|
+
throw new Error(`${name} takes ${widgetSpots.join(", ")}, or {place, page, order}, such as ${name}: side.${why} Nothing changed.`);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
// The most and least order of a card among those of its place.
|
|
125
|
+
const orderWords = "is a whole number from -100 to 100";
|
|
126
|
+
/** A widget's place in campaign.yaml as its place, page and order. */
|
|
127
|
+
const spotObject = z.object({
|
|
128
|
+
place: z.enum([...widgetPlaces, "off"], { error: `is ${[...widgetPlaces, "off"].join(", ")}` }).optional(),
|
|
129
|
+
page: z.enum(widgetPages, { error: `is ${widgetPages.join(", ")}` }).optional(),
|
|
130
|
+
order: z.int({ error: orderWords }).min(-100, { error: orderWords }).max(100, { error: orderWords }).optional(),
|
|
131
|
+
}, { error: (issue) => (issue.code === "unrecognized_keys" ? `has no ${issue.keys.join(", ")}: only place, page and order` : undefined) }).strict().refine((spot) => spot.place !== "page" || spot.page !== undefined, { error: "a card in place page names its page: scene, sheet, world or journal" });
|
|
132
|
+
/** A widget's place in campaign.yaml: a word, or its place, page and order. */
|
|
133
|
+
const spotSchema = z.union([z.enum(widgetSpots), spotObject]);
|
|
134
|
+
/** Where campaign.yaml puts the widgets it names; one written wrongly by hand is left out, its extension's place holding. */
|
|
135
|
+
function campaignSpots(root) {
|
|
136
|
+
let written;
|
|
137
|
+
try {
|
|
138
|
+
written = readOneSetting(root, "widgets");
|
|
139
|
+
}
|
|
140
|
+
catch {
|
|
141
|
+
return {};
|
|
142
|
+
}
|
|
143
|
+
const entries = written !== null && typeof written === "object" && !Array.isArray(written) ? Object.entries(written) : [];
|
|
144
|
+
return Object.fromEntries(entries.flatMap(([name, value]) => {
|
|
145
|
+
const parsed = spotSchema.safeParse(value);
|
|
146
|
+
return parsed.success ? [[name, parsed.data]] : [];
|
|
147
|
+
}));
|
|
148
|
+
}
|
|
149
|
+
function ownSpot(widget) {
|
|
150
|
+
return { place: widget.place, ...(widget.page === undefined ? {} : { page: widget.page }), order: widget.order };
|
|
151
|
+
}
|
|
152
|
+
/** Where the campaign puts a widget: a page's name is a card in that page; a place without its page keeps the extension's page, else the Scene. */
|
|
153
|
+
function spotOf(given, own) {
|
|
154
|
+
if (typeof given === "string") {
|
|
155
|
+
return widgetPages.includes(given) ? { place: "page", page: given, order: own.order } : { place: given, order: own.order };
|
|
156
|
+
}
|
|
157
|
+
const place = given.place ?? (given.page === undefined ? own.place : "page");
|
|
158
|
+
const page = place === "page" ? given.page ?? own.page ?? "scene" : undefined;
|
|
159
|
+
return { place, ...(page === undefined ? {} : { page }), order: given.order ?? own.order };
|
|
160
|
+
}
|
|
161
|
+
/** An extension's words in the campaign's language, none where it is written in it; or why they cannot be read, with their file. */
|
|
162
|
+
function wordsOf(extension, language) {
|
|
163
|
+
if (language === undefined || language.split("-")[0] === extension.language.split("-")[0]) {
|
|
164
|
+
return {};
|
|
165
|
+
}
|
|
166
|
+
try {
|
|
167
|
+
const read = extensionWords(extension.folder, language);
|
|
168
|
+
return read === undefined ? {} : { read };
|
|
169
|
+
}
|
|
170
|
+
catch (error) {
|
|
171
|
+
return { problem: messageOf(error) };
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
// What a widget may give: short words, few parts, numbers that are numbers.
|
|
175
|
+
const text = (most) => z.string().max(most);
|
|
176
|
+
const valueSchema = z.union([
|
|
177
|
+
z.number(),
|
|
178
|
+
text(80),
|
|
179
|
+
z.object({ number: z.number(), unit: text(12).optional() }).strict(),
|
|
180
|
+
z.object({ from: z.number(), to: z.number(), unit: text(12).optional() }).strict(),
|
|
181
|
+
]);
|
|
182
|
+
const textSchema = z.union([
|
|
183
|
+
text(160),
|
|
184
|
+
z.object({ text: text(240), values: z.record(z.string().regex(/^\w+$/), valueSchema).refine((values) => Object.keys(values).length <= 8, "at most 8 values") }).strict(),
|
|
185
|
+
]);
|
|
186
|
+
const iconName = z.string().regex(/^[a-z][a-z0-9-]*$/);
|
|
187
|
+
const partSchema = z.union([
|
|
188
|
+
z.object({ lead: textSchema, icon: iconName.optional(), value: valueSchema.optional() }).strict(),
|
|
189
|
+
z.object({ text: textSchema }).strict(),
|
|
190
|
+
z.object({ facts: z.array(textSchema).max(12) }).strict(),
|
|
191
|
+
z.object({ values: z.array(z.object({ label: textSchema, value: valueSchema }).strict()).max(12) }).strict(),
|
|
192
|
+
z.object({ track: z.object({ label: textSchema, value: z.int().min(0), max: z.int().min(1).max(100), look: z.enum(["pips", "bar"]).optional() }).strict() }).strict(),
|
|
193
|
+
z.object({ rows: z.array(z.object({ label: textSchema, value: valueSchema.optional(), note: textSchema.optional() }).strict()).max(24) }).strict(),
|
|
194
|
+
z.object({ table: z.object({ head: z.array(textSchema).min(1).max(6), rows: z.array(z.array(valueSchema).max(6)).max(24) }).strict() }).strict(),
|
|
195
|
+
z.object({ image: z.string().regex(/^[\w .-]+\.(png|jpe?g|webp|svg)$/i), alt: textSchema }).strict(),
|
|
196
|
+
]);
|
|
197
|
+
const widgetSchema = z.object({
|
|
198
|
+
icon: iconName.optional(),
|
|
199
|
+
chip: textSchema.optional(),
|
|
200
|
+
says: textSchema.optional(),
|
|
201
|
+
note: textSchema.optional(),
|
|
202
|
+
parts: z.array(partSchema).max(12).optional(),
|
|
203
|
+
}).strict();
|
|
204
|
+
/** What a hook gave, checked, translated, its icons and pictures found; it throws what the dashboard cannot show, for whoever made the extension. */
|
|
205
|
+
function shownContent(extension, words, given) {
|
|
206
|
+
const parsed = widgetSchema.safeParse(given);
|
|
207
|
+
if (!parsed.success) {
|
|
208
|
+
const issue = parsed.error.issues[0];
|
|
209
|
+
throw new Error(`it gave what the dashboard does not show, at ${issue.path.join(".") || "its top"}: ${issue.message}`);
|
|
210
|
+
}
|
|
211
|
+
if (JSON.stringify(parsed.data).length > mostShown) {
|
|
212
|
+
throw new Error(`it gave more than the dashboard shows of a widget, ${mostShown} characters as JSON`);
|
|
213
|
+
}
|
|
214
|
+
const icon = (name) => {
|
|
215
|
+
if (name !== undefined && extension.icons[name] === undefined) {
|
|
216
|
+
throw new Error(`it names the icon ${name}, which its extension.yaml does not have`);
|
|
217
|
+
}
|
|
218
|
+
return name === undefined ? undefined : extension.icons[name];
|
|
219
|
+
};
|
|
220
|
+
const said = (one) => (typeof one === "string" ? wordIn(words, one) : { text: wordIn(words, one.text), values: Object.fromEntries(Object.entries(one.values).map(([name, value]) => [name, valueIn(value)])) });
|
|
221
|
+
const valueIn = (value) => typeof value === "number" ? value : typeof value === "string" ? wordIn(words, value) : value.unit === undefined ? value : { ...value, unit: wordIn(words, value.unit) };
|
|
222
|
+
const { icon: ownIcon, chip, says, note, parts } = parsed.data;
|
|
223
|
+
const shownIcon = icon(ownIcon);
|
|
224
|
+
return {
|
|
225
|
+
...(shownIcon === undefined ? {} : { icon: shownIcon }),
|
|
226
|
+
...(chip === undefined ? {} : { chip: said(chip) }),
|
|
227
|
+
...(says === undefined ? {} : { says: said(says) }),
|
|
228
|
+
...(note === undefined ? {} : { note: said(note) }),
|
|
229
|
+
...(parts === undefined ? {} : {
|
|
230
|
+
parts: parts.map((part) => {
|
|
231
|
+
if ("lead" in part) {
|
|
232
|
+
const leadIcon = icon(part.icon);
|
|
233
|
+
return { lead: said(part.lead), ...(leadIcon === undefined ? {} : { icon: leadIcon }), ...(part.value === undefined ? {} : { value: valueIn(part.value) }) };
|
|
234
|
+
}
|
|
235
|
+
if ("text" in part) {
|
|
236
|
+
return { text: said(part.text) };
|
|
237
|
+
}
|
|
238
|
+
if ("facts" in part) {
|
|
239
|
+
return { facts: part.facts.map(said) };
|
|
240
|
+
}
|
|
241
|
+
if ("values" in part) {
|
|
242
|
+
return { values: part.values.map((one) => ({ label: said(one.label), value: valueIn(one.value) })) };
|
|
243
|
+
}
|
|
244
|
+
if ("track" in part) {
|
|
245
|
+
return { track: { ...part.track, label: said(part.track.label), value: Math.min(part.track.value, part.track.max) } };
|
|
246
|
+
}
|
|
247
|
+
if ("rows" in part) {
|
|
248
|
+
return {
|
|
249
|
+
rows: part.rows.map((row) => ({
|
|
250
|
+
label: said(row.label),
|
|
251
|
+
...(row.value === undefined ? {} : { value: valueIn(row.value) }),
|
|
252
|
+
...(row.note === undefined ? {} : { note: said(row.note) }),
|
|
253
|
+
})),
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
if ("table" in part) {
|
|
257
|
+
return { table: { head: part.table.head.map(said), rows: part.table.rows.map((row) => row.map(valueIn)) } };
|
|
258
|
+
}
|
|
259
|
+
return { image: pictureOf(extension, part.image), alt: said(part.alt) };
|
|
260
|
+
}),
|
|
261
|
+
}),
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
/** A picture of the extension's images/, as the dashboard serves it at an address of the extension's own; it throws when the extension has none by that name. */
|
|
265
|
+
function pictureOf(extension, name) {
|
|
266
|
+
const file = findImage([extension.folder], name);
|
|
267
|
+
if (file === undefined) {
|
|
268
|
+
throw new Error(`it shows the picture ${name}, which its images/ does not have`);
|
|
269
|
+
}
|
|
270
|
+
return { extension: extension.name, file: basename(file), version: Math.trunc(files().modified(file) ?? 0) };
|
|
271
|
+
}
|
|
272
|
+
function messageOf(error) {
|
|
273
|
+
return (error instanceof Error ? error.message : String(error)).split("\n")[0];
|
|
274
|
+
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import { type CountedByGame } from "../campaign/index.ts";
|
|
1
2
|
import type { Context } from "../core/context.ts";
|
|
2
3
|
import type { Problem } from "../core/problem.ts";
|
|
3
4
|
import { type PageType, type World } from "../pages/index.ts";
|
|
4
|
-
import { type GameSystem, type SystemSetting } from "../systems/index.ts";
|
|
5
|
+
import { type GameSystem, type SystemSetting, type SystemWords } from "../systems/index.ts";
|
|
5
6
|
/** The world of the campaign in `root`, with the pages of its game system when campaign.yaml names one that is installed (SYS-1, SYS-3). */
|
|
6
7
|
export declare function campaignWorld(root: string, context: Context): World;
|
|
8
|
+
/** The game system's words in the campaign's language (D-403): its own, else those translated on the fly on this computer (D-406). */
|
|
9
|
+
export declare function systemWordsOf(system: GameSystem, language: string, context: Context): SystemWords | undefined;
|
|
7
10
|
/**
|
|
8
11
|
* The installed game system that campaign.yaml names, with what the campaign adds to it (CAM-1, CAM-2): alone when the additions do not read (CAM-3). Undefined
|
|
9
12
|
* when it names none, or one that is not installed (SYS-1).
|
|
@@ -58,3 +61,7 @@ export declare function missingWithSystems(root: string, missing: string[], cont
|
|
|
58
61
|
* one that is not installed says so, with the fix (D-167). Undefined when campaign.yaml names none.
|
|
59
62
|
*/
|
|
60
63
|
export declare function systemInStatus(root: string, context: Context): string | undefined;
|
|
64
|
+
/** A language as messages name it, such as English for en. */
|
|
65
|
+
export declare function languageName(code: string): string;
|
|
66
|
+
/** What the game system counts itself, for a rigor's meaning (UPK-1, UPK-3): the day's food, and what burns, by its first name. */
|
|
67
|
+
export declare function countedByGame(system: GameSystem | undefined): CountedByGame;
|
|
@@ -2,8 +2,10 @@ import { join, resolve } from "node:path";
|
|
|
2
2
|
import { campaignFileName, readCampaignData, readOneSetting, readTextSetting } from "../campaign/index.js";
|
|
3
3
|
import { files, isInside } from "../core/store.js";
|
|
4
4
|
import { comparableText } from "../core/text.js";
|
|
5
|
+
import { languagePackFor, packSystemFolder } from "../languages/index.js";
|
|
6
|
+
import { homeSystemWords } from "../page-words.js";
|
|
5
7
|
import { loadWorld, searchSystemPages, worldFolderName } from "../pages/index.js";
|
|
6
|
-
import { findCampaignSystem, findSystem, installedSystems, withSettings } from "../systems/index.js";
|
|
8
|
+
import { findCampaignSystem, findSystem, installedSystems, systemWords, withSettings } from "../systems/index.js";
|
|
7
9
|
import { campaignExtensions, extensionSources, layeredParts } from "./game-extension-list.js";
|
|
8
10
|
/** The world of the campaign in `root`, with the pages of its game system when campaign.yaml names one that is installed (SYS-1, SYS-3). */
|
|
9
11
|
export function campaignWorld(root, context) {
|
|
@@ -13,9 +15,22 @@ export function campaignWorld(root, context) {
|
|
|
13
15
|
return files().remember(`world ${resolve(root)}`, dependsOn, () => {
|
|
14
16
|
const named = readTextSetting(root, "system");
|
|
15
17
|
const system = campaignSystem(root, context);
|
|
16
|
-
return loadWorld(root, {
|
|
18
|
+
return loadWorld(root, {
|
|
19
|
+
system,
|
|
20
|
+
language: readTextSetting(root, "language"),
|
|
21
|
+
missingSystem: system === undefined ? named : undefined,
|
|
22
|
+
noSystem: named === undefined,
|
|
23
|
+
rigor: readTextSetting(root, "rigor"),
|
|
24
|
+
});
|
|
17
25
|
});
|
|
18
26
|
}
|
|
27
|
+
/** The game system's words in the campaign's language (D-403): its own, else those translated on the fly on this computer (D-406). */
|
|
28
|
+
export function systemWordsOf(system, language, context) {
|
|
29
|
+
// A language package's words come first, then the system's own, then those translated on the fly (D-485 (3)).
|
|
30
|
+
const pack = languagePackFor(context.extensionFolders ?? [], language);
|
|
31
|
+
const packed = pack === undefined ? undefined : packSystemFolder(pack, system.name);
|
|
32
|
+
return (packed === undefined ? undefined : systemWords(packed, language)) ?? systemWords(system.folder, language) ?? homeSystemWords(context.home, system, language);
|
|
33
|
+
}
|
|
19
34
|
/**
|
|
20
35
|
* The installed game system that campaign.yaml names, with what the campaign adds to it (CAM-1, CAM-2): alone when the additions do not read (CAM-3). Undefined
|
|
21
36
|
* when it names none, or one that is not installed (SYS-1).
|
|
@@ -197,7 +212,7 @@ export function systemInStatus(root, context) {
|
|
|
197
212
|
return `${name} ${first === undefined ? "(not installed)" : `(not installed: ask the player, then config, setting system, value ${first.name})`}`;
|
|
198
213
|
}
|
|
199
214
|
/** A language as messages name it, such as English for en. */
|
|
200
|
-
function languageName(code) {
|
|
215
|
+
export function languageName(code) {
|
|
201
216
|
try {
|
|
202
217
|
return new Intl.DisplayNames(["en"], { type: "language" }).of(code) ?? code;
|
|
203
218
|
}
|
|
@@ -205,3 +220,8 @@ function languageName(code) {
|
|
|
205
220
|
return code;
|
|
206
221
|
}
|
|
207
222
|
}
|
|
223
|
+
/** What the game system counts itself, for a rigor's meaning (UPK-1, UPK-3): the day's food, and what burns, by its first name. */
|
|
224
|
+
export function countedByGame(system) {
|
|
225
|
+
const burning = Object.keys(system?.burning ?? {})[0];
|
|
226
|
+
return { upkeep: system?.upkeep !== undefined, ...(burning === undefined ? {} : { burning }) };
|
|
227
|
+
}
|