rpg-engine 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/adventures/index.d.ts +3 -0
- package/dist/adventures/index.js +5 -0
- package/dist/adventures/manifest.d.ts +39 -0
- package/dist/adventures/manifest.js +89 -0
- package/dist/adventures/placement.d.ts +4 -0
- package/dist/adventures/placement.js +14 -0
- package/dist/adventures/source.d.ts +21 -0
- package/dist/adventures/source.js +108 -0
- package/dist/bell-listener.d.ts +9 -0
- package/dist/bell-listener.js +83 -0
- package/dist/campaign/create-campaign.d.ts +3 -2
- package/dist/campaign/create-campaign.js +5 -5
- package/dist/campaign/host-files.d.ts +23 -6
- package/dist/campaign/host-files.js +130 -40
- package/dist/campaign/index.d.ts +2 -2
- package/dist/campaign/index.js +2 -2
- package/dist/campaign/settings.d.ts +33 -2
- package/dist/campaign/settings.js +49 -12
- package/dist/cli.js +10 -1
- package/dist/command-line.js +20 -2
- package/dist/commands/advance.js +6 -2
- package/dist/commands/ask.d.ts +11 -4
- package/dist/commands/ask.js +249 -23
- package/dist/commands/change.d.ts +29 -0
- package/dist/commands/change.js +260 -41
- package/dist/commands/config.d.ts +6 -3
- package/dist/commands/config.js +179 -79
- package/dist/commands/effect.js +38 -9
- package/dist/commands/game-advance.d.ts +11 -2
- package/dist/commands/game-advance.js +22 -7
- package/dist/commands/game-adventures.d.ts +70 -0
- package/dist/commands/game-adventures.js +418 -0
- package/dist/commands/game-bonds.d.ts +9 -0
- package/dist/commands/game-bonds.js +84 -0
- package/dist/commands/game-catalog.d.ts +36 -0
- package/dist/commands/game-catalog.js +122 -0
- package/dist/commands/game-checks.d.ts +17 -0
- package/dist/commands/game-checks.js +128 -0
- package/dist/commands/game-damage.d.ts +18 -0
- package/dist/commands/game-damage.js +74 -0
- package/dist/commands/game-effects.d.ts +5 -0
- package/dist/commands/game-effects.js +2 -2
- package/dist/commands/game-events.js +8 -4
- package/dist/commands/game-experience.js +2 -2
- package/dist/commands/game-extensions.d.ts +8 -1
- package/dist/commands/game-extensions.js +8 -3
- package/dist/commands/game-grid-moves.d.ts +4 -1
- package/dist/commands/game-grid-moves.js +8 -2
- package/dist/commands/game-hit-dice.d.ts +39 -0
- package/dist/commands/game-hit-dice.js +120 -0
- package/dist/commands/game-import.d.ts +11 -0
- package/dist/commands/game-import.js +154 -0
- package/dist/commands/game-journey.d.ts +6 -2
- package/dist/commands/game-journey.js +17 -6
- package/dist/commands/game-knowledge.d.ts +56 -6
- package/dist/commands/game-knowledge.js +152 -23
- package/dist/commands/game-library.d.ts +112 -0
- package/dist/commands/game-library.js +388 -0
- package/dist/commands/game-limits.d.ts +7 -0
- package/dist/commands/game-limits.js +67 -0
- package/dist/commands/game-mode.js +3 -3
- package/dist/commands/game-moves.d.ts +14 -1
- package/dist/commands/game-moves.js +24 -9
- package/dist/commands/game-recipe-pace.d.ts +6 -0
- package/dist/commands/game-recipe-pace.js +25 -0
- package/dist/commands/game-recipes.js +10 -3
- package/dist/commands/game-reminders.d.ts +3 -3
- package/dist/commands/game-reminders.js +10 -5
- package/dist/commands/game-roads.d.ts +11 -4
- package/dist/commands/game-roads.js +89 -26
- package/dist/commands/game-saves.d.ts +12 -0
- package/dist/commands/game-saves.js +44 -5
- package/dist/commands/game-scene.js +3 -1
- package/dist/commands/game-stacks.d.ts +78 -0
- package/dist/commands/game-stacks.js +198 -0
- package/dist/commands/game-system-code.d.ts +25 -0
- package/dist/commands/game-system-code.js +165 -0
- package/dist/commands/game-thoughts.d.ts +25 -0
- package/dist/commands/game-thoughts.js +57 -0
- package/dist/commands/game-turn-uses.d.ts +33 -0
- package/dist/commands/game-turn-uses.js +137 -0
- package/dist/commands/game-upkeep.d.ts +20 -0
- package/dist/commands/game-upkeep.js +190 -0
- package/dist/commands/game-view-journal.d.ts +14 -1
- package/dist/commands/game-view-journal.js +5 -2
- package/dist/commands/game-view-map.d.ts +3 -0
- package/dist/commands/game-view-map.js +5 -1
- package/dist/commands/game-view-place.d.ts +22 -3
- package/dist/commands/game-view-place.js +61 -24
- package/dist/commands/game-view-world.d.ts +98 -0
- package/dist/commands/game-view-world.js +98 -0
- package/dist/commands/game-voices.d.ts +5 -0
- package/dist/commands/game-voices.js +13 -0
- package/dist/commands/game-widgets.d.ts +66 -0
- package/dist/commands/game-widgets.js +274 -0
- package/dist/commands/game-world.d.ts +8 -1
- package/dist/commands/game-world.js +23 -3
- package/dist/commands/image.js +2 -3
- package/dist/commands/import.d.ts +47 -0
- package/dist/commands/import.js +390 -0
- package/dist/commands/index.js +6 -0
- package/dist/commands/init.js +2 -2
- package/dist/commands/install.js +2 -1
- package/dist/commands/instructions.js +26 -1
- package/dist/commands/mode.js +3 -1
- package/dist/commands/move.d.ts +2 -0
- package/dist/commands/move.js +86 -12
- package/dist/commands/package.d.ts +57 -3
- package/dist/commands/package.js +304 -49
- package/dist/commands/parts.d.ts +3 -0
- package/dist/commands/parts.js +5 -0
- package/dist/commands/problems.js +6 -0
- package/dist/commands/rename.js +3 -0
- package/dist/commands/reveal.js +12 -7
- package/dist/commands/roll.d.ts +2 -0
- package/dist/commands/roll.js +23 -7
- package/dist/commands/route.js +4 -5
- package/dist/commands/rules.d.ts +3 -0
- package/dist/commands/rules.js +38 -6
- package/dist/commands/save.d.ts +1 -1
- package/dist/commands/save.js +2 -2
- package/dist/commands/scene.d.ts +10 -1
- package/dist/commands/scene.js +146 -29
- package/dist/commands/sheet.d.ts +47 -6
- package/dist/commands/sheet.js +179 -33
- package/dist/commands/show.d.ts +33 -0
- package/dist/commands/show.js +19 -2
- package/dist/commands/status.d.ts +9 -3
- package/dist/commands/status.js +59 -17
- package/dist/commands/thoughts.d.ts +11 -0
- package/dist/commands/thoughts.js +54 -0
- package/dist/commands/trade.d.ts +17 -0
- package/dist/commands/trade.js +273 -0
- package/dist/commands/travel.d.ts +2 -0
- package/dist/commands/travel.js +40 -14
- package/dist/commands/validate.js +2 -1
- package/dist/commands/view.d.ts +99 -2
- package/dist/commands/view.js +273 -57
- package/dist/commands/worked-out.d.ts +16 -0
- package/dist/commands/worked-out.js +108 -13
- package/dist/commands/write.d.ts +1 -0
- package/dist/commands/write.js +93 -21
- package/dist/confirm/confirm.d.ts +35 -0
- package/dist/confirm/confirm.js +94 -0
- package/dist/confirm/index.d.ts +1 -0
- package/dist/confirm/index.js +3 -0
- package/dist/core/archive-paths.d.ts +8 -0
- package/dist/core/archive-paths.js +39 -0
- package/dist/core/context.d.ts +127 -5
- package/dist/core/context.js +4 -3
- package/dist/core/download.d.ts +2 -0
- package/dist/core/download.js +31 -0
- package/dist/core/field-kind.d.ts +4 -3
- package/dist/core/field-kind.js +4 -3
- package/dist/core/files.d.ts +10 -0
- package/dist/core/files.js +58 -2
- package/dist/core/formula.d.ts +3 -1
- package/dist/core/formula.js +13 -2
- package/dist/core/progression-rule.d.ts +2 -0
- package/dist/core/version.d.ts +2 -0
- package/dist/core/version.js +7 -0
- package/dist/dashboard/act-names.js +27 -0
- package/dist/dashboard/act-sheet.js +100 -0
- package/dist/dashboard/act-strip.js +49 -0
- package/dist/dashboard/acts.js +140 -0
- package/dist/dashboard/address.js +16 -12
- package/dist/dashboard/api.js +140 -10
- package/dist/dashboard/app.js +370 -41
- package/dist/dashboard/asked.js +297 -19
- package/dist/dashboard/calendar.js +56 -0
- package/dist/dashboard/card.js +13 -12
- package/dist/dashboard/coins.js +13 -0
- package/dist/dashboard/death-save.js +67 -0
- package/dist/dashboard/dice/pool.js +22 -0
- package/dist/dashboard/dice/roller.js +1 -1
- package/dist/dashboard/dice/stage.js +12 -4
- package/dist/dashboard/dice/tray.js +28 -15
- package/dist/dashboard/dying.js +46 -0
- package/dist/dashboard/extension-widgets.js +160 -0
- package/dist/dashboard/game-words.js +33 -4
- package/dist/dashboard/guide/ar.md +105 -100
- package/dist/dashboard/guide/cs.md +111 -106
- package/dist/dashboard/guide/da.md +95 -90
- package/dist/dashboard/guide/de.md +93 -88
- package/dist/dashboard/guide/el.md +110 -105
- package/dist/dashboard/guide/en.md +21 -16
- package/dist/dashboard/guide/es.md +79 -74
- package/dist/dashboard/guide/fi.md +99 -94
- package/dist/dashboard/guide/fr.md +83 -78
- package/dist/dashboard/guide/he.md +109 -104
- package/dist/dashboard/guide/hi.md +103 -98
- package/dist/dashboard/guide/hu.md +113 -108
- package/dist/dashboard/guide/is.md +102 -97
- package/dist/dashboard/guide/it.md +22 -17
- package/dist/dashboard/guide/ja.md +108 -103
- package/dist/dashboard/guide/ko.md +113 -108
- package/dist/dashboard/guide/nb.md +95 -90
- package/dist/dashboard/guide/nl.md +89 -84
- package/dist/dashboard/guide/pl.md +104 -99
- package/dist/dashboard/guide/pt.md +82 -77
- package/dist/dashboard/guide/ro.md +113 -108
- package/dist/dashboard/guide/ru.md +109 -104
- package/dist/dashboard/guide/sv.md +96 -91
- package/dist/dashboard/guide/tr.md +102 -97
- package/dist/dashboard/guide/uk.md +113 -108
- package/dist/dashboard/guide/zh.md +110 -105
- package/dist/dashboard/guide-markdown.js +4 -0
- package/dist/dashboard/help.js +4 -5
- package/dist/dashboard/i18n/ar.json +361 -16
- package/dist/dashboard/i18n/cs.json +361 -16
- package/dist/dashboard/i18n/da.json +361 -16
- package/dist/dashboard/i18n/de.json +361 -16
- package/dist/dashboard/i18n/el.json +361 -16
- package/dist/dashboard/i18n/es.json +361 -16
- package/dist/dashboard/i18n/fi.json +361 -16
- package/dist/dashboard/i18n/fr.json +361 -16
- package/dist/dashboard/i18n/he.json +361 -16
- package/dist/dashboard/i18n/hi.json +361 -16
- package/dist/dashboard/i18n/hu.json +361 -16
- package/dist/dashboard/i18n/is.json +361 -16
- package/dist/dashboard/i18n/it.json +363 -18
- package/dist/dashboard/i18n/ja.json +361 -16
- package/dist/dashboard/i18n/ko.json +361 -16
- package/dist/dashboard/i18n/nb.json +361 -16
- package/dist/dashboard/i18n/nl.json +361 -16
- package/dist/dashboard/i18n/pl.json +361 -16
- package/dist/dashboard/i18n/pt.json +361 -16
- package/dist/dashboard/i18n/ro.json +361 -16
- package/dist/dashboard/i18n/ru.json +361 -16
- package/dist/dashboard/i18n/sv.json +361 -16
- package/dist/dashboard/i18n/tr.json +361 -16
- package/dist/dashboard/i18n/uk.json +361 -16
- package/dist/dashboard/i18n/zh.json +361 -16
- package/dist/dashboard/icons.js +38 -4
- package/dist/dashboard/journal.js +203 -49
- package/dist/dashboard/labels.js +42 -4
- package/dist/dashboard/languages.js +2 -2
- package/dist/dashboard/layout.js +35 -0
- package/dist/dashboard/lore.js +44 -0
- package/dist/dashboard/markdown.js +136 -30
- package/dist/dashboard/master.js +2 -2
- package/dist/dashboard/notes.js +5 -5
- package/dist/dashboard/notices.js +24 -4
- package/dist/dashboard/packages.js +678 -0
- package/dist/dashboard/pages.js +0 -8
- package/dist/dashboard/party.js +17 -4
- package/dist/dashboard/place-map-view.js +47 -9
- package/dist/dashboard/rolls.js +35 -93
- package/dist/dashboard/save-outcome.js +42 -0
- package/dist/dashboard/saves.js +14 -11
- package/dist/dashboard/scene.js +114 -20
- package/dist/dashboard/settings.js +70 -12
- package/dist/dashboard/setup.js +4 -4
- package/dist/dashboard/sheet.js +123 -19
- package/dist/dashboard/spend.js +115 -0
- package/dist/dashboard/status.js +22 -10
- package/dist/dashboard/story.js +6 -6
- package/dist/dashboard/style.css +8047 -3468
- package/dist/dashboard/table.js +145 -0
- package/dist/dashboard/tabs.js +34 -0
- package/dist/dashboard/text.js +19 -1
- package/dist/dashboard/top.js +91 -31
- package/dist/dashboard/turns.js +150 -0
- package/dist/dashboard/widgets.js +21 -14
- package/dist/dashboard/world-calendar.js +101 -0
- package/dist/dashboard/world-lore.js +231 -0
- package/dist/dashboard/world.js +87 -29
- package/dist/dashboard-server.d.ts +10 -1
- package/dist/dashboard-server.js +738 -26
- package/dist/documents/index.d.ts +2 -0
- package/dist/documents/index.js +5 -0
- package/dist/documents/markup.d.ts +10 -0
- package/dist/documents/markup.js +124 -0
- package/dist/documents/ocr.d.ts +9 -0
- package/dist/documents/ocr.js +101 -0
- package/dist/documents/png.d.ts +9 -0
- package/dist/documents/png.js +75 -0
- package/dist/documents/read.d.ts +54 -0
- package/dist/documents/read.js +375 -0
- package/dist/extensions/api.d.ts +91 -9
- package/dist/extensions/extension.d.ts +28 -2
- package/dist/extensions/extension.js +49 -11
- package/dist/extensions/index.d.ts +5 -3
- package/dist/extensions/index.js +4 -2
- package/dist/extensions/packages.d.ts +13 -4
- package/dist/extensions/packages.js +114 -16
- package/dist/extensions/tarball.d.ts +6 -0
- package/dist/extensions/tarball.js +87 -0
- package/dist/extensions/words.d.ts +13 -0
- package/dist/extensions/words.js +42 -0
- package/dist/importer/index.d.ts +1 -0
- package/dist/importer/index.js +3 -0
- package/dist/importer/work.d.ts +132 -0
- package/dist/importer/work.js +306 -0
- package/dist/index.d.ts +3 -1
- package/dist/instructions/index.d.ts +7 -0
- package/dist/instructions/index.js +10 -0
- package/dist/languages/index.d.ts +1 -0
- package/dist/languages/index.js +3 -0
- package/dist/languages/language-pack.d.ts +32 -0
- package/dist/languages/language-pack.js +86 -0
- package/dist/library/books.d.ts +76 -0
- package/dist/library/books.js +378 -0
- package/dist/library/folders.d.ts +11 -0
- package/dist/library/folders.js +70 -0
- package/dist/library/index.d.ts +3 -0
- package/dist/library/index.js +5 -0
- package/dist/library/language.d.ts +2 -0
- package/dist/library/language.js +40 -0
- package/dist/library-reader.d.ts +7 -0
- package/dist/library-reader.js +36 -0
- package/dist/mcp-server.js +90 -7
- package/dist/money/index.d.ts +1 -1
- package/dist/money/index.js +1 -1
- package/dist/money/money.d.ts +6 -0
- package/dist/money/money.js +11 -0
- package/dist/page-words.js +4 -1
- package/dist/pages/check.d.ts +5 -0
- package/dist/pages/check.js +111 -5
- package/dist/pages/containers.d.ts +19 -1
- package/dist/pages/containers.js +50 -7
- package/dist/pages/index.d.ts +8 -5
- package/dist/pages/index.js +8 -5
- package/dist/pages/load.d.ts +11 -0
- package/dist/pages/load.js +69 -0
- package/dist/pages/markdown.d.ts +7 -0
- package/dist/pages/markdown.js +27 -3
- package/dist/pages/page-file.d.ts +2 -0
- package/dist/pages/page-file.js +28 -5
- package/dist/pages/rename-page.js +3 -2
- package/dist/pages/stack-entry.d.ts +47 -0
- package/dist/pages/stack-entry.js +83 -0
- package/dist/pages/stack-writes.d.ts +22 -0
- package/dist/pages/stack-writes.js +128 -0
- package/dist/pages/stacks.d.ts +52 -0
- package/dist/pages/stacks.js +168 -0
- package/dist/pages/standard-fields.js +1 -1
- package/dist/pages/system-pages.d.ts +5 -2
- package/dist/pages/system-pages.js +11 -5
- package/dist/pages/world.d.ts +29 -3
- package/dist/pages/world.js +66 -12
- package/dist/pages/write-page.js +15 -6
- package/dist/pictures/chosen.d.ts +5 -1
- package/dist/pictures/chosen.js +12 -3
- package/dist/pictures/claude.d.ts +3 -1
- package/dist/pictures/claude.js +38 -0
- package/dist/pictures/codex.d.ts +3 -1
- package/dist/pictures/codex.js +32 -0
- package/dist/pictures/helpers.d.ts +10 -0
- package/dist/pictures/helpers.js +53 -6
- package/dist/pictures/index.d.ts +5 -4
- package/dist/pictures/index.js +5 -4
- package/dist/pictures/stop.d.ts +2 -0
- package/dist/pictures/stop.js +18 -0
- package/dist/player-acts.d.ts +27 -0
- package/dist/player-acts.js +56 -0
- package/dist/rules/index.d.ts +1 -0
- package/dist/rules/index.js +3 -1
- package/dist/rules/page-search.d.ts +36 -0
- package/dist/rules/page-search.js +216 -0
- package/dist/rules/search.d.ts +7 -0
- package/dist/rules/search.js +2 -2
- package/dist/scene/scene.d.ts +2 -0
- package/dist/scene/scene.js +1 -0
- package/dist/systems/game-system.d.ts +161 -4
- package/dist/systems/game-system.js +237 -34
- package/dist/systems/index.d.ts +3 -1
- package/dist/systems/index.js +3 -1
- package/dist/systems/system-code.d.ts +97 -0
- package/dist/systems/system-code.js +62 -0
- package/dist/systems/system-folders.d.ts +11 -0
- package/dist/systems/system-folders.js +11 -0
- package/dist/systems/words.d.ts +2 -0
- package/dist/systems/words.js +3 -3
- package/instructions/author.md +1 -1
- package/instructions/buttons-physical-dice.md +1 -1
- package/instructions/buttons.md +1 -1
- package/instructions/character.md +15 -0
- package/instructions/combat.md +3 -1
- package/instructions/core.md +4 -4
- package/instructions/dashboard.md +4 -4
- package/instructions/import.md +14 -0
- package/instructions/mentor-hints.md +1 -1
- package/instructions/party.md +11 -0
- package/instructions/play.md +5 -5
- package/instructions/session-zero.md +1 -1
- package/instructions/setup.md +1 -1
- package/instructions/voices-always.md +1 -0
- package/instructions/voices-important.md +1 -0
- package/instructions/voices.md +14 -0
- package/package.json +6 -2
- package/systems/5e/LICENSE.md +1 -1
- package/systems/5e/dist/dying.js +193 -0
- package/systems/5e/dist/index.js +3 -0
- package/systems/5e/images/abacus.svg +1 -0
- package/systems/5e/images/acid-tube.svg +1 -0
- package/systems/5e/images/animal-hide.svg +1 -0
- package/systems/5e/images/anvil.svg +1 -0
- package/systems/5e/images/arrow-cluster.svg +1 -0
- package/systems/5e/images/backpack.svg +1 -0
- package/systems/5e/images/bagpipes.svg +1 -0
- package/systems/5e/images/barbed-spear.svg +1 -0
- package/systems/5e/images/barrel.svg +1 -0
- package/systems/5e/images/basket.svg +1 -0
- package/systems/5e/images/battle-axe.svg +1 -0
- package/systems/5e/images/beer-horn.svg +1 -0
- package/systems/5e/images/belt-buckles.svg +1 -0
- package/systems/5e/images/bird-scepter.svg +1 -0
- package/systems/5e/images/blanket.svg +1 -0
- package/systems/5e/images/book-cover.svg +1 -0
- package/systems/5e/images/boots.svg +1 -0
- package/systems/5e/images/bottle-vapors.svg +1 -0
- package/systems/5e/images/bow-arrow.svg +1 -0
- package/systems/5e/images/bowl-spiral.svg +1 -0
- package/systems/5e/images/bracer.svg +1 -0
- package/systems/5e/images/broadsword.svg +1 -0
- package/systems/5e/images/broom.svg +1 -0
- package/systems/5e/images/bullets.svg +1 -0
- package/systems/5e/images/caltrops.svg +1 -0
- package/systems/5e/images/camp-cooking-pot.svg +1 -0
- package/systems/5e/images/campfire.svg +1 -0
- package/systems/5e/images/camping-tent.svg +1 -0
- package/systems/5e/images/candle-flame.svg +1 -0
- package/systems/5e/images/candle-light.svg +1 -0
- package/systems/5e/images/canoe.svg +1 -0
- package/systems/5e/images/cape.svg +1 -0
- package/systems/5e/images/caravel.svg +1 -0
- package/systems/5e/images/card-pick.svg +1 -0
- package/systems/5e/images/chain-mail.svg +1 -0
- package/systems/5e/images/chained-arrow-heads.svg +1 -0
- package/systems/5e/images/chariot.svg +1 -0
- package/systems/5e/images/chest.svg +1 -0
- package/systems/5e/images/chisel.svg +1 -0
- package/systems/5e/images/claw-hammer.svg +1 -0
- package/systems/5e/images/colombian-statue.svg +1 -0
- package/systems/5e/images/cooking-pot.svg +1 -0
- package/systems/5e/images/crescent-staff.svg +1 -0
- package/systems/5e/images/crossbow.svg +1 -0
- package/systems/5e/images/crossed-chains.svg +1 -0
- package/systems/5e/images/crowbar.svg +1 -0
- package/systems/5e/images/crystal-ball.svg +1 -0
- package/systems/5e/images/crystal-cluster.svg +1 -0
- package/systems/5e/images/crystal-eye.svg +1 -0
- package/systems/5e/images/cubes.svg +1 -0
- package/systems/5e/images/dart.svg +1 -0
- package/systems/5e/images/dice-six-faces-five.svg +1 -0
- package/systems/5e/images/dragon-orb.svg +1 -0
- package/systems/5e/images/drakkar.svg +1 -0
- package/systems/5e/images/drum.svg +1 -0
- package/systems/5e/images/empty-wood-bucket-handle.svg +1 -0
- package/systems/5e/images/eye-shield.svg +1 -0
- package/systems/5e/images/fairy-wand.svg +1 -0
- package/systems/5e/images/feather.svg +1 -0
- package/systems/5e/images/feathered-wing.svg +1 -0
- package/systems/5e/images/fire-bottle.svg +1 -0
- package/systems/5e/images/fire-gem.svg +1 -0
- package/systems/5e/images/first-aid-kit.svg +1 -0
- package/systems/5e/images/fishing-hook.svg +1 -0
- package/systems/5e/images/fishing-net.svg +1 -0
- package/systems/5e/images/fishing-pole.svg +1 -0
- package/systems/5e/images/fist.svg +1 -0
- package/systems/5e/images/flail.svg +1 -0
- package/systems/5e/images/flanged-mace.svg +1 -0
- package/systems/5e/images/flat-hammer.svg +1 -0
- package/systems/5e/images/flint-spark.svg +1 -0
- package/systems/5e/images/floating-crystal.svg +1 -0
- package/systems/5e/images/flute.svg +1 -0
- package/systems/5e/images/galleon.svg +1 -0
- package/systems/5e/images/gauntlet.svg +1 -0
- package/systems/5e/images/gem-necklace.svg +1 -0
- package/systems/5e/images/gem-pendant.svg +1 -0
- package/systems/5e/images/gems.svg +1 -0
- package/systems/5e/images/gladius.svg +1 -0
- package/systems/5e/images/glaive.svg +1 -0
- package/systems/5e/images/glass-ball.svg +1 -0
- package/systems/5e/images/gloves.svg +1 -0
- package/systems/5e/images/gold-scarab.svg +1 -0
- package/systems/5e/images/grain-bundle.svg +1 -0
- package/systems/5e/images/halberd.svg +1 -0
- package/systems/5e/images/hand-saw.svg +1 -0
- package/systems/5e/images/handheld-fan.svg +1 -0
- package/systems/5e/images/harp.svg +1 -0
- package/systems/5e/images/hatchet.svg +1 -0
- package/systems/5e/images/headband-knot.svg +1 -0
- package/systems/5e/images/health-potion.svg +1 -0
- package/systems/5e/images/heart-bottle.svg +1 -0
- package/systems/5e/images/herbs-bundle.svg +1 -0
- package/systems/5e/images/hole-ladder.svg +1 -0
- package/systems/5e/images/holy-symbol.svg +1 -0
- package/systems/5e/images/holy-water.svg +1 -0
- package/systems/5e/images/honey-jar.svg +1 -0
- package/systems/5e/images/hood.svg +1 -0
- package/systems/5e/images/horseshoe.svg +1 -0
- package/systems/5e/images/hourglass.svg +1 -0
- package/systems/5e/images/hunting-horn.svg +1 -0
- package/systems/5e/images/jester-hat.svg +1 -0
- package/systems/5e/images/jug.svg +1 -0
- package/systems/5e/images/katana.svg +1 -0
- package/systems/5e/images/key-lock.svg +1 -0
- package/systems/5e/images/kitchen-scale.svg +1 -0
- package/systems/5e/images/knapsack.svg +1 -0
- package/systems/5e/images/ladder.svg +1 -0
- package/systems/5e/images/lantern.svg +1 -0
- package/systems/5e/images/leather-armor.svg +1 -0
- package/systems/5e/images/leather-boot.svg +1 -0
- package/systems/5e/images/leather-vest.svg +1 -0
- package/systems/5e/images/light-backpack.svg +1 -0
- package/systems/5e/images/light-helm.svg +1 -0
- package/systems/5e/images/locked-box.svg +1 -0
- package/systems/5e/images/locked-fortress.svg +1 -0
- package/systems/5e/images/lockpicks.svg +1 -0
- package/systems/5e/images/lunar-wand.svg +1 -0
- package/systems/5e/images/lyre.svg +1 -0
- package/systems/5e/images/magic-lamp.svg +1 -0
- package/systems/5e/images/magnifying-glass.svg +1 -0
- package/systems/5e/images/mail-shirt.svg +1 -0
- package/systems/5e/images/manacles.svg +1 -0
- package/systems/5e/images/marbles.svg +1 -0
- package/systems/5e/images/meat.svg +1 -0
- package/systems/5e/images/medal.svg +1 -0
- package/systems/5e/images/mirror-mirror.svg +1 -0
- package/systems/5e/images/mountain-climbing.svg +1 -0
- package/systems/5e/images/oil-can.svg +1 -0
- package/systems/5e/images/old-lantern.svg +1 -0
- package/systems/5e/images/old-wagon.svg +1 -0
- package/systems/5e/images/orb-wand.svg +1 -0
- package/systems/5e/images/oyster-pearl.svg +1 -0
- package/systems/5e/images/paint-brush.svg +1 -0
- package/systems/5e/images/painted-pottery.svg +1 -0
- package/systems/5e/images/palette.svg +1 -0
- package/systems/5e/images/paper.svg +1 -0
- package/systems/5e/images/pencil.svg +1 -0
- package/systems/5e/images/perfume-bottle.svg +1 -0
- package/systems/5e/images/pilgrim-hat.svg +1 -0
- package/systems/5e/images/pipes.svg +1 -0
- package/systems/5e/images/plain-arrow.svg +1 -0
- package/systems/5e/images/plain-dagger.svg +1 -0
- package/systems/5e/images/poison-bottle.svg +1 -0
- package/systems/5e/images/powder-bag.svg +1 -0
- package/systems/5e/images/prayer-beads.svg +1 -0
- package/systems/5e/images/pulley-hook.svg +1 -0
- package/systems/5e/images/quill-ink.svg +1 -0
- package/systems/5e/images/quill.svg +1 -0
- package/systems/5e/images/quiver.svg +1 -0
- package/systems/5e/images/red-carpet.svg +1 -0
- package/systems/5e/images/ring.svg +1 -0
- package/systems/5e/images/ringing-bell.svg +1 -0
- package/systems/5e/images/robe.svg +1 -0
- package/systems/5e/images/rope-coil.svg +1 -0
- package/systems/5e/images/round-bottom-flask.svg +1 -0
- package/systems/5e/images/round-potion.svg +1 -0
- package/systems/5e/images/rune-stone.svg +1 -0
- package/systems/5e/images/saddle.svg +1 -0
- package/systems/5e/images/scale-mail.svg +1 -0
- package/systems/5e/images/scroll-unfurled.svg +1 -0
- package/systems/5e/images/secret-book.svg +1 -0
- package/systems/5e/images/sewing-needle.svg +1 -0
- package/systems/5e/images/shield.svg +1 -0
- package/systems/5e/images/shirt-button.svg +1 -0
- package/systems/5e/images/sickle.svg +1 -0
- package/systems/5e/images/siege-ram.svg +1 -0
- package/systems/5e/images/skull-staff.svg +1 -0
- package/systems/5e/images/sleeping-bag.svg +1 -0
- package/systems/5e/images/sling.svg +1 -0
- package/systems/5e/images/slippers.svg +1 -0
- package/systems/5e/images/small-fishing-sailboat.svg +1 -0
- package/systems/5e/images/smoking-orb.svg +1 -0
- package/systems/5e/images/soap.svg +1 -0
- package/systems/5e/images/spade.svg +1 -0
- package/systems/5e/images/sparkling-sabre.svg +1 -0
- package/systems/5e/images/spell-book.svg +1 -0
- package/systems/5e/images/spiked-armor.svg +1 -0
- package/systems/5e/images/spiked-mace.svg +1 -0
- package/systems/5e/images/spikes.svg +1 -0
- package/systems/5e/images/spinning-wheel.svg +1 -0
- package/systems/5e/images/spyglass.svg +1 -0
- package/systems/5e/images/steampunk-goggles.svg +1 -0
- package/systems/5e/images/stone-block.svg +1 -0
- package/systems/5e/images/stone-pile.svg +1 -0
- package/systems/5e/images/stone-sphere.svg +1 -0
- package/systems/5e/images/straight-pipe.svg +1 -0
- package/systems/5e/images/swap-bag.svg +1 -0
- package/systems/5e/images/thor-hammer.svg +1 -0
- package/systems/5e/images/thrown-spear.svg +1 -0
- package/systems/5e/images/tiara.svg +1 -0
- package/systems/5e/images/tied-scroll.svg +1 -0
- package/systems/5e/images/tinker.svg +1 -0
- package/systems/5e/images/torch.svg +1 -0
- package/systems/5e/images/totem.svg +1 -0
- package/systems/5e/images/trap-mask.svg +1 -0
- package/systems/5e/images/treasure-map.svg +1 -0
- package/systems/5e/images/tribal-pendant.svg +1 -0
- package/systems/5e/images/trident.svg +1 -0
- package/systems/5e/images/two-handed-sword.svg +1 -0
- package/systems/5e/images/vial.svg +1 -0
- package/systems/5e/images/violin.svg +1 -0
- package/systems/5e/images/war-axe.svg +1 -0
- package/systems/5e/images/war-pick.svg +1 -0
- package/systems/5e/images/warhammer.svg +1 -0
- package/systems/5e/images/water-bottle.svg +1 -0
- package/systems/5e/images/waterskin.svg +1 -0
- package/systems/5e/images/wavy-chains.svg +1 -0
- package/systems/5e/images/wax-seal.svg +1 -0
- package/systems/5e/images/wheelbarrow.svg +1 -0
- package/systems/5e/images/whip.svg +1 -0
- package/systems/5e/images/whistle.svg +1 -0
- package/systems/5e/images/wing-cloak.svg +1 -0
- package/systems/5e/images/winged-scepter.svg +1 -0
- package/systems/5e/images/wizard-staff.svg +1 -0
- package/systems/5e/images/wolf-trap.svg +1 -0
- package/systems/5e/images/wood-canoe.svg +1 -0
- package/systems/5e/images/wood-club.svg +1 -0
- package/systems/5e/instructions/import.md +1 -0
- package/systems/5e/instructions/play.md +5 -0
- package/systems/5e/instructions/session-zero.md +1 -1
- package/systems/5e/package.json +11 -0
- package/systems/5e/system.yaml +231 -31
- package/systems/5e/words/ar.yaml +74 -0
- package/systems/5e/words/cs.yaml +74 -0
- package/systems/5e/words/da.yaml +74 -0
- package/systems/5e/words/de.yaml +74 -0
- package/systems/5e/words/el.yaml +74 -0
- package/systems/5e/words/en.yaml +20 -0
- package/systems/5e/words/es.yaml +74 -0
- package/systems/5e/words/fi.yaml +74 -0
- package/systems/5e/words/fr.yaml +74 -0
- package/systems/5e/words/he.yaml +74 -0
- package/systems/5e/words/hi.yaml +74 -0
- package/systems/5e/words/hu.yaml +74 -0
- package/systems/5e/words/is.yaml +74 -0
- package/systems/5e/words/it.yaml +84 -1
- package/systems/5e/words/ja.yaml +74 -0
- package/systems/5e/words/ko.yaml +74 -0
- package/systems/5e/words/nb.yaml +74 -0
- package/systems/5e/words/nl.yaml +74 -0
- package/systems/5e/words/pl.yaml +74 -0
- package/systems/5e/words/pt.yaml +74 -0
- package/systems/5e/words/ro.yaml +74 -0
- package/systems/5e/words/ru.yaml +74 -0
- package/systems/5e/words/sv.yaml +74 -0
- package/systems/5e/words/tr.yaml +74 -0
- package/systems/5e/words/uk.yaml +74 -0
- package/systems/5e/words/zh.yaml +74 -0
- package/systems/5e/world/creatures/Aboleth.md +1 -0
- package/systems/5e/world/creatures/Adult Black Dragon.md +2 -0
- package/systems/5e/world/creatures/Adult Blue Dragon.md +2 -0
- package/systems/5e/world/creatures/Adult Brass Dragon.md +2 -0
- package/systems/5e/world/creatures/Adult Bronze Dragon.md +2 -0
- package/systems/5e/world/creatures/Adult Copper Dragon.md +2 -0
- package/systems/5e/world/creatures/Adult Gold Dragon.md +2 -0
- package/systems/5e/world/creatures/Adult Green Dragon.md +2 -0
- package/systems/5e/world/creatures/Adult Red Dragon.md +2 -0
- package/systems/5e/world/creatures/Adult Silver Dragon.md +2 -0
- package/systems/5e/world/creatures/Adult White Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient Black Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient Blue Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient Brass Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient Bronze Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient Copper Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient Gold Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient Green Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient Red Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient Silver Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient White Dragon.md +2 -0
- package/systems/5e/world/creatures/Androsphinx.md +1 -0
- package/systems/5e/world/creatures/Dwarf.md +1 -0
- package/systems/5e/world/creatures/Gynosphinx.md +1 -0
- package/systems/5e/world/creatures/Kraken.md +1 -0
- package/systems/5e/world/creatures/Lich.md +2 -0
- package/systems/5e/world/creatures/Mummy Lord.md +1 -0
- package/systems/5e/world/creatures/Solar.md +1 -0
- package/systems/5e/world/creatures/Tarrasque.md +2 -0
- package/systems/5e/world/creatures/Unicorn.md +1 -0
- package/systems/5e/world/creatures/Vampire.md +2 -0
- package/systems/5e/world/items/Abacus.md +1 -0
- package/systems/5e/world/items/Acid.md +1 -0
- package/systems/5e/world/items/Adamantine Armor.md +1 -0
- package/systems/5e/world/items/Alchemist's Fire.md +1 -0
- package/systems/5e/world/items/Alchemist's Supplies.md +1 -0
- package/systems/5e/world/items/Ammunition, +1, +2, or +3.md +1 -0
- package/systems/5e/world/items/Amulet of Health.md +2 -0
- package/systems/5e/world/items/Amulet of Proof against Detection and Location.md +1 -0
- package/systems/5e/world/items/Amulet of the Planes.md +1 -0
- package/systems/5e/world/items/Amulet.md +1 -0
- package/systems/5e/world/items/Animated Shield.md +1 -0
- package/systems/5e/world/items/Antitoxin.md +1 -0
- package/systems/5e/world/items/Apparatus of the Crab.md +1 -0
- package/systems/5e/world/items/Armor of Invulnerability.md +2 -0
- package/systems/5e/world/items/Armor of Resistance.md +1 -0
- package/systems/5e/world/items/Armor of Vulnerability.md +1 -0
- package/systems/5e/world/items/Armor, +1, +2, or +3.md +1 -0
- package/systems/5e/world/items/Arrow of Slaying.md +1 -0
- package/systems/5e/world/items/Arrow-Catching Shield.md +1 -0
- package/systems/5e/world/items/Arrows.md +2 -0
- package/systems/5e/world/items/Backpack.md +1 -0
- package/systems/5e/world/items/Bag of Beans.md +1 -0
- package/systems/5e/world/items/Bag of Devouring.md +1 -0
- package/systems/5e/world/items/Bag of Holding.md +3 -0
- package/systems/5e/world/items/Bag of Tricks.md +1 -0
- package/systems/5e/world/items/Bagpipes.md +1 -0
- package/systems/5e/world/items/Ball Bearings.md +1 -0
- package/systems/5e/world/items/Barding.md +1 -0
- package/systems/5e/world/items/Barrel.md +1 -0
- package/systems/5e/world/items/Basic Poison.md +1 -0
- package/systems/5e/world/items/Basket.md +1 -0
- package/systems/5e/world/items/Battleaxe.md +1 -0
- package/systems/5e/world/items/Bead of Force.md +1 -0
- package/systems/5e/world/items/Bedroll.md +1 -0
- package/systems/5e/world/items/Bell.md +1 -0
- package/systems/5e/world/items/Belt of Dwarvenkind.md +1 -0
- package/systems/5e/world/items/Belt of Giant Strength.md +1 -0
- package/systems/5e/world/items/Berserker Axe.md +1 -0
- package/systems/5e/world/items/Bit and Bridle.md +1 -0
- package/systems/5e/world/items/Blanket.md +1 -0
- package/systems/5e/world/items/Block and Tackle.md +1 -0
- package/systems/5e/world/items/Blowgun Needles.md +2 -0
- package/systems/5e/world/items/Blowgun.md +1 -0
- package/systems/5e/world/items/Book.md +1 -0
- package/systems/5e/world/items/Boots of Elvenkind.md +1 -0
- package/systems/5e/world/items/Boots of Levitation.md +1 -0
- package/systems/5e/world/items/Boots of Speed.md +1 -0
- package/systems/5e/world/items/Boots of Striding and Springing.md +1 -0
- package/systems/5e/world/items/Boots of the Winterlands.md +2 -0
- package/systems/5e/world/items/Bowl of Commanding Water Elementals.md +1 -0
- package/systems/5e/world/items/Bracers of Archery.md +1 -0
- package/systems/5e/world/items/Bracers of Defense.md +1 -0
- package/systems/5e/world/items/Brazier of Commanding Fire Elementals.md +1 -0
- package/systems/5e/world/items/Breastplate.md +1 -0
- package/systems/5e/world/items/Brewer's Supplies.md +1 -0
- package/systems/5e/world/items/Brooch of Shielding.md +2 -0
- package/systems/5e/world/items/Broom of Flying.md +1 -0
- package/systems/5e/world/items/Bucket.md +1 -0
- package/systems/5e/world/items/Bullseye Lantern.md +1 -0
- package/systems/5e/world/items/Burglar's Pack.md +3 -0
- package/systems/5e/world/items/Calligrapher's Supplies.md +1 -0
- package/systems/5e/world/items/Caltrops.md +1 -0
- package/systems/5e/world/items/Candle of Invocation.md +1 -0
- package/systems/5e/world/items/Candle.md +1 -0
- package/systems/5e/world/items/Cape of the Mountebank.md +1 -0
- package/systems/5e/world/items/Carpenter's Tools.md +1 -0
- package/systems/5e/world/items/Carpet of Flying.md +1 -0
- package/systems/5e/world/items/Carriage.md +1 -0
- package/systems/5e/world/items/Cart.md +1 -0
- package/systems/5e/world/items/Cartographer's Tools.md +1 -0
- package/systems/5e/world/items/Censer of Controlling Air Elementals.md +1 -0
- package/systems/5e/world/items/Chain Mail.md +2 -0
- package/systems/5e/world/items/Chain Shirt.md +1 -0
- package/systems/5e/world/items/Chain.md +1 -0
- package/systems/5e/world/items/Chalk.md +1 -0
- package/systems/5e/world/items/Chariot.md +1 -0
- package/systems/5e/world/items/Chest.md +1 -0
- package/systems/5e/world/items/Chime of Opening.md +1 -0
- package/systems/5e/world/items/Circlet of Blasting.md +1 -0
- package/systems/5e/world/items/Climber's Kit.md +1 -0
- package/systems/5e/world/items/Cloak of Arachnida.md +2 -0
- package/systems/5e/world/items/Cloak of Displacement.md +1 -0
- package/systems/5e/world/items/Cloak of Elvenkind.md +1 -0
- package/systems/5e/world/items/Cloak of Protection.md +3 -0
- package/systems/5e/world/items/Cloak of the Bat.md +1 -0
- package/systems/5e/world/items/Cloak of the Manta Ray.md +1 -0
- package/systems/5e/world/items/Club.md +1 -0
- package/systems/5e/world/items/Cobbler's Tools.md +1 -0
- package/systems/5e/world/items/Common Clothes.md +1 -0
- package/systems/5e/world/items/Component Pouch.md +1 -0
- package/systems/5e/world/items/Cook's Utensils.md +1 -0
- package/systems/5e/world/items/Costume Clothes.md +1 -0
- package/systems/5e/world/items/Crossbow Bolt Case.md +1 -0
- package/systems/5e/world/items/Crossbow Bolts.md +2 -0
- package/systems/5e/world/items/Crowbar.md +1 -0
- package/systems/5e/world/items/Crystal Ball.md +1 -0
- package/systems/5e/world/items/Crystal.md +1 -0
- package/systems/5e/world/items/Cube of Force.md +2 -0
- package/systems/5e/world/items/Cubic Gate.md +2 -0
- package/systems/5e/world/items/Dagger of Venom.md +1 -0
- package/systems/5e/world/items/Dagger.md +1 -0
- package/systems/5e/world/items/Dancing Sword.md +1 -0
- package/systems/5e/world/items/Dart.md +1 -0
- package/systems/5e/world/items/Decanter of Endless Water.md +1 -0
- package/systems/5e/world/items/Deck of Illusions.md +1 -0
- package/systems/5e/world/items/Deck of Many Things.md +1 -0
- package/systems/5e/world/items/Defender.md +1 -0
- package/systems/5e/world/items/Demon Armor.md +1 -0
- package/systems/5e/world/items/Dice Set.md +1 -0
- package/systems/5e/world/items/Dimensional Shackles.md +1 -0
- package/systems/5e/world/items/Diplomat's Pack.md +3 -0
- package/systems/5e/world/items/Disguise Kit.md +1 -0
- package/systems/5e/world/items/Dragon Scale Mail.md +1 -0
- package/systems/5e/world/items/Dragon Slayer.md +1 -0
- package/systems/5e/world/items/Drum.md +1 -0
- package/systems/5e/world/items/Dulcimer.md +1 -0
- package/systems/5e/world/items/Dungeoneer's Pack.md +3 -0
- package/systems/5e/world/items/Dust of Disappearance.md +1 -0
- package/systems/5e/world/items/Dust of Dryness.md +1 -0
- package/systems/5e/world/items/Dust of Sneezing and Choking.md +1 -0
- package/systems/5e/world/items/Dwarven Plate.md +1 -0
- package/systems/5e/world/items/Dwarven Thrower.md +1 -0
- package/systems/5e/world/items/Efficient Quiver.md +1 -0
- package/systems/5e/world/items/Efreeti Bottle.md +1 -0
- package/systems/5e/world/items/Elemental Gem.md +1 -0
- package/systems/5e/world/items/Elven Chain.md +1 -0
- package/systems/5e/world/items/Emblem.md +1 -0
- package/systems/5e/world/items/Entertainer's Pack.md +3 -0
- package/systems/5e/world/items/Eversmoking Bottle.md +1 -0
- package/systems/5e/world/items/Exotic Saddle.md +1 -0
- package/systems/5e/world/items/Explorer's Pack.md +3 -0
- package/systems/5e/world/items/Eyes of Charming.md +1 -0
- package/systems/5e/world/items/Eyes of Minute Seeing.md +1 -0
- package/systems/5e/world/items/Eyes of the Eagle.md +1 -0
- package/systems/5e/world/items/Feather Token.md +1 -0
- package/systems/5e/world/items/Feed.md +1 -0
- package/systems/5e/world/items/Figurine of Wondrous Power.md +1 -0
- package/systems/5e/world/items/Fine Clothes.md +1 -0
- package/systems/5e/world/items/Fishing Tackle.md +1 -0
- package/systems/5e/world/items/Flail.md +1 -0
- package/systems/5e/world/items/Flame Tongue.md +1 -0
- package/systems/5e/world/items/Flask or Tankard.md +1 -0
- package/systems/5e/world/items/Flute.md +1 -0
- package/systems/5e/world/items/Folding Boat.md +1 -0
- package/systems/5e/world/items/Forgery Kit.md +1 -0
- package/systems/5e/world/items/Frost Brand.md +2 -0
- package/systems/5e/world/items/Galley.md +1 -0
- package/systems/5e/world/items/Gauntlets of Ogre Power.md +2 -0
- package/systems/5e/world/items/Gem of Brightness.md +2 -0
- package/systems/5e/world/items/Gem of Seeing.md +2 -0
- package/systems/5e/world/items/Giant Slayer.md +1 -0
- package/systems/5e/world/items/Glaive.md +1 -0
- package/systems/5e/world/items/Glamoured Studded Leather.md +1 -0
- package/systems/5e/world/items/Glass Bottle.md +1 -0
- package/systems/5e/world/items/Glassblower's Tools.md +1 -0
- package/systems/5e/world/items/Gloves of Missile Snaring.md +1 -0
- package/systems/5e/world/items/Gloves of Swimming and Climbing.md +1 -0
- package/systems/5e/world/items/Goggles of Night.md +1 -0
- package/systems/5e/world/items/Grappling Hook.md +1 -0
- package/systems/5e/world/items/Greataxe.md +1 -0
- package/systems/5e/world/items/Greatclub.md +1 -0
- package/systems/5e/world/items/Greatsword.md +1 -0
- package/systems/5e/world/items/Halberd.md +1 -0
- package/systems/5e/world/items/Half Plate Armor.md +1 -0
- package/systems/5e/world/items/Hammer of Thunderbolts.md +2 -0
- package/systems/5e/world/items/Hammer.md +1 -0
- package/systems/5e/world/items/Hand Crossbow.md +1 -0
- package/systems/5e/world/items/Handaxe.md +1 -0
- package/systems/5e/world/items/Handy Haversack.md +3 -0
- package/systems/5e/world/items/Hat of Disguise.md +1 -0
- package/systems/5e/world/items/Headband of Intellect.md +2 -0
- package/systems/5e/world/items/Healer's Kit.md +1 -0
- package/systems/5e/world/items/Heavy Crossbow.md +1 -0
- package/systems/5e/world/items/Helm of Brilliance.md +1 -0
- package/systems/5e/world/items/Helm of Comprehending Languages.md +1 -0
- package/systems/5e/world/items/Helm of Telepathy.md +1 -0
- package/systems/5e/world/items/Helm of Teleportation.md +2 -0
- package/systems/5e/world/items/Hempen Rope.md +1 -0
- package/systems/5e/world/items/Herbalism Kit.md +1 -0
- package/systems/5e/world/items/Hide Armor.md +1 -0
- package/systems/5e/world/items/Holy Avenger.md +1 -0
- package/systems/5e/world/items/Holy Water.md +1 -0
- package/systems/5e/world/items/Hooded Lantern.md +1 -0
- package/systems/5e/world/items/Horn of Blasting.md +1 -0
- package/systems/5e/world/items/Horn of Valhalla.md +1 -0
- package/systems/5e/world/items/Horn.md +1 -0
- package/systems/5e/world/items/Horseshoes of Speed.md +1 -0
- package/systems/5e/world/items/Horseshoes of a Zephyr.md +1 -0
- package/systems/5e/world/items/Hourglass.md +1 -0
- package/systems/5e/world/items/Hunting Trap.md +1 -0
- package/systems/5e/world/items/Immovable Rod.md +1 -0
- package/systems/5e/world/items/Ink Pen.md +1 -0
- package/systems/5e/world/items/Ink.md +1 -0
- package/systems/5e/world/items/Instant Fortress.md +1 -0
- package/systems/5e/world/items/Ioun Stone.md +1 -0
- package/systems/5e/world/items/Iron Bands of Binding.md +1 -0
- package/systems/5e/world/items/Iron Flask.md +1 -0
- package/systems/5e/world/items/Iron Pot.md +1 -0
- package/systems/5e/world/items/Iron Spikes.md +2 -0
- package/systems/5e/world/items/Javelin of Lightning.md +1 -0
- package/systems/5e/world/items/Javelin.md +1 -0
- package/systems/5e/world/items/Jeweler's Tools.md +1 -0
- package/systems/5e/world/items/Jug or Pitcher.md +1 -0
- package/systems/5e/world/items/Keelboat.md +1 -0
- package/systems/5e/world/items/Ladder.md +1 -0
- package/systems/5e/world/items/Lamp.md +1 -0
- package/systems/5e/world/items/Lance.md +1 -0
- package/systems/5e/world/items/Lantern of Revealing.md +1 -0
- package/systems/5e/world/items/Leather Armor.md +1 -0
- package/systems/5e/world/items/Leatherworker's Tools.md +1 -0
- package/systems/5e/world/items/Light Crossbow.md +1 -0
- package/systems/5e/world/items/Light Hammer.md +1 -0
- package/systems/5e/world/items/Lock.md +1 -0
- package/systems/5e/world/items/Longbow.md +1 -0
- package/systems/5e/world/items/Longship.md +1 -0
- package/systems/5e/world/items/Longsword.md +1 -0
- package/systems/5e/world/items/Luck Blade.md +1 -0
- package/systems/5e/world/items/Lute.md +1 -0
- package/systems/5e/world/items/Lyre.md +1 -0
- package/systems/5e/world/items/Mace of Disruption.md +1 -0
- package/systems/5e/world/items/Mace of Smiting.md +1 -0
- package/systems/5e/world/items/Mace of Terror.md +2 -0
- package/systems/5e/world/items/Mace.md +1 -0
- package/systems/5e/world/items/Magnifying Glass.md +1 -0
- package/systems/5e/world/items/Manacles.md +1 -0
- package/systems/5e/world/items/Mantle of Spell Resistance.md +1 -0
- package/systems/5e/world/items/Manual of Bodily Health.md +1 -0
- package/systems/5e/world/items/Manual of Gainful Exercise.md +1 -0
- package/systems/5e/world/items/Manual of Golems.md +1 -0
- package/systems/5e/world/items/Manual of Quickness of Action.md +1 -0
- package/systems/5e/world/items/Map or Scroll Case.md +1 -0
- package/systems/5e/world/items/Marvelous Pigments.md +1 -0
- package/systems/5e/world/items/Mason's Tools.md +1 -0
- package/systems/5e/world/items/Maul.md +1 -0
- package/systems/5e/world/items/Medallion of Thoughts.md +2 -0
- package/systems/5e/world/items/Merchant's Scale.md +1 -0
- package/systems/5e/world/items/Mess Kit.md +1 -0
- package/systems/5e/world/items/Military Saddle.md +1 -0
- package/systems/5e/world/items/Miner's Pick.md +1 -0
- package/systems/5e/world/items/Mirror of Life Trapping.md +1 -0
- package/systems/5e/world/items/Mithral Armor.md +1 -0
- package/systems/5e/world/items/Morningstar.md +1 -0
- package/systems/5e/world/items/Navigator's Tools.md +1 -0
- package/systems/5e/world/items/Necklace of Adaptation.md +1 -0
- package/systems/5e/world/items/Necklace of Fireballs.md +1 -0
- package/systems/5e/world/items/Necklace of Prayer Beads.md +1 -0
- package/systems/5e/world/items/Net.md +1 -0
- package/systems/5e/world/items/Nine Lives Stealer.md +1 -0
- package/systems/5e/world/items/Oathbow.md +1 -0
- package/systems/5e/world/items/Oil of Etherealness.md +1 -0
- package/systems/5e/world/items/Oil of Sharpness.md +1 -0
- package/systems/5e/world/items/Oil of Slipperiness.md +1 -0
- package/systems/5e/world/items/Oil.md +1 -0
- package/systems/5e/world/items/Orb of Dragonkind.md +2 -0
- package/systems/5e/world/items/Orb.md +1 -0
- package/systems/5e/world/items/Pack Saddle.md +1 -0
- package/systems/5e/world/items/Padded Armor.md +1 -0
- package/systems/5e/world/items/Painter's Supplies.md +1 -0
- package/systems/5e/world/items/Pan Flute.md +1 -0
- package/systems/5e/world/items/Paper.md +1 -0
- package/systems/5e/world/items/Parchment.md +1 -0
- package/systems/5e/world/items/Pearl of Power.md +1 -0
- package/systems/5e/world/items/Perfume.md +1 -0
- package/systems/5e/world/items/Periapt of Health.md +1 -0
- package/systems/5e/world/items/Periapt of Proof against Poison.md +1 -0
- package/systems/5e/world/items/Periapt of Wound Closure.md +1 -0
- package/systems/5e/world/items/Philter of Love.md +1 -0
- package/systems/5e/world/items/Pike.md +1 -0
- package/systems/5e/world/items/Pipes of Haunting.md +1 -0
- package/systems/5e/world/items/Pipes of the Sewers.md +1 -0
- package/systems/5e/world/items/Piton.md +1 -0
- package/systems/5e/world/items/Plate Armor of Etherealness.md +1 -0
- package/systems/5e/world/items/Plate Armor.md +2 -0
- package/systems/5e/world/items/Playing Card Set.md +1 -0
- package/systems/5e/world/items/Poisoner's Kit.md +1 -0
- package/systems/5e/world/items/Pole.md +1 -0
- package/systems/5e/world/items/Portable Hole.md +2 -0
- package/systems/5e/world/items/Portable Ram.md +1 -0
- package/systems/5e/world/items/Potion of Animal Friendship.md +1 -0
- package/systems/5e/world/items/Potion of Clairvoyance.md +1 -0
- package/systems/5e/world/items/Potion of Climbing.md +1 -0
- package/systems/5e/world/items/Potion of Diminution.md +1 -0
- package/systems/5e/world/items/Potion of Flying.md +1 -0
- package/systems/5e/world/items/Potion of Gaseous Form.md +1 -0
- package/systems/5e/world/items/Potion of Giant Strength.md +1 -0
- package/systems/5e/world/items/Potion of Growth.md +1 -0
- package/systems/5e/world/items/Potion of Healing.md +1 -0
- package/systems/5e/world/items/Potion of Heroism.md +1 -0
- package/systems/5e/world/items/Potion of Invisibility.md +1 -0
- package/systems/5e/world/items/Potion of Mind Reading.md +1 -0
- package/systems/5e/world/items/Potion of Poison.md +1 -0
- package/systems/5e/world/items/Potion of Resistance.md +1 -0
- package/systems/5e/world/items/Potion of Speed.md +1 -0
- package/systems/5e/world/items/Potion of Water Breathing.md +1 -0
- package/systems/5e/world/items/Potter's Tools.md +1 -0
- package/systems/5e/world/items/Pouch.md +1 -0
- package/systems/5e/world/items/Priest's Pack.md +3 -0
- package/systems/5e/world/items/Quarterstaff.md +1 -0
- package/systems/5e/world/items/Quiver.md +1 -0
- package/systems/5e/world/items/Rapier.md +1 -0
- package/systems/5e/world/items/Rations.md +1 -0
- package/systems/5e/world/items/Reliquary.md +1 -0
- package/systems/5e/world/items/Restorative Ointment.md +1 -0
- package/systems/5e/world/items/Riding Saddle.md +1 -0
- package/systems/5e/world/items/Ring Mail.md +1 -0
- package/systems/5e/world/items/Ring of Animal Influence.md +2 -0
- package/systems/5e/world/items/Ring of Djinni Summoning.md +1 -0
- package/systems/5e/world/items/Ring of Elemental Command.md +2 -0
- package/systems/5e/world/items/Ring of Evasion.md +2 -0
- package/systems/5e/world/items/Ring of Feather Falling.md +1 -0
- package/systems/5e/world/items/Ring of Free Action.md +1 -0
- package/systems/5e/world/items/Ring of Invisibility.md +1 -0
- package/systems/5e/world/items/Ring of Jumping.md +1 -0
- package/systems/5e/world/items/Ring of Mind Shielding.md +1 -0
- package/systems/5e/world/items/Ring of Protection.md +3 -0
- package/systems/5e/world/items/Ring of Regeneration.md +1 -0
- package/systems/5e/world/items/Ring of Resistance.md +1 -0
- package/systems/5e/world/items/Ring of Shooting Stars.md +2 -0
- package/systems/5e/world/items/Ring of Spell Storing.md +1 -0
- package/systems/5e/world/items/Ring of Spell Turning.md +1 -0
- package/systems/5e/world/items/Ring of Swimming.md +1 -0
- package/systems/5e/world/items/Ring of Telekinesis.md +1 -0
- package/systems/5e/world/items/Ring of Three Wishes.md +1 -0
- package/systems/5e/world/items/Ring of Warmth.md +2 -0
- package/systems/5e/world/items/Ring of Water Walking.md +1 -0
- package/systems/5e/world/items/Ring of X-ray Vision.md +1 -0
- package/systems/5e/world/items/Ring of the Ram.md +2 -0
- package/systems/5e/world/items/Robe of Eyes.md +1 -0
- package/systems/5e/world/items/Robe of Scintillating Colors.md +2 -0
- package/systems/5e/world/items/Robe of Stars.md +1 -0
- package/systems/5e/world/items/Robe of Useful Items.md +1 -0
- package/systems/5e/world/items/Robe of the Archmagi.md +3 -0
- package/systems/5e/world/items/Robes.md +1 -0
- package/systems/5e/world/items/Rod of Absorption.md +1 -0
- package/systems/5e/world/items/Rod of Alertness.md +1 -0
- package/systems/5e/world/items/Rod of Lordly Might.md +1 -0
- package/systems/5e/world/items/Rod of Rulership.md +1 -0
- package/systems/5e/world/items/Rod of Security.md +1 -0
- package/systems/5e/world/items/Rod.md +1 -0
- package/systems/5e/world/items/Rope of Climbing.md +1 -0
- package/systems/5e/world/items/Rope of Entanglement.md +1 -0
- package/systems/5e/world/items/Rowboat.md +1 -0
- package/systems/5e/world/items/Sack.md +1 -0
- package/systems/5e/world/items/Saddlebags.md +1 -0
- package/systems/5e/world/items/Sailing Ship.md +1 -0
- package/systems/5e/world/items/Scale Mail.md +1 -0
- package/systems/5e/world/items/Scarab of Protection.md +2 -0
- package/systems/5e/world/items/Scholar's Pack.md +3 -0
- package/systems/5e/world/items/Scimitar of Speed.md +1 -0
- package/systems/5e/world/items/Scimitar.md +1 -0
- package/systems/5e/world/items/Sealing Wax.md +1 -0
- package/systems/5e/world/items/Shawm.md +1 -0
- package/systems/5e/world/items/Shield of Missile Attraction.md +2 -0
- package/systems/5e/world/items/Shield, +1, +2, or +3.md +1 -0
- package/systems/5e/world/items/Shield.md +1 -0
- package/systems/5e/world/items/Shortbow.md +1 -0
- package/systems/5e/world/items/Shortsword.md +1 -0
- package/systems/5e/world/items/Shovel.md +1 -0
- package/systems/5e/world/items/Sickle.md +1 -0
- package/systems/5e/world/items/Signal Whistle.md +1 -0
- package/systems/5e/world/items/Signet Ring.md +1 -0
- package/systems/5e/world/items/Silk Rope.md +1 -0
- package/systems/5e/world/items/Sled.md +1 -0
- package/systems/5e/world/items/Sledgehammer.md +1 -0
- package/systems/5e/world/items/Sling Bullets.md +2 -0
- package/systems/5e/world/items/Sling.md +1 -0
- package/systems/5e/world/items/Slippers of Spider Climbing.md +1 -0
- package/systems/5e/world/items/Smith's Tools.md +1 -0
- package/systems/5e/world/items/Soap.md +1 -0
- package/systems/5e/world/items/Sovereign Glue.md +1 -0
- package/systems/5e/world/items/Spear.md +1 -0
- package/systems/5e/world/items/Spell Scroll.md +1 -0
- package/systems/5e/world/items/Spellbook.md +1 -0
- package/systems/5e/world/items/Spellguard Shield.md +1 -0
- package/systems/5e/world/items/Sphere of Annihilation.md +1 -0
- package/systems/5e/world/items/Splint Armor.md +2 -0
- package/systems/5e/world/items/Sprig of Mistletoe.md +1 -0
- package/systems/5e/world/items/Spyglass.md +1 -0
- package/systems/5e/world/items/Staff of Charming.md +1 -0
- package/systems/5e/world/items/Staff of Fire.md +3 -0
- package/systems/5e/world/items/Staff of Frost.md +3 -0
- package/systems/5e/world/items/Staff of Healing.md +2 -0
- package/systems/5e/world/items/Staff of Power.md +5 -0
- package/systems/5e/world/items/Staff of Striking.md +2 -0
- package/systems/5e/world/items/Staff of Swarming Insects.md +2 -0
- package/systems/5e/world/items/Staff of Thunder and Lightning.md +1 -0
- package/systems/5e/world/items/Staff of Withering.md +2 -0
- package/systems/5e/world/items/Staff of the Magi.md +3 -0
- package/systems/5e/world/items/Staff of the Python.md +1 -0
- package/systems/5e/world/items/Staff of the Woodlands.md +2 -0
- package/systems/5e/world/items/Staff.md +1 -0
- package/systems/5e/world/items/Steel Mirror.md +1 -0
- package/systems/5e/world/items/Stone of Controlling Earth Elementals.md +1 -0
- package/systems/5e/world/items/Stone of Good Luck.md +4 -0
- package/systems/5e/world/items/Studded Leather Armor.md +1 -0
- package/systems/5e/world/items/Sun Blade.md +1 -0
- package/systems/5e/world/items/Sword of Life Stealing.md +1 -0
- package/systems/5e/world/items/Sword of Sharpness.md +1 -0
- package/systems/5e/world/items/Sword of Wounding.md +1 -0
- package/systems/5e/world/items/Talisman of Pure Good.md +2 -0
- package/systems/5e/world/items/Talisman of Ultimate Evil.md +2 -0
- package/systems/5e/world/items/Talisman of the Sphere.md +1 -0
- package/systems/5e/world/items/Thieves' Tools.md +1 -0
- package/systems/5e/world/items/Tinderbox.md +1 -0
- package/systems/5e/world/items/Tinker's Tools.md +1 -0
- package/systems/5e/world/items/Tome of Clear Thought.md +1 -0
- package/systems/5e/world/items/Tome of Leadership and Influence.md +1 -0
- package/systems/5e/world/items/Tome of Understanding.md +1 -0
- package/systems/5e/world/items/Torch.md +1 -0
- package/systems/5e/world/items/Totem.md +1 -0
- package/systems/5e/world/items/Traveler's Clothes.md +1 -0
- package/systems/5e/world/items/Trident of Fish Command.md +2 -0
- package/systems/5e/world/items/Trident.md +1 -0
- package/systems/5e/world/items/Two-Person Tent.md +1 -0
- package/systems/5e/world/items/Unarmed Strike.md +1 -0
- package/systems/5e/world/items/Universal Solvent.md +1 -0
- package/systems/5e/world/items/Vial.md +1 -0
- package/systems/5e/world/items/Vicious Weapon.md +1 -0
- package/systems/5e/world/items/Viol.md +1 -0
- package/systems/5e/world/items/Vorpal Sword.md +1 -0
- package/systems/5e/world/items/Wagon.md +1 -0
- package/systems/5e/world/items/Wand of Binding.md +2 -0
- package/systems/5e/world/items/Wand of Enemy Detection.md +2 -0
- package/systems/5e/world/items/Wand of Fear.md +2 -0
- package/systems/5e/world/items/Wand of Fireballs.md +2 -0
- package/systems/5e/world/items/Wand of Lightning Bolts.md +2 -0
- package/systems/5e/world/items/Wand of Magic Detection.md +2 -0
- package/systems/5e/world/items/Wand of Magic Missiles.md +2 -0
- package/systems/5e/world/items/Wand of Paralysis.md +2 -0
- package/systems/5e/world/items/Wand of Polymorph.md +2 -0
- package/systems/5e/world/items/Wand of Secrets.md +2 -0
- package/systems/5e/world/items/Wand of Web.md +2 -0
- package/systems/5e/world/items/Wand of Wonder.md +2 -0
- package/systems/5e/world/items/Wand of the War Mage, +1, +2, or +3.md +1 -0
- package/systems/5e/world/items/Wand.md +1 -0
- package/systems/5e/world/items/War Pick.md +1 -0
- package/systems/5e/world/items/Warhammer.md +1 -0
- package/systems/5e/world/items/Warship.md +1 -0
- package/systems/5e/world/items/Waterskin.md +1 -0
- package/systems/5e/world/items/Weapon, +1, +2, or +3.md +1 -0
- package/systems/5e/world/items/Weaver's Tools.md +1 -0
- package/systems/5e/world/items/Well of Many Worlds.md +1 -0
- package/systems/5e/world/items/Whetstone.md +1 -0
- package/systems/5e/world/items/Whip.md +1 -0
- package/systems/5e/world/items/Wind Fan.md +1 -0
- package/systems/5e/world/items/Winged Boots.md +1 -0
- package/systems/5e/world/items/Wings of Flying.md +1 -0
- package/systems/5e/world/items/Woodcarver's Tools.md +1 -0
- package/systems/5e/world/items/Wooden Staff.md +1 -0
- package/systems/5e/world/items/Yew Wand.md +1 -0
- package/systems/free/instructions/play.md +5 -0
- package/systems/free/instructions/session-zero.md +1 -0
- package/systems/free/system.yaml +12 -0
- package/dist/dashboard/combat.js +0 -72
package/dist/commands/package.js
CHANGED
|
@@ -1,29 +1,46 @@
|
|
|
1
|
+
import { join } from "node:path";
|
|
1
2
|
import { z } from "zod";
|
|
2
3
|
import { changeExtensions, readTextSetting, requireCampaign } from "../campaign/index.js";
|
|
4
|
+
import { installedFromFolder } from "../core/files.js";
|
|
3
5
|
import { appendLogEntry } from "../core/log.js";
|
|
4
6
|
import { defineCommand } from "../core/registry.js";
|
|
5
7
|
import { files } from "../core/store.js";
|
|
6
8
|
import { comparableText } from "../core/text.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
+
import { isNewerVersion } from "../core/version.js";
|
|
10
|
+
import { extensionApi, findExtension, installedExtensions, isLocalSpec, isTarball, isVerified, readExtension, readsApi, shortName, verifiedScope } from "../extensions/index.js";
|
|
11
|
+
import { installedLanguages, languagePackProblems, readLanguagePack } from "../languages/index.js";
|
|
12
|
+
import { installedSystems, systemFolders, systemHasCode } from "../systems/index.js";
|
|
13
|
+
import { exportAdventure, installAdventure, installedAdventures, isAdventureSpec, readAdventureSpec, removeAdventure, storyTouching } from "./game-adventures.js";
|
|
9
14
|
import { listedExtensions, runsCode } from "./game-extension-list.js";
|
|
10
15
|
import { extensionCommandNames, packagesInstalled } from "./game-extensions.js";
|
|
11
16
|
import { campaignMode } from "./game-mode.js";
|
|
12
17
|
import { newDatedLogEntry } from "./game-time.js";
|
|
13
18
|
import { campaignWorld } from "./game-world.js";
|
|
19
|
+
/** The player's yes to a package not ours, not given (D-478): they said no or closed the question, or no window could be shown here. */
|
|
20
|
+
export class YesRefused extends Error {
|
|
21
|
+
code;
|
|
22
|
+
constructor(message, code) {
|
|
23
|
+
super(message);
|
|
24
|
+
this.code = code;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
14
27
|
export const packageCommand = defineCommand({
|
|
15
28
|
name: "package",
|
|
16
|
-
description: "The packages of the campaign: extensions such as weather, from npm. "
|
|
29
|
+
description: "The packages of the campaign: extensions such as weather, from npm, and adventures, as a .zip, a folder or a link with adventure.yaml. "
|
|
17
30
|
+ "list says those on this computer and those the campaign uses; available, those npm has, and updates. install adds or updates one, on this computer and in the campaign, "
|
|
18
|
-
+ "only once the player wants it; one not published by RPG Engine (@rpgengine/…) is someone else's: the player is asked
|
|
19
|
-
+ "
|
|
31
|
+
+ "only once the player wants it; one not published by RPG Engine (@rpgengine/…) is someone else's: the player is asked in the host's form, or in a window of their computer. "
|
|
32
|
+
+ "An adventure is installed when you bring its hook into the story, once the player wants it as the next. "
|
|
33
|
+
+ "remove takes one out of the campaign; uninstall takes it off this computer; export writes the campaign's world, as it was at its start, as an adventure. "
|
|
34
|
+
+ "Example: package install weather.",
|
|
20
35
|
group: "campaign",
|
|
21
36
|
positionals: ["action", "name"],
|
|
22
37
|
slow: true,
|
|
23
38
|
input: z.object({
|
|
24
|
-
action: z.enum(["list", "available", "install", "remove", "uninstall"]).describe("list, available, install, remove or
|
|
25
|
-
name: z.string().optional().describe("the package: its name alone for one of ours, such as weather; another's npm name with its scope, or npm:name without one, its version if wanted;
|
|
26
|
-
|
|
39
|
+
action: z.enum(["list", "available", "install", "remove", "uninstall", "export"]).describe("list, available, install, remove, uninstall or export"),
|
|
40
|
+
name: z.string().optional().describe("the package: its name alone for one of ours, such as weather; another's npm name with its scope, or npm:name without one, its version if wanted; a folder or a .tgz "
|
|
41
|
+
+ "file on this computer; an adventure's .zip, folder or https link; an adventure's title to remove it"),
|
|
42
|
+
author: z.string().min(1).optional().describe("export: who wrote the adventure, as the player wants it credited"),
|
|
43
|
+
license: z.string().min(1).optional().describe("export: the licence the player gives it, such as CC BY 4.0; without one, all rights are reserved"),
|
|
27
44
|
}),
|
|
28
45
|
async run(input, context) {
|
|
29
46
|
const root = requireCampaign(context.folder);
|
|
@@ -33,21 +50,56 @@ export const packageCommand = defineCommand({
|
|
|
33
50
|
if (input.action === "available") {
|
|
34
51
|
return await available(context);
|
|
35
52
|
}
|
|
53
|
+
if (input.action === "export") {
|
|
54
|
+
return { kind: "exported", ...exportAdventure(root, context, { author: input.author, license: input.license }) };
|
|
55
|
+
}
|
|
36
56
|
const name = input.name?.trim();
|
|
37
57
|
if (name === undefined || name === "") {
|
|
38
58
|
throw new Error(`Give the package to ${input.action}, such as package ${input.action} weather.`);
|
|
39
59
|
}
|
|
40
60
|
if (input.action === "install") {
|
|
41
|
-
return await
|
|
61
|
+
return isAdventureSpec(name) ? await adventureInstalled(root, context, name) : await installed(root, context, name);
|
|
62
|
+
}
|
|
63
|
+
const adventure = installedAdventures(root).find((one) => comparableText(one.title) === comparableText(name));
|
|
64
|
+
if (input.action === "remove" && adventure !== undefined) {
|
|
65
|
+
removeAdventure(root, context, adventure);
|
|
66
|
+
return { kind: "adventure-removed", title: adventure.title };
|
|
42
67
|
}
|
|
43
68
|
return input.action === "remove" ? removed(root, context, name) : await uninstalled(root, context, name);
|
|
44
69
|
},
|
|
45
70
|
format(result) {
|
|
71
|
+
if (result.kind === "adventure-installed") {
|
|
72
|
+
return adventureText(result);
|
|
73
|
+
}
|
|
74
|
+
if (result.kind === "adventure-removed") {
|
|
75
|
+
return `${result.title} is out of the campaign, with the files it wrote.`;
|
|
76
|
+
}
|
|
77
|
+
if (result.kind === "exported") {
|
|
78
|
+
return exportText(result);
|
|
79
|
+
}
|
|
80
|
+
if (result.kind === "language-installed") {
|
|
81
|
+
const { language } = result;
|
|
82
|
+
return [
|
|
83
|
+
`Installed ${language.name} (${language.code}) ${language.version}, the dashboard's words made by hand${language.verified ? "" : ", by someone else"}, for every campaign on this computer.`,
|
|
84
|
+
result.replaced === undefined ? "" : `It takes the place of ${result.replaced}.`,
|
|
85
|
+
result.missing === 0 ? "" : `The ${result.missing} phrases it lacks stay as the dashboard has them, its own or translated on the fly.`,
|
|
86
|
+
].filter((line) => line !== "").join(" ");
|
|
87
|
+
}
|
|
88
|
+
if (result.kind === "system-installed") {
|
|
89
|
+
const { system } = result;
|
|
90
|
+
return [
|
|
91
|
+
`Installed the game system ${system.name}${system.version === undefined ? "" : ` ${system.version}`}, ${system.title}${system.verified ? "" : ", not verified: at the player's risk"}.`,
|
|
92
|
+
system.used ? "The campaign plays it." : `It is for a new campaign, chosen in its setup: this one plays ${result.plays ?? "none yet"}.`,
|
|
93
|
+
system.code ? "Its code runs from the next start of the game's server." : "",
|
|
94
|
+
].filter((line) => line !== "").join(" ");
|
|
95
|
+
}
|
|
46
96
|
if (result.kind === "removed") {
|
|
47
97
|
return `The campaign no longer uses ${result.name}: its commands and its parts of your instructions are gone; what it kept in the campaign stays, and comes back if it is installed again.`;
|
|
48
98
|
}
|
|
49
99
|
if (result.kind === "uninstalled") {
|
|
50
|
-
return
|
|
100
|
+
return result.extension
|
|
101
|
+
? `${result.name} is off this computer${result.wasUsed ? ", and the campaign no longer uses it" : ""}: another campaign that lists it asks to install it again.`
|
|
102
|
+
: `${result.name} is off this computer.`;
|
|
51
103
|
}
|
|
52
104
|
if (result.kind === "installed") {
|
|
53
105
|
const { extension } = result;
|
|
@@ -75,6 +127,7 @@ export const packageCommand = defineCommand({
|
|
|
75
127
|
return [
|
|
76
128
|
`On this computer: ${installedLines.length === 0 ? "none" : installedLines.join("; ")}.`,
|
|
77
129
|
result.missing.length === 0 ? "" : `The campaign lists, not installed here: ${result.missing.join(", ")}; install each with package install.`,
|
|
130
|
+
result.adventures.length === 0 ? "" : `Its adventures: ${result.adventures.map((one) => `${one.title} ${one.version}${one.since === undefined ? "" : `, since ${one.since}`}`).join("; ")}.`,
|
|
78
131
|
"package available says those npm has, and updates.",
|
|
79
132
|
].filter((line) => line !== "").join("\n");
|
|
80
133
|
},
|
|
@@ -99,7 +152,8 @@ function listed(root, context) {
|
|
|
99
152
|
return { name: shortName(found.package), package: found.package, broken: error instanceof Error ? error.message : String(error) };
|
|
100
153
|
}
|
|
101
154
|
});
|
|
102
|
-
|
|
155
|
+
const adventures = installedAdventures(root).map((one) => ({ title: one.title, version: one.version, ...(one.since === undefined ? {} : { since: one.since }), removable: storyTouching(root, one) === undefined }));
|
|
156
|
+
return { kind: "list", installed: here, missing: used.filter((name) => !here.some((one) => one.package === name)), adventures, systems: systemsHere(root, context), languages: languagesHere(context) };
|
|
103
157
|
}
|
|
104
158
|
/** The extensions npm has for this rpg-engine's API, ours first, each with the version installed here and whether npm has a newer one (D-442). */
|
|
105
159
|
async function available(context) {
|
|
@@ -108,55 +162,60 @@ async function available(context) {
|
|
|
108
162
|
return { kind: "available", packages: [], failed: searched.failed };
|
|
109
163
|
}
|
|
110
164
|
const here = installedExtensions(context.extensionFolders ?? []);
|
|
111
|
-
const packages = searched.filter((one) => one.kind === "extension" && one.api
|
|
165
|
+
const packages = searched.filter((one) => one.kind === "extension" && readsApi(one.api)).map((one) => {
|
|
112
166
|
const installed = here.find((found) => found.package === one.name);
|
|
113
|
-
const
|
|
167
|
+
const copy = installed === undefined ? undefined : usable(context, one.name);
|
|
168
|
+
const version = copy?.version;
|
|
114
169
|
return {
|
|
115
170
|
name: shortName(one.name),
|
|
116
171
|
package: one.name,
|
|
117
172
|
version: one.version,
|
|
118
173
|
...(one.description === undefined ? {} : { description: one.description }),
|
|
119
174
|
...(one.author === undefined ? {} : { author: one.author }),
|
|
120
|
-
|
|
175
|
+
// What npm has is ours by its scope; the copy here is not, when a file or a folder of this computer took its place (D-452).
|
|
176
|
+
verified: isVerified(one.name, copy?.linked ?? false),
|
|
121
177
|
...(installed === undefined ? {} : { installed: version ?? "broken" }),
|
|
122
|
-
update: version !== undefined &&
|
|
178
|
+
update: version !== undefined && isNewerVersion(one.version, version),
|
|
123
179
|
};
|
|
124
180
|
});
|
|
125
181
|
return { kind: "available", packages: packages.sort((first, second) => Number(second.verified) - Number(first.verified) || first.name.localeCompare(second.name)) };
|
|
126
182
|
}
|
|
127
|
-
/** Whether a version is newer than another, by its numbers: 0.2.0 after 0.1.10. */
|
|
128
|
-
function newer(version, than) {
|
|
129
|
-
const numbers = (text) => text.split(/[.+-]/).slice(0, 3).map((part) => Number.parseInt(part, 10) || 0);
|
|
130
|
-
const [one, other] = [numbers(version), numbers(than)];
|
|
131
|
-
const differs = one.findIndex((part, index) => part !== other[index]);
|
|
132
|
-
return differs !== -1 && one[differs] > other[differs];
|
|
133
|
-
}
|
|
134
183
|
/** Installs a package on this computer and adds it to the campaign (D-27, D-428, D-441): ours, or another once the player wants it; an extension, for this game. */
|
|
135
|
-
async function installed(root, context, name
|
|
184
|
+
async function installed(root, context, name) {
|
|
136
185
|
const packages = context.packages;
|
|
137
186
|
if (packages === undefined) {
|
|
138
187
|
throw new Error("Packages are installed only by the game's server or the command line, which reach npm.");
|
|
139
188
|
}
|
|
140
189
|
// A name alone is one of ours: weather is @rpgengine/weather, never a stranger's of that name, which is given as npm:weather.
|
|
141
|
-
const spec = name.startsWith("npm:") ? name.slice(4) :
|
|
190
|
+
const spec = name.startsWith("npm:") ? name.slice(4) : isLocalSpec(name) || name.startsWith("@") ? name : `${verifiedScope}${name}`;
|
|
142
191
|
const described = await packages.describe(spec);
|
|
143
192
|
if ("failed" in described) {
|
|
144
193
|
throw new Error(`${described.failed}. Nothing changed${spec === name ? "" : `: ${name} alone means ${spec}, one of RPG Engine's; another's is named with its scope, or as npm:${name} without one`}.`);
|
|
145
194
|
}
|
|
195
|
+
if (described.kind === "system") {
|
|
196
|
+
return await systemInstalled(root, context, spec, name, described);
|
|
197
|
+
}
|
|
198
|
+
if (described.kind === "language") {
|
|
199
|
+
return await languageInstalled(root, context, spec, described);
|
|
200
|
+
}
|
|
146
201
|
if (described.kind !== "extension") {
|
|
147
202
|
throw new Error(described.kind === undefined
|
|
148
203
|
? `${described.name} is not a package for RPG Engine: its package.json does not say "rpg-engine": {"kind": "extension"}. Nothing changed.`
|
|
149
|
-
: `${described.name} is a package of kind ${described.kind}: for now
|
|
204
|
+
: `${described.name} is a package of kind ${described.kind}: for now extensions, game systems and adventures are installed this way. Nothing changed.`);
|
|
150
205
|
}
|
|
151
|
-
if (described.api
|
|
152
|
-
throw new Error(`${described.name} ${described.version} is made for the extension API ${described.api ?? "none"}, and this RPG Engine reads the API ${extensionApi}: install a version made for
|
|
153
|
-
}
|
|
154
|
-
const folderSpec = isFolderSpec(spec);
|
|
155
|
-
if (!isVerified(described.name, folderSpec)) {
|
|
156
|
-
await playerYes(context, folderSpec ? name : described.name, acceptRisk, folderSpec);
|
|
206
|
+
if (!readsApi(described.api)) {
|
|
207
|
+
throw new Error(`${described.name} ${described.version} is made for the extension API ${described.api ?? "none"}, and this RPG Engine reads the API 1 to ${extensionApi}: install a version made for these. Nothing changed.`);
|
|
157
208
|
}
|
|
209
|
+
const local = isLocalSpec(spec);
|
|
158
210
|
const before = usable(context, described.name);
|
|
159
|
-
|
|
211
|
+
if (!isVerified(described.name, local)) {
|
|
212
|
+
// A file or a folder says what it holds, and when it takes the place of a copy from npm, which is one for the whole computer (D-452).
|
|
213
|
+
const holds = local ? ` (${described.name} ${described.version}${described.author === undefined ? "" : `, by ${described.author}`})` : "";
|
|
214
|
+
const replaces = local && before !== undefined && !before.linked ? ` It takes the place of ${before.package} ${before.version} from npm, in every campaign on this computer.` : "";
|
|
215
|
+
await playerYes(context, local ? name : described.name, local, holds, replaces);
|
|
216
|
+
}
|
|
217
|
+
// A copy from a file or a folder never stands for the one npm has: asked by its name, npm's comes back.
|
|
218
|
+
const reinstall = before === undefined || before.version !== described.version || local || before.linked;
|
|
160
219
|
if (reinstall) {
|
|
161
220
|
const why = await packages.install(spec);
|
|
162
221
|
if (why !== undefined) {
|
|
@@ -203,27 +262,165 @@ async function installed(root, context, name, acceptRisk) {
|
|
|
203
262
|
};
|
|
204
263
|
}
|
|
205
264
|
/**
|
|
206
|
-
*
|
|
207
|
-
*
|
|
265
|
+
* Installs a game system on this computer (D-485), for a new campaign: the campaign keeps the one its setup chose. One not ours only with the player's yes,
|
|
266
|
+
* as an extension (D-441, D-478); a system that does not read is no system, whatever npm installed.
|
|
208
267
|
*/
|
|
209
|
-
async function
|
|
210
|
-
const
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
if (
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
268
|
+
async function systemInstalled(root, context, spec, name, described) {
|
|
269
|
+
const local = isLocalSpec(spec);
|
|
270
|
+
const named = shortName(described.name).replace(/^system-/, "");
|
|
271
|
+
const taken = systemsHere(root, context).find((one) => comparableText(one.name) === comparableText(named) && one.package !== described.name);
|
|
272
|
+
if (taken !== undefined) {
|
|
273
|
+
throw new Error(`There is already a game system named ${taken.name} on this computer${taken.package === undefined ? ", the engine's own" : `, from ${taken.package}`}: ${described.name} would take its name. Nothing changed.`);
|
|
274
|
+
}
|
|
275
|
+
if (!isVerified(described.name, local)) {
|
|
276
|
+
await playerYes(context, local ? name : described.name, local, local ? ` (${described.name} ${described.version})` : "");
|
|
218
277
|
}
|
|
219
|
-
const
|
|
278
|
+
const why = await context.packages.install(spec);
|
|
279
|
+
if (why !== undefined) {
|
|
280
|
+
throw new Error(`${described.name} could not be installed: ${why}. Nothing changed.`);
|
|
281
|
+
}
|
|
282
|
+
[...context.systemFolders, ...(context.extensionFolders ?? [])].forEach((folder) => files().refresh(folder));
|
|
283
|
+
let system;
|
|
284
|
+
try {
|
|
285
|
+
system = systemsHere(root, context).find((one) => one.package === described.name);
|
|
286
|
+
}
|
|
287
|
+
catch (error) {
|
|
288
|
+
throw new Error(`${described.name} was installed, but its system.yaml does not read: ${error instanceof Error ? error.message : String(error)}. Uninstall it with package uninstall ${described.name}.`);
|
|
289
|
+
}
|
|
290
|
+
if (system === undefined) {
|
|
291
|
+
throw new Error(`${described.name} was installed, but it has no system.yaml: it is no game system. Uninstall it with package uninstall ${described.name}.`);
|
|
292
|
+
}
|
|
293
|
+
appendLogEntry(root, newDatedLogEntry(root, context, "package-installed", "public", { package: described.name, version: described.version, verified: system.verified, kind: "system" }));
|
|
294
|
+
const plays = readTextSetting(root, "system");
|
|
295
|
+
return { kind: "system-installed", system, ...(plays === undefined ? {} : { plays }) };
|
|
296
|
+
}
|
|
297
|
+
/** The game systems on this computer, those shipped with the engine first, with the package each came in when npm installed it (D-485). */
|
|
298
|
+
function systemsHere(root, context) {
|
|
299
|
+
const plays = readTextSetting(root, "system") ?? "";
|
|
300
|
+
const folders = systemFolders(context.systemFolders);
|
|
301
|
+
return installedSystems(context.systemFolders).map((system) => {
|
|
302
|
+
const manifest = packageOf(folders.find((one) => one.name === system.name)?.folder ?? system.folder);
|
|
303
|
+
// The engine's own have no package of their own here; one npm installed is ours only by our scope, and never from a folder (D-441).
|
|
304
|
+
const shipped = system.folder.startsWith(context.systemFolders[0]);
|
|
305
|
+
const linked = installedFromFolder(system.folder);
|
|
306
|
+
return {
|
|
307
|
+
name: system.name,
|
|
308
|
+
title: system.title,
|
|
309
|
+
...(manifest === undefined ? {} : { version: manifest.version }),
|
|
310
|
+
...(manifest === undefined || shipped ? {} : { package: manifest.name }),
|
|
311
|
+
verified: shipped || (manifest !== undefined && isVerified(manifest.name, linked)),
|
|
312
|
+
used: comparableText(system.name) === comparableText(plays),
|
|
313
|
+
code: systemHasCode(system.folder),
|
|
314
|
+
};
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
/** The name and the version a package.json in this folder gives; undefined when it has none that reads. */
|
|
318
|
+
function packageOf(folder) {
|
|
319
|
+
try {
|
|
320
|
+
const read = JSON.parse(files().text(join(folder, "package.json")) ?? "");
|
|
321
|
+
return typeof read.name === "string" && typeof read.version === "string" ? { name: read.name, version: read.version } : undefined;
|
|
322
|
+
}
|
|
323
|
+
catch {
|
|
324
|
+
return undefined;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Installs a language package on this computer (D-485 (3)): texts the dashboard shows, never code, so no yes is asked; refused, and taken off again, when its
|
|
329
|
+
* phrases lose a {name} or turn the order of a text. It takes the place of another package of the same language.
|
|
330
|
+
*/
|
|
331
|
+
async function languageInstalled(root, context, spec, described) {
|
|
332
|
+
if (described.code === true || described.dependencies === true) {
|
|
333
|
+
throw new Error(`${described.name} says it is a language, and brings code or needs other packages: a language package is texts only. Nothing changed.`);
|
|
334
|
+
}
|
|
335
|
+
const before = installedLanguages(context.extensionFolders ?? []);
|
|
336
|
+
const packages = context.packages;
|
|
337
|
+
const why = await packages.install(spec);
|
|
338
|
+
if (why !== undefined) {
|
|
339
|
+
throw new Error(`${described.name} could not be installed: ${why}. Nothing changed.`);
|
|
340
|
+
}
|
|
341
|
+
(context.extensionFolders ?? []).forEach((folder) => files().refresh(folder));
|
|
342
|
+
const folder = installedExtensionFolder(context, described.name);
|
|
343
|
+
let checked;
|
|
344
|
+
let pack;
|
|
345
|
+
try {
|
|
346
|
+
pack = readLanguagePack(folder ?? "");
|
|
347
|
+
checked = languagePackProblems(pack, Object.keys(pagePhrases(context)));
|
|
348
|
+
}
|
|
349
|
+
catch (error) {
|
|
350
|
+
checked = { problems: [error instanceof Error ? error.message : String(error)], missing: 0 };
|
|
351
|
+
pack = { package: described.name, version: described.version, folder: folder ?? "", code: "", name: described.name };
|
|
352
|
+
}
|
|
353
|
+
if (checked.problems.length > 0) {
|
|
354
|
+
await packages.uninstall(described.name);
|
|
355
|
+
// An update refused leaves the version that was there before.
|
|
356
|
+
const earlier = before.find((one) => one.package === described.name);
|
|
357
|
+
const back = earlier === undefined || isLocalSpec(spec) ? undefined : await packages.install(`${earlier.package}@${earlier.version}`).then((why) => (why === undefined ? earlier.version : undefined));
|
|
358
|
+
(context.extensionFolders ?? []).forEach((one) => files().refresh(one));
|
|
359
|
+
throw new Error(`${described.name} cannot be used: ${checked.problems.join("; ")}. ${back === undefined ? "It was taken off this computer." : `Version ${back} stays.`}`);
|
|
360
|
+
}
|
|
361
|
+
// One language, one package: the one before for the same code goes (D-485 (3)).
|
|
362
|
+
const replaced = before.find((one) => one.code.toLowerCase() === pack.code.toLowerCase() && one.package !== described.name);
|
|
363
|
+
if (replaced !== undefined) {
|
|
364
|
+
await packages.uninstall(replaced.package);
|
|
365
|
+
(context.extensionFolders ?? []).forEach((one) => files().refresh(one));
|
|
366
|
+
}
|
|
367
|
+
const language = languagesHere(context).find((one) => one.package === described.name);
|
|
368
|
+
appendLogEntry(root, newDatedLogEntry(root, context, "package-installed", "public", { package: described.name, version: described.version, verified: language.verified, kind: "language" }));
|
|
369
|
+
return { kind: "language-installed", language, ...(replaced === undefined ? {} : { replaced: replaced.package }), missing: checked.missing };
|
|
370
|
+
}
|
|
371
|
+
/** The language packages on this computer, one for each language (D-485 (3)). */
|
|
372
|
+
function languagesHere(context) {
|
|
373
|
+
return installedLanguages(context.extensionFolders ?? []).map((pack) => ({
|
|
374
|
+
code: pack.code,
|
|
375
|
+
name: pack.name,
|
|
376
|
+
package: pack.package,
|
|
377
|
+
version: pack.version,
|
|
378
|
+
verified: isVerified(pack.package, installedFromFolder(pack.folder)),
|
|
379
|
+
}));
|
|
380
|
+
}
|
|
381
|
+
/** The folder npm installed a package in, among the extensions' folders; undefined when it is not there. */
|
|
382
|
+
function installedExtensionFolder(context, name) {
|
|
383
|
+
return (context.extensionFolders ?? []).map((folder) => join(folder, ...name.split("/"))).find((folder) => files().exists(join(folder, "package.json")));
|
|
384
|
+
}
|
|
385
|
+
/** The dashboard's phrases, by their English, as its curated Italian lists them all; none where the built page is not here. */
|
|
386
|
+
function pagePhrases(context) {
|
|
387
|
+
try {
|
|
388
|
+
return JSON.parse(files().text(join(context.pageFolder ?? "", "i18n", "it.json")) ?? "{}");
|
|
389
|
+
}
|
|
390
|
+
catch {
|
|
391
|
+
return {};
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
/**
|
|
395
|
+
* The player's own yes to a package not ours (D-441, D-478), where the master cannot give it with its own tools: the host's form first, never the dashboard's
|
|
396
|
+
* page, whose click a local program can forge; else a window of their operating system; else none, and it throws.
|
|
397
|
+
*/
|
|
398
|
+
async function playerYes(context, name, local, holds = "", replaces = "") {
|
|
399
|
+
const warning = local
|
|
400
|
+
? `${name}${holds} is ${isTarball(name) ? "a file" : "a folder"} of this computer, not a package published by RPG Engine: its code runs, it is never verified, and RPG Engine takes no responsibility for it.${replaces}`
|
|
401
|
+
: `${name} is not published by RPG Engine: its texts are someone else's, and RPG Engine takes no responsibility for it.`;
|
|
402
|
+
const question = `Install ${name}? ${warning}`;
|
|
403
|
+
const title = "A package not ours";
|
|
404
|
+
const answer = context.player === undefined ? "unavailable" : await context.player.choose(question, title, ["Install it, at my risk", "Do not install it"], context.signal);
|
|
220
405
|
if (answer === 0) {
|
|
221
406
|
return;
|
|
222
407
|
}
|
|
223
408
|
if (answer === 1 || (typeof answer === "object" && answer !== null)) {
|
|
224
|
-
throw new
|
|
409
|
+
throw new YesRefused(`The player did not want ${name}. Nothing changed.`, "declined");
|
|
410
|
+
}
|
|
411
|
+
// Closed without an answer is no yes, never a reason to ask again some other way.
|
|
412
|
+
if (answer === undefined) {
|
|
413
|
+
throw new YesRefused(`The player closed the question without a yes to ${name}. Nothing changed: ask again only if they bring it up.`, "declined");
|
|
225
414
|
}
|
|
226
|
-
|
|
415
|
+
const window = context.confirm === undefined ? "none" : await context.confirm.ask(title, question, context.signal);
|
|
416
|
+
if (window === "yes") {
|
|
417
|
+
return;
|
|
418
|
+
}
|
|
419
|
+
if (window === "no") {
|
|
420
|
+
throw new YesRefused(`The player did not want ${name}. Nothing changed.`, "declined");
|
|
421
|
+
}
|
|
422
|
+
throw new YesRefused(`${warning} Only the player can say yes to it, in the host's form or in a window of their computer, and neither can be shown here (no desktop, as over SSH; `
|
|
423
|
+
+ `on Linux zenity or kdialog shows it): install it where one can be. Nothing changed.`, "no-window");
|
|
227
424
|
}
|
|
228
425
|
/** The installed extension of this package, when it reads; undefined when it is missing or broken. */
|
|
229
426
|
function usable(context, name) {
|
|
@@ -270,7 +467,14 @@ function removed(root, context, name) {
|
|
|
270
467
|
/** Takes a package off this computer with npm, and out of the campaign when it uses it (D-442); other campaigns that list it ask to install it again. */
|
|
271
468
|
async function uninstalled(root, context, name) {
|
|
272
469
|
const packages = context.packages;
|
|
273
|
-
const
|
|
470
|
+
const system = systemsHere(root, context).find((one) => one.package !== undefined && (one.package === name || comparableText(one.name) === comparableText(name)));
|
|
471
|
+
if (system?.used === true) {
|
|
472
|
+
throw new Error(`The campaign plays ${system.name}: it stays on this computer. Nothing changed.`);
|
|
473
|
+
}
|
|
474
|
+
const other = system?.package ?? languagesHere(context).find((one) => one.package === name || comparableText(one.code) === comparableText(name))?.package;
|
|
475
|
+
const found = other === undefined
|
|
476
|
+
? installedExtensions(context.extensionFolders ?? []).find((one) => one.package === name || comparableText(shortName(one.package)) === comparableText(name))
|
|
477
|
+
: { package: other };
|
|
274
478
|
if (found === undefined) {
|
|
275
479
|
const here = installedExtensions(context.extensionFolders ?? []).map((one) => shortName(one.package));
|
|
276
480
|
throw new Error(`${name} is not on this computer${here.length === 0 ? ": no package is" : `; these are: ${here.join(", ")}`}. Nothing changed.`);
|
|
@@ -282,12 +486,63 @@ async function uninstalled(root, context, name) {
|
|
|
282
486
|
if (why !== undefined) {
|
|
283
487
|
throw new Error(`${found.package} could not be uninstalled: ${why}. Nothing changed.`);
|
|
284
488
|
}
|
|
285
|
-
(context.extensionFolders ?? []).forEach((folder) => files().refresh(folder));
|
|
489
|
+
[...context.systemFolders, ...(context.extensionFolders ?? [])].forEach((folder) => files().refresh(folder));
|
|
286
490
|
const listed = listedExtensions(root);
|
|
287
491
|
const wasUsed = Object.hasOwn(listed, found.package);
|
|
288
492
|
if (wasUsed) {
|
|
289
493
|
changeExtensions(root, Object.fromEntries(Object.entries(listed).filter(([candidate]) => candidate !== found.package)));
|
|
290
494
|
}
|
|
291
495
|
appendLogEntry(root, newDatedLogEntry(root, context, "package-uninstalled", "public", { package: found.package }));
|
|
292
|
-
return { kind: "uninstalled", name: shortName(found.package), wasUsed };
|
|
496
|
+
return { kind: "uninstalled", name: shortName(found.package), wasUsed, extension: other === undefined };
|
|
497
|
+
}
|
|
498
|
+
/** Installs an adventure from a .zip, a folder or a link (D-483): no npm, no code, and the same refusals wherever it comes from. */
|
|
499
|
+
async function adventureInstalled(root, context, spec) {
|
|
500
|
+
const adventure = await readAdventureSpec(spec, context);
|
|
501
|
+
return { kind: "adventure-installed", ...installAdventure(root, context, adventure, spec) };
|
|
502
|
+
}
|
|
503
|
+
/** What the master hears of an adventure installed (D-483 (5)): what it is in a few lines, then what to read and where it starts, never its text. */
|
|
504
|
+
export function adventureText(result) {
|
|
505
|
+
const { manifest } = result;
|
|
506
|
+
const by = manifest.author === undefined ? "" : ` by ${manifest.author}`;
|
|
507
|
+
const rights = manifest.license ?? "all rights reserved";
|
|
508
|
+
const counts = Object.entries(result.counts).map(([kind, count]) => `${count} ${kind}`).join(", ");
|
|
509
|
+
const levels = manifest.levels === undefined ? undefined : manifest.levels.from === manifest.levels.to ? `level ${manifest.levels.from}` : `levels ${manifest.levels.from}-${manifest.levels.to}`;
|
|
510
|
+
const start = result.start === undefined
|
|
511
|
+
? ""
|
|
512
|
+
: result.start.placed
|
|
513
|
+
? ` It starts in [[${result.start.name}]].`
|
|
514
|
+
: ` It starts in [[${result.start.name}]], in no place of the world yet: write it into the place that holds it, or give it a position, and a road from where it is reached.`;
|
|
515
|
+
const read = manifest.opening === undefined ? "Read its places and quests" : `Show [[${manifest.opening}]] and the pages it says to read first`;
|
|
516
|
+
return [
|
|
517
|
+
`${result.already ? "The campaign already has" : "Installed"} the adventure ${manifest.title} ${manifest.version}${by} (${rights}): ${manifest.about.replace(/\.$/, "")}. ${counts}.`,
|
|
518
|
+
levels === undefined ? "" : `It is written for ${levels}: adapt it to the party's.`,
|
|
519
|
+
manifest.content.length === 0 ? "" : `Its content: ${manifest.content.join(", ")}; keep to the player's lines and veils.`,
|
|
520
|
+
result.firstDate === undefined
|
|
521
|
+
? ""
|
|
522
|
+
: result.shift === 0
|
|
523
|
+
? `Its first date: [[${result.firstDate.page}]], on ${result.firstDate.date}.`
|
|
524
|
+
: `Its dates moved ${result.shift} days: the first, [[${result.firstDate.page}]], on ${result.firstDate.date}.`,
|
|
525
|
+
result.textDates === 0 ? "" : result.textDates === 1 ? "1 date in its text stays as written: count it from today." : `${result.textDates} dates in its text stay as written: count them from today.`,
|
|
526
|
+
result.shadows.length === 0 ? "" : `Its pages take the place of the game system's: ${result.shadows.join(", ")}.`,
|
|
527
|
+
result.covers.length === 0 ? "" : `Its rules take the place of the game system's: ${result.covers.join(", ")}.`,
|
|
528
|
+
result.ignored.length === 0 ? "" : `Left out, no part of an adventure: ${result.ignored.join(", ")}.`,
|
|
529
|
+
`${read} before you narrate.${start} Bring a hook into the story: the adventure begins when the player takes it.`,
|
|
530
|
+
].filter((line) => line !== "").join(" ");
|
|
531
|
+
}
|
|
532
|
+
/** What the master hears of an export (ADV-7): the file, what it came from and what stayed out. */
|
|
533
|
+
function exportText(result) {
|
|
534
|
+
const out = [
|
|
535
|
+
result.leftOut.characters.length === 0 ? "" : `the player characters (${result.leftOut.characters.join(", ")})`,
|
|
536
|
+
result.leftOut.adventures.length === 0 ? "" : `the adventures it installed (${result.leftOut.adventures.join(", ")})`,
|
|
537
|
+
].filter((part) => part !== "");
|
|
538
|
+
return [
|
|
539
|
+
`Wrote ${result.file}: ${result.pages} pages, from ${result.from}${out.length === 0 ? "" : `, without ${out.join(" and ")}`}.`,
|
|
540
|
+
result.opening === undefined
|
|
541
|
+
? "It has no opening page: one tagged opening, with the situation, the hooks, what happens if no one steps in and the pages to read first, and its start, makes it ready."
|
|
542
|
+
: `Its opening is [[${result.opening}]].`,
|
|
543
|
+
result.sourced === undefined
|
|
544
|
+
? "The player shares it as a file, and only what they have the right to share."
|
|
545
|
+
: `${result.sourced.length} of its pages come from the player's own documents (source:): ${result.sourced.slice(0, 5).join(", ")}${result.sourced.length > 5 ? "…" : ""}. `
|
|
546
|
+
+ "So it says personal use only. Ask the player whether they may share it: only with the document's own license, or their rights to it; if so, export again with that license.",
|
|
547
|
+
].join(" ");
|
|
293
548
|
}
|
package/dist/commands/parts.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type { Context } from "../core/context.ts";
|
|
2
|
+
import { type World } from "../pages/index.ts";
|
|
2
3
|
import type { GameSystem } from "../systems/index.ts";
|
|
3
4
|
/** A part of the instructions as the core and the system give it, with no regard to what was told; undefined when neither has it. */
|
|
4
5
|
export declare function partText(name: string, system: GameSystem | undefined): string | undefined;
|
|
5
6
|
/** A part of the instructions for a situation that opens: once in a chat where the MCP server keeps what it told, until instructions; every time elsewhere. Empty when there is none, or it was told. */
|
|
6
7
|
export declare function situationPart(name: string, context: Context, system: GameSystem | undefined): string;
|
|
8
|
+
/** How to run the table for more than one living player character (D-450, D-480), once in a chat as a situation's part; none with fewer. */
|
|
9
|
+
export declare function partyPart(context: Context, system: GameSystem | undefined, world: World): string;
|
|
7
10
|
/**
|
|
8
11
|
* The mentor's part for the way the player wants the game taught (D-347), once in a chat as a situation's part: none when off; with the tutorial, the
|
|
9
12
|
* mechanics already explained.
|
package/dist/commands/parts.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// The parts of the master's instructions that the tools give when a situation opens, such as a fight or a new day (D-97, D-121).
|
|
2
2
|
import { readSettings } from "../campaign/index.js";
|
|
3
3
|
import { corePart, layeredPart } from "../instructions/index.js";
|
|
4
|
+
import { playerCharacters } from "../pages/index.js";
|
|
4
5
|
import { campaignSystem } from "./game-world.js";
|
|
5
6
|
/** A part of the instructions as the core and the system give it, with no regard to what was told; undefined when neither has it. */
|
|
6
7
|
export function partText(name, system) {
|
|
@@ -16,6 +17,10 @@ export function situationPart(name, context, system) {
|
|
|
16
17
|
context.told?.add(name);
|
|
17
18
|
return text;
|
|
18
19
|
}
|
|
20
|
+
/** How to run the table for more than one living player character (D-450, D-480), once in a chat as a situation's part; none with fewer. */
|
|
21
|
+
export function partyPart(context, system, world) {
|
|
22
|
+
return playerCharacters(world).filter((page) => page.fields.status !== "dead").length > 1 ? situationPart("party", context, system) : "";
|
|
23
|
+
}
|
|
19
24
|
/**
|
|
20
25
|
* The mentor's part for the way the player wants the game taught (D-347), once in a chat as a situation's part: none when off; with the tutorial, the
|
|
21
26
|
* mechanics already explained.
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { checkSettings } from "../campaign/index.js";
|
|
2
2
|
import { checkLog } from "../core/log.js";
|
|
3
3
|
import { checkWorld } from "../pages/index.js";
|
|
4
|
+
import { bondProblems } from "./game-bonds.js";
|
|
4
5
|
import { effectProblems } from "./game-effects.js";
|
|
5
6
|
import { eventProblems } from "./game-events.js";
|
|
6
7
|
import { experienceProblems } from "./game-experience.js";
|
|
7
8
|
import { campaignExtensions } from "./game-extension-list.js";
|
|
8
9
|
import { gridProblems } from "./game-grids.js";
|
|
9
10
|
import { imageProblems } from "./game-images.js";
|
|
11
|
+
import { limitProblems } from "./game-limits.js";
|
|
10
12
|
import { mapProblems } from "./game-maps.js";
|
|
11
13
|
import { modeProblems } from "./game-mode.js";
|
|
12
14
|
import { moneyProblems } from "./game-money.js";
|
|
@@ -15,6 +17,7 @@ import { questProblems } from "./game-quests.js";
|
|
|
15
17
|
import { passageProblems, roadProblems } from "./game-roads.js";
|
|
16
18
|
import { readOpenScene, sceneProblems } from "./game-scene.js";
|
|
17
19
|
import { readPresent, timeProblems } from "./game-time.js";
|
|
20
|
+
import { extensionWordsProblems } from "./game-widgets.js";
|
|
18
21
|
import { campaignSystem, systemOccasions, systemProblems, systemSettingProblems } from "./game-world.js";
|
|
19
22
|
import { listValueProblems } from "./sheet.js";
|
|
20
23
|
import { workedOutProblems } from "./worked-out.js";
|
|
@@ -31,6 +34,8 @@ export function campaignProblems(root, world, context) {
|
|
|
31
34
|
// While what campaign.yaml adds does not read, what the pages hold is not judged by the system alone: that fix comes first (CAM-3).
|
|
32
35
|
...(system.length === 0 ? workedOutProblems(world) : []),
|
|
33
36
|
...listValueProblems(world, campaignSystem(root, context)),
|
|
37
|
+
...bondProblems(world, campaignSystem(root, context)),
|
|
38
|
+
...limitProblems(world, campaignSystem(root, context)),
|
|
34
39
|
...experienceProblems(world),
|
|
35
40
|
...imageProblems(root, context, world),
|
|
36
41
|
...roadProblems(world, campaignSystem(root, context)),
|
|
@@ -40,6 +45,7 @@ export function campaignProblems(root, world, context) {
|
|
|
40
45
|
...shortRoadProblems(world),
|
|
41
46
|
...timeProblems(root, context),
|
|
42
47
|
...campaignExtensions(root, context).problems,
|
|
48
|
+
...extensionWordsProblems(root, context),
|
|
43
49
|
...modeProblems(root),
|
|
44
50
|
...eventProblems(world),
|
|
45
51
|
...questProblems(world),
|
package/dist/commands/rename.js
CHANGED
|
@@ -107,6 +107,9 @@ function renameInState(root, from, to) {
|
|
|
107
107
|
if (scene.seen !== undefined && Object.keys(scene.seen).some((name) => named(name) !== name)) {
|
|
108
108
|
changes.push([["seen"], Object.fromEntries(Object.entries(scene.seen).map(([name, said]) => [named(name), said]))]);
|
|
109
109
|
}
|
|
110
|
+
if (scene.used !== undefined && Object.keys(scene.used).some((name) => named(name) !== name)) {
|
|
111
|
+
changes.push([["used"], Object.fromEntries(Object.entries(scene.used).map(([name, used]) => [named(name), used]))]);
|
|
112
|
+
}
|
|
110
113
|
if (scene.moved !== undefined && named(scene.moved.turn) !== scene.moved.turn) {
|
|
111
114
|
changes.push([["moved", "turn"], to]);
|
|
112
115
|
}
|
package/dist/commands/reveal.js
CHANGED
|
@@ -3,7 +3,7 @@ import { requireCampaign } from "../campaign/index.js";
|
|
|
3
3
|
import { appendLogEntry, readLog } from "../core/log.js";
|
|
4
4
|
import { defineCommand } from "../core/registry.js";
|
|
5
5
|
import { comparableText, withArticle } from "../core/text.js";
|
|
6
|
-
import { baseChain, isEmptyField, isPartyMember, links, locate, pageNamed, parsePageReference, secretNames, shownPart, systemLabel, withPage, writePage } from "../pages/index.js";
|
|
6
|
+
import { baseChain, isEmptyField, isPartyMember, isPlayerCharacter, links, locate, pageNamed, parsePageReference, playerCharacters, secretNames, shownPart, systemLabel, withPage, writePage } from "../pages/index.js";
|
|
7
7
|
import { placedPosition } from "./game-positions.js";
|
|
8
8
|
import { copyName, readOpenScene } from "./game-scene.js";
|
|
9
9
|
import { newDatedLogEntry } from "./game-time.js";
|
|
@@ -68,10 +68,10 @@ export const reveal = defineCommand({
|
|
|
68
68
|
* with them; what someone else learned alone stays hidden, since a secret's name may tell too much.
|
|
69
69
|
*/
|
|
70
70
|
function logLearned(root, context, world, lines) {
|
|
71
|
-
const players = world
|
|
71
|
+
const players = playerCharacters(world);
|
|
72
72
|
const playerKnows = (link) => players.some((player) => knowsLink(player, link));
|
|
73
73
|
for (const { learner, links: learned } of lines) {
|
|
74
|
-
const visible = learner
|
|
74
|
+
const visible = isPlayerCharacter(learner) || (isPartyMember(learner) && learned.every(playerKnows));
|
|
75
75
|
appendLogEntry(root, newDatedLogEntry(root, context, "learned", visible ? "public" : "hidden", { page: learner.name, knows: learned }));
|
|
76
76
|
}
|
|
77
77
|
}
|
|
@@ -80,8 +80,10 @@ function logLearned(root, context, world, lines) {
|
|
|
80
80
|
* may bring; and a place with a position to give theirs from. Undefined when there is none.
|
|
81
81
|
*/
|
|
82
82
|
function unplacedPlaces(world, lines) {
|
|
83
|
-
|
|
84
|
-
const
|
|
83
|
+
// What any player character learned (VIEW-12).
|
|
84
|
+
const players = lines.filter((line) => isPlayerCharacter(line.learner));
|
|
85
|
+
const player = players[0];
|
|
86
|
+
const places = [...new Set(players.flatMap((line) => line.links))].flatMap((link) => links(link)).filter((link) => link.section === undefined).flatMap((link) => {
|
|
85
87
|
const page = pageNamed(world, link.page);
|
|
86
88
|
return page?.type === "place" && page.fields.stops === undefined && [page, ...locate(world, page).chain].every((holder) => placedPosition(world, holder) === undefined) ? [page.name] : [];
|
|
87
89
|
});
|
|
@@ -131,9 +133,12 @@ function missingSecret(world, page, name) {
|
|
|
131
133
|
}
|
|
132
134
|
/** Who learns, when not said: the player's character, when there is one only (REV-2). */
|
|
133
135
|
function playerCharacter(world) {
|
|
134
|
-
|
|
136
|
+
// A dead one learns nothing more, beside the living (VIEW-12).
|
|
137
|
+
const all = playerCharacters(world);
|
|
138
|
+
const living = all.filter((page) => page.fields.status !== "dead");
|
|
139
|
+
const players = living.length > 0 ? living : all;
|
|
135
140
|
if (players.length !== 1) {
|
|
136
|
-
throw new Error(players.length === 0 ? "There is no player's character: give who learns it with to." : `There are ${players.length} player
|
|
141
|
+
throw new Error(players.length === 0 ? "There is no player's character: give who learns it with to." : `There are ${players.length} player characters, ${players.map((page) => page.name).join(" and ")}: give who learns it with to.`);
|
|
137
142
|
}
|
|
138
143
|
return players[0];
|
|
139
144
|
}
|