rpg-engine 0.2.1 → 0.4.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 +43 -3
- package/dist/campaign/settings.js +58 -14
- package/dist/cli.js +10 -1
- package/dist/command-line.js +26 -3
- 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 +217 -83
- 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-master-rolls.d.ts +15 -0
- package/dist/commands/game-master-rolls.js +34 -0
- package/dist/commands/game-mode.js +5 -4
- 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 +172 -0
- package/dist/commands/game-tables.d.ts +7 -0
- package/dist/commands/game-tables.js +40 -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 +308 -51
- 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 +6 -0
- package/dist/commands/roll.js +95 -24
- 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 +367 -16
- package/dist/dashboard/i18n/cs.json +367 -16
- package/dist/dashboard/i18n/da.json +367 -16
- package/dist/dashboard/i18n/de.json +367 -16
- package/dist/dashboard/i18n/el.json +367 -16
- package/dist/dashboard/i18n/es.json +367 -16
- package/dist/dashboard/i18n/fi.json +367 -16
- package/dist/dashboard/i18n/fr.json +367 -16
- package/dist/dashboard/i18n/he.json +367 -16
- package/dist/dashboard/i18n/hi.json +367 -16
- package/dist/dashboard/i18n/hu.json +367 -16
- package/dist/dashboard/i18n/is.json +367 -16
- package/dist/dashboard/i18n/it.json +369 -18
- package/dist/dashboard/i18n/ja.json +367 -16
- package/dist/dashboard/i18n/ko.json +367 -16
- package/dist/dashboard/i18n/nb.json +367 -16
- package/dist/dashboard/i18n/nl.json +367 -16
- package/dist/dashboard/i18n/pl.json +367 -16
- package/dist/dashboard/i18n/pt.json +367 -16
- package/dist/dashboard/i18n/ro.json +367 -16
- package/dist/dashboard/i18n/ru.json +367 -16
- package/dist/dashboard/i18n/sv.json +367 -16
- package/dist/dashboard/i18n/tr.json +367 -16
- package/dist/dashboard/i18n/uk.json +367 -16
- package/dist/dashboard/i18n/zh.json +367 -16
- package/dist/dashboard/icons.js +38 -4
- package/dist/dashboard/journal.js +203 -49
- package/dist/dashboard/labels.js +45 -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 +71 -13
- 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/dice/index.d.ts +2 -0
- package/dist/dice/index.js +3 -1
- package/dist/dice/oracle.d.ts +19 -0
- package/dist/dice/oracle.js +22 -0
- package/dist/dice/tables.d.ts +29 -0
- package/dist/dice/tables.js +123 -0
- 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 +15 -0
- package/dist/pages/markdown.js +54 -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 +5 -5
- 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 +6 -6
- 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 +7 -3
- 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 +6 -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/pages.js
CHANGED
|
@@ -9,10 +9,6 @@ import { t } from "./text.js";
|
|
|
9
9
|
export function PageHead({ section, id, title }) {
|
|
10
10
|
return (_jsxs("div", { class: "page-head", children: [_jsx("span", { class: "page-mark", children: _jsx(Icon, { name: section }) }), _jsx("h2", { id: id, children: title ?? sectionLabel(section) })] }));
|
|
11
11
|
}
|
|
12
|
-
/** A section the page does not have yet: what it will hold. */
|
|
13
|
-
export function Upcoming({ section }) {
|
|
14
|
-
return (_jsxs("section", { class: "page-stack", "aria-labelledby": "upcoming-title", children: [_jsx(PageHead, { section: section, id: "upcoming-title" }), _jsxs("div", { class: "upcoming", children: [_jsx("p", { children: upcoming(section) }), _jsx("p", { class: "upcoming-note", children: t("It comes in a next step.") })] })] }));
|
|
15
|
-
}
|
|
16
12
|
/**
|
|
17
13
|
* What the page is (D-409): a card of the product, with the robot and its links; a card of the game system the campaign plays; a card of how it was made, with
|
|
18
14
|
* Stefano's motto, as in the READMEs; a card of the licences and the system's credits; then, out of the cards and small, the copyright.
|
|
@@ -26,7 +22,3 @@ const mitLicence = "https://opensource.org/license/mit";
|
|
|
26
22
|
function withLinks(text) {
|
|
27
23
|
return text.split(/(https?:\/\/[^\s]*[^\s.,;)])/).map((part, index) => (index % 2 === 1 ? _jsx("a", { href: part, target: "_blank", rel: "noreferrer", children: part }, index) : part));
|
|
28
24
|
}
|
|
29
|
-
/** What a section to come will hold, as the plan says (D-269). */
|
|
30
|
-
function upcoming(section) {
|
|
31
|
-
return section === "world" ? t("What your character knows, the documents found and the calendar; the world map later.") : undefined;
|
|
32
|
-
}
|
package/dist/dashboard/party.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
|
|
2
|
+
import { dyingWord } from "./dying.js";
|
|
2
3
|
import { fieldLabel, initials, nameHue } from "./labels.js";
|
|
3
4
|
import { stripCounter } from "./layout.js";
|
|
4
5
|
import { tokenSymbolsPref, usePref } from "./prefs.js";
|
|
@@ -16,12 +17,23 @@ export function PartyStrip({ party, chosen, scene }) {
|
|
|
16
17
|
const status = memberStatus(member, scene);
|
|
17
18
|
// One name for a screen reader, which the drawing inside would say twice.
|
|
18
19
|
const said = [member.name, counter === undefined ? "" : `${fieldLabel(counter.field)} ${counter.text}`, ...statusWords(status)];
|
|
19
|
-
return (_jsxs("a", { href: sheetAddress(member.name), class: `member${member.dead ? " dead" : ""}`, "aria-current": member.name === chosen ? "page" : undefined, "aria-label": said.filter((part) => part !== "").join(", "), children: [_jsx(MemberToken, { member: member, status: status }), _jsx("span", { class: "name", children: member.name }), member.dead
|
|
20
|
+
return (_jsxs("a", { href: sheetAddress(member.name), class: `member${member.dead ? " dead" : ""}`, "aria-current": member.name === chosen ? "page" : undefined, "aria-label": said.filter((part) => part !== "").join(", "), children: [_jsx(MemberToken, { member: member, status: status }), _jsx("span", { class: "name", children: member.name }), member.dead
|
|
21
|
+
? _jsx("span", { class: "dead-mark", children: t("dead") })
|
|
22
|
+
: status.dying !== undefined && member.dying !== undefined
|
|
23
|
+
? _jsx(MemberDying, { state: status.dying, counters: member.dying })
|
|
24
|
+
: counter && _jsx(Bar, { value: counter, label: fieldLabel(counter.field) }), _jsx(Effects, { effects: member.effects, most: 2 })] }, member.name));
|
|
20
25
|
}) }));
|
|
21
26
|
}
|
|
27
|
+
/** One of the party at their dying point in the strip (D-461): the word of where they stand and their marks, small, in place of their bar. */
|
|
28
|
+
function MemberDying({ state, counters }) {
|
|
29
|
+
const successes = counters.find((counter) => counter.side === "successes");
|
|
30
|
+
const failures = counters.find((counter) => counter.side === "failures");
|
|
31
|
+
const marks = (counter, kind) => counter === undefined ? [] : Array.from({ length: counter.limit ?? Math.max(counter.value, 1) }, (_, index) => _jsx("span", { class: `strip-mark ${kind}${index < counter.value ? " marked" : ""}` }, `${kind}${index}`));
|
|
32
|
+
return (_jsxs("span", { class: `member-dying ${state}`, children: [_jsx("span", { class: "member-dying-word", children: dyingWord(state, counters) }), _jsx("span", { class: "strip-marks", "aria-hidden": "true", children: [...marks(successes, "success"), ...marks(failures, "failure")] })] }));
|
|
33
|
+
}
|
|
22
34
|
/** A party member's token with the pip of their state (D-419), in the strip and the sheet's band; never in the rolls. Their class in its tooltip (D-409). */
|
|
23
35
|
export function MemberToken({ member, large, status }) {
|
|
24
|
-
return (_jsx("span", { class: "token-holder", "data-tip": member.headline === undefined ? undefined : `${member.name} · ${member.headline}`, children: _jsx(Token, { member: member, large: large, side: sideOf(member.role), status: status }) }));
|
|
36
|
+
return (_jsx("span", { class: "token-holder", "data-tip": member.headline === undefined ? undefined : `${member.name} · ${member.headline}`, children: _jsx(Token, { member: member, large: large, side: sideOf(member.role), status: status, dying: status.dying }) }));
|
|
25
37
|
}
|
|
26
38
|
/** The side of one of the party by their role; anyone else has none. */
|
|
27
39
|
export function sideOf(role) {
|
|
@@ -37,8 +49,9 @@ export const sideIcons = {
|
|
|
37
49
|
* With a side, the pip of that side at the start of its lower edge, with their class's symbol or the side's (D-414); with a state, its pip at the end (D-419); with a
|
|
38
50
|
* number, a stranger's as Creature 2's or B1's, a small dark coin at the end of its upper edge, off the face (D-420).
|
|
39
51
|
*/
|
|
40
|
-
export function Token({ member, large, hostile, side, status, number }) {
|
|
41
|
-
const
|
|
52
|
+
export function Token({ member, large, hostile, side, status, number, dying }) {
|
|
53
|
+
const fallen = dying === "dead" || member.dead === true ? "dead" : dying === undefined ? "" : `fallen ${dying}`;
|
|
54
|
+
const classes = ["token", member.role, fallen, large ? "large" : "", hostile ? "hostile" : ""].filter((name) => name !== "").join(" ");
|
|
42
55
|
return (_jsxs("span", { class: classes, "aria-hidden": "true", children: [member.image === undefined
|
|
43
56
|
? _jsx("span", { class: "initials", style: { "--hue": String(nameHue(member.name)) }, children: initials(member.name) })
|
|
44
57
|
// A new address when the picture changes; the same one comes back as not modified on a reload (D-277).
|
|
@@ -5,6 +5,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "preact/jsx-ru
|
|
|
5
5
|
// is where in words, the map's twin.
|
|
6
6
|
import { Fragment } from "preact";
|
|
7
7
|
import { useEffect, useRef, useState } from "preact/hooks";
|
|
8
|
+
import { TalkName, usePlayerActs } from "./act-names.js";
|
|
8
9
|
import { CardHead } from "./card.js";
|
|
9
10
|
import { Glass, GlassDefs } from "./glass.js";
|
|
10
11
|
import { iconPath } from "./icons.js";
|
|
@@ -12,14 +13,25 @@ import { strangerLabel } from "./labels.js";
|
|
|
12
13
|
import { sideIcons, sideOf } from "./party.js";
|
|
13
14
|
import { columnName, exitSide, floorLoops, groundKinds, isSolid, isStandable, isWalled, kindAt, nextTo, piecesOf, squareName, squareOf, symbolAt, tracedLoop } from "./place-map.js";
|
|
14
15
|
import { conditionsPref, tokenSymbolsPref, useChoice, usePref } from "./prefs.js";
|
|
16
|
+
import { dyingState } from "./save-outcome.js";
|
|
15
17
|
import { statusMarks, statusWords } from "./status.js";
|
|
16
18
|
import { t } from "./text.js";
|
|
17
19
|
// How wide a square is drawn, in pixels.
|
|
18
20
|
const size = 40;
|
|
19
21
|
// The order of who is where under the map.
|
|
20
22
|
const roles = ["pc", "companion", "other"];
|
|
21
|
-
export function PlaceMap({ map, place, acting, picking }) {
|
|
23
|
+
export function PlaceMap({ map, place, acting, picking, choosing, bare = false, dying, self: selfName }) {
|
|
22
24
|
const svg = useRef(null);
|
|
25
|
+
const where = useRef(null);
|
|
26
|
+
const acts = usePlayerActs();
|
|
27
|
+
// On the page, a token touched starts talking to them, the focus coming back to their line of who is where (D-495).
|
|
28
|
+
const talking = acts === undefined || picking !== undefined ? undefined : {
|
|
29
|
+
onChoose: (name) => {
|
|
30
|
+
const line = [...(where.current?.querySelectorAll("button.talk") ?? [])].find((button) => button.dataset.name === name);
|
|
31
|
+
return name !== undefined && acts.start({ talk: name }, line ?? svg.current ?? document.body);
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
const tokens = choosing ?? talking;
|
|
23
35
|
const scale = useScale(svg);
|
|
24
36
|
const sides = map.exits.map((exit) => exitSide(map, squareOf(exit.square) ?? { column: 0, row: 0 }));
|
|
25
37
|
const [left, top] = [30 + (sides.includes("left") ? 30 : 0), 30 + (sides.includes("top") ? 36 : 0)];
|
|
@@ -41,7 +53,7 @@ export function PlaceMap({ map, place, acting, picking }) {
|
|
|
41
53
|
const square = squareOf(one.square);
|
|
42
54
|
return square === undefined ? [] : [{ ...one, at: square }];
|
|
43
55
|
});
|
|
44
|
-
const self = standing.find((one) => one.role === "pc");
|
|
56
|
+
const self = standing.find((one) => one.role === "pc" && (selfName === undefined || one.name === selfName));
|
|
45
57
|
// What one fills, in squares a side: a large creature stands on the square at the top left of its own (GRD-4).
|
|
46
58
|
const middle = (one) => [X(one.at.column) + (size * (one.side ?? 1)) / 2, Y(one.at.row) + (size * (one.side ?? 1)) / 2];
|
|
47
59
|
// The squares the character can still reach, and those it stands on, which are never out of its reach (D-328).
|
|
@@ -56,12 +68,34 @@ export function PlaceMap({ map, place, acting, picking }) {
|
|
|
56
68
|
];
|
|
57
69
|
const letters = Math.max(11, 11 / scale);
|
|
58
70
|
const drawn = (_jsxs(_Fragment, { children: [_jsx("path", { class: "lm-floor-fill", d: floor, "fill-rule": "evenodd" }), _jsx("g", { class: "lm-ground", "clip-path": "url(#lm-open)", children: open.filter((square) => groundKinds.includes(kindAt(map, square))).map((square) => _jsx(Ground, { kind: kindAt(map, square), x: X(square.column), y: Y(square.row), side: size, seed: square }, squareName(square))) }), _jsx("path", { class: "lm-grid", d: open.map((square) => `M${X(square.column)} ${Y(square.row)}h${size}v${size}h${-size}z`).join(""), "clip-path": "url(#lm-open)" }), open.filter((square) => featureAt(square)?.difficult).map((square) => _jsx(Corner, { x: X(square.column), y: Y(square.row), side: size }, squareName(square))), things.map((feature) => piecesOf(map, feature.symbol, feature.kind).map((piece) => (_jsxs("g", { class: `lm-thing ${feature.kind}`, children: [_jsx("title", { children: [featureName(feature), feature.blocks ? t("blocks") : "", feature.difficult ? t("difficult") : ""].filter((part) => part !== "").join(", ") }), _jsx(Thing, { kind: feature.kind, symbol: feature.symbol, x: X(piece.left), y: Y(piece.top), w: (piece.right - piece.left) * size, h: (piece.bottom - piece.top) * size, cells: piece.squares.map((square) => [X(square.column), Y(square.row)]) })] }, `${feature.symbol} ${piece.left} ${piece.top}`)))), _jsx("path", { class: "lm-shade", d: outline, "clip-path": "url(#lm-open)", filter: "url(#lm-blur)" })] }));
|
|
59
|
-
return (_jsxs("section", { class: "lm", "aria-labelledby": "lm-title", children: [_jsx(CardHead, { icon: iconPath("world"), title: _jsx("h3", { id: "lm-title", children: t("Map") }), note: place }), _jsx("div", { class: picking === undefined ? "lm-frame" : "lm-frame panned", children: _jsxs("svg", { ref: svg, class: `lm-svg lm-look-${map.ground}`, viewBox: `0 0 ${width} ${height}`, ...(picking === undefined ? {} : { width: width * 1.2 }), role: "img", "aria-label": t("Map of {place}", { place }), children: [_jsxs("defs", { children: [_jsx(Patterns, {}), _jsx(GlassDefs, { prefix: "lm" }), _jsxs("radialGradient", { id: "lm-hostile-glow", children: [_jsx("stop", { offset: "0.75", "stop-color": "#c8321f", "stop-opacity": "0.3" }), _jsx("stop", { offset: "1", "stop-color": "#c8321f", "stop-opacity": "0" })] }), _jsx("clipPath", { id: "lm-open", children: _jsx("path", { d: floor, "clip-rule": "evenodd" }) }), !walled && (_jsx("mask", { id: "lm-fade", maskUnits: "userSpaceOnUse", x: 0, y: 0, width: width, height: height, children: _jsx("rect", { x: X(0) + size * 0.35, y: Y(0) + size * 0.35, width: map.columns * size - size * 0.7, height: map.rows * size - size * 0.7, fill: "#fff", filter: "url(#lm-soft)" }) })), standing.map((one, index) => (_jsx("clipPath", { id: `lm-token-${index}`, children: _jsx("circle", { cx: middle(one)[0], cy: middle(one)[1], r: size * (one.side ?? 1) * 0.43 }) }, index)))] }), _jsx("rect", { class: "lm-paper", width: width, height: height }), _jsx("g", { class: "lm-walls", children: squares.filter((square) => ["wall", "rock", "window"].includes(kindAt(map, square)) && nearRoom(square)).map((square) => (_jsxs(Fragment, { children: [_jsx("rect", { class: "lm-wall-under", x: X(square.column), y: Y(square.row), width: size, height: size }), _jsx("rect", { class: `lm-wall ${kindAt(map, square)}`, x: X(square.column), y: Y(square.row), width: size, height: size })] }, squareName(square)))) }), walled ? drawn : _jsx("g", { mask: "url(#lm-fade)", children: drawn }), reach.length > 0 && (_jsx("g", { class: "lm-out", "aria-hidden": "true", "clip-path": "url(#lm-open)", children: open.filter((square) => !reach.some((near) => near.column === square.column && near.row === square.row)).map((square) => (_jsx("rect", { x: X(square.column), y: Y(square.row), width: size, height: size }, squareName(square)))) })), _jsx("path", { class: "lm-outline", d: outline, filter: "url(#lm-ink)" }), squares.filter((square) => ["door", "open-door", "secret-door"].includes(kindAt(map, square))).map((square) => (_jsx(Door, { kind: kindAt(map, square), name: featureAt(square)?.name ?? "door", square: square, map: map, x: X(square.column), y: Y(square.row) }, squareName(square)))), map.exits.map((exit, index) => {
|
|
71
|
+
return (_jsxs("section", { class: "lm", "aria-labelledby": "lm-title", children: [_jsx(CardHead, { icon: iconPath("world"), title: _jsx("h3", { id: "lm-title", children: t("Map") }), note: place }), _jsx("div", { class: picking === undefined && choosing === undefined ? "lm-frame" : "lm-frame panned", children: _jsxs("svg", { ref: svg, class: `lm-svg lm-look-${map.ground}`, viewBox: `0 0 ${width} ${height}`, ...(picking === undefined && choosing === undefined ? {} : { width: width * 1.2 }), role: "img", "aria-label": t("Map of {place}", { place }), children: [_jsxs("defs", { children: [_jsx(Patterns, {}), _jsx(GlassDefs, { prefix: "lm" }), _jsxs("radialGradient", { id: "lm-hostile-glow", children: [_jsx("stop", { offset: "0.75", "stop-color": "#c8321f", "stop-opacity": "0.3" }), _jsx("stop", { offset: "1", "stop-color": "#c8321f", "stop-opacity": "0" })] }), _jsx("clipPath", { id: "lm-open", children: _jsx("path", { d: floor, "clip-rule": "evenodd" }) }), !walled && (_jsx("mask", { id: "lm-fade", maskUnits: "userSpaceOnUse", x: 0, y: 0, width: width, height: height, children: _jsx("rect", { x: X(0) + size * 0.35, y: Y(0) + size * 0.35, width: map.columns * size - size * 0.7, height: map.rows * size - size * 0.7, fill: "#fff", filter: "url(#lm-soft)" }) })), standing.map((one, index) => (_jsx("clipPath", { id: `lm-token-${index}`, children: _jsx("circle", { cx: middle(one)[0], cy: middle(one)[1], r: size * (one.side ?? 1) * 0.43 }) }, index)))] }), _jsx("rect", { class: "lm-paper", width: width, height: height }), _jsx("g", { class: "lm-walls", children: squares.filter((square) => ["wall", "rock", "window"].includes(kindAt(map, square)) && nearRoom(square)).map((square) => (_jsxs(Fragment, { children: [_jsx("rect", { class: "lm-wall-under", x: X(square.column), y: Y(square.row), width: size, height: size }), _jsx("rect", { class: `lm-wall ${kindAt(map, square)}`, x: X(square.column), y: Y(square.row), width: size, height: size })] }, squareName(square)))) }), walled ? drawn : _jsx("g", { mask: "url(#lm-fade)", children: drawn }), reach.length > 0 && (_jsx("g", { class: "lm-out", "aria-hidden": "true", "clip-path": "url(#lm-open)", children: open.filter((square) => !reach.some((near) => near.column === square.column && near.row === square.row)).map((square) => (_jsx("rect", { x: X(square.column), y: Y(square.row), width: size, height: size }, squareName(square)))) })), _jsx("path", { class: "lm-outline", d: outline, filter: "url(#lm-ink)" }), squares.filter((square) => ["door", "open-door", "secret-door"].includes(kindAt(map, square))).map((square) => (_jsx(Door, { kind: kindAt(map, square), name: featureAt(square)?.name ?? "door", square: square, map: map, x: X(square.column), y: Y(square.row) }, squareName(square)))), map.exits.map((exit, index) => {
|
|
60
72
|
const square = squareOf(exit.square);
|
|
61
73
|
return square === undefined ? null : _jsx(Exit, { side: sides[index], to: exit.to, x: X(square.column) + size / 2, y: Y(square.row) + size / 2, letters: Math.max(13, 12 / scale) }, exit.square);
|
|
62
|
-
}), _jsxs("g", { class: "lm-coordinates", "font-size": letters, children: [Array.from({ length: map.columns }, (_, column) => _jsx("text", { x: X(column) + size / 2, y: top - 10, "text-anchor": "middle", children: columnName(column) }, `c${column}`)), Array.from({ length: map.rows }, (_, row) => _jsx("text", { x: left - 10, y: Y(row) + size / 2, "text-anchor": "end", "dominant-baseline": "middle", children: row + 1 }, `r${row}`))] }), _jsx("g", { class: "lm-tokens", children: standing.map((one, index) =>
|
|
63
|
-
|
|
64
|
-
|
|
74
|
+
}), _jsxs("g", { class: "lm-coordinates", "font-size": letters, children: [Array.from({ length: map.columns }, (_, column) => _jsx("text", { x: X(column) + size / 2, y: top - 10, "text-anchor": "middle", children: columnName(column) }, `c${column}`)), Array.from({ length: map.rows }, (_, row) => _jsx("text", { x: left - 10, y: Y(row) + size / 2, "text-anchor": "end", "dominant-baseline": "middle", children: row + 1 }, `r${row}`))] }), _jsx("g", { class: "lm-tokens", children: standing.map((one, index) => {
|
|
75
|
+
// Talking needs someone else, never one of the player characters; choosing for an action takes the one acting too, as themselves, and
|
|
76
|
+
// with more than one the others by name.
|
|
77
|
+
const other = one.role !== "pc" || (choosing !== undefined && selfName !== undefined && one !== self);
|
|
78
|
+
const shown = !other ? undefined : one.stranger ? strangerLabel(one.name) : one.name;
|
|
79
|
+
const choice = tokens === undefined || (shown === undefined && choosing === undefined) ? undefined : {
|
|
80
|
+
chosen: choosing !== undefined && choosing.selected === shown && shown !== undefined,
|
|
81
|
+
onChoose: () => tokens.onChoose(shown),
|
|
82
|
+
};
|
|
83
|
+
return (_jsx(Token, { one: { ...one, party: one.role !== "other", dying: dyingState(dying?.get(one.name)), counters: dying?.get(one.name) }, index: index, acting: one.name === acting, hostile: one.hostile === true, x: middle(one)[0], y: middle(one)[1], scale: scale, ...(choice === undefined ? {} : { choice }) }, index));
|
|
84
|
+
}) }), picking !== undefined && (_jsx("g", { class: "lm-picks", children: squares.filter((square) => isStandable(map, square)).map((square) => (_jsx("rect", { class: picking.selected === squareName(square) ? "lm-pick selected" : "lm-pick", x: X(square.column) + 1, y: Y(square.row) + 1, width: size - 2, height: size - 2, rx: 4, onClick: () => picking.onSelect(squareName(square)), children: _jsx("title", { children: squareName(square) }) }, squareName(square)))) }))] }) }), !bare && _jsx(MapKey, { map: map, reach: reach.length > 0, self: selfName }), !bare && standing.length > 0 && (_jsx("ul", { ref: where, class: "lm-where", "aria-label": t("Who is where"), children: standing.toSorted((first, second) => measuredFirst(first, second, selfName === undefined ? undefined : self) || roles.indexOf(first.role) - roles.indexOf(second.role)).map((one, index) => (_jsxs("li", { class: `lm-where-${one.role}${one.hostile === true ? " hostile" : ""}`, children: [one.role === "pc"
|
|
85
|
+
? _jsx("span", { class: "lm-where-name", children: one.name })
|
|
86
|
+
: (_jsx(TalkName, { name: one.stranger ? strangerLabel(one.name) : one.name, children: _jsx("span", { class: "lm-where-name", children: one.stranger ? strangerLabel(one.name) : one.name }) })), _jsx("span", { class: "lm-key-square", children: one.square }), selfName !== undefined && one === self
|
|
87
|
+
? _jsx("span", { class: "lm-where-far", children: t("from here") })
|
|
88
|
+
: one.distance !== undefined
|
|
89
|
+
? _jsx("span", { class: "lm-where-far", children: one.distance })
|
|
90
|
+
: self !== undefined && one !== self && (nextTo(one.at, self.at) || one.square === self.square) && (_jsx("span", { class: "lm-where-far", children: selfName === undefined ? t("next to you") : t("next to {name}", { name: selfName }) }))] }, index))) }))] }));
|
|
91
|
+
}
|
|
92
|
+
/** The one the distances are from before anyone else, when named: a negative number puts the first before the second. */
|
|
93
|
+
function measuredFirst(first, second, from) {
|
|
94
|
+
return from === undefined ? 0 : first === from ? -1 : second === from ? 1 : 0;
|
|
95
|
+
}
|
|
96
|
+
/** The map's key: the veil of the player's turn, named with more than one player character, the things of the legend, where the squares lead. */
|
|
97
|
+
function MapKey({ map, reach, self }) {
|
|
98
|
+
return (_jsxs("ul", { class: "lm-key", "aria-label": t("Legend"), children: [reach && (_jsxs("li", { children: [_jsxs("svg", { class: `lm-swatch lm-look-${map.ground}`, viewBox: "0 0 40 40", "aria-hidden": "true", children: [_jsx("rect", { class: "lm-floor-fill", width: 40, height: 40 }), _jsx("g", { class: "lm-out", children: _jsx("rect", { width: 40, height: 40 }) })] }), _jsx("span", { class: "lm-key-name", children: self === undefined ? t("out of your move this turn") : t("out of {name}'s move this turn", { name: self }) })] })), map.legend.filter((feature) => !["floor", "ground"].includes(feature.kind)).map((feature) => (_jsxs("li", { children: [_jsx(Swatch, { feature: feature, ground: map.ground }), _jsx("span", { class: "lm-key-name", children: featureName(feature) }), feature.blocks && !["wall", "rock"].includes(feature.kind) && _jsx("span", { class: "lm-key-note", children: t("blocks") }), feature.difficult && _jsx("span", { class: "lm-key-note", children: t("difficult") })] }, feature.symbol))), map.exits.map((exit) => (_jsxs("li", { class: "lm-key-exit", children: [_jsx("span", { class: "lm-key-square", children: exit.square }), _jsx("span", { children: `→ ${exit.to ?? t("somewhere")}` })] }, exit.square)))] }));
|
|
65
99
|
}
|
|
66
100
|
/** How much the map is scaled on the screen, from its drawn width to its shown one: the letters around it keep a readable size on a phone. */
|
|
67
101
|
function useScale(svg) {
|
|
@@ -255,7 +289,7 @@ function Exit({ side, to, x, y, letters }) {
|
|
|
255
289
|
* red a little (D-415); one of the party has the pip of their side at the lower left, with their class's symbol or the side's (D-414); anyone the pip of
|
|
256
290
|
* their state at the lower right, and its words in the token's title (D-419).
|
|
257
291
|
*/
|
|
258
|
-
function Token({ one, index, acting, hostile, x, y, scale }) {
|
|
292
|
+
function Token({ one, index, acting, hostile, x, y, scale, choice }) {
|
|
259
293
|
const [symbols] = usePref(tokenSymbolsPref);
|
|
260
294
|
const side = one.side ?? 1;
|
|
261
295
|
const r = size * side * 0.43;
|
|
@@ -269,7 +303,7 @@ function Token({ one, index, acting, hostile, x, y, scale }) {
|
|
|
269
303
|
const below = Math.min(grow, 1.12);
|
|
270
304
|
const inward = (radius, paper, by = below) => (by - 1) * (radius + paper);
|
|
271
305
|
const pipPaper = pip === "you" ? 3 : 1.5;
|
|
272
|
-
return (_jsxs("g", { class:
|
|
306
|
+
return (_jsxs("g", { class: ["lm-token", one.role, acting ? "acting" : "", fallenOf(one), choice === undefined ? "" : "choosable", choice?.chosen === true ? "chosen" : ""].filter((name) => name !== "").join(" "), style: acting ? { transformOrigin: `${x}px ${y}px` } : undefined, onClick: choice?.onChoose, children: [_jsx("title", { children: [`${one.stranger ? strangerLabel(one.name) : one.name}, ${one.square}`, ...statusWords(one)].join(" · ") }), hostile && (_jsxs(_Fragment, { children: [_jsx("circle", { class: "lm-hostile-glow", cx: x, cy: y, r: r + 7, fill: "url(#lm-hostile-glow)" }), _jsx("circle", { class: "lm-hostile", cx: x, cy: y, r: r + 2.4 })] })), choice !== undefined && _jsx("circle", { class: "lm-choice", cx: x, cy: y, r: r + 4 }), _jsxs("g", { filter: "url(#lm-drop)", children: [_jsx("circle", { class: "lm-disc", cx: x, cy: y, r: r }), _jsx("circle", { class: "lm-ring", cx: x, cy: y, r: r - 0.5 }), one.image
|
|
273
307
|
? _jsx("image", { href: `/images/${encodeURIComponent(one.image.file)}?v=${one.image.version}`, x: x - r, y: y - r, width: r * 2, height: r * 2, "clip-path": `url(#lm-token-${index})` })
|
|
274
308
|
: (_jsx("g", { transform: `translate(${x} ${y}) scale(${side})`, children: number !== undefined
|
|
275
309
|
? _jsx("text", { class: "lm-number", y: 1, "text-anchor": "middle", "dominant-baseline": "middle", children: number })
|
|
@@ -277,6 +311,10 @@ function Token({ one, index, acting, hostile, x, y, scale }) {
|
|
|
277
311
|
? _jsx("path", { class: "lm-stranger", d: "M12 3c-4 0-6.5 3.5-6.5 8v3.5L4 20.5h16l-1.5-6V11c0-4.5-2.5-8-6.5-8Z", transform: "translate(-10.8 -11) scale(0.9)" })
|
|
278
312
|
: _jsx("text", { class: "lm-number", y: 1, "text-anchor": "middle", "dominant-baseline": "middle", children: one.name.slice(0, 1).toUpperCase() }) })), _jsx(Glass, { x: x, y: y, r: r, prefix: "lm" }), _jsx("path", { class: "lm-bevel-lit", d: crescent(x, y, r, 1.5) }), _jsx("path", { class: "lm-bevel-shade", d: crescent(x, y, r, -1.5) })] }), pip !== undefined && _jsx(MapPip, { side: pip, icon: one.stranger ? undefined : one.icon, x: x - r * 0.725 + inward(pipRadius, pipPaper), y: y + r * 0.725 - inward(pipRadius, pipPaper), grow: below }), one.image !== undefined && number !== undefined && _jsx(MapNumber, { number: number, x: x + r * 0.725 - inward(numberRadius, 1.5, grow), y: y - r * 0.725 + inward(numberRadius, 1.5, grow), grow: grow }), _jsx(MapStatus, { one: one, x: x + r * 0.56 - inward(statusRadius, 1.5), y: y + r * 0.56 - inward(statusRadius, 1.5), grow: below })] }));
|
|
279
313
|
}
|
|
314
|
+
/** At 0 a token greyed, until its counter rises again; dead, greyer and faded, as in the party's strip (D-461). */
|
|
315
|
+
function fallenOf(one) {
|
|
316
|
+
return one.dead === true || one.dying === "dead" ? "dead" : one.down === true ? "fallen" : "";
|
|
317
|
+
}
|
|
280
318
|
// The marks on a token as on one of 40 pixels on the page: the side's pip of 17, the state's of 12, a number's coin 13 high.
|
|
281
319
|
const pipRadius = size * 0.43 * (17 / 40);
|
|
282
320
|
const statusRadius = size * 0.43 * (12 / 40);
|
|
@@ -318,7 +356,7 @@ function MapStatus({ one, x, y, grow }) {
|
|
|
318
356
|
// The second coin up more than out, within the token's square: a crescent of about 3 of the token's 40 past the paper round the first (D-420).
|
|
319
357
|
const behind = { x: radius * 0.3, y: radius * 0.85 };
|
|
320
358
|
const strong = marks[0].kind === "state";
|
|
321
|
-
return (_jsxs("g", { class: ["lm-status", strong ? "strong" : "", shown === "hover" ? "on-hover" : ""].filter((name) => name !== "").join(" "), "aria-hidden": "true", children: [marks.length > 1 && (_jsxs(_Fragment, { children: [_jsx("circle", { class: "lm-pip-paper", cx: x + behind.x, cy: y - behind.y, r: radius + paper }), _jsx("circle", { class: "lm-status-back", cx: x + behind.x, cy: y - behind.y, r: radius })] })), _jsx("circle", { class: "lm-pip-paper", cx: x, cy: y, r: radius + paper }), _jsx("circle", { class: "lm-status-disc", cx: x, cy: y, r: radius }), _jsx("path", { class: "lm-status-symbol", d: marks[0].icon, transform: `translate(${x - 12 * scale} ${y - 12 * scale}) scale(${scale})` })] }));
|
|
359
|
+
return (_jsxs("g", { class: ["lm-status", strong ? "strong" : "", marks[0].tone ?? "", shown === "hover" ? "on-hover" : ""].filter((name) => name !== "").join(" "), "aria-hidden": "true", children: [marks.length > 1 && (_jsxs(_Fragment, { children: [_jsx("circle", { class: "lm-pip-paper", cx: x + behind.x, cy: y - behind.y, r: radius + paper }), _jsx("circle", { class: "lm-status-back", cx: x + behind.x, cy: y - behind.y, r: radius })] })), _jsx("circle", { class: "lm-pip-paper", cx: x, cy: y, r: radius + paper }), _jsx("circle", { class: "lm-status-disc", cx: x, cy: y, r: radius }), _jsx("path", { class: marks[0].filled ? "lm-status-symbol filled" : "lm-status-symbol", d: marks[0].icon, transform: `translate(${x - 12 * scale} ${y - 12 * scale}) scale(${scale})` })] }));
|
|
322
360
|
}
|
|
323
361
|
/** The thin crescent a coin's bevel lights, from its top when `offset` is positive or shades at its bottom when negative: the circle less itself moved by it. */
|
|
324
362
|
function crescent(x, y, r, offset) {
|
package/dist/dashboard/rolls.js
CHANGED
|
@@ -1,46 +1,37 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
|
|
2
2
|
// The rolls the player may see (D-279), the newest first: theirs with their character's token, the master's shown ones with the robot and for whom; hidden
|
|
3
3
|
// rolls never come here. The player's free rolls come in too, dashed and dimmed, from this browser alone (D-330 (4)). A card like the sheet's, which shows the
|
|
4
|
-
// newest roll while it is closed (D-284)
|
|
4
|
+
// newest roll while it is closed (D-284), on the table beside the sheet too. Those of the last half hour, older ones at a click at the end of the
|
|
5
5
|
// list; Clear starts the list again, the log untouched, and forgets the free rolls; Restore brings the log back, never them (D-302, D-304).
|
|
6
6
|
import { useEffect, useRef, useState } from "preact/hooks";
|
|
7
|
-
import { CardHeader,
|
|
7
|
+
import { CardHeader, useOpen } from "./card.js";
|
|
8
8
|
import { DiceFaces } from "./faces.js";
|
|
9
9
|
import { gameDateLabel, notationLabel } from "./game-words.js";
|
|
10
|
-
import { cardIcons,
|
|
10
|
+
import { cardIcons, Icon } from "./icons.js";
|
|
11
11
|
import { notationModifier, strangerLabel } from "./labels.js";
|
|
12
12
|
import { rollWindow } from "./layout.js";
|
|
13
13
|
import { Token } from "./party.js";
|
|
14
14
|
import { t } from "./text.js";
|
|
15
|
-
//
|
|
16
|
-
// cleared the list of a campaign; how many older rolls each Load more shows.
|
|
17
|
-
const besideSheet = "(min-width: 900px)";
|
|
18
|
-
const awayKey = "rpg-engine.rolls-away";
|
|
15
|
+
// Where the browser remembers when the player last cleared the list of a campaign; how many older rolls each Load more shows.
|
|
19
16
|
const clearedKey = "rpg-engine.rolls-cleared";
|
|
20
17
|
const moreRolls = 10;
|
|
21
18
|
// How long a new roll keeps its mark, which the style sheet fades at the end (D-303).
|
|
22
19
|
const markLength = 9000;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
export function RollLog({ rolls, free, unread, campaign, party, fresh, onMore, onClearFree }) {
|
|
27
|
-
const lead = party.find((member) => member.role === "pc");
|
|
20
|
+
export function RollLog({ rolls, free, unread, campaign, party, several = false, fresh, onMore, onClearFree }) {
|
|
21
|
+
// With more than one player character the tray's free dice, of no sheet, are no one's: the die for a face, "Free roll" for a name.
|
|
22
|
+
const of = { lead: party.find((member) => member.role === "pc"), nobody: several };
|
|
28
23
|
const [chosen, toggle] = useOpen("Rolls");
|
|
29
|
-
const beside = useMedia(besideSheet);
|
|
30
|
-
const [away, setAway] = useState(readAway);
|
|
31
24
|
const [cleared, setCleared] = useState(() => readCleared(campaign));
|
|
32
25
|
const [older, setOlder] = useState(0);
|
|
33
26
|
// The rolls already drawn: a new one comes in only the first time, not again when the column comes back.
|
|
34
27
|
const greeted = useRef(new Set());
|
|
35
|
-
const [track, setTrack] = useState(null);
|
|
36
28
|
const [scroller, setScroller] = useState(null);
|
|
37
|
-
const open =
|
|
29
|
+
const open = chosen;
|
|
38
30
|
// The log's rolls and the free ones, by when each was rolled.
|
|
39
31
|
const all = [...rolls, ...free].toSorted((first, second) => Date.parse(first.at) - Date.parse(second.at));
|
|
40
32
|
const listed = rollWindow(all, { now: Date.now(), cleared, older, unread });
|
|
41
33
|
const newest = listed.shown.at(-1);
|
|
42
34
|
const below = useMoreBelow(scroller);
|
|
43
|
-
useListRoom(track, beside);
|
|
44
35
|
const clear = () => {
|
|
45
36
|
const now = Date.now();
|
|
46
37
|
setCleared(now);
|
|
@@ -61,16 +52,9 @@ export function RollLog({ rolls, free, unread, campaign, party, fresh, onMore, o
|
|
|
61
52
|
onMore();
|
|
62
53
|
}
|
|
63
54
|
};
|
|
64
|
-
|
|
65
|
-
setAway(now);
|
|
66
|
-
writeAway(now);
|
|
67
|
-
};
|
|
68
|
-
if (beside && away) {
|
|
69
|
-
return (_jsx("aside", { class: "rolls away", "aria-label": t("Rolls"), children: _jsxs("button", { type: "button", class: "rolls-tab", "aria-label": t("Show the rolls"), onClick: () => putAway(false), children: [_jsx(DieIcon, { sides: 20 }), _jsx("span", { children: t("Rolls") })] }) }));
|
|
70
|
-
}
|
|
71
|
-
return (_jsx("aside", { class: "rolls", "aria-labelledby": "rolls-title", ref: setTrack, children: _jsxs("details", { class: "rolls-card", open: open, children: [_jsx(CardHeader, { icon: cardIcons.rolls, title: _jsx("h2", { id: "rolls-title", class: "rolls-title", children: t("Rolls") }), preview: newest === undefined ? undefined : `${[nameOf(newest, lead), newest.check].filter((part) => part !== undefined && part !== "").join(" · ")} · ${newest.total}`, open: open, onToggle: toggle, fixed: beside }), _jsxs("div", { class: beside ? "rolls-tools" : "rolls-tools folding", children: [(listed.shown.length > 0 || listed.more) && (_jsx("button", { type: "button", class: "icon-button tip-left", "aria-label": t("Clear the rolls"), "data-tip": t("Clear the list"), onClick: clear, children: _jsx(Icon, { name: "clearAll" }) })), beside && (_jsx("button", { type: "button", class: "icon-button tip-left", "aria-label": t("Hide the rolls"), "data-tip": t("Hide"), onClick: () => putAway(true), children: _jsx(Icon, { name: "aside" }) }))] }), _jsxs("div", { class: "roll-frame", children: [_jsxs("div", { class: "roll-scroll", ref: setScroller, children: [listed.shown.length === 0
|
|
55
|
+
return (_jsx("aside", { class: "rolls", "aria-labelledby": "rolls-title", children: _jsxs("details", { class: "rolls-card", open: open, children: [_jsx(CardHeader, { icon: cardIcons.rolls, title: _jsx("h2", { id: "rolls-title", class: "rolls-title", children: t("Rolls") }), preview: newest === undefined ? undefined : `${[nameOf(newest, of), newest.check].filter((part) => part !== undefined && part !== "").join(" · ")} · ${newest.total}`, open: open, onToggle: toggle }), _jsx("div", { class: "rolls-tools folding", children: (listed.shown.length > 0 || listed.more) && (_jsx("button", { type: "button", class: "icon-button tip-left", "aria-label": t("Clear the rolls"), "data-tip": t("Clear the list"), onClick: clear, children: _jsx(Icon, { name: "clearAll" }) })) }), _jsxs("div", { class: "roll-frame", children: [_jsxs("div", { class: "roll-scroll", ref: setScroller, children: [listed.shown.length === 0
|
|
72
56
|
? _jsx("p", { class: "rolls-none", children: emptyText(rolls.length, listed.before) })
|
|
73
|
-
: (_jsx("ol", { class: "roll-list", children: [...listed.shown].reverse().map((roll) => _jsx(RollRow, { roll: roll, name: nameOf(roll,
|
|
57
|
+
: (_jsx("ol", { class: "roll-list", children: [...listed.shown].reverse().map((roll) => (_jsx(RollRow, { roll: roll, name: nameOf(roll, of), token: tokenOf(roll, party, of), fresh: fresh.has(roll.id), greeted: greeted.current, several: several }, roll.id))) })), listed.more
|
|
74
58
|
? _jsx("button", { type: "button", class: "rolls-more", onClick: loadMore, children: t("Load more") })
|
|
75
59
|
: cleared > 0 && _jsx("button", { type: "button", class: "rolls-more", onClick: restore, children: t("Restore the cleared rolls") })] }), below && _jsx("div", { class: "rolls-below", "aria-hidden": "true" })] })] }) }));
|
|
76
60
|
}
|
|
@@ -79,7 +63,7 @@ export function RollLog({ rolls, free, unread, campaign, party, fresh, onMore, o
|
|
|
79
63
|
* its tooltip the whole roll, which the lines may cut, with the notation in words; the chat's text for a screen reader. A new one first opens its place, then
|
|
80
64
|
* appears in it, with a yellow corner for a while (D-303): as it first shows, whatever the readings after, and once.
|
|
81
65
|
*/
|
|
82
|
-
function RollRow({ roll, name, token, fresh, greeted }) {
|
|
66
|
+
function RollRow({ roll, name, token, fresh, greeted, several }) {
|
|
83
67
|
const [entering] = useState(() => fresh && !greeted.has(roll.id));
|
|
84
68
|
const [marked, setMarked] = useState(entering);
|
|
85
69
|
useEffect(() => {
|
|
@@ -96,7 +80,11 @@ function RollRow({ roll, name, token, fresh, greeted }) {
|
|
|
96
80
|
const said = [roll.check === undefined ? name : `${name} · ${roll.check}`, roll.text, notationLabel(roll.words), rolledWhen(roll), free ? t("Free roll · not logged") : undefined]
|
|
97
81
|
.filter((line) => line !== undefined && line !== "")
|
|
98
82
|
.join("\n");
|
|
99
|
-
return (_jsxs("li", { class: ["roll", player ? "by-player" : "by-master", free ? "free" : "", entering ? "entering" : ""].filter((part) => part !== "").join(" "), "data-roll": roll.id, title: said, children: [marked && _jsx("span", { class: "roll-flag", "aria-hidden": "true", children: "!" }), token === undefined
|
|
83
|
+
return (_jsxs("li", { class: ["roll", player ? "by-player" : "by-master", free ? "free" : "", entering ? "entering" : ""].filter((part) => part !== "").join(" "), "data-roll": roll.id, title: said, children: [marked && _jsx("span", { class: "roll-flag", "aria-hidden": "true", children: "!" }), token === undefined
|
|
84
|
+
? _jsx("img", { class: "roll-robot", src: "/assets/favicon.svg", alt: "" })
|
|
85
|
+
: token === "die"
|
|
86
|
+
? (_jsx("span", { class: "token roll-die", "aria-hidden": "true", children: _jsx(Icon, { name: "dice" }) }))
|
|
87
|
+
: _jsx(Token, { member: token }), _jsxs("span", { class: "roll-who", children: [_jsx("span", { class: "visually-hidden", children: `${marked ? t("New.") + " " : ""}${free ? t("Your free roll, not logged:") : player ? (several ? t("The players' roll:") : t("Your roll:")) : t("The master's roll:")} ` }), name] }), roll.check && _jsx("span", { class: "roll-check", children: roll.check }), _jsx("span", { class: "roll-total num", children: roll.total }), _jsxs("span", { class: "roll-dice", children: [_jsx(DiceFaces, { dice: roll.dice, modifier: notationModifier(roll.notation) }), _jsx("span", { class: "visually-hidden", children: roll.text })] })] }));
|
|
100
88
|
}
|
|
101
89
|
/** What the list says with no roll in it: what comes there, that the last half hour had none, or that the player cleared it. */
|
|
102
90
|
function emptyText(read, older) {
|
|
@@ -105,40 +93,37 @@ function emptyText(read, older) {
|
|
|
105
93
|
}
|
|
106
94
|
return older > 0 ? t("No rolls in the last half hour.") : t("Cleared: the new rolls come here.");
|
|
107
95
|
}
|
|
108
|
-
/**
|
|
109
|
-
|
|
110
|
-
|
|
96
|
+
/**
|
|
97
|
+
* Whom a roll is for, by name: the player's character for the player's own, whom the master named, or the master for a roll for no one; the tray's free dice
|
|
98
|
+
* among several player characters are a free roll of no one's.
|
|
99
|
+
*/
|
|
100
|
+
function nameOf(roll, of) {
|
|
101
|
+
if (freeOfNobody(roll, of)) {
|
|
102
|
+
return t("Free roll");
|
|
103
|
+
}
|
|
104
|
+
return roll.who === undefined ? (roll.by === "player" ? of.lead?.name ?? "" : t("The master")) : roll.stranger ? strangerLabel(roll.who) : roll.who;
|
|
105
|
+
}
|
|
106
|
+
/** Whether a roll is the tray's free dice, of no sheet, while more than one player character plays: no one's. */
|
|
107
|
+
function freeOfNobody(roll, of) {
|
|
108
|
+
return of.nobody && "free" in roll && roll.who === undefined;
|
|
111
109
|
}
|
|
112
110
|
/**
|
|
113
111
|
* The token of whom a roll is for (D-286): the player's character for the player's own; a member of the party; anyone else with their picture, or a question mark
|
|
114
|
-
* for someone the character does not know; none, so the robot, for a roll the master makes for no one.
|
|
112
|
+
* for someone the character does not know; none, so the robot, for a roll the master makes for no one; a die for free dice of no one's.
|
|
115
113
|
*/
|
|
116
|
-
function tokenOf(roll, party,
|
|
114
|
+
function tokenOf(roll, party, of) {
|
|
117
115
|
const member = party.find((candidate) => candidate.name === roll.who);
|
|
116
|
+
if (freeOfNobody(roll, of)) {
|
|
117
|
+
return "die";
|
|
118
|
+
}
|
|
118
119
|
if (roll.by === "player") {
|
|
119
|
-
return member ?? lead ?? { name: "?", role: "pc" };
|
|
120
|
+
return member ?? of.lead ?? { name: "?", role: "pc" };
|
|
120
121
|
}
|
|
121
122
|
if (member !== undefined || roll.who === undefined) {
|
|
122
123
|
return member;
|
|
123
124
|
}
|
|
124
125
|
return { name: roll.stranger ? "?" : roll.who, role: "other", ...(roll.image === undefined ? {} : { image: roll.image }) };
|
|
125
126
|
}
|
|
126
|
-
function readAway() {
|
|
127
|
-
try {
|
|
128
|
-
return localStorage.getItem(awayKey) === "away";
|
|
129
|
-
}
|
|
130
|
-
catch {
|
|
131
|
-
return false;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
function writeAway(away) {
|
|
135
|
-
try {
|
|
136
|
-
localStorage.setItem(awayKey, away ? "away" : "beside");
|
|
137
|
-
}
|
|
138
|
-
catch {
|
|
139
|
-
// The page forgets it at the next reload.
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
127
|
function readCleared(campaign) {
|
|
143
128
|
try {
|
|
144
129
|
return Number(localStorage.getItem(`${clearedKey}:${campaign ?? ""}`) ?? 0) || 0;
|
|
@@ -189,49 +174,6 @@ function useMoreBelow(scroller) {
|
|
|
189
174
|
}, [scroller]);
|
|
190
175
|
return below;
|
|
191
176
|
}
|
|
192
|
-
/**
|
|
193
|
-
* Beside the sheet, how tall the rolls' list may be (D-304): from where their card stands, under the page's top, to the window's foot or the sheet's end,
|
|
194
|
-
* whichever comes first, so that the card never leaves the window, slides under the page's top or makes the page taller.
|
|
195
|
-
*/
|
|
196
|
-
function useListRoom(track, beside) {
|
|
197
|
-
useEffect(() => {
|
|
198
|
-
if (track === null || !beside) {
|
|
199
|
-
return;
|
|
200
|
-
}
|
|
201
|
-
let asked = 0;
|
|
202
|
-
const measure = () => {
|
|
203
|
-
asked = 0;
|
|
204
|
-
const card = track.querySelector(".rolls-card");
|
|
205
|
-
const list = track.querySelector(".roll-scroll");
|
|
206
|
-
if (card === null || list === null) {
|
|
207
|
-
return;
|
|
208
|
-
}
|
|
209
|
-
const box = track.getBoundingClientRect();
|
|
210
|
-
const top = Math.max(Number.parseFloat(getComputedStyle(card).top) || 0, box.top);
|
|
211
|
-
const bottom = Math.min(window.innerHeight - windowMargin, box.bottom);
|
|
212
|
-
const around = card.offsetHeight - list.offsetHeight;
|
|
213
|
-
track.style.setProperty("--list-room", `${Math.max(leastRoom, Math.floor(bottom - top - around))}px`);
|
|
214
|
-
};
|
|
215
|
-
const update = () => {
|
|
216
|
-
asked ||= requestAnimationFrame(measure);
|
|
217
|
-
};
|
|
218
|
-
const sizes = new ResizeObserver(update);
|
|
219
|
-
sizes.observe(track);
|
|
220
|
-
window.addEventListener("scroll", update, { passive: true });
|
|
221
|
-
window.addEventListener("resize", update);
|
|
222
|
-
// The card's place changes as the page's top or what the master asks come and go.
|
|
223
|
-
track.addEventListener("transitionend", update);
|
|
224
|
-
update();
|
|
225
|
-
return () => {
|
|
226
|
-
cancelAnimationFrame(asked);
|
|
227
|
-
sizes.disconnect();
|
|
228
|
-
window.removeEventListener("scroll", update);
|
|
229
|
-
window.removeEventListener("resize", update);
|
|
230
|
-
track.removeEventListener("transitionend", update);
|
|
231
|
-
track.style.removeProperty("--list-room");
|
|
232
|
-
};
|
|
233
|
-
}, [track, beside]);
|
|
234
|
-
}
|
|
235
177
|
/** When a roll was made: the game's day and hour, and the real time, as "day 1, 18:00 in the game · rolled at 18:15". */
|
|
236
178
|
function rolledWhen(roll) {
|
|
237
179
|
const real = new Date(roll.at);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The outcome of a death save from what its roll left (DIE-4): back above the dying point, failures added, the last of them dead, or a success, the last of
|
|
3
|
+
* them stable; none when it changed nothing, as when the system's code did not run.
|
|
4
|
+
*/
|
|
5
|
+
export function saveOutcome(save, after) {
|
|
6
|
+
if (after.dead === true) {
|
|
7
|
+
return { kind: "dead", successes: save.successes.value, failures: save.failures.most, count: Math.max(save.failures.most - save.failures.value, 1) };
|
|
8
|
+
}
|
|
9
|
+
if (after.dying === undefined) {
|
|
10
|
+
return { kind: "back", successes: 0, failures: 0, count: 0 };
|
|
11
|
+
}
|
|
12
|
+
const successes = sideValue(after.dying, "successes") ?? save.successes.value;
|
|
13
|
+
const failures = sideValue(after.dying, "failures") ?? save.failures.value;
|
|
14
|
+
if (failures > save.failures.value) {
|
|
15
|
+
const count = failures - save.failures.value;
|
|
16
|
+
return { kind: failures >= save.failures.most ? "dead" : count > 1 ? "failures" : "failure", successes, failures, count };
|
|
17
|
+
}
|
|
18
|
+
if (successes > save.successes.value) {
|
|
19
|
+
return { kind: successes >= save.successes.most ? "stable" : "success", successes, failures, count: 0 };
|
|
20
|
+
}
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
/** What the system calls one whose successes are full, as the 5e's Stable; none when it names nothing. */
|
|
24
|
+
export function stableName(counters) {
|
|
25
|
+
return counters?.find((counter) => counter.side === "successes")?.full;
|
|
26
|
+
}
|
|
27
|
+
/** Of someone's effects, those their marks say beside their state: never the one that names it stable, as the 5e's Stable, said once by the state (playtest 11). */
|
|
28
|
+
export function effectsBesideState(effects, counters) {
|
|
29
|
+
const stable = dyingState(counters) === "stable" ? stableName(counters)?.toLowerCase() : undefined;
|
|
30
|
+
return effects.filter((effect) => effect.name.toLowerCase() !== stable);
|
|
31
|
+
}
|
|
32
|
+
/** The state the panel of the dying says, from its counters by their sides; none when not dying. */
|
|
33
|
+
export function dyingState(counters) {
|
|
34
|
+
if (counters === undefined) {
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
const full = (side) => counters.some((counter) => counter.side === side && counter.limit !== undefined && counter.value >= counter.limit);
|
|
38
|
+
return full("failures") ? "dead" : full("successes") ? "stable" : "dying";
|
|
39
|
+
}
|
|
40
|
+
function sideValue(counters, side) {
|
|
41
|
+
return counters.find((counter) => counter.side === side)?.value;
|
|
42
|
+
}
|
package/dist/dashboard/saves.js
CHANGED
|
@@ -8,7 +8,8 @@ import { phraseLabel, realTimeLabel, valueLabel } from "./labels.js";
|
|
|
8
8
|
import { placeKinds } from "./map-symbols.js";
|
|
9
9
|
import { PageHead } from "./pages.js";
|
|
10
10
|
import { t } from "./text.js";
|
|
11
|
-
|
|
11
|
+
/** The Saves section; with `several` player characters, checkpoint goes back when all die, or when one does and the table chooses it (D-480 (2)). */
|
|
12
|
+
export function SavesView({ version, campaign, several = false }) {
|
|
12
13
|
const [saves, setSaves] = useState();
|
|
13
14
|
const [problem, setProblem] = useState();
|
|
14
15
|
const [said, setSaid] = useState();
|
|
@@ -44,9 +45,9 @@ export function SavesView({ version, campaign }) {
|
|
|
44
45
|
read();
|
|
45
46
|
};
|
|
46
47
|
const points = saves?.reset ?? [];
|
|
47
|
-
return (_jsxs("section", { class: "saves", "aria-labelledby": "saves-title", children: [_jsx(PageHead, { section: "saves", id: "saves-title" }), saves !== undefined && (_jsxs("p", { class: "saves-lead", children: [_jsxs("strong", { children: [valueLabel(saves.mode), ":"] }), " ", modeText(saves.mode) ?? saves.rule, " ", _jsx("a", { href: sectionAddress("settings"), children: t("Change it in Settings.") })] })), problem !== undefined && _jsx("p", { class: "saves-said problem", role: "alert", children: problem }), said !== undefined && _jsx("p", { ref: saying, tabIndex: -1, class: said.problem ? "saves-said problem" : "saves-said", role: "status", children: said.text }), saves?.wentBack !== undefined && (_jsx(NewChat, { back: wentBackTitle(saves.wentBack, saves.saves), busy: busy, onConfirm: () => void send({ action: "new chat" }, `✓ ${t("The game goes on in the new chat: write «continua» there.")}`) })), saves?.make === true && _jsx(SaveNow, { busy: busy, onSave: (label) => void send({ action: "make", ...(label === "" ? {} : { label }) }, `✓ ${t("Saved.")}`) }), saves !== undefined && saves.saves.length === 0 && _jsx("p", { class: "saves-none", children: t("No saves yet: the game saves its start when play begins, then at the end of each scene.") }), saves !== undefined && saves.saves.length > 0 && (_jsx("ol", { class: "save-cards", children: saves.saves.map((save, index) => (_jsxs("li", { class: "save-card", children: [_jsx(SaveFace, { save: save }), save.load && (_jsx("button", { type: "button", class: "
|
|
48
|
+
return (_jsxs("section", { class: "saves", "aria-labelledby": "saves-title", children: [_jsx(PageHead, { section: "saves", id: "saves-title" }), saves !== undefined && (_jsxs("p", { class: "saves-lead", children: [_jsxs("strong", { children: [valueLabel(saves.mode), ":"] }), " ", modeText(saves.mode, several) ?? saves.rule, " ", _jsx("a", { href: sectionAddress("settings"), children: t("Change it in Settings.") })] })), problem !== undefined && _jsx("p", { class: "saves-said problem", role: "alert", children: problem }), said !== undefined && _jsx("p", { ref: saying, tabIndex: -1, class: said.problem ? "saves-said problem" : "saves-said", role: "status", children: said.text }), saves?.wentBack !== undefined && (_jsx(NewChat, { back: wentBackTitle(saves.wentBack, saves.saves), busy: busy, onConfirm: () => void send({ action: "new chat" }, `✓ ${t("The game goes on in the new chat: write «continua» there.")}`) })), saves?.make === true && _jsx(SaveNow, { busy: busy, onSave: (label) => void send({ action: "make", ...(label === "" ? {} : { label }) }, `✓ ${t("Saved.")}`) }), saves !== undefined && saves.saves.length === 0 && _jsx("p", { class: "saves-none", children: t("No saves yet: the game saves its start when play begins, then at the end of each scene.") }), saves !== undefined && saves.saves.length > 0 && (_jsx("ol", { class: "save-cards", children: saves.saves.map((save, index) => (_jsxs("li", { class: "save-card", children: [_jsx(SaveFace, { save: save }), save.load && (_jsx("button", { type: "button", class: "button", "aria-label": t("Go back here: {save}", { save: saveTitle(save) }), disabled: busy, onClick: () => setAsking(save), children: t("Go back here") })), saves.mode === "checkpoint" && index === 0 && !save.load && save.point === undefined && (_jsx("p", { class: "save-note", children: several ? t("Back here if they all die, or if the table chooses it when one dies") : t("Back here if your character dies") }))] }, save.number))) })), points.length > 0 && (_jsxs("section", { class: "saves-over", "aria-labelledby": "saves-over-title", children: [_jsx("h3", { id: "saves-over-title", children: t("Start over") }), _jsx("p", { children: points.length > 1
|
|
48
49
|
? t("Back to the campaign's start: everything that happened since is gone from the story, with the same character or a new one.")
|
|
49
|
-
: t("Back to the campaign's start: everything that happened since is gone from the story.") }), _jsx("button", { type: "button", class: "
|
|
50
|
+
: t("Back to the campaign's start: everything that happened since is gone from the story.") }), _jsx("button", { type: "button", class: "button danger", disabled: busy, onClick: () => setAsking("reset"), children: t("Start the campaign over…") })] })), asking !== undefined && asking !== "reset" && saves !== undefined && (_jsx(GoBack, { save: asking, later: saves.saves.filter((save) => save.number > asking.number).length, busy: busy, onClose: () => setAsking(undefined), onConfirm: () => void send({ action: "load", save: asking.number }, t("Back to {save}.", { save: saveTitle(asking) })) })), asking === "reset" && saves !== undefined && points.length > 0 && (_jsx(StartOver, { saves: saves.saves, points: points, campaign: campaign, busy: busy, onClose: () => setAsking(undefined), onConfirm: (name, to) => void send({ action: "reset", campaign: name, to }, to === "session zero" ? t("The campaign starts over, your character to make again.") : t("The campaign starts over.")) }))] }));
|
|
50
51
|
}
|
|
51
52
|
/** A save as its card shows it: the picture of the place, or the mark of its kind; its name, the badge of a point to start over from, the place and the time. */
|
|
52
53
|
function SaveFace({ save }) {
|
|
@@ -63,7 +64,7 @@ function SaveFace({ save }) {
|
|
|
63
64
|
* the player opens and confirms here, or tells the master there.
|
|
64
65
|
*/
|
|
65
66
|
function NewChat({ back, busy, onConfirm }) {
|
|
66
|
-
return (_jsxs("div", { class: "saves-chat", children: [_jsxs("p", { children: [_jsx("strong", { children: t("Open a new chat with the master.") }), " ", t("The game went back to {save}, and the chat you were playing in remembers what is gone: the master goes on only in a new one (/clear in Claude Code, a new conversation elsewhere). Once it is open, press here, or tell the master there.", { save: back })] }), _jsx("button", { type: "button", class: "
|
|
67
|
+
return (_jsxs("div", { class: "saves-chat", children: [_jsxs("p", { children: [_jsx("strong", { children: t("Open a new chat with the master.") }), " ", t("The game went back to {save}, and the chat you were playing in remembers what is gone: the master goes on only in a new one (/clear in Claude Code, a new conversation elsewhere). Once it is open, press here, or tell the master there.", { save: back })] }), _jsx("button", { type: "button", class: "button gold", disabled: busy, onClick: onConfirm, children: t("I opened a new chat") })] }));
|
|
67
68
|
}
|
|
68
69
|
/** The save the game went back to, by its card's title when it is still there. */
|
|
69
70
|
function wentBackTitle(back, saves) {
|
|
@@ -77,7 +78,7 @@ function SaveNow({ busy, onSave }) {
|
|
|
77
78
|
event.preventDefault();
|
|
78
79
|
onSave(label.trim());
|
|
79
80
|
setLabel("");
|
|
80
|
-
}, children: [_jsx("input", { type: "text", value: label, maxLength: 80, placeholder: t("Name (optional)"), "aria-label": t("The save's name, if you like"), onInput: (event) => setLabel(event.currentTarget.value) }), _jsx("button", { type: "submit", class: "
|
|
81
|
+
}, children: [_jsx("input", { type: "text", value: label, maxLength: 80, placeholder: t("Name (optional)"), "aria-label": t("The save's name, if you like"), onInput: (event) => setLabel(event.currentTarget.value) }), _jsx("button", { type: "submit", class: "button gold", disabled: busy, children: t("Save now") })] }));
|
|
81
82
|
}
|
|
82
83
|
/** Going back to a save, once confirmed: what is lost said first. */
|
|
83
84
|
function GoBack({ save, later, busy, onClose, onConfirm }) {
|
|
@@ -86,7 +87,7 @@ function GoBack({ save, later, busy, onClose, onConfirm }) {
|
|
|
86
87
|
: later === 1
|
|
87
88
|
? t("The game goes back to how it was then. What happened after it is gone from the story, and so is the save after it.")
|
|
88
89
|
: t("The game goes back to how it was then. What happened after it is gone from the story, and so are the {count} saves after it.", { count: later });
|
|
89
|
-
return (_jsxs(Confirm, { title: t("Go back to this save?"), onClose: onClose, children: [_jsx("div", { class: "save-card shown", children: _jsx(SaveFace, { save: save }) }), _jsx("p", { children: lost }), _jsx("p", { class: "confirm-note", children: t("Your settings stay as they are. A copy of the game as it is now stays in the campaign's .saves folder.") }), _jsxs("div", { class: "confirm-buttons", children: [_jsx("button", { type: "button", class: "
|
|
90
|
+
return (_jsxs(Confirm, { title: t("Go back to this save?"), onClose: onClose, children: [_jsx("div", { class: "save-card shown", children: _jsx(SaveFace, { save: save }) }), _jsx("p", { children: lost }), _jsx("p", { class: "confirm-note", children: t("Your settings stay as they are. A copy of the game as it is now stays in the campaign's .saves folder.") }), _jsxs("div", { class: "confirm-buttons", children: [_jsx("button", { type: "button", class: "button", autoFocus: true, onClick: onClose, children: t("Cancel") }), _jsx("button", { type: "button", class: "button danger final", disabled: busy, onClick: onConfirm, children: t("Go back") })] })] }));
|
|
90
91
|
}
|
|
91
92
|
/**
|
|
92
93
|
* Starting the campaign over, in two steps: from where, with the same character or a new one, and what is lost; then the campaign's name written, as for
|
|
@@ -107,15 +108,15 @@ function StartOver({ saves, points, campaign, busy, onClose, onConfirm }) {
|
|
|
107
108
|
}, [sure]);
|
|
108
109
|
return (_jsxs(Confirm, { title: t("Start the campaign over?"), onClose: onClose, children: [!sure && (_jsxs(_Fragment, { children: [points.length > 1 && (_jsxs("fieldset", { class: "over-choice", children: [_jsx("legend", { children: t("From where") }), points.map((point) => (_jsxs("label", { children: [_jsx("input", { type: "radio", name: "start-over-from", checked: to === point, onChange: () => setTo(point) }), _jsxs("span", { children: [_jsx("strong", { children: pointTexts(point).title }), _jsx("span", { children: pointTexts(point).about })] })] }, point)))] })), target !== undefined && (_jsx("div", { class: "save-card shown", children: _jsx(SaveFace, { save: target }) })), _jsx("p", { children: to === "session zero"
|
|
109
110
|
? t("Everything that happened since is gone from the story, and so is every save after it, your character too.")
|
|
110
|
-
: t("Everything that happened since is gone from the story, and so is every save after it.") }), _jsx("p", { class: "confirm-note", children: t("Your settings stay as they are. A copy of the game as it is now stays in the campaign's .saves folder.") }), _jsxs("div", { class: "confirm-buttons", children: [_jsx("button", { type: "button", class: "
|
|
111
|
+
: t("Everything that happened since is gone from the story, and so is every save after it.") }), _jsx("p", { class: "confirm-note", children: t("Your settings stay as they are. A copy of the game as it is now stays in the campaign's .saves folder.") }), _jsxs("div", { class: "confirm-buttons", children: [_jsx("button", { type: "button", class: "button", autoFocus: true, onClick: onClose, children: t("Cancel") }), _jsx("button", { type: "button", class: "button danger", onClick: () => setSure(true), children: t("Continue") })] })] })), sure && (_jsxs("form", { class: "confirm-name", onSubmit: (event) => {
|
|
111
112
|
event.preventDefault();
|
|
112
113
|
if (matches) {
|
|
113
114
|
onConfirm(name, to);
|
|
114
115
|
}
|
|
115
|
-
}, children: [_jsxs("label", { for: "start-over-name", children: [t("To start it over, write the campaign's name"), campaign === undefined ? "" : (_jsxs(_Fragment, { children: [": ", _jsx("strong", { children: campaign })] }))] }), _jsx("input", { ref: field, id: "start-over-name", type: "text", value: name, autoComplete: "off", spellcheck: false, onInput: (event) => setName(event.currentTarget.value) }), _jsxs("div", { class: "confirm-buttons", children: [_jsx("button", { type: "button", class: "
|
|
116
|
+
}, children: [_jsxs("label", { for: "start-over-name", children: [t("To start it over, write the campaign's name"), campaign === undefined ? "" : (_jsxs(_Fragment, { children: [": ", _jsx("strong", { children: campaign })] }))] }), _jsx("input", { ref: field, id: "start-over-name", type: "text", value: name, autoComplete: "off", spellcheck: false, onInput: (event) => setName(event.currentTarget.value) }), _jsxs("div", { class: "confirm-buttons", children: [_jsx("button", { type: "button", class: "button", onClick: onClose, children: t("Cancel") }), _jsx("button", { type: "submit", class: "button danger final", disabled: !matches || busy, children: t("Start over") })] })] }))] }));
|
|
116
117
|
}
|
|
117
118
|
/** A modal question over the whole page, the dice too, which Escape closes. */
|
|
118
|
-
function Confirm({ title, onClose, children }) {
|
|
119
|
+
export function Confirm({ title, onClose, children }) {
|
|
119
120
|
const dialog = useRef(null);
|
|
120
121
|
useEffect(() => {
|
|
121
122
|
dialog.current?.showModal();
|
|
@@ -134,10 +135,12 @@ function comparable(text) {
|
|
|
134
135
|
return text.trim().normalize("NFC").toLowerCase().replace(/[‘’]/g, "'");
|
|
135
136
|
}
|
|
136
137
|
/** What a mode of saves lets the player do, in their words; undefined for one the page does not know. */
|
|
137
|
-
function modeText(mode) {
|
|
138
|
+
function modeText(mode, several) {
|
|
138
139
|
const texts = {
|
|
139
140
|
free: t("save when you like, and go back to any save."),
|
|
140
|
-
checkpoint:
|
|
141
|
+
checkpoint: several
|
|
142
|
+
? t("the game saves at the end of each scene, and goes back to the last save only if they all die, or if the table chooses it when one dies.")
|
|
143
|
+
: t("the game saves at the end of each scene, and goes back to the last save only if your character dies."),
|
|
141
144
|
permadeath: t("the game saves at the end of each scene, but never goes back: what happens stays. You can only start the campaign over."),
|
|
142
145
|
};
|
|
143
146
|
return texts[mode];
|