rpg-engine 0.2.0 → 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 +85 -9
- package/dist/commands/package.js +378 -50
- 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 +131 -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 +127 -15
- 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
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
// The widgets of a value (D-273, D-284): pips, a bar, a track centred on zero, a number's progress, chips or a list of sentences; each says its value in words
|
|
3
|
+
// for a screen reader.
|
|
4
|
+
import { ActName, usePlayerActs } from "./act-names.js";
|
|
5
|
+
import { Coins } from "./coins.js";
|
|
6
|
+
import { besideLabel, burnsLabel, effectEndLabel, effectLabel, effectName } from "./game-words.js";
|
|
7
|
+
import { itemLabel, shownText } from "./labels.js";
|
|
4
8
|
import { progressShare, trackPlaces, widgetOf } from "./layout.js";
|
|
5
9
|
import { t } from "./text.js";
|
|
6
10
|
// Below this share of its maximum a bar is low: hatched, not only red.
|
|
@@ -21,7 +25,8 @@ export function ValueDrawing({ value, label, fields }) {
|
|
|
21
25
|
case "list":
|
|
22
26
|
return _jsx(Chips, { value: value, fields: fields });
|
|
23
27
|
default:
|
|
24
|
-
|
|
28
|
+
// Money as its coins (D-431).
|
|
29
|
+
return value.coins !== undefined && value.coins.length > 0 ? _jsx(Coins, { coins: value.coins }) : _jsx("span", { class: value.text.length > 40 ? "text" : "num", children: shownText(value.text, value.kind) });
|
|
25
30
|
}
|
|
26
31
|
}
|
|
27
32
|
export function Pips({ value, label }) {
|
|
@@ -31,11 +36,11 @@ export function Pips({ value, label }) {
|
|
|
31
36
|
export function Bar({ value, label }) {
|
|
32
37
|
const { value: current, max = 0 } = value.counter ?? { value: 0 };
|
|
33
38
|
const share = max === 0 ? 0 : Math.min(1, Math.max(0, current / max));
|
|
34
|
-
return (_jsxs("span", { class: "bar-line", children: [_jsx("span", { class: share < low ? "bar low" : "bar", role: "meter", "aria-label": label, "aria-valuemin": 0, "aria-valuemax": max, "aria-valuenow": current, "aria-valuetext": value.text, children: _jsx("span", { class: "fill", style: { "--fill": String(share) } }) }), _jsx("span", { class: "num", children: shownText(value.text) })] }));
|
|
39
|
+
return (_jsxs("span", { class: "bar-line", children: [_jsx("span", { class: share < low ? "bar low" : "bar", role: "meter", "aria-label": label, "aria-valuemin": 0, "aria-valuemax": max, "aria-valuenow": current, "aria-valuetext": value.text, children: _jsx("span", { class: "fill", style: { "--fill": String(share) } }) }), _jsx("span", { class: "num", children: shownText(value.text, value.kind) })] }));
|
|
35
40
|
}
|
|
36
41
|
/** A number on its way to the next mark, as the experience toward the next level: the number, what the next mark needs, a bar under them (D-284). */
|
|
37
42
|
export function Progress({ value, label }) {
|
|
38
|
-
return (_jsxs("span", { class: "progress-line", children: [_jsxs("span", { class: "progress-first", children: [_jsx("span", { class: "num", children: shownText(value.text) }), besideLabel(value) !== undefined && _jsx("span", { class: "progress-next", children: shownText(besideLabel(value) ?? "") })] }), _jsx(ProgressBar, { value: value, label: label })] }));
|
|
43
|
+
return (_jsxs("span", { class: "progress-line", children: [_jsxs("span", { class: "progress-first", children: [_jsx("span", { class: "num", children: shownText(value.text, value.kind) }), besideLabel(value) !== undefined && _jsx("span", { class: "progress-next", children: shownText(besideLabel(value) ?? "") })] }), _jsx(ProgressBar, { value: value, label: label })] }));
|
|
39
44
|
}
|
|
40
45
|
/** The bar of a number's progress, in the accent, never low: it is no resource that runs out. */
|
|
41
46
|
export function ProgressBar({ value, label }) {
|
|
@@ -48,22 +53,24 @@ export function Track({ value, label }) {
|
|
|
48
53
|
const counter = value.counter ?? { value: 0 };
|
|
49
54
|
const places = trackPlaces(counter);
|
|
50
55
|
const style = { "--from": String(Math.min(places.zero, places.value)), "--to": String(Math.max(places.zero, places.value)), "--zero": String(places.zero) };
|
|
51
|
-
return (_jsxs("span", { class: "bar-line", children: [_jsx("span", { class: "num limit", children: shownText(String(counter.min ?? 0)) }), _jsxs("span", { class: "track", role: "meter", "aria-label": label, "aria-valuemin": counter.min, "aria-valuemax": counter.max, "aria-valuenow": counter.value, "aria-valuetext": value.text, style: style, children: [_jsx("span", { class: "fill" }), _jsx("span", { class: "zero" })] }), _jsx("span", { class: "num", children: shownText(value.text) })] }));
|
|
56
|
+
return (_jsxs("span", { class: "bar-line", children: [_jsx("span", { class: "num limit", children: shownText(String(counter.min ?? 0)) }), _jsxs("span", { class: "track", role: "meter", "aria-label": label, "aria-valuemin": counter.min, "aria-valuemax": counter.max, "aria-valuenow": counter.value, "aria-valuetext": value.text, style: style, children: [_jsx("span", { class: "fill" }), _jsx("span", { class: "zero" })] }), _jsx("span", { class: "num", children: shownText(value.text, value.kind) })] }));
|
|
52
57
|
}
|
|
53
58
|
/** A list as chips, or as lines when it is of sentences; what the character's parts add to it apart, with where it comes from (PRO-7). */
|
|
54
59
|
export function Chips({ value, fields }) {
|
|
55
|
-
return (_jsxs("span", { class: "chips-block", children: [_jsx(Items, { items: value.items ?? [], fields: fields }), value.always && (_jsxs("span", { class: "always", children: [_jsx("span", { class: "always-from", children: t("Always, from {sources}", { sources: value.always.from.join(` ${t("and")} `) }) }), _jsx(Items, { items: value.always.items, fields: fields })] }))] }));
|
|
60
|
+
return (_jsxs("span", { class: "chips-block", children: [_jsx(Items, { items: value.items ?? [], field: value.field, fields: fields }), value.always && (_jsxs("span", { class: "always", children: [_jsx("span", { class: "always-from", children: t("Always, from {sources}", { sources: value.always.from.join(` ${t("and")} `) }) }), _jsx(Items, { items: value.always.items, field: value.field, fields: fields })] }))] }));
|
|
56
61
|
}
|
|
57
|
-
|
|
62
|
+
/** A list's items, each a button that acts when the system names verbs for its field (D-495). */
|
|
63
|
+
function Items({ items, field, fields }) {
|
|
64
|
+
const verbs = usePlayerActs()?.actions[field];
|
|
65
|
+
const acting = verbs !== undefined && verbs.length > 0;
|
|
58
66
|
const sentences = items.some((item) => item.trim().split(/\s+/).length >= sentenceWords);
|
|
59
|
-
return _jsx("ul", { class: sentences ? "notes" : "chips",
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
return (_jsx("div", { class: "death-saves", children: dying.map((counter, index) => (_jsxs("p", { class: "saves-row", children: [_jsx("span", { class: "saves-label", children: phraseLabel(fieldLabel(counter.field)) }), Array.from({ length: counter.limit ?? Math.max(counter.value, 1) }, (_, mark) => _jsx("span", { class: `save ${index === 0 ? "success" : "failure"}${mark < counter.value ? " marked" : ""}`, "aria-hidden": "true" }, mark)), _jsx("span", { class: "visually-hidden", children: t("{value} of {max}", { value: counter.value, max: counter.limit ?? "?" }) })] }, counter.field))) }));
|
|
67
|
+
return (_jsx("ul", { class: [sentences ? "notes" : "chips", acting ? "acting" : ""].filter((name) => name !== "").join(" "), children: items.map((item) => {
|
|
68
|
+
const label = itemLabel(item, fields);
|
|
69
|
+
return _jsx("li", { children: acting ? _jsx(ActName, { verbs: verbs, item: label, children: label }) : label }, item);
|
|
70
|
+
}) }));
|
|
64
71
|
}
|
|
65
72
|
/** Someone's effects as tags, each with its end; past `most`, how many more. */
|
|
66
73
|
export function Effects({ effects, most }) {
|
|
67
74
|
const shown = most === undefined ? effects : effects.slice(0, most);
|
|
68
|
-
return effects.length === 0 ? null : (_jsxs("span", { class: "effects", children: [shown.map((effect) => _jsxs("span", { class: "effect", title: effectLabel(effect), children: [effect.name, effect.end && most === undefined ? _jsx("span", { class: "end", children: `· ${effectEndLabel(effect.end)}` }) : null] }, effect.text)), effects.length > shown.length && _jsxs("span", { class: "effect more", children: ["+", effects.length - shown.length] })] }));
|
|
75
|
+
return effects.length === 0 ? null : (_jsxs("span", { class: "effects", children: [shown.map((effect) => (_jsxs("span", { class: "effect", title: effectLabel(effect), children: [effectName(effect.name), effect.end && most === undefined ? _jsx("span", { class: "end", children: `· ${effectEndLabel(effect.end)}` }) : null, effect.burns && most === undefined ? _jsx("span", { class: "end", children: `· ${burnsLabel(effect.name, effect.burns)}` }) : null] }, effect.text))), effects.length > shown.length && _jsxs("span", { class: "effect more", children: ["+", effects.length - shown.length] })] }));
|
|
69
76
|
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "preact/jsx-runtime";
|
|
2
|
+
// The calendar of the World section (D-276, TIM-8): today, as large as a game's date; the deadlines the character knows, the soonest first, with the time left;
|
|
3
|
+
// the month with its season along the year, its days in rows of ten (five on a phone), never weeks, which a calendar of months alone does not have; the days of
|
|
4
|
+
// the story lit, the scenes and deadlines marked, and the day chosen with what it holds, its scenes with their place leading to the Journal. Without a
|
|
5
|
+
// calendar start, the days of the story in the same rows, by their number.
|
|
6
|
+
import { useEffect, useRef, useState } from "preact/hooks";
|
|
7
|
+
import { sectionAddress } from "./address.js";
|
|
8
|
+
import { calendarDateOf, dayMarks, monthAt, monthOffsetOf, storyDays } from "./calendar.js";
|
|
9
|
+
import { CardHead, useMedia } from "./card.js";
|
|
10
|
+
import { calendarDayLabel, calendarMonthLabel, gameDateLabel, seasonLabel } from "./game-words.js";
|
|
11
|
+
import { Icon, iconPath } from "./icons.js";
|
|
12
|
+
import { Deadline } from "./journal.js";
|
|
13
|
+
import { arrowStep, capitalized, isolated, listText, t } from "./text.js";
|
|
14
|
+
export function CalendarTab({ calendar }) {
|
|
15
|
+
const narrow = useMedia("(max-width: 600px)");
|
|
16
|
+
const row = narrow ? 5 : 10;
|
|
17
|
+
const [offset, setOffset] = useState(0);
|
|
18
|
+
const [chosen, setChosen] = useState(calendar.today ?? 1);
|
|
19
|
+
const grid = useRef(null);
|
|
20
|
+
const keyed = useRef(false);
|
|
21
|
+
const month = monthAt(calendar, offset);
|
|
22
|
+
const days = month === undefined ? storyDays(calendar, row) : Array.from({ length: month.days }, (_, index) => month.first + index);
|
|
23
|
+
// A day chosen with the keys takes the focus, in this month or the next one the arrows went to.
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
if (keyed.current) {
|
|
26
|
+
keyed.current = false;
|
|
27
|
+
grid.current?.querySelector(`[data-day="${chosen}"]`)?.focus();
|
|
28
|
+
}
|
|
29
|
+
}, [chosen, offset]);
|
|
30
|
+
const choose = (day, byKeys = false) => {
|
|
31
|
+
keyed.current = byKeys;
|
|
32
|
+
setChosen(day);
|
|
33
|
+
if (month !== undefined && (day < month.first || day >= month.first + month.days)) {
|
|
34
|
+
setOffset(monthOffsetOf(calendar, day));
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
// The day the keys reach the grid on: the one chosen, or the month's first when it is in another month.
|
|
38
|
+
const focusable = days.includes(chosen) ? chosen : days[0];
|
|
39
|
+
const move = (event) => {
|
|
40
|
+
const across = arrowStep(event.key, true);
|
|
41
|
+
const step = across !== 0 ? across : event.key === "ArrowDown" ? row : event.key === "ArrowUp" ? -row : 0;
|
|
42
|
+
// From the day that has the focus, which may not be the one chosen, as when the chosen day is in another month.
|
|
43
|
+
const from = Number(event.target.dataset.day ?? focusable);
|
|
44
|
+
const to = event.key === "Home" ? days[0] : event.key === "End" ? days.at(-1) : step === 0 ? undefined : from + step;
|
|
45
|
+
if (to !== undefined && (month !== undefined || days.includes(to))) {
|
|
46
|
+
event.preventDefault();
|
|
47
|
+
choose(to, true);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
const backToday = () => {
|
|
51
|
+
setOffset(0);
|
|
52
|
+
setChosen(calendar.today ?? 1);
|
|
53
|
+
};
|
|
54
|
+
return (_jsxs("div", { class: "calendar", children: [_jsxs("div", { class: "calendar-side", children: [_jsx(Today, { calendar: calendar }), calendar.deadlines.length > 0 && _jsx(Deadlines, { calendar: calendar })] }), _jsxs("section", { class: "card calendar-month", "aria-labelledby": "calendar-month-title", children: [_jsx(CardHead, { icon: iconPath("calendar"), title: _jsx("h3", { id: "calendar-month-title", class: "calendar-month-name", children: month === undefined ? t("The days of the story") : calendarMonthLabel(month.name, month.year) }), children: month !== undefined && (_jsxs("span", { class: "calendar-steps", children: [(offset !== 0 || chosen !== calendar.today) && _jsx("button", { type: "button", class: "button quiet", onClick: backToday, children: t("Today") }), _jsx("button", { type: "button", class: "icon-button calendar-back", "aria-label": t("Previous month"), "data-tip": t("Previous month"), onClick: () => setOffset(offset - 1), children: _jsx(Icon, { name: "fold" }) }), _jsx("button", { type: "button", class: "icon-button tip-left", "aria-label": t("Next month"), "data-tip": t("Next month"), onClick: () => setOffset(offset + 1), children: _jsx(Icon, { name: "fold" }) })] })) }), _jsxs("div", { class: "card-body", children: [month !== undefined && _jsx(Year, { calendar: calendar, month: month }), _jsx("div", { class: `calendar-days rows-${row}`, role: "group", "aria-label": t("Days"), ref: grid, onKeyDown: move, children: days.map((day) => (_jsx(DayCell, { calendar: calendar, day: day, label: month === undefined ? day : day - month.first + 1, chosen: day === chosen, focusable: day === focusable, onChoose: () => choose(day) }, day))) }), _jsxs("p", { class: "calendar-key", "aria-hidden": "true", children: [_jsx("span", { class: "calendar-key-today", children: t("Today") }), _jsx("span", { class: "calendar-key-lived", children: t("Days of the story") }), _jsx("span", { class: "calendar-key-scene", children: t("Scene") }), _jsxs("span", { class: "calendar-key-deadline", children: [_jsx(Icon, { name: "hourglass" }), t("Deadline")] })] }), _jsx(DayDetails, { calendar: calendar, day: chosen })] })] })] }));
|
|
55
|
+
}
|
|
56
|
+
/** Today, large: the day of the calendar with its season, or the game's day; the game's date and hour under it. */
|
|
57
|
+
function Today({ calendar }) {
|
|
58
|
+
const date = calendar.today === undefined ? undefined : calendarDateOf(calendar, calendar.today);
|
|
59
|
+
return (_jsxs("section", { class: "card calendar-today", "aria-labelledby": "calendar-today-title", children: [_jsx(CardHead, { icon: iconPath("clock"), title: _jsx("h3", { id: "calendar-today-title", children: t("Today") }) }), _jsx("div", { class: "card-body", children: calendar.now === undefined ? _jsx("p", { class: "browse-none", children: t("The story has no date yet: the master sets it when the play begins.") }) : (_jsxs(_Fragment, { children: [_jsx("p", { class: "calendar-date", children: date === undefined ? capitalized(gameDateLabel(`day ${calendar.today}`)) : calendarDayLabel({ day: date.day, month: date.name, ...(date.year === undefined ? {} : { year: date.year }) }) }), _jsxs("p", { class: "calendar-now", children: [date?.season !== undefined && _jsx(Season, { season: date.season }), _jsx("span", { children: date === undefined ? /\d{1,2}:\d{2}/.exec(calendar.now)?.[0] : capitalized(gameDateLabel(calendar.now)) })] })] })) })] }));
|
|
60
|
+
}
|
|
61
|
+
/** The deadlines the character knows, the soonest first: the quest, the day it falls on, the time left; each leads to the quests in the Journal. */
|
|
62
|
+
function Deadlines({ calendar }) {
|
|
63
|
+
return (_jsxs("section", { class: "card", "aria-labelledby": "calendar-deadlines-title", children: [_jsx(CardHead, { icon: iconPath("hourglass"), title: _jsx("h3", { id: "calendar-deadlines-title", children: t("Deadlines") }) }), _jsx("ul", { class: "calendar-deadlines", children: calendar.deadlines.map((deadline) => (_jsx("li", { children: _jsxs("a", { class: deadline.main ? "calendar-deadline main" : "calendar-deadline", href: sectionAddress("journal", "quests"), children: [_jsxs("span", { class: "browse-words", children: [_jsx("span", { class: "browse-name", children: deadline.quest }), _jsx("span", { class: "browse-meta", children: [deadline.main ? t("Main quest") : undefined, dayName(calendar, deadline.day)].filter((part) => part !== undefined).join(" · ") })] }), _jsx(Deadline, { deadline: deadline })] }) }, deadline.quest))) })] }));
|
|
64
|
+
}
|
|
65
|
+
/** The months of the year as a ribbon, each as long as its days and in its season's colour; the month shown raised, today's with a dot. */
|
|
66
|
+
function Year({ calendar, month }) {
|
|
67
|
+
const months = calendar.months ?? [];
|
|
68
|
+
return (_jsxs("div", { class: "calendar-year", "aria-hidden": "true", children: [months.map((one, index) => (_jsx("span", { class: ["calendar-year-month", `season-${seasonClass(one.season)}`, index === month.month ? "shown" : "", index === calendar.date?.month ? "now" : ""].filter((name) => name !== "").join(" "), style: { flexGrow: String(one.days) } }, index))), month.season !== undefined && _jsx(Season, { season: month.season })] }));
|
|
69
|
+
}
|
|
70
|
+
/** A day of the grid: its number, today ringed, the story's days lit, a dot for each scene, the hourglass of a deadline; its words for a screen reader. */
|
|
71
|
+
function DayCell({ calendar, day, label, chosen, focusable, onChoose }) {
|
|
72
|
+
const marks = dayMarks(calendar, day);
|
|
73
|
+
const classes = ["calendar-day", marks.today ? "today" : "", marks.lived ? "lived" : "", day < 1 ? "before" : "", marks.deadlines.length > 0 ? "due" : ""].filter((name) => name !== "").join(" ");
|
|
74
|
+
const words = [
|
|
75
|
+
dayName(calendar, day),
|
|
76
|
+
marks.today ? t("today") : undefined,
|
|
77
|
+
marks.scenes.length === 0 ? undefined : marks.scenes.length === 1 ? t("1 scene") : t("{count} scenes", { count: marks.scenes.length }),
|
|
78
|
+
marks.deadlines.length === 0 ? undefined : t("deadline of {quests}", { quests: listText(marks.deadlines.map((deadline) => deadline.quest)) }),
|
|
79
|
+
].filter((part) => part !== undefined);
|
|
80
|
+
return (_jsxs("button", { type: "button", class: classes, "data-day": day, "aria-pressed": chosen, "aria-label": words.join(", "), tabIndex: focusable ? 0 : -1, onClick: onChoose, children: [_jsx("span", { class: "calendar-day-number num", "aria-hidden": "true", children: label }), _jsxs("span", { class: "calendar-day-marks", "aria-hidden": "true", children: [marks.scenes.slice(0, 3).map((scene) => _jsx("span", { class: "calendar-scene-dot" }, scene.number)), marks.deadlines.length > 0 && _jsx(Icon, { name: "hourglass" })] })] }));
|
|
81
|
+
}
|
|
82
|
+
/** What the chosen day holds: its name, its deadlines and its scenes, each scene leading to its chapter in the Journal. */
|
|
83
|
+
function DayDetails({ calendar, day }) {
|
|
84
|
+
const marks = dayMarks(calendar, day);
|
|
85
|
+
const empty = marks.scenes.length === 0 && marks.deadlines.length === 0;
|
|
86
|
+
return (_jsxs("div", { class: "calendar-chosen", children: [_jsxs("h4", { class: "calendar-chosen-title", children: [capitalized(dayName(calendar, day)), marks.today && _jsx("span", { class: "eyebrow accent calendar-chosen-now", children: t("Today") })] }), empty && _jsx("p", { class: "browse-none", children: day > (calendar.today ?? 1) ? t("Nothing your character knows of is due on this day.") : t("No scene of the story on this day.") }), !empty && (_jsxs("ul", { class: "calendar-chosen-list", children: [marks.deadlines.map((deadline) => (_jsx("li", { children: _jsxs("a", { class: "calendar-line", href: sectionAddress("journal", "quests"), children: [_jsx(Icon, { name: "hourglass" }), _jsx("span", { children: t("Deadline of {quest}", { quest: isolated(deadline.quest) }) })] }) }, deadline.quest))), marks.scenes.map((scene) => (_jsx("li", { children: _jsxs("a", { class: "calendar-line", href: sectionAddress("journal", "story", String(scene.number)), children: [_jsx(Icon, { name: "journal" }), _jsxs("span", { class: "calendar-scene", children: [_jsxs("span", { children: [_jsx("span", { class: "calendar-chapter", children: t("Chapter {number}", { number: scene.number }) }), ` ${scene.title}`] }), scene.place !== undefined && _jsx("span", { class: "calendar-scene-place", children: scene.place })] })] }) }, scene.number)))] }))] }));
|
|
87
|
+
}
|
|
88
|
+
/** A season by its word, after a dot of its colour. */
|
|
89
|
+
function Season({ season }) {
|
|
90
|
+
return (_jsxs("span", { class: `calendar-season season-${seasonClass(season)}`, children: [_jsx("span", { class: "calendar-season-dot", "aria-hidden": "true" }), seasonLabel(season)] }));
|
|
91
|
+
}
|
|
92
|
+
/** A game day by its name: the day of the calendar with its game day, as 30 October 1491 · day 3, or day 3 without a calendar start. */
|
|
93
|
+
function dayName(calendar, day) {
|
|
94
|
+
const date = calendarDateOf(calendar, day);
|
|
95
|
+
const game = day >= 1 ? gameDateLabel(`day ${day}`) : undefined;
|
|
96
|
+
return date === undefined ? game ?? "" : [calendarDayLabel({ day: date.day, month: date.name, ...(date.year === undefined ? {} : { year: date.year }) }), game].filter((part) => part !== undefined).join(" · ");
|
|
97
|
+
}
|
|
98
|
+
/** The four seasons have their colours; any other season is plain. */
|
|
99
|
+
function seasonClass(season) {
|
|
100
|
+
return season !== undefined && ["winter", "spring", "summer", "autumn"].includes(season) ? season : "other";
|
|
101
|
+
}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useState } from "preact/hooks";
|
|
3
|
+
import { sectionAddress } from "./address.js";
|
|
4
|
+
import { pictureAddress, readView } from "./api.js";
|
|
5
|
+
import { useMedia } from "./card.js";
|
|
6
|
+
import { Icon } from "./icons.js";
|
|
7
|
+
import { documentLook, foundLore, groupedLore, knownTo, loreGroupOf } from "./lore.js";
|
|
8
|
+
import { placeKindLabel, placeKinds } from "./map-symbols.js";
|
|
9
|
+
import { knowersOf, Markdown, plainLine } from "./markdown.js";
|
|
10
|
+
import { Token } from "./party.js";
|
|
11
|
+
import { arrowStep, capitalized, foldedText, t } from "./text.js";
|
|
12
|
+
// From this width the reader stands beside the list.
|
|
13
|
+
const wide = "(min-width: 900px)";
|
|
14
|
+
/**
|
|
15
|
+
* The pages the character knows: the list by kind with its search, and the one open, read again as the game changes (`version`). `onMap` is the address of a
|
|
16
|
+
* place on the world map, or of the nearest that holds it. With more than one player character (`players`), a chip for each among the kinds shows what that
|
|
17
|
+
* one knows (D-480 (7)).
|
|
18
|
+
*/
|
|
19
|
+
export function LoreTab({ world, version, open, onMap, players = [] }) {
|
|
20
|
+
const [search, setSearch] = useState("");
|
|
21
|
+
// A kind of page, or a player character's name after "@".
|
|
22
|
+
const [filter, setFilter] = useState();
|
|
23
|
+
const besides = useMedia(wide);
|
|
24
|
+
const found = foundLore(world.known, search);
|
|
25
|
+
const kept = (entry, key) => key === undefined || (key.startsWith("@") ? knownTo(entry, key.slice(1)) : loreGroupOf(entry) === key);
|
|
26
|
+
const shownFilter = filter !== undefined && found.some((entry) => kept(entry, filter)) ? filter : undefined;
|
|
27
|
+
const listed = found.filter((entry) => kept(entry, shownFilter));
|
|
28
|
+
const groups = groupedLore(listed);
|
|
29
|
+
const each = players.length > 1 ? players : [];
|
|
30
|
+
// A name the address gives that the character does not know: said so over the list.
|
|
31
|
+
const asked = world.known.find((one) => one.name === open);
|
|
32
|
+
const entry = asked ?? (besides ? groups[0]?.entries[0] : undefined);
|
|
33
|
+
const link = linksOf(world);
|
|
34
|
+
if (world.known.length === 0) {
|
|
35
|
+
return _jsx("p", { class: "browse-none", children: t("Your character knows no one and nothing yet: whom they meet and what they learn comes here, as the master writes it.") });
|
|
36
|
+
}
|
|
37
|
+
return (_jsxs(Browse, { open: entry?.name, explicit: asked !== undefined, back: sectionAddress("world", "lore"), backLabel: t("All you know"), children: [_jsxs("div", { class: "browse-list", children: [open !== undefined && asked === undefined && _jsx("p", { class: "browse-none", role: "status", children: t("Your character knows nothing called “{name}”.", { name: open }) }), _jsx("div", { class: "browse-find", children: _jsxs("span", { class: "search", children: [_jsx(Icon, { name: "search" }), _jsx("input", { type: "search", value: search, placeholder: t("Search"), "aria-label": t("Search what your character knows"), onInput: (event) => setSearch(event.currentTarget.value) })] }) }), (groupedLore(world.known).length > 1 || each.length > 0) && (_jsx(FilterChips, { label: t("Kinds"), chosen: shownFilter, onChoose: setFilter, all: found.length, options: [
|
|
38
|
+
...groupedLore(found).map((part) => ({ key: part.group, name: groupLabel(part.group), count: part.entries.length })),
|
|
39
|
+
...each.map((member) => ({ key: `@${member.name}`, name: member.name, count: found.filter((entry) => knownTo(entry, member.name)).length, member })),
|
|
40
|
+
] })), found.length === 0 && (_jsxs("p", { class: "browse-none", role: "status", children: [t("Nothing your character knows matches “{search}”.", { search }), " ", _jsx("button", { type: "button", class: "button quiet", onClick: () => setSearch(""), children: t("Clear the search") })] })), groups.map((part) => (_jsxs("section", { class: "browse-group", "aria-labelledby": `lore-${part.group}`, children: [_jsxs("h3", { class: "eyebrow", id: `lore-${part.group}`, children: [groupLabel(part.group), _jsx("span", { class: "browse-count num", children: part.entries.length })] }), _jsx("ul", { class: "browse-rows", children: part.entries.map((one, index) => (_jsx("li", { children: _jsxs("a", { class: "browse-row", href: sectionAddress("world", "lore", one.name), "aria-current": one.name === entry?.name ? "true" : undefined, "aria-describedby": `lore-${part.group}-${index}`, "data-name": one.name, children: [_jsx(LoreThumb, { entry: one }), _jsxs("span", { class: "browse-words", children: [_jsx("span", { class: "browse-name", children: one.name }), _jsx("span", { class: "browse-meta", id: `lore-${part.group}-${index}`, children: entryMeta(one) })] })] }) }, one.name))) })] }, part.group)))] }), entry !== undefined && (_jsx(LoreReader, { entry: entry, version: version, link: link, several: each.length > 0, onMap: entry.type === "place" ? onMap([entry.name, ...entry.within ?? []]) : undefined, focus: asked !== undefined }, entry.name))] }));
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The documents the character has or read: those it carries, then the others; the one open on its paper, as what it is. With more than one player character
|
|
44
|
+
* (`players`), a group for each who carries some, by name (D-480 (7)).
|
|
45
|
+
*/
|
|
46
|
+
export function DocumentsTab({ world, open, players = [] }) {
|
|
47
|
+
const besides = useMedia(wide);
|
|
48
|
+
const asked = world.documents.find((one) => one.name === open);
|
|
49
|
+
const document = asked ?? (besides ? world.documents[0] : undefined);
|
|
50
|
+
const link = linksOf(world);
|
|
51
|
+
if (world.documents.length === 0) {
|
|
52
|
+
return _jsx("p", { class: "browse-none", children: t("No documents yet: the letters, notices and pages your character finds or reads come here, to read again.") });
|
|
53
|
+
}
|
|
54
|
+
const several = players.length > 1;
|
|
55
|
+
const carriers = several ? players.map((member) => member.name) : [];
|
|
56
|
+
const parts = [
|
|
57
|
+
...carriers.map((name, index) => ({ key: `carried-${index}`, name: t("With {name}", { name }), documents: world.documents.filter((one) => one.carried && one.carrier === name) })),
|
|
58
|
+
{ key: "carried", name: t("With you"), documents: world.documents.filter((one) => one.carried && (one.carrier === undefined || !carriers.includes(one.carrier))) },
|
|
59
|
+
{ key: "read", name: t("Read elsewhere"), documents: world.documents.filter((one) => !one.carried) },
|
|
60
|
+
].filter((part) => part.documents.length > 0);
|
|
61
|
+
return (_jsxs(Browse, { open: document?.name, explicit: asked !== undefined, back: sectionAddress("world", "documents"), backLabel: t("All documents"), children: [_jsxs("div", { class: "browse-list", children: [open !== undefined && asked === undefined && _jsx("p", { class: "browse-none", role: "status", children: t("Your character has no document called “{name}”.", { name: open }) }), parts.map((part) => (_jsxs("section", { class: "browse-group", "aria-labelledby": `documents-${part.key}`, children: [_jsxs("h3", { class: "eyebrow", id: `documents-${part.key}`, children: [part.name, _jsx("span", { class: "browse-count num", children: part.documents.length })] }), _jsx("ul", { class: "browse-rows", children: part.documents.map((one, index) => (_jsx("li", { children: _jsxs("a", { class: "browse-row", href: sectionAddress("world", "documents", one.name), "aria-current": one.name === document?.name ? "true" : undefined, "aria-describedby": `documents-${part.key}-${index}`, "data-name": one.name, children: [_jsx("span", { class: `browse-thumb paper-thumb look-${documentLook(one.document)}`, "aria-hidden": "true", children: _jsx(DocumentGlyph, { look: documentLook(one.document) }) }), _jsxs("span", { class: "browse-words", children: [_jsx("span", { class: "browse-name", children: one.name }), _jsx("span", { class: "browse-meta", id: `documents-${part.key}-${index}`, children: [documentLabel(one.document), plainLine(one.text)].filter((part) => part !== undefined).join(" · ") })] })] }) }, one.name))) })] }, part.key)))] }), document !== undefined && _jsx(DocumentReader, { document: document, link: link, focus: asked !== undefined, several: several }, document.name)] }));
|
|
62
|
+
}
|
|
63
|
+
/** Whether a document is carried, in words: by the player's character, or with more than one by the one named, as its group says; nothing of one read elsewhere. */
|
|
64
|
+
function carriedWords(document, several) {
|
|
65
|
+
if (!several) {
|
|
66
|
+
return document.carried ? t("You carry it") : t("You read it");
|
|
67
|
+
}
|
|
68
|
+
return document.carried && document.carrier !== undefined ? t("With {name}", { name: document.carrier }) : undefined;
|
|
69
|
+
}
|
|
70
|
+
/** A document in the page's language, by what it is: Letter; one the page does not know as its own word. */
|
|
71
|
+
function documentLabel(document) {
|
|
72
|
+
const labels = {
|
|
73
|
+
letter: t("Letter"),
|
|
74
|
+
note: t("Note"),
|
|
75
|
+
notice: t("Notice"),
|
|
76
|
+
page: t("Page"),
|
|
77
|
+
book: t("Book"),
|
|
78
|
+
diary: t("Diary"),
|
|
79
|
+
journal: t("Diary"),
|
|
80
|
+
map: t("Map"),
|
|
81
|
+
scroll: t("Scroll"),
|
|
82
|
+
inscription: t("Inscription"),
|
|
83
|
+
};
|
|
84
|
+
const word = document.trim();
|
|
85
|
+
return labels[word.toLowerCase()] ?? capitalized(word);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* The list and its reader: side by side on a wide screen; under it the reader in the list's place once a page is open, with the way back at its top. Back from
|
|
89
|
+
* a page, the focus goes to its row.
|
|
90
|
+
*/
|
|
91
|
+
function Browse({ open, explicit, back, backLabel, children }) {
|
|
92
|
+
const box = useRef(null);
|
|
93
|
+
const last = useRef();
|
|
94
|
+
useEffect(() => {
|
|
95
|
+
if (explicit) {
|
|
96
|
+
last.current = open;
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
const row = last.current === undefined ? undefined : [...box.current?.querySelectorAll(".browse-row") ?? []].find((one) => one.dataset.name === last.current);
|
|
100
|
+
last.current = undefined;
|
|
101
|
+
if (row !== undefined) {
|
|
102
|
+
row.focus({ preventScroll: true });
|
|
103
|
+
row.scrollIntoView({ block: "center" });
|
|
104
|
+
}
|
|
105
|
+
}, [open, explicit]);
|
|
106
|
+
return (_jsxs("div", { class: explicit ? "browse open" : "browse", ref: box, children: [explicit && (_jsxs("a", { class: "browse-back button quiet", href: back, children: [_jsx(Icon, { name: "fold" }), backLabel] })), children] }));
|
|
107
|
+
}
|
|
108
|
+
/** A page the character knows, read whole as it knows it: its picture, what it is and where, its text with its links, and where it leads on the page. */
|
|
109
|
+
function LoreReader({ entry, version, link, onMap, focus, several }) {
|
|
110
|
+
const [text, setText] = useState();
|
|
111
|
+
// Who knows each secret, when not all the player characters do: said after its title, the one place the page names them (D-480 (7)).
|
|
112
|
+
const [knowers, setKnowers] = useState([]);
|
|
113
|
+
const [problem, setProblem] = useState(false);
|
|
114
|
+
const reads = useRef(0);
|
|
115
|
+
const title = useRef(null);
|
|
116
|
+
// Its whole text, read when it opens and again as the game changes, the last reading alone; the opening the list has until then.
|
|
117
|
+
useEffect(() => {
|
|
118
|
+
const reading = ++reads.current;
|
|
119
|
+
readView(entry.name).then((page) => {
|
|
120
|
+
if (reading === reads.current) {
|
|
121
|
+
setText(page.kind === "page" ? page.text : "");
|
|
122
|
+
setKnowers(page.kind === "page" ? page.knownBy ?? [] : []);
|
|
123
|
+
setProblem(false);
|
|
124
|
+
}
|
|
125
|
+
}, () => reading === reads.current && text === undefined && setProblem(true));
|
|
126
|
+
}, [entry.name, version]);
|
|
127
|
+
useOpened(title, focus);
|
|
128
|
+
const person = entry.type === "character" || entry.type === "creature";
|
|
129
|
+
const banner = entry.picture !== undefined && !person;
|
|
130
|
+
return (_jsxs("article", { class: "browse-reader", "aria-labelledby": "reader-title", children: [banner && _jsx("img", { class: "reader-banner", src: pictureAddress(entry.picture), alt: "" }), _jsxs("header", { class: "reader-head", children: [person && _jsx(Token, { member: { name: entry.name, image: entry.picture, role: entry.companion ? "companion" : "other" }, large: true, ...(entry.companion ? { side: "ally" } : {}) }), _jsxs("div", { children: [_jsx("p", { class: "eyebrow", children: entryKind(entry) }), _jsx("h3", { id: "reader-title", tabIndex: -1, ref: title, children: entry.name }), entry.within !== undefined && (_jsxs("p", { class: "reader-where", children: [_jsx(Icon, { name: "place" }), _jsx("span", { class: "reader-path", children: entry.within.toReversed().map((place, index) => (_jsxs("span", { children: [index > 0 && _jsx("span", { class: "reader-step", "aria-hidden": "true" }), _jsx("a", { class: "md-link", href: sectionAddress("world", "lore", place), children: place })] }, place))) })] }))] })] }), (onMap !== undefined || entry.companion) && (_jsxs("p", { class: "reader-actions", children: [onMap !== undefined && (_jsxs("a", { class: "button package-button", href: onMap, children: [_jsx(Icon, { name: "world" }), t("Show on the map")] })), entry.companion && (_jsxs("a", { class: "button package-button", href: `#/party/${encodeURIComponent(entry.name)}`, children: [_jsx(Icon, { name: "party" }), t("Open the sheet")] }))] })), _jsxs("div", { class: "reader-text", children: [text === undefined && !problem && entry.summary !== "" && _jsx(Markdown, { text: entry.summary, link: link }), text !== undefined && text.trim() !== "" && _jsx(Markdown, { text: text, link: link, secretKnowers: several ? knowersOf(knowers) : undefined }), ((text !== undefined && text.trim() === "") || (text === undefined && entry.summary === "")) && !problem && (_jsx("p", { class: "browse-none", children: text === undefined ? t("Reading…") : t("Your character knows its name, and nothing more yet.") })), problem && _jsx("p", { class: "browse-none", children: t("This page could not be read now: try again in a moment.") })] })] }));
|
|
131
|
+
}
|
|
132
|
+
/** A document on its paper, as what it is: a letter, a notice, a torn page; its picture first, larger at a click, for a map above all. */
|
|
133
|
+
function DocumentReader({ document, link, focus, several }) {
|
|
134
|
+
const title = useRef(null);
|
|
135
|
+
const look = documentLook(document.document);
|
|
136
|
+
useOpened(title, focus);
|
|
137
|
+
return (_jsxs("article", { class: "browse-reader", "aria-labelledby": "reader-title", children: [_jsx("header", { class: "reader-head", children: _jsxs("div", { children: [_jsx("p", { class: "eyebrow", children: [documentLabel(document.document), carriedWords(document, several)].filter((part) => part !== undefined).join(" · ") }), _jsx("h3", { id: "reader-title", tabIndex: -1, ref: title, children: document.name })] }) }), _jsxs("div", { class: `paper look-${look}`, children: [_jsx("span", { class: "paper-mark", "aria-hidden": "true" }), document.picture !== undefined && (_jsx("a", { class: "paper-picture", href: pictureAddress(document.picture), target: "_blank", rel: "noreferrer", children: _jsx("img", { src: pictureAddress(document.picture), alt: t("{name}, as drawn", { name: document.name }) }) })), document.text.trim() !== "" && _jsx(Markdown, { text: document.text, link: link })] })] }));
|
|
138
|
+
}
|
|
139
|
+
/** A row of filter chips: All, then each option with its count; one stop of Tab, the arrows along it. */
|
|
140
|
+
function FilterChips({ label, options, chosen, all, onChoose }) {
|
|
141
|
+
const row = useRef(null);
|
|
142
|
+
const move = (event) => {
|
|
143
|
+
const buttons = [...row.current?.querySelectorAll("button") ?? []];
|
|
144
|
+
const at = buttons.indexOf(event.target);
|
|
145
|
+
const step = arrowStep(event.key, true);
|
|
146
|
+
const to = event.key === "Home" ? 0 : event.key === "End" ? buttons.length - 1 : step === 0 ? -1 : (at + step + buttons.length) % buttons.length;
|
|
147
|
+
if (to >= 0) {
|
|
148
|
+
event.preventDefault();
|
|
149
|
+
buttons[to]?.focus();
|
|
150
|
+
buttons[to]?.click();
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
const chip = (key, name, count, member) => (_jsxs("button", { type: "button", class: member === undefined ? undefined : "with-token", "aria-pressed": chosen === key, tabIndex: chosen === key ? 0 : -1, onClick: () => onChoose(key), children: [member !== undefined && _jsx(Token, { member: member }), name, _jsx("span", { class: "package-count", children: count })] }, key ?? ""));
|
|
154
|
+
return (_jsxs("div", { class: "filter-chips", role: "group", "aria-label": label, ref: row, onKeyDown: move, children: [chip(undefined, t("All"), all), options.map((option) => chip(option.key, option.name, option.count, option.member))] }));
|
|
155
|
+
}
|
|
156
|
+
/** A page's small picture in its row: a person's token, a place's picture or the mark of its kind, else the first letter of its name. */
|
|
157
|
+
function LoreThumb({ entry }) {
|
|
158
|
+
if (entry.type === "character" || entry.type === "creature") {
|
|
159
|
+
return _jsx(Token, { member: { name: entry.name, image: entry.picture, role: entry.companion ? "companion" : "other" }, ...(entry.companion ? { side: "ally" } : {}) });
|
|
160
|
+
}
|
|
161
|
+
if (entry.picture !== undefined) {
|
|
162
|
+
return (_jsx("span", { class: "browse-thumb", "aria-hidden": "true", children: _jsx("img", { src: pictureAddress(entry.picture), alt: "", loading: "lazy" }) }));
|
|
163
|
+
}
|
|
164
|
+
const kind = entry.kind === undefined ? undefined : placeKinds[entry.kind];
|
|
165
|
+
return (_jsx("span", { class: `browse-thumb mark ${loreGroupOf(entry)}`, "aria-hidden": "true", children: kind === undefined ? _jsx("span", { class: "browse-letter", children: [...entry.name][0]?.toUpperCase() }) : (_jsx("svg", { viewBox: "0 0 24 24", children: _jsx("path", { d: kind.glyph }) })) }));
|
|
166
|
+
}
|
|
167
|
+
/** A document's drawing in its row: an envelope, a nailed sheet, an open book, a map… */
|
|
168
|
+
function DocumentGlyph({ look }) {
|
|
169
|
+
const glyphs = {
|
|
170
|
+
letter: "M3.5 6.5h17v11h-17Z M3.5 6.5 12 13l8.5-6.5",
|
|
171
|
+
note: "M6 3.5h8.5L18 7v13.5H6Z M14.5 3.5V7H18 M9 11h6 M9 14.5h6 M9 18h3.5",
|
|
172
|
+
notice: "M5.5 6h13v14.5h-13Z M12 3v5 M8.5 11.5h7 M8.5 14.5h7 M8.5 17.5h4.5",
|
|
173
|
+
page: "M12 6.5C10 5 7 4.5 3.5 5v13.5C7 18 10 18.5 12 20c2-1.5 5-2 8.5-1.5V5C17 4.5 14 5 12 6.5Z M12 6.5V20",
|
|
174
|
+
diary: "M6.5 3.5h11v17h-11Z M9.5 3.5v17 M14 3.5v6l1.5-1.2 1.5 1.2v-6",
|
|
175
|
+
map: "M3.5 6.5 9 4.5l6 2 5.5-2v13l-5.5 2-6-2-5.5 2Z M9 4.5v13 M15 6.5v13",
|
|
176
|
+
scroll: "M7 4.5h10.5a2 2 0 0 1 0 4H7 M7 4.5a2 2 0 0 0 0 4v9.5a2 2 0 0 0 2 2h10 M17.5 8.5v11.5 M10 12h5 M10 15.5h5",
|
|
177
|
+
inscription: "M6 20.5V9a6 6 0 0 1 12 0v11.5Z M9 11h6 M9 14h6 M9 17h4",
|
|
178
|
+
plain: "M6 3.5h12v17H6Z M9 8h6 M9 12h6 M9 16h4",
|
|
179
|
+
};
|
|
180
|
+
return (_jsx("svg", { viewBox: "0 0 24 24", children: _jsx("path", { d: glyphs[look] ?? glyphs.plain }) }));
|
|
181
|
+
}
|
|
182
|
+
/** The opened page's title takes the focus when the player opened it, so that a screen reader reads it; on a phone the page goes back to its top. */
|
|
183
|
+
function useOpened(title, focus) {
|
|
184
|
+
useEffect(() => {
|
|
185
|
+
if (!focus) {
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
title.current?.focus({ preventScroll: true });
|
|
189
|
+
if (!matchMedia(wide).matches) {
|
|
190
|
+
title.current?.closest(".browse")?.scrollIntoView({ block: "start" });
|
|
191
|
+
}
|
|
192
|
+
}, [focus]);
|
|
193
|
+
}
|
|
194
|
+
/** Where a link of a text leads: a page the character knows to its reader, a document to its paper; any other stays words. */
|
|
195
|
+
function linksOf(world) {
|
|
196
|
+
// By the name without case and accents, as a link of Obsidian finds its page.
|
|
197
|
+
const known = new Map(world.known.map((entry) => [foldedText(entry.name), entry.name]));
|
|
198
|
+
const documents = new Map(world.documents.map((document) => [foldedText(document.name), document.name]));
|
|
199
|
+
return (name) => {
|
|
200
|
+
const page = known.get(foldedText(name));
|
|
201
|
+
const document = documents.get(foldedText(name));
|
|
202
|
+
return page !== undefined ? sectionAddress("world", "lore", page) : document !== undefined ? sectionAddress("world", "documents", document) : undefined;
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
/** What a page is, in the reader's eyebrow: a companion, a person, the kind of a place, a faction… */
|
|
206
|
+
function entryKind(entry) {
|
|
207
|
+
if (entry.companion) {
|
|
208
|
+
return t("Companion");
|
|
209
|
+
}
|
|
210
|
+
const kinds = { character: t("Person"), faction: t("Faction"), creature: t("Creature"), item: t("Item"), event: t("Event"), topic: t("Topic") };
|
|
211
|
+
return entry.type === "place" ? placeKindLabel(entry.kind) ?? t("Place") : kinds[entry.type] ?? capitalized(entry.type);
|
|
212
|
+
}
|
|
213
|
+
/** A row's line under the name: what the page is, then the opening of its text, or for a place where it is. */
|
|
214
|
+
function entryMeta(entry) {
|
|
215
|
+
const opening = plainLine(entry.summary);
|
|
216
|
+
const where = entry.within?.[0];
|
|
217
|
+
return [entryKind(entry), opening ?? where].filter((part) => part !== undefined && part !== "").join(" · ");
|
|
218
|
+
}
|
|
219
|
+
/** A group of the list in the page's language. */
|
|
220
|
+
function groupLabel(group) {
|
|
221
|
+
const labels = {
|
|
222
|
+
people: t("People"),
|
|
223
|
+
places: t("Places"),
|
|
224
|
+
factions: t("Factions"),
|
|
225
|
+
creatures: t("Creatures"),
|
|
226
|
+
items: t("Items"),
|
|
227
|
+
tales: t("Tales and events"),
|
|
228
|
+
other: t("Other"),
|
|
229
|
+
};
|
|
230
|
+
return labels[group];
|
|
231
|
+
}
|