rpg-engine 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/adventures/index.d.ts +3 -0
- package/dist/adventures/index.js +5 -0
- package/dist/adventures/manifest.d.ts +39 -0
- package/dist/adventures/manifest.js +89 -0
- package/dist/adventures/placement.d.ts +4 -0
- package/dist/adventures/placement.js +14 -0
- package/dist/adventures/source.d.ts +21 -0
- package/dist/adventures/source.js +108 -0
- package/dist/bell-listener.d.ts +9 -0
- package/dist/bell-listener.js +83 -0
- package/dist/campaign/create-campaign.d.ts +3 -2
- package/dist/campaign/create-campaign.js +5 -5
- package/dist/campaign/host-files.d.ts +23 -6
- package/dist/campaign/host-files.js +130 -40
- package/dist/campaign/index.d.ts +2 -2
- package/dist/campaign/index.js +2 -2
- package/dist/campaign/settings.d.ts +33 -2
- package/dist/campaign/settings.js +49 -12
- package/dist/cli.js +10 -1
- package/dist/command-line.js +20 -2
- package/dist/commands/advance.js +6 -2
- package/dist/commands/ask.d.ts +11 -4
- package/dist/commands/ask.js +249 -23
- package/dist/commands/change.d.ts +29 -0
- package/dist/commands/change.js +260 -41
- package/dist/commands/config.d.ts +6 -3
- package/dist/commands/config.js +179 -79
- package/dist/commands/effect.js +38 -9
- package/dist/commands/game-advance.d.ts +11 -2
- package/dist/commands/game-advance.js +22 -7
- package/dist/commands/game-adventures.d.ts +70 -0
- package/dist/commands/game-adventures.js +418 -0
- package/dist/commands/game-bonds.d.ts +9 -0
- package/dist/commands/game-bonds.js +84 -0
- package/dist/commands/game-catalog.d.ts +36 -0
- package/dist/commands/game-catalog.js +122 -0
- package/dist/commands/game-checks.d.ts +17 -0
- package/dist/commands/game-checks.js +128 -0
- package/dist/commands/game-damage.d.ts +18 -0
- package/dist/commands/game-damage.js +74 -0
- package/dist/commands/game-effects.d.ts +5 -0
- package/dist/commands/game-effects.js +2 -2
- package/dist/commands/game-events.js +8 -4
- package/dist/commands/game-experience.js +2 -2
- package/dist/commands/game-extensions.d.ts +8 -1
- package/dist/commands/game-extensions.js +8 -3
- package/dist/commands/game-grid-moves.d.ts +4 -1
- package/dist/commands/game-grid-moves.js +8 -2
- package/dist/commands/game-hit-dice.d.ts +39 -0
- package/dist/commands/game-hit-dice.js +120 -0
- package/dist/commands/game-import.d.ts +11 -0
- package/dist/commands/game-import.js +154 -0
- package/dist/commands/game-journey.d.ts +6 -2
- package/dist/commands/game-journey.js +17 -6
- package/dist/commands/game-knowledge.d.ts +56 -6
- package/dist/commands/game-knowledge.js +152 -23
- package/dist/commands/game-library.d.ts +112 -0
- package/dist/commands/game-library.js +388 -0
- package/dist/commands/game-limits.d.ts +7 -0
- package/dist/commands/game-limits.js +67 -0
- package/dist/commands/game-mode.js +3 -3
- package/dist/commands/game-moves.d.ts +14 -1
- package/dist/commands/game-moves.js +24 -9
- package/dist/commands/game-recipe-pace.d.ts +6 -0
- package/dist/commands/game-recipe-pace.js +25 -0
- package/dist/commands/game-recipes.js +10 -3
- package/dist/commands/game-reminders.d.ts +3 -3
- package/dist/commands/game-reminders.js +10 -5
- package/dist/commands/game-roads.d.ts +11 -4
- package/dist/commands/game-roads.js +89 -26
- package/dist/commands/game-saves.d.ts +12 -0
- package/dist/commands/game-saves.js +44 -5
- package/dist/commands/game-scene.js +3 -1
- package/dist/commands/game-stacks.d.ts +78 -0
- package/dist/commands/game-stacks.js +198 -0
- package/dist/commands/game-system-code.d.ts +25 -0
- package/dist/commands/game-system-code.js +165 -0
- package/dist/commands/game-thoughts.d.ts +25 -0
- package/dist/commands/game-thoughts.js +57 -0
- package/dist/commands/game-turn-uses.d.ts +33 -0
- package/dist/commands/game-turn-uses.js +137 -0
- package/dist/commands/game-upkeep.d.ts +20 -0
- package/dist/commands/game-upkeep.js +190 -0
- package/dist/commands/game-view-journal.d.ts +14 -1
- package/dist/commands/game-view-journal.js +5 -2
- package/dist/commands/game-view-map.d.ts +3 -0
- package/dist/commands/game-view-map.js +5 -1
- package/dist/commands/game-view-place.d.ts +22 -3
- package/dist/commands/game-view-place.js +61 -24
- package/dist/commands/game-view-world.d.ts +98 -0
- package/dist/commands/game-view-world.js +98 -0
- package/dist/commands/game-voices.d.ts +5 -0
- package/dist/commands/game-voices.js +13 -0
- package/dist/commands/game-widgets.d.ts +66 -0
- package/dist/commands/game-widgets.js +274 -0
- package/dist/commands/game-world.d.ts +8 -1
- package/dist/commands/game-world.js +23 -3
- package/dist/commands/image.js +2 -3
- package/dist/commands/import.d.ts +47 -0
- package/dist/commands/import.js +390 -0
- package/dist/commands/index.js +6 -0
- package/dist/commands/init.js +2 -2
- package/dist/commands/install.js +2 -1
- package/dist/commands/instructions.js +26 -1
- package/dist/commands/mode.js +3 -1
- package/dist/commands/move.d.ts +2 -0
- package/dist/commands/move.js +86 -12
- package/dist/commands/package.d.ts +57 -3
- package/dist/commands/package.js +304 -49
- package/dist/commands/parts.d.ts +3 -0
- package/dist/commands/parts.js +5 -0
- package/dist/commands/problems.js +6 -0
- package/dist/commands/rename.js +3 -0
- package/dist/commands/reveal.js +12 -7
- package/dist/commands/roll.d.ts +2 -0
- package/dist/commands/roll.js +23 -7
- package/dist/commands/route.js +4 -5
- package/dist/commands/rules.d.ts +3 -0
- package/dist/commands/rules.js +38 -6
- package/dist/commands/save.d.ts +1 -1
- package/dist/commands/save.js +2 -2
- package/dist/commands/scene.d.ts +10 -1
- package/dist/commands/scene.js +146 -29
- package/dist/commands/sheet.d.ts +47 -6
- package/dist/commands/sheet.js +179 -33
- package/dist/commands/show.d.ts +33 -0
- package/dist/commands/show.js +19 -2
- package/dist/commands/status.d.ts +9 -3
- package/dist/commands/status.js +59 -17
- package/dist/commands/thoughts.d.ts +11 -0
- package/dist/commands/thoughts.js +54 -0
- package/dist/commands/trade.d.ts +17 -0
- package/dist/commands/trade.js +273 -0
- package/dist/commands/travel.d.ts +2 -0
- package/dist/commands/travel.js +40 -14
- package/dist/commands/validate.js +2 -1
- package/dist/commands/view.d.ts +99 -2
- package/dist/commands/view.js +273 -57
- package/dist/commands/worked-out.d.ts +16 -0
- package/dist/commands/worked-out.js +108 -13
- package/dist/commands/write.d.ts +1 -0
- package/dist/commands/write.js +93 -21
- package/dist/confirm/confirm.d.ts +35 -0
- package/dist/confirm/confirm.js +94 -0
- package/dist/confirm/index.d.ts +1 -0
- package/dist/confirm/index.js +3 -0
- package/dist/core/archive-paths.d.ts +8 -0
- package/dist/core/archive-paths.js +39 -0
- package/dist/core/context.d.ts +127 -5
- package/dist/core/context.js +4 -3
- package/dist/core/download.d.ts +2 -0
- package/dist/core/download.js +31 -0
- package/dist/core/field-kind.d.ts +4 -3
- package/dist/core/field-kind.js +4 -3
- package/dist/core/files.d.ts +10 -0
- package/dist/core/files.js +58 -2
- package/dist/core/formula.d.ts +3 -1
- package/dist/core/formula.js +13 -2
- package/dist/core/progression-rule.d.ts +2 -0
- package/dist/core/version.d.ts +2 -0
- package/dist/core/version.js +7 -0
- package/dist/dashboard/act-names.js +27 -0
- package/dist/dashboard/act-sheet.js +100 -0
- package/dist/dashboard/act-strip.js +49 -0
- package/dist/dashboard/acts.js +140 -0
- package/dist/dashboard/address.js +16 -12
- package/dist/dashboard/api.js +140 -10
- package/dist/dashboard/app.js +370 -41
- package/dist/dashboard/asked.js +297 -19
- package/dist/dashboard/calendar.js +56 -0
- package/dist/dashboard/card.js +13 -12
- package/dist/dashboard/coins.js +13 -0
- package/dist/dashboard/death-save.js +67 -0
- package/dist/dashboard/dice/pool.js +22 -0
- package/dist/dashboard/dice/roller.js +1 -1
- package/dist/dashboard/dice/stage.js +12 -4
- package/dist/dashboard/dice/tray.js +28 -15
- package/dist/dashboard/dying.js +46 -0
- package/dist/dashboard/extension-widgets.js +160 -0
- package/dist/dashboard/game-words.js +33 -4
- package/dist/dashboard/guide/ar.md +105 -100
- package/dist/dashboard/guide/cs.md +111 -106
- package/dist/dashboard/guide/da.md +95 -90
- package/dist/dashboard/guide/de.md +93 -88
- package/dist/dashboard/guide/el.md +110 -105
- package/dist/dashboard/guide/en.md +21 -16
- package/dist/dashboard/guide/es.md +79 -74
- package/dist/dashboard/guide/fi.md +99 -94
- package/dist/dashboard/guide/fr.md +83 -78
- package/dist/dashboard/guide/he.md +109 -104
- package/dist/dashboard/guide/hi.md +103 -98
- package/dist/dashboard/guide/hu.md +113 -108
- package/dist/dashboard/guide/is.md +102 -97
- package/dist/dashboard/guide/it.md +22 -17
- package/dist/dashboard/guide/ja.md +108 -103
- package/dist/dashboard/guide/ko.md +113 -108
- package/dist/dashboard/guide/nb.md +95 -90
- package/dist/dashboard/guide/nl.md +89 -84
- package/dist/dashboard/guide/pl.md +104 -99
- package/dist/dashboard/guide/pt.md +82 -77
- package/dist/dashboard/guide/ro.md +113 -108
- package/dist/dashboard/guide/ru.md +109 -104
- package/dist/dashboard/guide/sv.md +96 -91
- package/dist/dashboard/guide/tr.md +102 -97
- package/dist/dashboard/guide/uk.md +113 -108
- package/dist/dashboard/guide/zh.md +110 -105
- package/dist/dashboard/guide-markdown.js +4 -0
- package/dist/dashboard/help.js +4 -5
- package/dist/dashboard/i18n/ar.json +361 -16
- package/dist/dashboard/i18n/cs.json +361 -16
- package/dist/dashboard/i18n/da.json +361 -16
- package/dist/dashboard/i18n/de.json +361 -16
- package/dist/dashboard/i18n/el.json +361 -16
- package/dist/dashboard/i18n/es.json +361 -16
- package/dist/dashboard/i18n/fi.json +361 -16
- package/dist/dashboard/i18n/fr.json +361 -16
- package/dist/dashboard/i18n/he.json +361 -16
- package/dist/dashboard/i18n/hi.json +361 -16
- package/dist/dashboard/i18n/hu.json +361 -16
- package/dist/dashboard/i18n/is.json +361 -16
- package/dist/dashboard/i18n/it.json +363 -18
- package/dist/dashboard/i18n/ja.json +361 -16
- package/dist/dashboard/i18n/ko.json +361 -16
- package/dist/dashboard/i18n/nb.json +361 -16
- package/dist/dashboard/i18n/nl.json +361 -16
- package/dist/dashboard/i18n/pl.json +361 -16
- package/dist/dashboard/i18n/pt.json +361 -16
- package/dist/dashboard/i18n/ro.json +361 -16
- package/dist/dashboard/i18n/ru.json +361 -16
- package/dist/dashboard/i18n/sv.json +361 -16
- package/dist/dashboard/i18n/tr.json +361 -16
- package/dist/dashboard/i18n/uk.json +361 -16
- package/dist/dashboard/i18n/zh.json +361 -16
- package/dist/dashboard/icons.js +38 -4
- package/dist/dashboard/journal.js +203 -49
- package/dist/dashboard/labels.js +42 -4
- package/dist/dashboard/languages.js +2 -2
- package/dist/dashboard/layout.js +35 -0
- package/dist/dashboard/lore.js +44 -0
- package/dist/dashboard/markdown.js +136 -30
- package/dist/dashboard/master.js +2 -2
- package/dist/dashboard/notes.js +5 -5
- package/dist/dashboard/notices.js +24 -4
- package/dist/dashboard/packages.js +678 -0
- package/dist/dashboard/pages.js +0 -8
- package/dist/dashboard/party.js +17 -4
- package/dist/dashboard/place-map-view.js +47 -9
- package/dist/dashboard/rolls.js +35 -93
- package/dist/dashboard/save-outcome.js +42 -0
- package/dist/dashboard/saves.js +14 -11
- package/dist/dashboard/scene.js +114 -20
- package/dist/dashboard/settings.js +70 -12
- package/dist/dashboard/setup.js +4 -4
- package/dist/dashboard/sheet.js +123 -19
- package/dist/dashboard/spend.js +115 -0
- package/dist/dashboard/status.js +22 -10
- package/dist/dashboard/story.js +6 -6
- package/dist/dashboard/style.css +8047 -3468
- package/dist/dashboard/table.js +145 -0
- package/dist/dashboard/tabs.js +34 -0
- package/dist/dashboard/text.js +19 -1
- package/dist/dashboard/top.js +91 -31
- package/dist/dashboard/turns.js +150 -0
- package/dist/dashboard/widgets.js +21 -14
- package/dist/dashboard/world-calendar.js +101 -0
- package/dist/dashboard/world-lore.js +231 -0
- package/dist/dashboard/world.js +87 -29
- package/dist/dashboard-server.d.ts +10 -1
- package/dist/dashboard-server.js +738 -26
- package/dist/documents/index.d.ts +2 -0
- package/dist/documents/index.js +5 -0
- package/dist/documents/markup.d.ts +10 -0
- package/dist/documents/markup.js +124 -0
- package/dist/documents/ocr.d.ts +9 -0
- package/dist/documents/ocr.js +101 -0
- package/dist/documents/png.d.ts +9 -0
- package/dist/documents/png.js +75 -0
- package/dist/documents/read.d.ts +54 -0
- package/dist/documents/read.js +375 -0
- package/dist/extensions/api.d.ts +91 -9
- package/dist/extensions/extension.d.ts +28 -2
- package/dist/extensions/extension.js +49 -11
- package/dist/extensions/index.d.ts +5 -3
- package/dist/extensions/index.js +4 -2
- package/dist/extensions/packages.d.ts +13 -4
- package/dist/extensions/packages.js +114 -16
- package/dist/extensions/tarball.d.ts +6 -0
- package/dist/extensions/tarball.js +87 -0
- package/dist/extensions/words.d.ts +13 -0
- package/dist/extensions/words.js +42 -0
- package/dist/importer/index.d.ts +1 -0
- package/dist/importer/index.js +3 -0
- package/dist/importer/work.d.ts +132 -0
- package/dist/importer/work.js +306 -0
- package/dist/index.d.ts +3 -1
- package/dist/instructions/index.d.ts +7 -0
- package/dist/instructions/index.js +10 -0
- package/dist/languages/index.d.ts +1 -0
- package/dist/languages/index.js +3 -0
- package/dist/languages/language-pack.d.ts +32 -0
- package/dist/languages/language-pack.js +86 -0
- package/dist/library/books.d.ts +76 -0
- package/dist/library/books.js +378 -0
- package/dist/library/folders.d.ts +11 -0
- package/dist/library/folders.js +70 -0
- package/dist/library/index.d.ts +3 -0
- package/dist/library/index.js +5 -0
- package/dist/library/language.d.ts +2 -0
- package/dist/library/language.js +40 -0
- package/dist/library-reader.d.ts +7 -0
- package/dist/library-reader.js +36 -0
- package/dist/mcp-server.js +90 -7
- package/dist/money/index.d.ts +1 -1
- package/dist/money/index.js +1 -1
- package/dist/money/money.d.ts +6 -0
- package/dist/money/money.js +11 -0
- package/dist/page-words.js +4 -1
- package/dist/pages/check.d.ts +5 -0
- package/dist/pages/check.js +111 -5
- package/dist/pages/containers.d.ts +19 -1
- package/dist/pages/containers.js +50 -7
- package/dist/pages/index.d.ts +8 -5
- package/dist/pages/index.js +8 -5
- package/dist/pages/load.d.ts +11 -0
- package/dist/pages/load.js +69 -0
- package/dist/pages/markdown.d.ts +7 -0
- package/dist/pages/markdown.js +27 -3
- package/dist/pages/page-file.d.ts +2 -0
- package/dist/pages/page-file.js +28 -5
- package/dist/pages/rename-page.js +3 -2
- package/dist/pages/stack-entry.d.ts +47 -0
- package/dist/pages/stack-entry.js +83 -0
- package/dist/pages/stack-writes.d.ts +22 -0
- package/dist/pages/stack-writes.js +128 -0
- package/dist/pages/stacks.d.ts +52 -0
- package/dist/pages/stacks.js +168 -0
- package/dist/pages/standard-fields.js +1 -1
- package/dist/pages/system-pages.d.ts +5 -2
- package/dist/pages/system-pages.js +11 -5
- package/dist/pages/world.d.ts +29 -3
- package/dist/pages/world.js +66 -12
- package/dist/pages/write-page.js +15 -6
- package/dist/pictures/chosen.d.ts +5 -1
- package/dist/pictures/chosen.js +12 -3
- package/dist/pictures/claude.d.ts +3 -1
- package/dist/pictures/claude.js +38 -0
- package/dist/pictures/codex.d.ts +3 -1
- package/dist/pictures/codex.js +32 -0
- package/dist/pictures/helpers.d.ts +10 -0
- package/dist/pictures/helpers.js +53 -6
- package/dist/pictures/index.d.ts +5 -4
- package/dist/pictures/index.js +5 -4
- package/dist/pictures/stop.d.ts +2 -0
- package/dist/pictures/stop.js +18 -0
- package/dist/player-acts.d.ts +27 -0
- package/dist/player-acts.js +56 -0
- package/dist/rules/index.d.ts +1 -0
- package/dist/rules/index.js +3 -1
- package/dist/rules/page-search.d.ts +36 -0
- package/dist/rules/page-search.js +216 -0
- package/dist/rules/search.d.ts +7 -0
- package/dist/rules/search.js +2 -2
- package/dist/scene/scene.d.ts +2 -0
- package/dist/scene/scene.js +1 -0
- package/dist/systems/game-system.d.ts +161 -4
- package/dist/systems/game-system.js +237 -34
- package/dist/systems/index.d.ts +3 -1
- package/dist/systems/index.js +3 -1
- package/dist/systems/system-code.d.ts +97 -0
- package/dist/systems/system-code.js +62 -0
- package/dist/systems/system-folders.d.ts +11 -0
- package/dist/systems/system-folders.js +11 -0
- package/dist/systems/words.d.ts +2 -0
- package/dist/systems/words.js +3 -3
- package/instructions/author.md +1 -1
- package/instructions/buttons-physical-dice.md +1 -1
- package/instructions/buttons.md +1 -1
- package/instructions/character.md +15 -0
- package/instructions/combat.md +3 -1
- package/instructions/core.md +4 -4
- package/instructions/dashboard.md +4 -4
- package/instructions/import.md +14 -0
- package/instructions/mentor-hints.md +1 -1
- package/instructions/party.md +11 -0
- package/instructions/play.md +5 -5
- package/instructions/session-zero.md +1 -1
- package/instructions/setup.md +1 -1
- package/instructions/voices-always.md +1 -0
- package/instructions/voices-important.md +1 -0
- package/instructions/voices.md +14 -0
- package/package.json +6 -2
- package/systems/5e/LICENSE.md +1 -1
- package/systems/5e/dist/dying.js +193 -0
- package/systems/5e/dist/index.js +3 -0
- package/systems/5e/images/abacus.svg +1 -0
- package/systems/5e/images/acid-tube.svg +1 -0
- package/systems/5e/images/animal-hide.svg +1 -0
- package/systems/5e/images/anvil.svg +1 -0
- package/systems/5e/images/arrow-cluster.svg +1 -0
- package/systems/5e/images/backpack.svg +1 -0
- package/systems/5e/images/bagpipes.svg +1 -0
- package/systems/5e/images/barbed-spear.svg +1 -0
- package/systems/5e/images/barrel.svg +1 -0
- package/systems/5e/images/basket.svg +1 -0
- package/systems/5e/images/battle-axe.svg +1 -0
- package/systems/5e/images/beer-horn.svg +1 -0
- package/systems/5e/images/belt-buckles.svg +1 -0
- package/systems/5e/images/bird-scepter.svg +1 -0
- package/systems/5e/images/blanket.svg +1 -0
- package/systems/5e/images/book-cover.svg +1 -0
- package/systems/5e/images/boots.svg +1 -0
- package/systems/5e/images/bottle-vapors.svg +1 -0
- package/systems/5e/images/bow-arrow.svg +1 -0
- package/systems/5e/images/bowl-spiral.svg +1 -0
- package/systems/5e/images/bracer.svg +1 -0
- package/systems/5e/images/broadsword.svg +1 -0
- package/systems/5e/images/broom.svg +1 -0
- package/systems/5e/images/bullets.svg +1 -0
- package/systems/5e/images/caltrops.svg +1 -0
- package/systems/5e/images/camp-cooking-pot.svg +1 -0
- package/systems/5e/images/campfire.svg +1 -0
- package/systems/5e/images/camping-tent.svg +1 -0
- package/systems/5e/images/candle-flame.svg +1 -0
- package/systems/5e/images/candle-light.svg +1 -0
- package/systems/5e/images/canoe.svg +1 -0
- package/systems/5e/images/cape.svg +1 -0
- package/systems/5e/images/caravel.svg +1 -0
- package/systems/5e/images/card-pick.svg +1 -0
- package/systems/5e/images/chain-mail.svg +1 -0
- package/systems/5e/images/chained-arrow-heads.svg +1 -0
- package/systems/5e/images/chariot.svg +1 -0
- package/systems/5e/images/chest.svg +1 -0
- package/systems/5e/images/chisel.svg +1 -0
- package/systems/5e/images/claw-hammer.svg +1 -0
- package/systems/5e/images/colombian-statue.svg +1 -0
- package/systems/5e/images/cooking-pot.svg +1 -0
- package/systems/5e/images/crescent-staff.svg +1 -0
- package/systems/5e/images/crossbow.svg +1 -0
- package/systems/5e/images/crossed-chains.svg +1 -0
- package/systems/5e/images/crowbar.svg +1 -0
- package/systems/5e/images/crystal-ball.svg +1 -0
- package/systems/5e/images/crystal-cluster.svg +1 -0
- package/systems/5e/images/crystal-eye.svg +1 -0
- package/systems/5e/images/cubes.svg +1 -0
- package/systems/5e/images/dart.svg +1 -0
- package/systems/5e/images/dice-six-faces-five.svg +1 -0
- package/systems/5e/images/dragon-orb.svg +1 -0
- package/systems/5e/images/drakkar.svg +1 -0
- package/systems/5e/images/drum.svg +1 -0
- package/systems/5e/images/empty-wood-bucket-handle.svg +1 -0
- package/systems/5e/images/eye-shield.svg +1 -0
- package/systems/5e/images/fairy-wand.svg +1 -0
- package/systems/5e/images/feather.svg +1 -0
- package/systems/5e/images/feathered-wing.svg +1 -0
- package/systems/5e/images/fire-bottle.svg +1 -0
- package/systems/5e/images/fire-gem.svg +1 -0
- package/systems/5e/images/first-aid-kit.svg +1 -0
- package/systems/5e/images/fishing-hook.svg +1 -0
- package/systems/5e/images/fishing-net.svg +1 -0
- package/systems/5e/images/fishing-pole.svg +1 -0
- package/systems/5e/images/fist.svg +1 -0
- package/systems/5e/images/flail.svg +1 -0
- package/systems/5e/images/flanged-mace.svg +1 -0
- package/systems/5e/images/flat-hammer.svg +1 -0
- package/systems/5e/images/flint-spark.svg +1 -0
- package/systems/5e/images/floating-crystal.svg +1 -0
- package/systems/5e/images/flute.svg +1 -0
- package/systems/5e/images/galleon.svg +1 -0
- package/systems/5e/images/gauntlet.svg +1 -0
- package/systems/5e/images/gem-necklace.svg +1 -0
- package/systems/5e/images/gem-pendant.svg +1 -0
- package/systems/5e/images/gems.svg +1 -0
- package/systems/5e/images/gladius.svg +1 -0
- package/systems/5e/images/glaive.svg +1 -0
- package/systems/5e/images/glass-ball.svg +1 -0
- package/systems/5e/images/gloves.svg +1 -0
- package/systems/5e/images/gold-scarab.svg +1 -0
- package/systems/5e/images/grain-bundle.svg +1 -0
- package/systems/5e/images/halberd.svg +1 -0
- package/systems/5e/images/hand-saw.svg +1 -0
- package/systems/5e/images/handheld-fan.svg +1 -0
- package/systems/5e/images/harp.svg +1 -0
- package/systems/5e/images/hatchet.svg +1 -0
- package/systems/5e/images/headband-knot.svg +1 -0
- package/systems/5e/images/health-potion.svg +1 -0
- package/systems/5e/images/heart-bottle.svg +1 -0
- package/systems/5e/images/herbs-bundle.svg +1 -0
- package/systems/5e/images/hole-ladder.svg +1 -0
- package/systems/5e/images/holy-symbol.svg +1 -0
- package/systems/5e/images/holy-water.svg +1 -0
- package/systems/5e/images/honey-jar.svg +1 -0
- package/systems/5e/images/hood.svg +1 -0
- package/systems/5e/images/horseshoe.svg +1 -0
- package/systems/5e/images/hourglass.svg +1 -0
- package/systems/5e/images/hunting-horn.svg +1 -0
- package/systems/5e/images/jester-hat.svg +1 -0
- package/systems/5e/images/jug.svg +1 -0
- package/systems/5e/images/katana.svg +1 -0
- package/systems/5e/images/key-lock.svg +1 -0
- package/systems/5e/images/kitchen-scale.svg +1 -0
- package/systems/5e/images/knapsack.svg +1 -0
- package/systems/5e/images/ladder.svg +1 -0
- package/systems/5e/images/lantern.svg +1 -0
- package/systems/5e/images/leather-armor.svg +1 -0
- package/systems/5e/images/leather-boot.svg +1 -0
- package/systems/5e/images/leather-vest.svg +1 -0
- package/systems/5e/images/light-backpack.svg +1 -0
- package/systems/5e/images/light-helm.svg +1 -0
- package/systems/5e/images/locked-box.svg +1 -0
- package/systems/5e/images/locked-fortress.svg +1 -0
- package/systems/5e/images/lockpicks.svg +1 -0
- package/systems/5e/images/lunar-wand.svg +1 -0
- package/systems/5e/images/lyre.svg +1 -0
- package/systems/5e/images/magic-lamp.svg +1 -0
- package/systems/5e/images/magnifying-glass.svg +1 -0
- package/systems/5e/images/mail-shirt.svg +1 -0
- package/systems/5e/images/manacles.svg +1 -0
- package/systems/5e/images/marbles.svg +1 -0
- package/systems/5e/images/meat.svg +1 -0
- package/systems/5e/images/medal.svg +1 -0
- package/systems/5e/images/mirror-mirror.svg +1 -0
- package/systems/5e/images/mountain-climbing.svg +1 -0
- package/systems/5e/images/oil-can.svg +1 -0
- package/systems/5e/images/old-lantern.svg +1 -0
- package/systems/5e/images/old-wagon.svg +1 -0
- package/systems/5e/images/orb-wand.svg +1 -0
- package/systems/5e/images/oyster-pearl.svg +1 -0
- package/systems/5e/images/paint-brush.svg +1 -0
- package/systems/5e/images/painted-pottery.svg +1 -0
- package/systems/5e/images/palette.svg +1 -0
- package/systems/5e/images/paper.svg +1 -0
- package/systems/5e/images/pencil.svg +1 -0
- package/systems/5e/images/perfume-bottle.svg +1 -0
- package/systems/5e/images/pilgrim-hat.svg +1 -0
- package/systems/5e/images/pipes.svg +1 -0
- package/systems/5e/images/plain-arrow.svg +1 -0
- package/systems/5e/images/plain-dagger.svg +1 -0
- package/systems/5e/images/poison-bottle.svg +1 -0
- package/systems/5e/images/powder-bag.svg +1 -0
- package/systems/5e/images/prayer-beads.svg +1 -0
- package/systems/5e/images/pulley-hook.svg +1 -0
- package/systems/5e/images/quill-ink.svg +1 -0
- package/systems/5e/images/quill.svg +1 -0
- package/systems/5e/images/quiver.svg +1 -0
- package/systems/5e/images/red-carpet.svg +1 -0
- package/systems/5e/images/ring.svg +1 -0
- package/systems/5e/images/ringing-bell.svg +1 -0
- package/systems/5e/images/robe.svg +1 -0
- package/systems/5e/images/rope-coil.svg +1 -0
- package/systems/5e/images/round-bottom-flask.svg +1 -0
- package/systems/5e/images/round-potion.svg +1 -0
- package/systems/5e/images/rune-stone.svg +1 -0
- package/systems/5e/images/saddle.svg +1 -0
- package/systems/5e/images/scale-mail.svg +1 -0
- package/systems/5e/images/scroll-unfurled.svg +1 -0
- package/systems/5e/images/secret-book.svg +1 -0
- package/systems/5e/images/sewing-needle.svg +1 -0
- package/systems/5e/images/shield.svg +1 -0
- package/systems/5e/images/shirt-button.svg +1 -0
- package/systems/5e/images/sickle.svg +1 -0
- package/systems/5e/images/siege-ram.svg +1 -0
- package/systems/5e/images/skull-staff.svg +1 -0
- package/systems/5e/images/sleeping-bag.svg +1 -0
- package/systems/5e/images/sling.svg +1 -0
- package/systems/5e/images/slippers.svg +1 -0
- package/systems/5e/images/small-fishing-sailboat.svg +1 -0
- package/systems/5e/images/smoking-orb.svg +1 -0
- package/systems/5e/images/soap.svg +1 -0
- package/systems/5e/images/spade.svg +1 -0
- package/systems/5e/images/sparkling-sabre.svg +1 -0
- package/systems/5e/images/spell-book.svg +1 -0
- package/systems/5e/images/spiked-armor.svg +1 -0
- package/systems/5e/images/spiked-mace.svg +1 -0
- package/systems/5e/images/spikes.svg +1 -0
- package/systems/5e/images/spinning-wheel.svg +1 -0
- package/systems/5e/images/spyglass.svg +1 -0
- package/systems/5e/images/steampunk-goggles.svg +1 -0
- package/systems/5e/images/stone-block.svg +1 -0
- package/systems/5e/images/stone-pile.svg +1 -0
- package/systems/5e/images/stone-sphere.svg +1 -0
- package/systems/5e/images/straight-pipe.svg +1 -0
- package/systems/5e/images/swap-bag.svg +1 -0
- package/systems/5e/images/thor-hammer.svg +1 -0
- package/systems/5e/images/thrown-spear.svg +1 -0
- package/systems/5e/images/tiara.svg +1 -0
- package/systems/5e/images/tied-scroll.svg +1 -0
- package/systems/5e/images/tinker.svg +1 -0
- package/systems/5e/images/torch.svg +1 -0
- package/systems/5e/images/totem.svg +1 -0
- package/systems/5e/images/trap-mask.svg +1 -0
- package/systems/5e/images/treasure-map.svg +1 -0
- package/systems/5e/images/tribal-pendant.svg +1 -0
- package/systems/5e/images/trident.svg +1 -0
- package/systems/5e/images/two-handed-sword.svg +1 -0
- package/systems/5e/images/vial.svg +1 -0
- package/systems/5e/images/violin.svg +1 -0
- package/systems/5e/images/war-axe.svg +1 -0
- package/systems/5e/images/war-pick.svg +1 -0
- package/systems/5e/images/warhammer.svg +1 -0
- package/systems/5e/images/water-bottle.svg +1 -0
- package/systems/5e/images/waterskin.svg +1 -0
- package/systems/5e/images/wavy-chains.svg +1 -0
- package/systems/5e/images/wax-seal.svg +1 -0
- package/systems/5e/images/wheelbarrow.svg +1 -0
- package/systems/5e/images/whip.svg +1 -0
- package/systems/5e/images/whistle.svg +1 -0
- package/systems/5e/images/wing-cloak.svg +1 -0
- package/systems/5e/images/winged-scepter.svg +1 -0
- package/systems/5e/images/wizard-staff.svg +1 -0
- package/systems/5e/images/wolf-trap.svg +1 -0
- package/systems/5e/images/wood-canoe.svg +1 -0
- package/systems/5e/images/wood-club.svg +1 -0
- package/systems/5e/instructions/import.md +1 -0
- package/systems/5e/instructions/play.md +5 -0
- package/systems/5e/instructions/session-zero.md +1 -1
- package/systems/5e/package.json +11 -0
- package/systems/5e/system.yaml +231 -31
- package/systems/5e/words/ar.yaml +74 -0
- package/systems/5e/words/cs.yaml +74 -0
- package/systems/5e/words/da.yaml +74 -0
- package/systems/5e/words/de.yaml +74 -0
- package/systems/5e/words/el.yaml +74 -0
- package/systems/5e/words/en.yaml +20 -0
- package/systems/5e/words/es.yaml +74 -0
- package/systems/5e/words/fi.yaml +74 -0
- package/systems/5e/words/fr.yaml +74 -0
- package/systems/5e/words/he.yaml +74 -0
- package/systems/5e/words/hi.yaml +74 -0
- package/systems/5e/words/hu.yaml +74 -0
- package/systems/5e/words/is.yaml +74 -0
- package/systems/5e/words/it.yaml +84 -1
- package/systems/5e/words/ja.yaml +74 -0
- package/systems/5e/words/ko.yaml +74 -0
- package/systems/5e/words/nb.yaml +74 -0
- package/systems/5e/words/nl.yaml +74 -0
- package/systems/5e/words/pl.yaml +74 -0
- package/systems/5e/words/pt.yaml +74 -0
- package/systems/5e/words/ro.yaml +74 -0
- package/systems/5e/words/ru.yaml +74 -0
- package/systems/5e/words/sv.yaml +74 -0
- package/systems/5e/words/tr.yaml +74 -0
- package/systems/5e/words/uk.yaml +74 -0
- package/systems/5e/words/zh.yaml +74 -0
- package/systems/5e/world/creatures/Aboleth.md +1 -0
- package/systems/5e/world/creatures/Adult Black Dragon.md +2 -0
- package/systems/5e/world/creatures/Adult Blue Dragon.md +2 -0
- package/systems/5e/world/creatures/Adult Brass Dragon.md +2 -0
- package/systems/5e/world/creatures/Adult Bronze Dragon.md +2 -0
- package/systems/5e/world/creatures/Adult Copper Dragon.md +2 -0
- package/systems/5e/world/creatures/Adult Gold Dragon.md +2 -0
- package/systems/5e/world/creatures/Adult Green Dragon.md +2 -0
- package/systems/5e/world/creatures/Adult Red Dragon.md +2 -0
- package/systems/5e/world/creatures/Adult Silver Dragon.md +2 -0
- package/systems/5e/world/creatures/Adult White Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient Black Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient Blue Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient Brass Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient Bronze Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient Copper Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient Gold Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient Green Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient Red Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient Silver Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient White Dragon.md +2 -0
- package/systems/5e/world/creatures/Androsphinx.md +1 -0
- package/systems/5e/world/creatures/Dwarf.md +1 -0
- package/systems/5e/world/creatures/Gynosphinx.md +1 -0
- package/systems/5e/world/creatures/Kraken.md +1 -0
- package/systems/5e/world/creatures/Lich.md +2 -0
- package/systems/5e/world/creatures/Mummy Lord.md +1 -0
- package/systems/5e/world/creatures/Solar.md +1 -0
- package/systems/5e/world/creatures/Tarrasque.md +2 -0
- package/systems/5e/world/creatures/Unicorn.md +1 -0
- package/systems/5e/world/creatures/Vampire.md +2 -0
- package/systems/5e/world/items/Abacus.md +1 -0
- package/systems/5e/world/items/Acid.md +1 -0
- package/systems/5e/world/items/Adamantine Armor.md +1 -0
- package/systems/5e/world/items/Alchemist's Fire.md +1 -0
- package/systems/5e/world/items/Alchemist's Supplies.md +1 -0
- package/systems/5e/world/items/Ammunition, +1, +2, or +3.md +1 -0
- package/systems/5e/world/items/Amulet of Health.md +2 -0
- package/systems/5e/world/items/Amulet of Proof against Detection and Location.md +1 -0
- package/systems/5e/world/items/Amulet of the Planes.md +1 -0
- package/systems/5e/world/items/Amulet.md +1 -0
- package/systems/5e/world/items/Animated Shield.md +1 -0
- package/systems/5e/world/items/Antitoxin.md +1 -0
- package/systems/5e/world/items/Apparatus of the Crab.md +1 -0
- package/systems/5e/world/items/Armor of Invulnerability.md +2 -0
- package/systems/5e/world/items/Armor of Resistance.md +1 -0
- package/systems/5e/world/items/Armor of Vulnerability.md +1 -0
- package/systems/5e/world/items/Armor, +1, +2, or +3.md +1 -0
- package/systems/5e/world/items/Arrow of Slaying.md +1 -0
- package/systems/5e/world/items/Arrow-Catching Shield.md +1 -0
- package/systems/5e/world/items/Arrows.md +2 -0
- package/systems/5e/world/items/Backpack.md +1 -0
- package/systems/5e/world/items/Bag of Beans.md +1 -0
- package/systems/5e/world/items/Bag of Devouring.md +1 -0
- package/systems/5e/world/items/Bag of Holding.md +3 -0
- package/systems/5e/world/items/Bag of Tricks.md +1 -0
- package/systems/5e/world/items/Bagpipes.md +1 -0
- package/systems/5e/world/items/Ball Bearings.md +1 -0
- package/systems/5e/world/items/Barding.md +1 -0
- package/systems/5e/world/items/Barrel.md +1 -0
- package/systems/5e/world/items/Basic Poison.md +1 -0
- package/systems/5e/world/items/Basket.md +1 -0
- package/systems/5e/world/items/Battleaxe.md +1 -0
- package/systems/5e/world/items/Bead of Force.md +1 -0
- package/systems/5e/world/items/Bedroll.md +1 -0
- package/systems/5e/world/items/Bell.md +1 -0
- package/systems/5e/world/items/Belt of Dwarvenkind.md +1 -0
- package/systems/5e/world/items/Belt of Giant Strength.md +1 -0
- package/systems/5e/world/items/Berserker Axe.md +1 -0
- package/systems/5e/world/items/Bit and Bridle.md +1 -0
- package/systems/5e/world/items/Blanket.md +1 -0
- package/systems/5e/world/items/Block and Tackle.md +1 -0
- package/systems/5e/world/items/Blowgun Needles.md +2 -0
- package/systems/5e/world/items/Blowgun.md +1 -0
- package/systems/5e/world/items/Book.md +1 -0
- package/systems/5e/world/items/Boots of Elvenkind.md +1 -0
- package/systems/5e/world/items/Boots of Levitation.md +1 -0
- package/systems/5e/world/items/Boots of Speed.md +1 -0
- package/systems/5e/world/items/Boots of Striding and Springing.md +1 -0
- package/systems/5e/world/items/Boots of the Winterlands.md +2 -0
- package/systems/5e/world/items/Bowl of Commanding Water Elementals.md +1 -0
- package/systems/5e/world/items/Bracers of Archery.md +1 -0
- package/systems/5e/world/items/Bracers of Defense.md +1 -0
- package/systems/5e/world/items/Brazier of Commanding Fire Elementals.md +1 -0
- package/systems/5e/world/items/Breastplate.md +1 -0
- package/systems/5e/world/items/Brewer's Supplies.md +1 -0
- package/systems/5e/world/items/Brooch of Shielding.md +2 -0
- package/systems/5e/world/items/Broom of Flying.md +1 -0
- package/systems/5e/world/items/Bucket.md +1 -0
- package/systems/5e/world/items/Bullseye Lantern.md +1 -0
- package/systems/5e/world/items/Burglar's Pack.md +3 -0
- package/systems/5e/world/items/Calligrapher's Supplies.md +1 -0
- package/systems/5e/world/items/Caltrops.md +1 -0
- package/systems/5e/world/items/Candle of Invocation.md +1 -0
- package/systems/5e/world/items/Candle.md +1 -0
- package/systems/5e/world/items/Cape of the Mountebank.md +1 -0
- package/systems/5e/world/items/Carpenter's Tools.md +1 -0
- package/systems/5e/world/items/Carpet of Flying.md +1 -0
- package/systems/5e/world/items/Carriage.md +1 -0
- package/systems/5e/world/items/Cart.md +1 -0
- package/systems/5e/world/items/Cartographer's Tools.md +1 -0
- package/systems/5e/world/items/Censer of Controlling Air Elementals.md +1 -0
- package/systems/5e/world/items/Chain Mail.md +2 -0
- package/systems/5e/world/items/Chain Shirt.md +1 -0
- package/systems/5e/world/items/Chain.md +1 -0
- package/systems/5e/world/items/Chalk.md +1 -0
- package/systems/5e/world/items/Chariot.md +1 -0
- package/systems/5e/world/items/Chest.md +1 -0
- package/systems/5e/world/items/Chime of Opening.md +1 -0
- package/systems/5e/world/items/Circlet of Blasting.md +1 -0
- package/systems/5e/world/items/Climber's Kit.md +1 -0
- package/systems/5e/world/items/Cloak of Arachnida.md +2 -0
- package/systems/5e/world/items/Cloak of Displacement.md +1 -0
- package/systems/5e/world/items/Cloak of Elvenkind.md +1 -0
- package/systems/5e/world/items/Cloak of Protection.md +3 -0
- package/systems/5e/world/items/Cloak of the Bat.md +1 -0
- package/systems/5e/world/items/Cloak of the Manta Ray.md +1 -0
- package/systems/5e/world/items/Club.md +1 -0
- package/systems/5e/world/items/Cobbler's Tools.md +1 -0
- package/systems/5e/world/items/Common Clothes.md +1 -0
- package/systems/5e/world/items/Component Pouch.md +1 -0
- package/systems/5e/world/items/Cook's Utensils.md +1 -0
- package/systems/5e/world/items/Costume Clothes.md +1 -0
- package/systems/5e/world/items/Crossbow Bolt Case.md +1 -0
- package/systems/5e/world/items/Crossbow Bolts.md +2 -0
- package/systems/5e/world/items/Crowbar.md +1 -0
- package/systems/5e/world/items/Crystal Ball.md +1 -0
- package/systems/5e/world/items/Crystal.md +1 -0
- package/systems/5e/world/items/Cube of Force.md +2 -0
- package/systems/5e/world/items/Cubic Gate.md +2 -0
- package/systems/5e/world/items/Dagger of Venom.md +1 -0
- package/systems/5e/world/items/Dagger.md +1 -0
- package/systems/5e/world/items/Dancing Sword.md +1 -0
- package/systems/5e/world/items/Dart.md +1 -0
- package/systems/5e/world/items/Decanter of Endless Water.md +1 -0
- package/systems/5e/world/items/Deck of Illusions.md +1 -0
- package/systems/5e/world/items/Deck of Many Things.md +1 -0
- package/systems/5e/world/items/Defender.md +1 -0
- package/systems/5e/world/items/Demon Armor.md +1 -0
- package/systems/5e/world/items/Dice Set.md +1 -0
- package/systems/5e/world/items/Dimensional Shackles.md +1 -0
- package/systems/5e/world/items/Diplomat's Pack.md +3 -0
- package/systems/5e/world/items/Disguise Kit.md +1 -0
- package/systems/5e/world/items/Dragon Scale Mail.md +1 -0
- package/systems/5e/world/items/Dragon Slayer.md +1 -0
- package/systems/5e/world/items/Drum.md +1 -0
- package/systems/5e/world/items/Dulcimer.md +1 -0
- package/systems/5e/world/items/Dungeoneer's Pack.md +3 -0
- package/systems/5e/world/items/Dust of Disappearance.md +1 -0
- package/systems/5e/world/items/Dust of Dryness.md +1 -0
- package/systems/5e/world/items/Dust of Sneezing and Choking.md +1 -0
- package/systems/5e/world/items/Dwarven Plate.md +1 -0
- package/systems/5e/world/items/Dwarven Thrower.md +1 -0
- package/systems/5e/world/items/Efficient Quiver.md +1 -0
- package/systems/5e/world/items/Efreeti Bottle.md +1 -0
- package/systems/5e/world/items/Elemental Gem.md +1 -0
- package/systems/5e/world/items/Elven Chain.md +1 -0
- package/systems/5e/world/items/Emblem.md +1 -0
- package/systems/5e/world/items/Entertainer's Pack.md +3 -0
- package/systems/5e/world/items/Eversmoking Bottle.md +1 -0
- package/systems/5e/world/items/Exotic Saddle.md +1 -0
- package/systems/5e/world/items/Explorer's Pack.md +3 -0
- package/systems/5e/world/items/Eyes of Charming.md +1 -0
- package/systems/5e/world/items/Eyes of Minute Seeing.md +1 -0
- package/systems/5e/world/items/Eyes of the Eagle.md +1 -0
- package/systems/5e/world/items/Feather Token.md +1 -0
- package/systems/5e/world/items/Feed.md +1 -0
- package/systems/5e/world/items/Figurine of Wondrous Power.md +1 -0
- package/systems/5e/world/items/Fine Clothes.md +1 -0
- package/systems/5e/world/items/Fishing Tackle.md +1 -0
- package/systems/5e/world/items/Flail.md +1 -0
- package/systems/5e/world/items/Flame Tongue.md +1 -0
- package/systems/5e/world/items/Flask or Tankard.md +1 -0
- package/systems/5e/world/items/Flute.md +1 -0
- package/systems/5e/world/items/Folding Boat.md +1 -0
- package/systems/5e/world/items/Forgery Kit.md +1 -0
- package/systems/5e/world/items/Frost Brand.md +2 -0
- package/systems/5e/world/items/Galley.md +1 -0
- package/systems/5e/world/items/Gauntlets of Ogre Power.md +2 -0
- package/systems/5e/world/items/Gem of Brightness.md +2 -0
- package/systems/5e/world/items/Gem of Seeing.md +2 -0
- package/systems/5e/world/items/Giant Slayer.md +1 -0
- package/systems/5e/world/items/Glaive.md +1 -0
- package/systems/5e/world/items/Glamoured Studded Leather.md +1 -0
- package/systems/5e/world/items/Glass Bottle.md +1 -0
- package/systems/5e/world/items/Glassblower's Tools.md +1 -0
- package/systems/5e/world/items/Gloves of Missile Snaring.md +1 -0
- package/systems/5e/world/items/Gloves of Swimming and Climbing.md +1 -0
- package/systems/5e/world/items/Goggles of Night.md +1 -0
- package/systems/5e/world/items/Grappling Hook.md +1 -0
- package/systems/5e/world/items/Greataxe.md +1 -0
- package/systems/5e/world/items/Greatclub.md +1 -0
- package/systems/5e/world/items/Greatsword.md +1 -0
- package/systems/5e/world/items/Halberd.md +1 -0
- package/systems/5e/world/items/Half Plate Armor.md +1 -0
- package/systems/5e/world/items/Hammer of Thunderbolts.md +2 -0
- package/systems/5e/world/items/Hammer.md +1 -0
- package/systems/5e/world/items/Hand Crossbow.md +1 -0
- package/systems/5e/world/items/Handaxe.md +1 -0
- package/systems/5e/world/items/Handy Haversack.md +3 -0
- package/systems/5e/world/items/Hat of Disguise.md +1 -0
- package/systems/5e/world/items/Headband of Intellect.md +2 -0
- package/systems/5e/world/items/Healer's Kit.md +1 -0
- package/systems/5e/world/items/Heavy Crossbow.md +1 -0
- package/systems/5e/world/items/Helm of Brilliance.md +1 -0
- package/systems/5e/world/items/Helm of Comprehending Languages.md +1 -0
- package/systems/5e/world/items/Helm of Telepathy.md +1 -0
- package/systems/5e/world/items/Helm of Teleportation.md +2 -0
- package/systems/5e/world/items/Hempen Rope.md +1 -0
- package/systems/5e/world/items/Herbalism Kit.md +1 -0
- package/systems/5e/world/items/Hide Armor.md +1 -0
- package/systems/5e/world/items/Holy Avenger.md +1 -0
- package/systems/5e/world/items/Holy Water.md +1 -0
- package/systems/5e/world/items/Hooded Lantern.md +1 -0
- package/systems/5e/world/items/Horn of Blasting.md +1 -0
- package/systems/5e/world/items/Horn of Valhalla.md +1 -0
- package/systems/5e/world/items/Horn.md +1 -0
- package/systems/5e/world/items/Horseshoes of Speed.md +1 -0
- package/systems/5e/world/items/Horseshoes of a Zephyr.md +1 -0
- package/systems/5e/world/items/Hourglass.md +1 -0
- package/systems/5e/world/items/Hunting Trap.md +1 -0
- package/systems/5e/world/items/Immovable Rod.md +1 -0
- package/systems/5e/world/items/Ink Pen.md +1 -0
- package/systems/5e/world/items/Ink.md +1 -0
- package/systems/5e/world/items/Instant Fortress.md +1 -0
- package/systems/5e/world/items/Ioun Stone.md +1 -0
- package/systems/5e/world/items/Iron Bands of Binding.md +1 -0
- package/systems/5e/world/items/Iron Flask.md +1 -0
- package/systems/5e/world/items/Iron Pot.md +1 -0
- package/systems/5e/world/items/Iron Spikes.md +2 -0
- package/systems/5e/world/items/Javelin of Lightning.md +1 -0
- package/systems/5e/world/items/Javelin.md +1 -0
- package/systems/5e/world/items/Jeweler's Tools.md +1 -0
- package/systems/5e/world/items/Jug or Pitcher.md +1 -0
- package/systems/5e/world/items/Keelboat.md +1 -0
- package/systems/5e/world/items/Ladder.md +1 -0
- package/systems/5e/world/items/Lamp.md +1 -0
- package/systems/5e/world/items/Lance.md +1 -0
- package/systems/5e/world/items/Lantern of Revealing.md +1 -0
- package/systems/5e/world/items/Leather Armor.md +1 -0
- package/systems/5e/world/items/Leatherworker's Tools.md +1 -0
- package/systems/5e/world/items/Light Crossbow.md +1 -0
- package/systems/5e/world/items/Light Hammer.md +1 -0
- package/systems/5e/world/items/Lock.md +1 -0
- package/systems/5e/world/items/Longbow.md +1 -0
- package/systems/5e/world/items/Longship.md +1 -0
- package/systems/5e/world/items/Longsword.md +1 -0
- package/systems/5e/world/items/Luck Blade.md +1 -0
- package/systems/5e/world/items/Lute.md +1 -0
- package/systems/5e/world/items/Lyre.md +1 -0
- package/systems/5e/world/items/Mace of Disruption.md +1 -0
- package/systems/5e/world/items/Mace of Smiting.md +1 -0
- package/systems/5e/world/items/Mace of Terror.md +2 -0
- package/systems/5e/world/items/Mace.md +1 -0
- package/systems/5e/world/items/Magnifying Glass.md +1 -0
- package/systems/5e/world/items/Manacles.md +1 -0
- package/systems/5e/world/items/Mantle of Spell Resistance.md +1 -0
- package/systems/5e/world/items/Manual of Bodily Health.md +1 -0
- package/systems/5e/world/items/Manual of Gainful Exercise.md +1 -0
- package/systems/5e/world/items/Manual of Golems.md +1 -0
- package/systems/5e/world/items/Manual of Quickness of Action.md +1 -0
- package/systems/5e/world/items/Map or Scroll Case.md +1 -0
- package/systems/5e/world/items/Marvelous Pigments.md +1 -0
- package/systems/5e/world/items/Mason's Tools.md +1 -0
- package/systems/5e/world/items/Maul.md +1 -0
- package/systems/5e/world/items/Medallion of Thoughts.md +2 -0
- package/systems/5e/world/items/Merchant's Scale.md +1 -0
- package/systems/5e/world/items/Mess Kit.md +1 -0
- package/systems/5e/world/items/Military Saddle.md +1 -0
- package/systems/5e/world/items/Miner's Pick.md +1 -0
- package/systems/5e/world/items/Mirror of Life Trapping.md +1 -0
- package/systems/5e/world/items/Mithral Armor.md +1 -0
- package/systems/5e/world/items/Morningstar.md +1 -0
- package/systems/5e/world/items/Navigator's Tools.md +1 -0
- package/systems/5e/world/items/Necklace of Adaptation.md +1 -0
- package/systems/5e/world/items/Necklace of Fireballs.md +1 -0
- package/systems/5e/world/items/Necklace of Prayer Beads.md +1 -0
- package/systems/5e/world/items/Net.md +1 -0
- package/systems/5e/world/items/Nine Lives Stealer.md +1 -0
- package/systems/5e/world/items/Oathbow.md +1 -0
- package/systems/5e/world/items/Oil of Etherealness.md +1 -0
- package/systems/5e/world/items/Oil of Sharpness.md +1 -0
- package/systems/5e/world/items/Oil of Slipperiness.md +1 -0
- package/systems/5e/world/items/Oil.md +1 -0
- package/systems/5e/world/items/Orb of Dragonkind.md +2 -0
- package/systems/5e/world/items/Orb.md +1 -0
- package/systems/5e/world/items/Pack Saddle.md +1 -0
- package/systems/5e/world/items/Padded Armor.md +1 -0
- package/systems/5e/world/items/Painter's Supplies.md +1 -0
- package/systems/5e/world/items/Pan Flute.md +1 -0
- package/systems/5e/world/items/Paper.md +1 -0
- package/systems/5e/world/items/Parchment.md +1 -0
- package/systems/5e/world/items/Pearl of Power.md +1 -0
- package/systems/5e/world/items/Perfume.md +1 -0
- package/systems/5e/world/items/Periapt of Health.md +1 -0
- package/systems/5e/world/items/Periapt of Proof against Poison.md +1 -0
- package/systems/5e/world/items/Periapt of Wound Closure.md +1 -0
- package/systems/5e/world/items/Philter of Love.md +1 -0
- package/systems/5e/world/items/Pike.md +1 -0
- package/systems/5e/world/items/Pipes of Haunting.md +1 -0
- package/systems/5e/world/items/Pipes of the Sewers.md +1 -0
- package/systems/5e/world/items/Piton.md +1 -0
- package/systems/5e/world/items/Plate Armor of Etherealness.md +1 -0
- package/systems/5e/world/items/Plate Armor.md +2 -0
- package/systems/5e/world/items/Playing Card Set.md +1 -0
- package/systems/5e/world/items/Poisoner's Kit.md +1 -0
- package/systems/5e/world/items/Pole.md +1 -0
- package/systems/5e/world/items/Portable Hole.md +2 -0
- package/systems/5e/world/items/Portable Ram.md +1 -0
- package/systems/5e/world/items/Potion of Animal Friendship.md +1 -0
- package/systems/5e/world/items/Potion of Clairvoyance.md +1 -0
- package/systems/5e/world/items/Potion of Climbing.md +1 -0
- package/systems/5e/world/items/Potion of Diminution.md +1 -0
- package/systems/5e/world/items/Potion of Flying.md +1 -0
- package/systems/5e/world/items/Potion of Gaseous Form.md +1 -0
- package/systems/5e/world/items/Potion of Giant Strength.md +1 -0
- package/systems/5e/world/items/Potion of Growth.md +1 -0
- package/systems/5e/world/items/Potion of Healing.md +1 -0
- package/systems/5e/world/items/Potion of Heroism.md +1 -0
- package/systems/5e/world/items/Potion of Invisibility.md +1 -0
- package/systems/5e/world/items/Potion of Mind Reading.md +1 -0
- package/systems/5e/world/items/Potion of Poison.md +1 -0
- package/systems/5e/world/items/Potion of Resistance.md +1 -0
- package/systems/5e/world/items/Potion of Speed.md +1 -0
- package/systems/5e/world/items/Potion of Water Breathing.md +1 -0
- package/systems/5e/world/items/Potter's Tools.md +1 -0
- package/systems/5e/world/items/Pouch.md +1 -0
- package/systems/5e/world/items/Priest's Pack.md +3 -0
- package/systems/5e/world/items/Quarterstaff.md +1 -0
- package/systems/5e/world/items/Quiver.md +1 -0
- package/systems/5e/world/items/Rapier.md +1 -0
- package/systems/5e/world/items/Rations.md +1 -0
- package/systems/5e/world/items/Reliquary.md +1 -0
- package/systems/5e/world/items/Restorative Ointment.md +1 -0
- package/systems/5e/world/items/Riding Saddle.md +1 -0
- package/systems/5e/world/items/Ring Mail.md +1 -0
- package/systems/5e/world/items/Ring of Animal Influence.md +2 -0
- package/systems/5e/world/items/Ring of Djinni Summoning.md +1 -0
- package/systems/5e/world/items/Ring of Elemental Command.md +2 -0
- package/systems/5e/world/items/Ring of Evasion.md +2 -0
- package/systems/5e/world/items/Ring of Feather Falling.md +1 -0
- package/systems/5e/world/items/Ring of Free Action.md +1 -0
- package/systems/5e/world/items/Ring of Invisibility.md +1 -0
- package/systems/5e/world/items/Ring of Jumping.md +1 -0
- package/systems/5e/world/items/Ring of Mind Shielding.md +1 -0
- package/systems/5e/world/items/Ring of Protection.md +3 -0
- package/systems/5e/world/items/Ring of Regeneration.md +1 -0
- package/systems/5e/world/items/Ring of Resistance.md +1 -0
- package/systems/5e/world/items/Ring of Shooting Stars.md +2 -0
- package/systems/5e/world/items/Ring of Spell Storing.md +1 -0
- package/systems/5e/world/items/Ring of Spell Turning.md +1 -0
- package/systems/5e/world/items/Ring of Swimming.md +1 -0
- package/systems/5e/world/items/Ring of Telekinesis.md +1 -0
- package/systems/5e/world/items/Ring of Three Wishes.md +1 -0
- package/systems/5e/world/items/Ring of Warmth.md +2 -0
- package/systems/5e/world/items/Ring of Water Walking.md +1 -0
- package/systems/5e/world/items/Ring of X-ray Vision.md +1 -0
- package/systems/5e/world/items/Ring of the Ram.md +2 -0
- package/systems/5e/world/items/Robe of Eyes.md +1 -0
- package/systems/5e/world/items/Robe of Scintillating Colors.md +2 -0
- package/systems/5e/world/items/Robe of Stars.md +1 -0
- package/systems/5e/world/items/Robe of Useful Items.md +1 -0
- package/systems/5e/world/items/Robe of the Archmagi.md +3 -0
- package/systems/5e/world/items/Robes.md +1 -0
- package/systems/5e/world/items/Rod of Absorption.md +1 -0
- package/systems/5e/world/items/Rod of Alertness.md +1 -0
- package/systems/5e/world/items/Rod of Lordly Might.md +1 -0
- package/systems/5e/world/items/Rod of Rulership.md +1 -0
- package/systems/5e/world/items/Rod of Security.md +1 -0
- package/systems/5e/world/items/Rod.md +1 -0
- package/systems/5e/world/items/Rope of Climbing.md +1 -0
- package/systems/5e/world/items/Rope of Entanglement.md +1 -0
- package/systems/5e/world/items/Rowboat.md +1 -0
- package/systems/5e/world/items/Sack.md +1 -0
- package/systems/5e/world/items/Saddlebags.md +1 -0
- package/systems/5e/world/items/Sailing Ship.md +1 -0
- package/systems/5e/world/items/Scale Mail.md +1 -0
- package/systems/5e/world/items/Scarab of Protection.md +2 -0
- package/systems/5e/world/items/Scholar's Pack.md +3 -0
- package/systems/5e/world/items/Scimitar of Speed.md +1 -0
- package/systems/5e/world/items/Scimitar.md +1 -0
- package/systems/5e/world/items/Sealing Wax.md +1 -0
- package/systems/5e/world/items/Shawm.md +1 -0
- package/systems/5e/world/items/Shield of Missile Attraction.md +2 -0
- package/systems/5e/world/items/Shield, +1, +2, or +3.md +1 -0
- package/systems/5e/world/items/Shield.md +1 -0
- package/systems/5e/world/items/Shortbow.md +1 -0
- package/systems/5e/world/items/Shortsword.md +1 -0
- package/systems/5e/world/items/Shovel.md +1 -0
- package/systems/5e/world/items/Sickle.md +1 -0
- package/systems/5e/world/items/Signal Whistle.md +1 -0
- package/systems/5e/world/items/Signet Ring.md +1 -0
- package/systems/5e/world/items/Silk Rope.md +1 -0
- package/systems/5e/world/items/Sled.md +1 -0
- package/systems/5e/world/items/Sledgehammer.md +1 -0
- package/systems/5e/world/items/Sling Bullets.md +2 -0
- package/systems/5e/world/items/Sling.md +1 -0
- package/systems/5e/world/items/Slippers of Spider Climbing.md +1 -0
- package/systems/5e/world/items/Smith's Tools.md +1 -0
- package/systems/5e/world/items/Soap.md +1 -0
- package/systems/5e/world/items/Sovereign Glue.md +1 -0
- package/systems/5e/world/items/Spear.md +1 -0
- package/systems/5e/world/items/Spell Scroll.md +1 -0
- package/systems/5e/world/items/Spellbook.md +1 -0
- package/systems/5e/world/items/Spellguard Shield.md +1 -0
- package/systems/5e/world/items/Sphere of Annihilation.md +1 -0
- package/systems/5e/world/items/Splint Armor.md +2 -0
- package/systems/5e/world/items/Sprig of Mistletoe.md +1 -0
- package/systems/5e/world/items/Spyglass.md +1 -0
- package/systems/5e/world/items/Staff of Charming.md +1 -0
- package/systems/5e/world/items/Staff of Fire.md +3 -0
- package/systems/5e/world/items/Staff of Frost.md +3 -0
- package/systems/5e/world/items/Staff of Healing.md +2 -0
- package/systems/5e/world/items/Staff of Power.md +5 -0
- package/systems/5e/world/items/Staff of Striking.md +2 -0
- package/systems/5e/world/items/Staff of Swarming Insects.md +2 -0
- package/systems/5e/world/items/Staff of Thunder and Lightning.md +1 -0
- package/systems/5e/world/items/Staff of Withering.md +2 -0
- package/systems/5e/world/items/Staff of the Magi.md +3 -0
- package/systems/5e/world/items/Staff of the Python.md +1 -0
- package/systems/5e/world/items/Staff of the Woodlands.md +2 -0
- package/systems/5e/world/items/Staff.md +1 -0
- package/systems/5e/world/items/Steel Mirror.md +1 -0
- package/systems/5e/world/items/Stone of Controlling Earth Elementals.md +1 -0
- package/systems/5e/world/items/Stone of Good Luck.md +4 -0
- package/systems/5e/world/items/Studded Leather Armor.md +1 -0
- package/systems/5e/world/items/Sun Blade.md +1 -0
- package/systems/5e/world/items/Sword of Life Stealing.md +1 -0
- package/systems/5e/world/items/Sword of Sharpness.md +1 -0
- package/systems/5e/world/items/Sword of Wounding.md +1 -0
- package/systems/5e/world/items/Talisman of Pure Good.md +2 -0
- package/systems/5e/world/items/Talisman of Ultimate Evil.md +2 -0
- package/systems/5e/world/items/Talisman of the Sphere.md +1 -0
- package/systems/5e/world/items/Thieves' Tools.md +1 -0
- package/systems/5e/world/items/Tinderbox.md +1 -0
- package/systems/5e/world/items/Tinker's Tools.md +1 -0
- package/systems/5e/world/items/Tome of Clear Thought.md +1 -0
- package/systems/5e/world/items/Tome of Leadership and Influence.md +1 -0
- package/systems/5e/world/items/Tome of Understanding.md +1 -0
- package/systems/5e/world/items/Torch.md +1 -0
- package/systems/5e/world/items/Totem.md +1 -0
- package/systems/5e/world/items/Traveler's Clothes.md +1 -0
- package/systems/5e/world/items/Trident of Fish Command.md +2 -0
- package/systems/5e/world/items/Trident.md +1 -0
- package/systems/5e/world/items/Two-Person Tent.md +1 -0
- package/systems/5e/world/items/Unarmed Strike.md +1 -0
- package/systems/5e/world/items/Universal Solvent.md +1 -0
- package/systems/5e/world/items/Vial.md +1 -0
- package/systems/5e/world/items/Vicious Weapon.md +1 -0
- package/systems/5e/world/items/Viol.md +1 -0
- package/systems/5e/world/items/Vorpal Sword.md +1 -0
- package/systems/5e/world/items/Wagon.md +1 -0
- package/systems/5e/world/items/Wand of Binding.md +2 -0
- package/systems/5e/world/items/Wand of Enemy Detection.md +2 -0
- package/systems/5e/world/items/Wand of Fear.md +2 -0
- package/systems/5e/world/items/Wand of Fireballs.md +2 -0
- package/systems/5e/world/items/Wand of Lightning Bolts.md +2 -0
- package/systems/5e/world/items/Wand of Magic Detection.md +2 -0
- package/systems/5e/world/items/Wand of Magic Missiles.md +2 -0
- package/systems/5e/world/items/Wand of Paralysis.md +2 -0
- package/systems/5e/world/items/Wand of Polymorph.md +2 -0
- package/systems/5e/world/items/Wand of Secrets.md +2 -0
- package/systems/5e/world/items/Wand of Web.md +2 -0
- package/systems/5e/world/items/Wand of Wonder.md +2 -0
- package/systems/5e/world/items/Wand of the War Mage, +1, +2, or +3.md +1 -0
- package/systems/5e/world/items/Wand.md +1 -0
- package/systems/5e/world/items/War Pick.md +1 -0
- package/systems/5e/world/items/Warhammer.md +1 -0
- package/systems/5e/world/items/Warship.md +1 -0
- package/systems/5e/world/items/Waterskin.md +1 -0
- package/systems/5e/world/items/Weapon, +1, +2, or +3.md +1 -0
- package/systems/5e/world/items/Weaver's Tools.md +1 -0
- package/systems/5e/world/items/Well of Many Worlds.md +1 -0
- package/systems/5e/world/items/Whetstone.md +1 -0
- package/systems/5e/world/items/Whip.md +1 -0
- package/systems/5e/world/items/Wind Fan.md +1 -0
- package/systems/5e/world/items/Winged Boots.md +1 -0
- package/systems/5e/world/items/Wings of Flying.md +1 -0
- package/systems/5e/world/items/Woodcarver's Tools.md +1 -0
- package/systems/5e/world/items/Wooden Staff.md +1 -0
- package/systems/5e/world/items/Yew Wand.md +1 -0
- package/systems/free/instructions/play.md +5 -0
- package/systems/free/instructions/session-zero.md +1 -0
- package/systems/free/system.yaml +12 -0
- package/dist/dashboard/combat.js +0 -72
package/dist/dashboard/asked.js
CHANGED
|
@@ -1,22 +1,57 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "preact/jsx-runtime";
|
|
2
2
|
// What the master asks the player (D-279): the question, and a button for each check or answer; the click goes to the engine, which rolls the check and gives
|
|
3
3
|
// the master its result. Or the player's own words, in place of a button (ASK-10). A banner over the page, which never changes section by itself (D-276). By
|
|
4
4
|
// hand, as the player may choose for this browser, a check has no button: it is rolled from its row of the sheet or with the tray's dice (D-330).
|
|
5
5
|
import { Fragment } from "preact";
|
|
6
|
-
import { useEffect, useRef, useState } from "preact/hooks";
|
|
6
|
+
import { useEffect, useLayoutEffect, useRef, useState } from "preact/hooks";
|
|
7
7
|
import { answer } from "./api.js";
|
|
8
8
|
import { trayThrows } from "./dice/pool.js";
|
|
9
9
|
import { notationLabel } from "./game-words.js";
|
|
10
10
|
import { Icon, NotationIcons } from "./icons.js";
|
|
11
11
|
import { checkOf, notationModifier, sameDice, signed } from "./labels.js";
|
|
12
12
|
import { MapSheet } from "./map-sheet.js";
|
|
13
|
-
import { sheetAddress } from "./party.js";
|
|
13
|
+
import { sheetAddress, sideOf, Token } from "./party.js";
|
|
14
14
|
import { byHandPref, usePref } from "./prefs.js";
|
|
15
15
|
import { t, tParts } from "./text.js";
|
|
16
|
+
import { turnWords } from "./turns.js";
|
|
16
17
|
// How far below the top the banner stays, as in the style sheet; how many characters the player's own words may have, as the server takes them.
|
|
17
18
|
const bannerTop = 16;
|
|
18
19
|
const mostWords = 500;
|
|
19
|
-
|
|
20
|
+
// How much of the question a folded bar keeps in sight beside its answers, in pixels, on a wide screen.
|
|
21
|
+
const questionRoom = 240;
|
|
22
|
+
// The question is whole at the very top of the page. It folds once the player has scrolled down, from the highest point since it was whole, its own height
|
|
23
|
+
// and this share of the window more: the page they read has gone past it, not a nudge.
|
|
24
|
+
const topOfPage = 8;
|
|
25
|
+
const furtherShare = 0.4;
|
|
26
|
+
// How long after the wheel, a key, the scroll bar or a finger's fling a scroll is still the player's; any other is the page's own, and counts for nothing.
|
|
27
|
+
const wheelTime = 800;
|
|
28
|
+
const flingTime = 2500;
|
|
29
|
+
// How long the question takes to fold or open, the style sheet's --short, its height eased out as it opens and in as it folds.
|
|
30
|
+
const foldTime = 250;
|
|
31
|
+
const easeOut = "cubic-bezier(0.05, 0.7, 0.1, 1)";
|
|
32
|
+
const easeIn = "cubic-bezier(0.3, 0, 0.8, 0.15)";
|
|
33
|
+
const scrollKeys = new Set(["ArrowDown", "ArrowUp", "PageDown", "PageUp", "Home", "End", " "]);
|
|
34
|
+
/**
|
|
35
|
+
* The master's question. `yourTurn` when it is asked on the turn of whom it asks; `who`, with more than one player character, the one it asks, whose portrait
|
|
36
|
+
* takes the robot's place, the robot small on its edge, and whose name it says (D-480 (7)); `turnName`, then, whose turn it is, for a question that names no one.
|
|
37
|
+
*/
|
|
38
|
+
export function AskedBanner({ asked, yourTurn, who, turnName, map, place, answered, onAnswered }) {
|
|
39
|
+
// Folded to a bar that stays in sight, the checks still in it: by the player, even at the top of the page, until they open it or a new question comes;
|
|
40
|
+
// or down the page. How it changed last, for its motion.
|
|
41
|
+
const [folded, setFolded] = useState(false);
|
|
42
|
+
const [motion, setMotion] = useState("");
|
|
43
|
+
const foldedNow = useRef(folded);
|
|
44
|
+
foldedNow.current = folded;
|
|
45
|
+
const unfolding = useRef(false);
|
|
46
|
+
// Opened by the player, it stays open until they fold it or a new question comes.
|
|
47
|
+
const opened = useRef(false);
|
|
48
|
+
// The highest point of the page the player has scrolled to since the question was whole, and where the page was at the last look.
|
|
49
|
+
const travel = useRef({ from: window.scrollY, last: window.scrollY });
|
|
50
|
+
// Its height before it folded or opened, which it grows or shrinks from; folded down the page, the room it kept open, its height and margin, so that the
|
|
51
|
+
// page under it neither moves nor changes its length.
|
|
52
|
+
const before = useRef();
|
|
53
|
+
const kept = useRef();
|
|
54
|
+
const moving = useRef(false);
|
|
20
55
|
const [sent, setSent] = useState();
|
|
21
56
|
const [byHand, setByHand] = usePref(byHandPref);
|
|
22
57
|
const [picking, setPicking] = useState(false);
|
|
@@ -25,31 +60,236 @@ export function AskedBanner({ asked, yourTurn, map, place, answered, onAnswered
|
|
|
25
60
|
const banner = useRef(null);
|
|
26
61
|
const checks = asked.labels.map((label) => checkOf(label, asked.title));
|
|
27
62
|
const roll = checks.some((check) => check !== undefined);
|
|
63
|
+
// Folded, every answer stays in the bar while they all fit in a line beside the question; else only the checks. Their width, measured while all shown.
|
|
64
|
+
const [roomy, setRoomy] = useState(true);
|
|
65
|
+
const needed = useRef(0);
|
|
66
|
+
// A new question measures its own answers afresh.
|
|
67
|
+
useEffect(() => {
|
|
68
|
+
needed.current = 0;
|
|
69
|
+
setRoomy(true);
|
|
70
|
+
}, [asked.id]);
|
|
71
|
+
useLayoutEffect(() => {
|
|
72
|
+
const element = banner.current;
|
|
73
|
+
if (folded === false || element === null) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
const measure = () => {
|
|
77
|
+
const buttons = element.querySelector(".asked-buttons");
|
|
78
|
+
if (roomy && buttons !== null) {
|
|
79
|
+
needed.current = buttons.scrollWidth;
|
|
80
|
+
}
|
|
81
|
+
setRoomy(needed.current <= foldedRoom(element));
|
|
82
|
+
};
|
|
83
|
+
measure();
|
|
84
|
+
const observer = new ResizeObserver(measure);
|
|
85
|
+
observer.observe(element);
|
|
86
|
+
return () => observer.disconnect();
|
|
87
|
+
}, [folded, asked.id, roomy]);
|
|
28
88
|
// By hand, the note names the checks the sheet or the tray answer; the others keep their buttons (D-380).
|
|
29
89
|
const named = checks.flatMap((check, index) => (check !== undefined && byHandAnswers(asked, index) ? [check] : []));
|
|
30
90
|
// Answered from the sheet or the tray, the banner folds away as after a click.
|
|
31
91
|
const gone = sent !== undefined || answered === true;
|
|
32
|
-
// While the banner is there, the rolls beside the sheet stay in sight under it, as tall as it is, even as it folds away (D-291)
|
|
92
|
+
// While the banner is there, the rolls beside the sheet stay in sight under it, as tall as it is, even as it folds away (D-291); folding to its bar or
|
|
93
|
+
// opening, once it has its new height, as the page restyles itself at each change.
|
|
33
94
|
useEffect(() => {
|
|
34
95
|
const element = banner.current;
|
|
35
96
|
if (element === null) {
|
|
36
97
|
return;
|
|
37
98
|
}
|
|
38
99
|
const root = document.documentElement;
|
|
39
|
-
const observer = new ResizeObserver(() =>
|
|
100
|
+
const observer = new ResizeObserver(() => !moving.current && publishSpace(element));
|
|
40
101
|
observer.observe(element);
|
|
41
102
|
return () => {
|
|
42
103
|
observer.disconnect();
|
|
43
104
|
root.style.removeProperty("--asked-space");
|
|
105
|
+
freePage();
|
|
44
106
|
};
|
|
45
107
|
}, []);
|
|
46
|
-
// A question asked again takes the place of the one before: its buttons start unclicked.
|
|
108
|
+
// A question asked again takes the place of the one before: its buttons start unclicked, and it folds again as the page scrolls.
|
|
47
109
|
useEffect(() => {
|
|
110
|
+
opened.current = false;
|
|
111
|
+
travel.current = { from: window.scrollY, last: window.scrollY };
|
|
48
112
|
setSent(undefined);
|
|
49
113
|
setProblem(undefined);
|
|
50
114
|
setWords("");
|
|
51
115
|
setPicking(false);
|
|
116
|
+
setFolded(false);
|
|
117
|
+
setMotion("");
|
|
52
118
|
}, [asked.id]);
|
|
119
|
+
// Opened or folded by the player, the focus stays on the button that undoes it, drawn anew.
|
|
120
|
+
useEffect(() => {
|
|
121
|
+
const element = banner.current;
|
|
122
|
+
if (element === null || !unfolding.current) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
unfolding.current = false;
|
|
126
|
+
element.querySelector(".asked-fold")?.focus();
|
|
127
|
+
}, [folded]);
|
|
128
|
+
// Folded or opened, the question eases from its old height to its new one, its content fading in, unless the player asks for less motion. Folded down
|
|
129
|
+
// the page, its margin grows by what its height loses, so that the page keeps its length and its place.
|
|
130
|
+
useLayoutEffect(() => {
|
|
131
|
+
const element = banner.current;
|
|
132
|
+
if (element === null) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
const from = before.current;
|
|
136
|
+
before.current = undefined;
|
|
137
|
+
const room = kept.current;
|
|
138
|
+
if (room !== undefined) {
|
|
139
|
+
holdPage();
|
|
140
|
+
}
|
|
141
|
+
// In the room it keeps, height and margin always make the same: also from a height caught halfway, when the player opens it as it folds.
|
|
142
|
+
const to = element.getBoundingClientRect().height;
|
|
143
|
+
const marginFrom = room === undefined || from === undefined ? Number.parseFloat(getComputedStyle(element).marginBottom) : room.margin + room.height - from;
|
|
144
|
+
const marginTo = room === undefined ? marginFrom : folded === false ? room.margin : room.margin + room.height - to;
|
|
145
|
+
// Its last state; the page free to hold on to what the player reads only when no other motion follows.
|
|
146
|
+
const settle = (last = true) => {
|
|
147
|
+
if (last) {
|
|
148
|
+
freePage();
|
|
149
|
+
}
|
|
150
|
+
moving.current = false;
|
|
151
|
+
if (folded === false || room === undefined) {
|
|
152
|
+
element.style.removeProperty("margin-bottom");
|
|
153
|
+
kept.current = undefined;
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
element.style.marginBottom = `${marginTo}px`;
|
|
157
|
+
}
|
|
158
|
+
publishSpace(element);
|
|
159
|
+
};
|
|
160
|
+
if (from === undefined || matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
|
161
|
+
settle();
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
// Its margin at the end at once, under the animation, which holds the start until it plays.
|
|
165
|
+
element.style.marginBottom = `${marginTo}px`;
|
|
166
|
+
moving.current = true;
|
|
167
|
+
const easing = folded === false ? easeOut : easeIn;
|
|
168
|
+
const motion = element.animate([{ height: `${from}px`, marginBottom: `${marginFrom}px`, overflow: "hidden" }, { height: `${to}px`, marginBottom: `${marginTo}px`, overflow: "hidden" }], { duration: foldTime, easing });
|
|
169
|
+
motion.onfinish = () => settle();
|
|
170
|
+
return () => {
|
|
171
|
+
motion.onfinish = null;
|
|
172
|
+
motion.cancel();
|
|
173
|
+
settle(false);
|
|
174
|
+
};
|
|
175
|
+
}, [folded]);
|
|
176
|
+
// Scrolled down by the player far enough, past the page's header and stuck at the top, the question folds to its bar; back at the very top it is whole.
|
|
177
|
+
// Never when the player folded or opened it, has the keyboard in it, or has answered. A scroll that is not the player's, as the page holding on to what
|
|
178
|
+
// they read while something above it changes its height, moves where the count starts with it.
|
|
179
|
+
useEffect(() => {
|
|
180
|
+
const change = (element, now) => {
|
|
181
|
+
const box = element.getBoundingClientRect();
|
|
182
|
+
if (now === "scroll") {
|
|
183
|
+
kept.current = { height: box.height, margin: Number.parseFloat(getComputedStyle(element).marginBottom) };
|
|
184
|
+
}
|
|
185
|
+
holdPage();
|
|
186
|
+
before.current = box.height;
|
|
187
|
+
setMotion(now === false ? "opening" : "folding");
|
|
188
|
+
setFolded(now);
|
|
189
|
+
};
|
|
190
|
+
// Until when a scroll is the player's: the wheel, a key, a finger or the scroll bar.
|
|
191
|
+
let theirsUntil = 0;
|
|
192
|
+
let held = false;
|
|
193
|
+
const theirs = (time) => () => {
|
|
194
|
+
theirsUntil = Math.max(theirsUntil, performance.now() + time);
|
|
195
|
+
};
|
|
196
|
+
const wheel = theirs(wheelTime);
|
|
197
|
+
const fling = theirs(flingTime);
|
|
198
|
+
const key = (event) => {
|
|
199
|
+
const typing = event.target instanceof HTMLElement && event.target.closest(event.key === " " ? "input, textarea, select, [contenteditable], button, summary, a" : "input, textarea, select, [contenteditable]") !== null;
|
|
200
|
+
if (scrollKeys.has(event.key) && !typing) {
|
|
201
|
+
wheel();
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
// A finger on the page, or the pointer on the scroll bar, which the page itself is the target of.
|
|
205
|
+
const press = (event) => {
|
|
206
|
+
held = event.type === "touchstart" || event.target === document.documentElement;
|
|
207
|
+
};
|
|
208
|
+
const release = () => {
|
|
209
|
+
if (held) {
|
|
210
|
+
held = false;
|
|
211
|
+
fling();
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
// Read once a frame, however often the page scrolls.
|
|
215
|
+
let queued = false;
|
|
216
|
+
const queue = () => {
|
|
217
|
+
if (!queued) {
|
|
218
|
+
queued = true;
|
|
219
|
+
requestAnimationFrame(() => {
|
|
220
|
+
queued = false;
|
|
221
|
+
onScroll();
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
const onScroll = () => {
|
|
226
|
+
const element = banner.current;
|
|
227
|
+
const now = window.scrollY;
|
|
228
|
+
const count = travel.current;
|
|
229
|
+
if (held || performance.now() < theirsUntil) {
|
|
230
|
+
count.from = Math.min(count.from, now);
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
count.from += now - count.last;
|
|
234
|
+
}
|
|
235
|
+
count.last = now;
|
|
236
|
+
if (element === null || gone || picking || moving.current || foldedNow.current === "hand" || element.querySelector(":focus-visible") !== null) {
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
if (now <= topOfPage) {
|
|
240
|
+
count.from = now;
|
|
241
|
+
if (foldedNow.current === "scroll") {
|
|
242
|
+
change(element, false);
|
|
243
|
+
}
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
// The top has drawn itself together first, and is still; the question stuck under it.
|
|
247
|
+
const header = document.querySelector(".top.compact");
|
|
248
|
+
const still = header !== null && !header.getAnimations({ subtree: true }).some((running) => running instanceof CSSTransition);
|
|
249
|
+
const stuck = element.getBoundingClientRect().top <= Number.parseFloat(getComputedStyle(element).top) + 1;
|
|
250
|
+
const further = element.offsetHeight + window.innerHeight * furtherShare;
|
|
251
|
+
if (foldedNow.current === false && !opened.current && still && stuck && now - count.from >= further) {
|
|
252
|
+
change(element, "scroll");
|
|
253
|
+
}
|
|
254
|
+
};
|
|
255
|
+
// The top done drawing itself together, the question may fold where the page already is.
|
|
256
|
+
const settled = (event) => {
|
|
257
|
+
if (event.target instanceof Element && event.target.closest(".top") !== null) {
|
|
258
|
+
queue();
|
|
259
|
+
}
|
|
260
|
+
};
|
|
261
|
+
window.addEventListener("scroll", queue, { passive: true });
|
|
262
|
+
window.addEventListener("wheel", wheel, { passive: true });
|
|
263
|
+
window.addEventListener("keydown", key);
|
|
264
|
+
window.addEventListener("pointerdown", press);
|
|
265
|
+
window.addEventListener("pointerup", release);
|
|
266
|
+
window.addEventListener("touchstart", press, { passive: true });
|
|
267
|
+
window.addEventListener("touchend", release);
|
|
268
|
+
window.addEventListener("touchcancel", release);
|
|
269
|
+
document.addEventListener("transitionend", settled);
|
|
270
|
+
return () => {
|
|
271
|
+
window.removeEventListener("scroll", queue);
|
|
272
|
+
window.removeEventListener("wheel", wheel);
|
|
273
|
+
window.removeEventListener("keydown", key);
|
|
274
|
+
window.removeEventListener("pointerdown", press);
|
|
275
|
+
window.removeEventListener("pointerup", release);
|
|
276
|
+
window.removeEventListener("touchstart", press);
|
|
277
|
+
window.removeEventListener("touchend", release);
|
|
278
|
+
window.removeEventListener("touchcancel", release);
|
|
279
|
+
document.removeEventListener("transitionend", settled);
|
|
280
|
+
};
|
|
281
|
+
}, [gone, picking]);
|
|
282
|
+
// Folded or opened by the player, it stays so until they change it or a new question comes.
|
|
283
|
+
const fold = (now) => {
|
|
284
|
+
unfolding.current = true;
|
|
285
|
+
opened.current = !now;
|
|
286
|
+
before.current = banner.current?.getBoundingClientRect().height;
|
|
287
|
+
if (kept.current !== undefined) {
|
|
288
|
+
holdPage();
|
|
289
|
+
}
|
|
290
|
+
setMotion(now ? "folding" : "opening");
|
|
291
|
+
setFolded(now ? "hand" : false);
|
|
292
|
+
};
|
|
53
293
|
// A button by its place, the player's own words, or a square of the map.
|
|
54
294
|
const reply = async (given) => {
|
|
55
295
|
setSent(typeof given === "number" ? given : typeof given === "string" ? "words" : "square");
|
|
@@ -71,18 +311,56 @@ export function AskedBanner({ asked, yourTurn, map, place, answered, onAnswered
|
|
|
71
311
|
void reply(words.trim());
|
|
72
312
|
}
|
|
73
313
|
};
|
|
74
|
-
|
|
314
|
+
// A check's button, or an answer's; by hand a check has none, as its row of the sheet and the tray's dice answer it, unless neither does.
|
|
315
|
+
const answerButton = (label, index, onlyChecks = false) => {
|
|
316
|
+
const check = checks[index];
|
|
317
|
+
const kind = check !== undefined ? "asked-check" : roll ? "asked-other" : "asked-answer";
|
|
318
|
+
if ((check !== undefined && byHand && byHandAnswers(asked, index)) || (onlyChecks && check === undefined)) {
|
|
319
|
+
return null;
|
|
320
|
+
}
|
|
321
|
+
return (_jsx("button", { type: "button", class: sent === index ? `${kind} sent` : kind, disabled: gone, title: notationLabel(asked.words?.[index] ?? undefined), onClick: () => void reply(index), children: check === undefined ? label : _jsx(CheckLabel, { check: check.check, dice: check.dice, name: asked.names?.[index] ?? keptName(check.dice) }) }, label));
|
|
322
|
+
};
|
|
323
|
+
const classes = ["asked", roll ? "asked-roll" : "", gone ? "leaving" : "", folded === false ? "" : "folded", motion].filter((name) => name !== "").join(" ");
|
|
324
|
+
const toggle = (_jsx("button", { type: "button", class: "icon-button asked-fold", "aria-expanded": folded === false, "aria-label": folded === false ? t("Fold the question") : t("Open the question"), "data-tip": folded === false ? t("Fold the question") : undefined, onClick: () => fold(folded === false), children: folded === false && _jsx(Icon, { name: "minus" }) }));
|
|
325
|
+
if (folded !== false) {
|
|
326
|
+
// Folded, a bar the whole width: the question in a line, its answers when they fit or else the checks' buttons, and the button that opens it again.
|
|
327
|
+
const shown = asked.labels.map((label, index) => answerButton(label, index, !roomy)).filter((button) => button !== null);
|
|
328
|
+
return (_jsxs("section", { ref: banner, class: classes, "aria-label": t("What the master asks"), children: [who === undefined ? _jsx("img", { class: "asked-robot", src: "/assets/favicon.svg", alt: "" }) : _jsx(AskedWho, { member: who }), _jsxs("p", { class: "asked-bar-question", children: [who !== undefined && (_jsxs(_Fragment, { children: [_jsx("b", { class: "asked-bar-name", children: who.name }), " · "] })), asked.question] }), shown.length > 0 && _jsx("div", { class: "asked-buttons", children: shown }), toggle] }));
|
|
329
|
+
}
|
|
330
|
+
return (_jsxs("section", { ref: banner, class: classes, "aria-labelledby": `asked-${asked.id}`, children: [toggle, who === undefined ? _jsx("img", { class: "asked-robot", src: "/assets/favicon.svg", alt: "" }) : _jsx(AskedWho, { member: who }), _jsxs("div", { class: "asked-body", children: [yourTurn ? _jsx("p", { class: "eyebrow asked-turn", children: turnWords(who?.name ?? turnName) }) : who !== undefined && _jsx("p", { class: "eyebrow asked-turn", children: t("For {name}", { name: who.name }) }), _jsx("h2", { class: "asked-title", children: asked.title }), _jsxs("p", { id: `asked-${asked.id}`, class: "asked-question", role: "alert", children: [who !== undefined && _jsx("span", { class: "visually-hidden", children: `${who.name}: ` }), asked.question] }), named.length > 0 && byHand && (_jsxs("p", { class: "asked-hand-note", children: [_jsx(Icon, { name: "hand" }), _jsx("span", { children: tParts("Roll {checks} yourself, on {sheet} or with the dice.", {
|
|
75
331
|
checks: named.map((check, index) => (_jsxs(Fragment, { children: [index > 0 && (index === named.length - 1 ? ` ${t("or")} ` : ", "), _jsxs("a", { class: "asked-hand-check", href: sheetAddress(asked.who ?? ""), onClick: () => showRow(asked.fields?.[asked.labels.findIndex((label) => checkOf(label, asked.title)?.check === check.check)]), children: [_jsx(NotationIcons, { notation: check.dice }), check.check] })] }, check.check))),
|
|
76
|
-
sheet: _jsx("a", { href: sheetAddress(asked.who ?? ""), children: t("your sheet") }),
|
|
77
|
-
}).map((part, index) => _jsx(Fragment, { children: part }, index)) })] })), _jsxs("div", { class: "asked-buttons", children: [asked.square && map !== undefined && (_jsxs("button", { type: "button", class: sent === "square" ? "asked-check sent" : "asked-check", disabled: gone, onClick: () => setPicking(true), children: [_jsx(Icon, { name: "world" }), _jsx("span", { class: "asked-check-name", children: t("Choose on the map") })] })), asked.labels.map((label, index) => {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
332
|
+
sheet: _jsx("a", { href: sheetAddress(asked.who ?? ""), children: who === undefined ? t("your sheet") : t("{name}'s sheet", { name: who.name }) }),
|
|
333
|
+
}).map((part, index) => _jsx(Fragment, { children: part }, index)) })] })), _jsxs("div", { class: "asked-buttons", children: [asked.square && map !== undefined && (_jsxs("button", { type: "button", class: sent === "square" ? "asked-check sent" : "asked-check", disabled: gone, onClick: () => setPicking(true), children: [_jsx(Icon, { name: "world" }), _jsx("span", { class: "asked-check-name", children: t("Choose on the map") })] })), asked.labels.map((label, index) => answerButton(label, index))] }), _jsxs("div", { class: "asked-foot", children: [_jsxs("form", { class: "asked-own", onSubmit: own, children: [_jsx("input", { type: "text", value: words, maxLength: mostWords, placeholder: t("Or write what you do…"), "aria-label": t("Or write what you do"), disabled: gone, onInput: (event) => setWords(event.currentTarget.value) }), _jsx("button", { type: "submit", class: "icon-button", "aria-label": t("Send"), "data-tip": t("Send"), disabled: gone || words.trim() === "", children: _jsx(Icon, { name: "send" }) })] }), roll && (_jsxs("label", { class: "asked-hand", children: [_jsx("input", { type: "checkbox", role: "switch", checked: byHand, onChange: (event) => setByHand(event.currentTarget.checked) }), _jsx(Icon, { name: "hand" }), t("By hand")] }))] }), problem && _jsx("p", { class: "asked-problem", role: "alert", children: problem })] }), picking && map !== undefined && _jsx(MapSheet, { map: map, place: place ?? "", question: asked.question, onPick: (square) => void reply({ square }), onClose: () => setPicking(false) })] }));
|
|
334
|
+
}
|
|
335
|
+
/** The portrait of the player character the master asks, where the robot was, the robot small on its edge (D-480 (7)); its name is in the words beside it. */
|
|
336
|
+
function AskedWho({ member }) {
|
|
337
|
+
return (_jsxs("span", { class: "asked-who", children: [_jsx(Token, { member: member, side: sideOf(member.role) }), _jsx("img", { class: "asked-who-robot", src: "/assets/favicon.svg", alt: "" })] }));
|
|
338
|
+
}
|
|
339
|
+
/** The width the folded bar leaves its answers: beside the robot and some of the question on a wide screen; a line of their own on a phone. */
|
|
340
|
+
function foldedRoom(element) {
|
|
341
|
+
const style = getComputedStyle(element);
|
|
342
|
+
const inner = element.clientWidth - Number.parseFloat(style.paddingLeft) - Number.parseFloat(style.paddingRight);
|
|
343
|
+
const robot = element.querySelector(".asked-robot, .asked-who");
|
|
344
|
+
const gap = Number.parseFloat(style.columnGap) || 0;
|
|
345
|
+
const beside = matchMedia("(max-width: 600px)").matches ? 0 : (robot?.offsetWidth ?? 0) + questionRoom + 2 * gap;
|
|
346
|
+
return inner - beside;
|
|
347
|
+
}
|
|
348
|
+
/** Tells what stays on top beside the page, the rolls, how much room the question takes. */
|
|
349
|
+
function publishSpace(element) {
|
|
350
|
+
document.documentElement.style.setProperty("--asked-space", `${element.offsetHeight + bannerTop}px`);
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* Keeps the page where it is while the question changes its height and margin by the same amount: the browser would otherwise move the page for the moment
|
|
354
|
+
* the question is measured at its new height, and stop at its top. Chrome reads it from the body as well as from the root.
|
|
355
|
+
*/
|
|
356
|
+
function holdPage() {
|
|
357
|
+
document.documentElement.style.overflowAnchor = "none";
|
|
358
|
+
document.body.style.overflowAnchor = "none";
|
|
359
|
+
}
|
|
360
|
+
/** Lets the browser hold on to what the player reads again. */
|
|
361
|
+
function freePage() {
|
|
362
|
+
document.documentElement.style.removeProperty("overflow-anchor");
|
|
363
|
+
document.body.style.removeProperty("overflow-anchor");
|
|
86
364
|
}
|
|
87
365
|
/** Whether a check can be answered by hand: a field of the sheet it alone names, whose row lights, or dice the tray can throw and tells from the other checks'. */
|
|
88
366
|
function byHandAnswers(asked, index) {
|
|
@@ -117,7 +395,7 @@ function showRow(field) {
|
|
|
117
395
|
* A check's button (D-297): its dice as pictures, one of two faded when only one counts, its name, the number added and what kind of roll it is in words, as
|
|
118
396
|
* "with advantage" (D-399); the notation is in the tooltip.
|
|
119
397
|
*/
|
|
120
|
-
function CheckLabel({ check, dice, name }) {
|
|
398
|
+
export function CheckLabel({ check, dice, name }) {
|
|
121
399
|
const modifier = notationModifier(dice);
|
|
122
400
|
return (_jsxs(_Fragment, { children: [_jsx(NotationIcons, { notation: dice }), _jsx("span", { class: "asked-check-name", children: check }), modifier !== 0 && _jsx("span", { class: "asked-dice", children: signed(modifier) }), name !== undefined && _jsx("span", { class: "asked-roll-name", children: name }), _jsx("span", { class: "visually-hidden", children: dice })] }));
|
|
123
401
|
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/** The month `offset` months from today's, with its first game day; none without a calendar start. */
|
|
2
|
+
export function monthAt(calendar, offset) {
|
|
3
|
+
const { months, date, today } = calendar;
|
|
4
|
+
if (months === undefined || months.length === 0 || date === undefined || today === undefined) {
|
|
5
|
+
return undefined;
|
|
6
|
+
}
|
|
7
|
+
let month = date.month;
|
|
8
|
+
let year = date.year;
|
|
9
|
+
let first = today - (date.day - 1);
|
|
10
|
+
for (let step = 0; step < offset; step++) {
|
|
11
|
+
first += months[month].days;
|
|
12
|
+
[month, year] = month === months.length - 1 ? [0, year === undefined ? undefined : year + 1] : [month + 1, year];
|
|
13
|
+
}
|
|
14
|
+
for (let step = 0; step > offset; step--) {
|
|
15
|
+
[month, year] = month === 0 ? [months.length - 1, year === undefined ? undefined : year - 1] : [month - 1, year];
|
|
16
|
+
first -= months[month].days;
|
|
17
|
+
}
|
|
18
|
+
const { name, days, season } = months[month];
|
|
19
|
+
return { offset, month, name, days, ...(season === undefined ? {} : { season }), ...(year === undefined ? {} : { year }), first };
|
|
20
|
+
}
|
|
21
|
+
/** How many months from today's the month of a game day is; 0 without a calendar start. */
|
|
22
|
+
export function monthOffsetOf(calendar, gameDay) {
|
|
23
|
+
let offset = 0;
|
|
24
|
+
let month = monthAt(calendar, offset);
|
|
25
|
+
while (month !== undefined && gameDay < month.first) {
|
|
26
|
+
offset -= 1;
|
|
27
|
+
month = monthAt(calendar, offset);
|
|
28
|
+
}
|
|
29
|
+
while (month !== undefined && gameDay >= month.first + month.days) {
|
|
30
|
+
offset += 1;
|
|
31
|
+
month = monthAt(calendar, offset);
|
|
32
|
+
}
|
|
33
|
+
return month === undefined ? 0 : offset;
|
|
34
|
+
}
|
|
35
|
+
/** The day of the calendar a game day is: from today's, counting the months' days, the first month again after the last and the year one more. */
|
|
36
|
+
export function calendarDateOf(calendar, gameDay) {
|
|
37
|
+
const month = monthAt(calendar, monthOffsetOf(calendar, gameDay));
|
|
38
|
+
return month === undefined
|
|
39
|
+
? undefined
|
|
40
|
+
: { day: gameDay - month.first + 1, month: month.month, name: month.name, ...(month.season === undefined ? {} : { season: month.season }), ...(month.year === undefined ? {} : { year: month.year }) };
|
|
41
|
+
}
|
|
42
|
+
/** What a game day holds. */
|
|
43
|
+
export function dayMarks(calendar, gameDay) {
|
|
44
|
+
const today = calendar.today ?? 1;
|
|
45
|
+
return {
|
|
46
|
+
today: gameDay === calendar.today,
|
|
47
|
+
lived: gameDay >= 1 && gameDay <= today,
|
|
48
|
+
scenes: calendar.scenes.filter((scene) => scene.day === gameDay),
|
|
49
|
+
deadlines: calendar.deadlines.filter((deadline) => deadline.day === gameDay),
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/** The game days a story without a calendar draws: from day 1 to the last that holds something, today included, in whole rows. */
|
|
53
|
+
export function storyDays(calendar, row) {
|
|
54
|
+
const last = Math.max(calendar.today ?? 1, ...calendar.deadlines.map((deadline) => deadline.day), ...calendar.scenes.map((scene) => scene.day));
|
|
55
|
+
return Array.from({ length: Math.ceil(last / row) * row }, (_, index) => index + 1);
|
|
56
|
+
}
|
package/dist/dashboard/card.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
|
|
2
2
|
import { useEffect, useState } from "preact/hooks";
|
|
3
|
+
import { t } from "./text.js";
|
|
3
4
|
// Up to this width the cards start closed.
|
|
4
5
|
const narrow = "(max-width: 600px)";
|
|
5
6
|
// The chevron: down while the card is closed, turned up once it is open.
|
|
6
7
|
const chevronPath = "M6 9.5l6 6 6-6";
|
|
7
8
|
/**
|
|
8
9
|
* Whether a card is open, and what opens and closes it: only the player's click, which the browser remembers by the card's name; the page setting it is not.
|
|
9
|
-
* Until then a card starts closed on a phone, but the one that is `first
|
|
10
|
+
* Until then a card starts closed on a phone, but the one that is `first`, or as `start` says.
|
|
10
11
|
*/
|
|
11
|
-
export function useOpen(name, first = false) {
|
|
12
|
-
const [open, setOpen] = useState(() => storedOpen(name, first));
|
|
12
|
+
export function useOpen(name, first = false, start) {
|
|
13
|
+
const [open, setOpen] = useState(() => storedOpen(name, first, start));
|
|
13
14
|
const toggle = (event) => {
|
|
14
15
|
event.preventDefault();
|
|
15
16
|
setOpen(!open);
|
|
@@ -29,17 +30,17 @@ export function useMedia(query) {
|
|
|
29
30
|
return matches;
|
|
30
31
|
}
|
|
31
32
|
/**
|
|
32
|
-
* A card's header, all of it the toggle: its icon, its title, what it holds while closed, for the eye alone,
|
|
33
|
-
* chevron and does not close.
|
|
33
|
+
* A card's header, all of it the toggle: its icon, its title, what it holds while closed, for the eye alone, a note that stays, and the chevron, whose tooltip
|
|
34
|
+
* says what a click does; a card that stays open has no chevron and does not close.
|
|
34
35
|
*/
|
|
35
|
-
export function CardHeader({ icon, title, preview, open, onToggle, fixed }) {
|
|
36
|
-
return (_jsxs("summary", { class: fixed ? "fixed" : undefined, onClick: fixed ? (event) => event.preventDefault() : onToggle, children: [_jsx("svg", { class: "card-icon", viewBox: "0 0 24 24", "aria-hidden": "true", children: _jsx("path", { d: icon }) }), title, !open && preview !== undefined && _jsx("span", { class: "preview", "aria-hidden": "true", children: preview }), !fixed && (_jsx("svg", { class: "chevron", viewBox: "0 0 24 24", "aria-hidden": "true", children: _jsx("path", { d: chevronPath }) }))] }));
|
|
36
|
+
export function CardHeader({ icon, title, preview, note, open, onToggle, fixed }) {
|
|
37
|
+
return (_jsxs("summary", { class: fixed ? "fixed" : undefined, onClick: fixed ? (event) => event.preventDefault() : onToggle, children: [_jsx("svg", { class: "card-icon", viewBox: "0 0 24 24", "aria-hidden": "true", children: _jsx("path", { d: icon }) }), title, !open && preview !== undefined && _jsx("span", { class: "preview", "aria-hidden": "true", children: preview }), note !== undefined && _jsx("span", { class: "card-head-note", children: note }), !fixed && (_jsx("span", { class: "chevron-tip tip-left", "aria-hidden": "true", "data-tip": open ? t("Close") : t("Open"), children: _jsx("svg", { class: "chevron", viewBox: "0 0 24 24", "aria-hidden": "true", children: _jsx("path", { d: chevronPath }) }) }))] }));
|
|
37
38
|
}
|
|
38
|
-
/** The header of a card that is always open
|
|
39
|
-
export function CardHead({ icon, title, note }) {
|
|
40
|
-
return (_jsxs("header", { class: "card-head", children: [_jsx("svg", { class: "card-icon", viewBox: "0 0 24 24", "aria-hidden": "true", children: _jsx("path", { d: icon }) }), title, note !== undefined && _jsx("span", { class: "card-head-note", children: note })] }));
|
|
39
|
+
/** The header of a card that is always open (D-419): the look of a card's header, its icon, its title, a note at its end, and its own buttons after it; no toggle. */
|
|
40
|
+
export function CardHead({ icon, title, note, children }) {
|
|
41
|
+
return (_jsxs("header", { class: "card-head", children: [_jsx("svg", { class: "card-icon", viewBox: "0 0 24 24", "aria-hidden": "true", children: _jsx("path", { d: icon }) }), title, note !== undefined && _jsx("span", { class: "card-head-note", children: note }), children] }));
|
|
41
42
|
}
|
|
42
|
-
function storedOpen(name, first) {
|
|
43
|
+
function storedOpen(name, first, start) {
|
|
43
44
|
try {
|
|
44
45
|
const stored = localStorage.getItem(`rpg-group:${name}`);
|
|
45
46
|
if (stored !== null) {
|
|
@@ -49,7 +50,7 @@ function storedOpen(name, first) {
|
|
|
49
50
|
catch {
|
|
50
51
|
// No storage, as in a private window: the default.
|
|
51
52
|
}
|
|
52
|
-
return first || !matchMedia(narrow).matches;
|
|
53
|
+
return start ?? (first || !matchMedia(narrow).matches);
|
|
53
54
|
}
|
|
54
55
|
function storeOpen(name, open) {
|
|
55
56
|
try {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
|
|
2
|
+
import { shownText } from "./labels.js";
|
|
3
|
+
/** The coins of a value that is money, from the one worth most. */
|
|
4
|
+
export function Coins({ coins }) {
|
|
5
|
+
return (_jsx("span", { class: "coins", children: coins.map(({ coin, count, metal }) => {
|
|
6
|
+
const name = shownText(coin);
|
|
7
|
+
return (_jsxs("span", { class: "coin", "data-metal": metal, title: `${count} ${name}`, children: [_jsx(CoinDisc, {}), _jsx("span", { class: "num", children: count }), _jsx("span", { class: "coin-name", children: name })] }, coin));
|
|
8
|
+
}) }));
|
|
9
|
+
}
|
|
10
|
+
/** A coin's disc: its face and rim in the colours of its metal, a ring stamped inside and a glint. */
|
|
11
|
+
function CoinDisc() {
|
|
12
|
+
return (_jsxs("svg", { class: "coin-disc", viewBox: "0 0 16 16", "aria-hidden": "true", children: [_jsx("circle", { class: "coin-face", cx: "8", cy: "8", r: "6.9" }), _jsx("circle", { class: "coin-ring", cx: "8", cy: "8", r: "4.1" }), _jsx("path", { class: "coin-glint", d: "M4.6 6.1a3.9 3.9 0 0 1 2.3-2.2" })] }));
|
|
13
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "preact/jsx-runtime";
|
|
2
|
+
// The death save the master asks of the player (D-460, D-461): a card of its own over the page, which stays until the outcome is told. The character's portrait
|
|
3
|
+
// greyed, a ring that beats and a line of the heart; the successes on one side, the failures on the other, what each face does under the one button. Once the
|
|
4
|
+
// dice land, the outcome in words, the new mark lit, the line and the portrait as it says: back in colour on the highest face, flat and grey at the last failure.
|
|
5
|
+
import { useEffect, useRef } from "preact/hooks";
|
|
6
|
+
import { CheckLabel } from "./asked.js";
|
|
7
|
+
import { HeartLine, Marks, sideLabel, Skull, stableWord } from "./dying.js";
|
|
8
|
+
import { Icon } from "./icons.js";
|
|
9
|
+
import { checkOf, fieldLabel } from "./labels.js";
|
|
10
|
+
import { Token } from "./party.js";
|
|
11
|
+
import { t } from "./text.js";
|
|
12
|
+
import { turnWords } from "./turns.js";
|
|
13
|
+
/** The card of a death save asked of the player, from the question to its outcome, which the player closes once read. */
|
|
14
|
+
export function DeathSaveCard({ asked, save, member, name, roll, outcome, rolling, onRoll, onClose }) {
|
|
15
|
+
const card = useRef(null);
|
|
16
|
+
const check = checkOf(asked.labels[0] ?? "", asked.title);
|
|
17
|
+
const successes = outcome?.successes ?? save.successes.value;
|
|
18
|
+
const failures = outcome?.failures ?? save.failures.value;
|
|
19
|
+
const highest = save.highest === undefined ? undefined : `${save.highest.value} ${fieldLabel(save.highest.field)}`;
|
|
20
|
+
const told = roll === undefined ? (rolling ? "rolling" : "asking") : outcome === undefined ? "told" : `told ${outcome.kind}`;
|
|
21
|
+
const classes = ["dying-card", told].join(" ");
|
|
22
|
+
const words = outcome === undefined ? "" : outcomeWords(outcome, highest, stableWord(member?.dying));
|
|
23
|
+
// Each side named as the panel of the dying names it, by the counters of who rolls.
|
|
24
|
+
const label = (side) => sideLabel({ field: save[side].field, mark: member?.dying?.find((counter) => counter.side === side)?.mark });
|
|
25
|
+
// While it is there, the rolls beside the sheet stay in sight under it, as under the master's question (D-291).
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
const element = card.current;
|
|
28
|
+
if (element === null) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const root = document.documentElement;
|
|
32
|
+
const observer = new ResizeObserver(() => root.style.setProperty("--asked-space", `${element.offsetHeight + 16}px`));
|
|
33
|
+
observer.observe(element);
|
|
34
|
+
return () => {
|
|
35
|
+
observer.disconnect();
|
|
36
|
+
root.style.removeProperty("--asked-space");
|
|
37
|
+
};
|
|
38
|
+
}, []);
|
|
39
|
+
return (_jsxs("section", { ref: card, class: classes, "aria-labelledby": `dying-${asked.id}`, children: [roll !== undefined && (_jsx("button", { type: "button", class: "icon-button dying-close", "aria-label": t("Close"), "data-tip": t("Close"), onClick: onClose, children: _jsx(Icon, { name: "close" }) })), _jsx("p", { class: "eyebrow asked-turn", children: check === undefined ? turnWords(name) : `${turnWords(name)} · ${check.check}` }), _jsx("p", { id: `dying-${asked.id}`, class: "asked-question", role: roll === undefined ? "alert" : undefined, children: asked.question }), _jsxs("div", { class: "dying-life", children: [_jsx(HeartLine, { line: heartLine(outcome?.kind) }), _jsx(Marks, { kind: "successes", label: label("successes"), value: successes, most: save.successes.most, lit: outcome?.kind === "success" || outcome?.kind === "stable" ? 1 : 0 }), _jsx("span", { class: "dying-token", children: member !== undefined && _jsx(Token, { member: member, large: true }) }), _jsx(Marks, { kind: "failures", label: label("failures"), value: failures, most: save.failures.most, lit: outcome?.count ?? 0 })] }), _jsxs("div", { class: "dying-foot", children: [roll === undefined && (_jsx("button", { type: "button", class: rolling ? "dying-roll sent" : "dying-roll", disabled: rolling, "aria-describedby": `dying-stakes-${asked.id}`, onClick: onRoll, children: check === undefined ? asked.labels[0] : _jsx(CheckLabel, { check: check.check, dice: check.dice, name: undefined }) })), _jsx("p", { class: "dying-word", role: "status", children: roll !== undefined && (_jsxs(_Fragment, { children: [_jsxs("span", { "aria-hidden": "true", children: [outcome === undefined ? roll.total : `${roll.total} · `, outcome?.kind === "dead" && _jsx(Skull, {}), words] }), _jsx("span", { class: "visually-hidden", children: outcome === undefined
|
|
40
|
+
? String(roll.total)
|
|
41
|
+
: `${roll.total}: ${words}. ${label("successes")}: ${t("{value} of {max}", { value: successes, max: save.successes.most })}; ${label("failures")}: ${t("{value} of {max}", { value: failures, max: save.failures.most })}.` })] })) }), _jsx("p", { id: `dying-stakes-${asked.id}`, class: "dying-stakes", children: [
|
|
42
|
+
t("{value} or more: a success", { value: save.atLeast }),
|
|
43
|
+
...(save.lowest === undefined ? [] : [save.lowest === 2 ? t("{face}: two failures", { face: 1 }) : t("{face}: {count} failures", { face: 1, count: save.lowest })]),
|
|
44
|
+
...(highest === undefined ? [] : [t("{face}: back up with {value}", { face: save.sides, value: highest })]),
|
|
45
|
+
].join(" · ") })] })] }));
|
|
46
|
+
}
|
|
47
|
+
/** The outcome in the page's words, stable as the system calls it. */
|
|
48
|
+
function outcomeWords(outcome, highest, stable) {
|
|
49
|
+
switch (outcome.kind) {
|
|
50
|
+
case "success":
|
|
51
|
+
return t("Success");
|
|
52
|
+
case "stable":
|
|
53
|
+
return stable;
|
|
54
|
+
case "failure":
|
|
55
|
+
return t("Failure");
|
|
56
|
+
case "failures":
|
|
57
|
+
return outcome.count === 2 ? t("Two failures") : t("{count} failures", { count: outcome.count });
|
|
58
|
+
case "dead":
|
|
59
|
+
return t("Dead");
|
|
60
|
+
case "back":
|
|
61
|
+
return highest === undefined ? t("Back up") : t("Back up with {value}", { value: highest });
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/** The line of the heart for an outcome: faint while it is to roll, a beat at a success, weaker at a failure, strong back on their feet, flat at the last. */
|
|
65
|
+
function heartLine(kind) {
|
|
66
|
+
return kind === undefined ? "faint" : kind === "back" ? "strong" : kind === "dead" ? "flat" : kind === "success" || kind === "stable" ? "beat" : "weak";
|
|
67
|
+
}
|
|
@@ -41,6 +41,28 @@ export function withDropped(dice, keeps) {
|
|
|
41
41
|
}));
|
|
42
42
|
return dice.map((die, index) => (dropped.has(index) ? { ...die, dropped: true } : die));
|
|
43
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* The dice thrown with those a notation does not count dropped, as the system writes a better or a worse roll: 2d20kl1 keeps the lowest d20, 2d20dl1 drops it,
|
|
46
|
+
* 4d6kh3 keeps the three highest; a kind it says nothing of counts whole.
|
|
47
|
+
*/
|
|
48
|
+
export function droppedBy(dice, written) {
|
|
49
|
+
const dropped = new Set([...written.toLowerCase().matchAll(/\d*d(\d+)([kd])([hl])(\d*)/g)].flatMap(([, sides, rule, which, count]) => {
|
|
50
|
+
const ofKind = dice.map((die, index) => ({ die, index })).filter(({ die }) => die.sides === Number(sides)).toSorted((first, second) => first.die.value - second.die.value);
|
|
51
|
+
const many = Math.min(ofKind.length, count === "" ? 1 : Number(count));
|
|
52
|
+
// From the lowest up: keeping the highest drops all but the top ones, dropping the lowest drops the bottom ones.
|
|
53
|
+
const gone = rule === "k" ? (which === "h" ? ofKind.slice(0, ofKind.length - many) : ofKind.slice(many)) : which === "l" ? ofKind.slice(0, many) : ofKind.slice(ofKind.length - many);
|
|
54
|
+
return gone.map(({ index }) => index);
|
|
55
|
+
}));
|
|
56
|
+
return dice.map((die, index) => (dropped.has(index) ? { ...die, dropped: true } : die));
|
|
57
|
+
}
|
|
58
|
+
/** The total of dice thrown: the faces that count, the dropped ones left out, and the number added. */
|
|
59
|
+
export function keptTotal(dice, modifier) {
|
|
60
|
+
return dice.reduce((sum, die) => sum + (die.dropped === true ? 0 : die.value), modifier);
|
|
61
|
+
}
|
|
62
|
+
/** The dice doubled, as a critical hit's damage: each die twice, never the number added. */
|
|
63
|
+
export function doubled(pool) {
|
|
64
|
+
return pool.flatMap((sides) => [sides, sides]);
|
|
65
|
+
}
|
|
44
66
|
/** The dice thrown as the chat writes them: each kind's faces in brackets, a dropped one in parentheses, the biggest first, then the modifier. */
|
|
45
67
|
export function diceText(dice, modifier) {
|
|
46
68
|
const kinds = [...new Set(dice.map((die) => die.sides))].sort((first, second) => Number(second) - Number(first));
|
|
@@ -62,7 +62,7 @@ export async function makeRoller(canvas) {
|
|
|
62
62
|
dice.forEach((die, index) => die.rare !== undefined && stage.celebrate(index, die.rare, { instant, particles }));
|
|
63
63
|
return true;
|
|
64
64
|
},
|
|
65
|
-
cover: (
|
|
65
|
+
cover: (foot, head, tight) => stage.cover(foot, head, tight),
|
|
66
66
|
hide: () => stage.hide(),
|
|
67
67
|
resize: () => stage.resize(),
|
|
68
68
|
};
|