rpg-engine 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/adventures/index.d.ts +3 -0
- package/dist/adventures/index.js +5 -0
- package/dist/adventures/manifest.d.ts +39 -0
- package/dist/adventures/manifest.js +89 -0
- package/dist/adventures/placement.d.ts +4 -0
- package/dist/adventures/placement.js +14 -0
- package/dist/adventures/source.d.ts +21 -0
- package/dist/adventures/source.js +108 -0
- package/dist/bell-listener.d.ts +9 -0
- package/dist/bell-listener.js +83 -0
- package/dist/campaign/create-campaign.d.ts +3 -2
- package/dist/campaign/create-campaign.js +5 -5
- package/dist/campaign/host-files.d.ts +23 -6
- package/dist/campaign/host-files.js +130 -40
- package/dist/campaign/index.d.ts +2 -2
- package/dist/campaign/index.js +2 -2
- package/dist/campaign/settings.d.ts +33 -2
- package/dist/campaign/settings.js +49 -12
- package/dist/cli.js +10 -1
- package/dist/command-line.js +20 -2
- package/dist/commands/advance.js +6 -2
- package/dist/commands/ask.d.ts +11 -4
- package/dist/commands/ask.js +249 -23
- package/dist/commands/change.d.ts +29 -0
- package/dist/commands/change.js +260 -41
- package/dist/commands/config.d.ts +6 -3
- package/dist/commands/config.js +179 -79
- package/dist/commands/effect.js +38 -9
- package/dist/commands/game-advance.d.ts +11 -2
- package/dist/commands/game-advance.js +22 -7
- package/dist/commands/game-adventures.d.ts +70 -0
- package/dist/commands/game-adventures.js +418 -0
- package/dist/commands/game-bonds.d.ts +9 -0
- package/dist/commands/game-bonds.js +84 -0
- package/dist/commands/game-catalog.d.ts +36 -0
- package/dist/commands/game-catalog.js +122 -0
- package/dist/commands/game-checks.d.ts +17 -0
- package/dist/commands/game-checks.js +128 -0
- package/dist/commands/game-damage.d.ts +18 -0
- package/dist/commands/game-damage.js +74 -0
- package/dist/commands/game-effects.d.ts +5 -0
- package/dist/commands/game-effects.js +2 -2
- package/dist/commands/game-events.js +8 -4
- package/dist/commands/game-experience.js +2 -2
- package/dist/commands/game-extensions.d.ts +8 -1
- package/dist/commands/game-extensions.js +8 -3
- package/dist/commands/game-grid-moves.d.ts +4 -1
- package/dist/commands/game-grid-moves.js +8 -2
- package/dist/commands/game-hit-dice.d.ts +39 -0
- package/dist/commands/game-hit-dice.js +120 -0
- package/dist/commands/game-import.d.ts +11 -0
- package/dist/commands/game-import.js +154 -0
- package/dist/commands/game-journey.d.ts +6 -2
- package/dist/commands/game-journey.js +17 -6
- package/dist/commands/game-knowledge.d.ts +56 -6
- package/dist/commands/game-knowledge.js +152 -23
- package/dist/commands/game-library.d.ts +112 -0
- package/dist/commands/game-library.js +388 -0
- package/dist/commands/game-limits.d.ts +7 -0
- package/dist/commands/game-limits.js +67 -0
- package/dist/commands/game-mode.js +3 -3
- package/dist/commands/game-moves.d.ts +14 -1
- package/dist/commands/game-moves.js +24 -9
- package/dist/commands/game-recipe-pace.d.ts +6 -0
- package/dist/commands/game-recipe-pace.js +25 -0
- package/dist/commands/game-recipes.js +10 -3
- package/dist/commands/game-reminders.d.ts +3 -3
- package/dist/commands/game-reminders.js +10 -5
- package/dist/commands/game-roads.d.ts +11 -4
- package/dist/commands/game-roads.js +89 -26
- package/dist/commands/game-saves.d.ts +12 -0
- package/dist/commands/game-saves.js +44 -5
- package/dist/commands/game-scene.js +3 -1
- package/dist/commands/game-stacks.d.ts +78 -0
- package/dist/commands/game-stacks.js +198 -0
- package/dist/commands/game-system-code.d.ts +25 -0
- package/dist/commands/game-system-code.js +165 -0
- package/dist/commands/game-thoughts.d.ts +25 -0
- package/dist/commands/game-thoughts.js +57 -0
- package/dist/commands/game-turn-uses.d.ts +33 -0
- package/dist/commands/game-turn-uses.js +137 -0
- package/dist/commands/game-upkeep.d.ts +20 -0
- package/dist/commands/game-upkeep.js +190 -0
- package/dist/commands/game-view-journal.d.ts +14 -1
- package/dist/commands/game-view-journal.js +5 -2
- package/dist/commands/game-view-map.d.ts +3 -0
- package/dist/commands/game-view-map.js +5 -1
- package/dist/commands/game-view-place.d.ts +22 -3
- package/dist/commands/game-view-place.js +61 -24
- package/dist/commands/game-view-world.d.ts +98 -0
- package/dist/commands/game-view-world.js +98 -0
- package/dist/commands/game-voices.d.ts +5 -0
- package/dist/commands/game-voices.js +13 -0
- package/dist/commands/game-widgets.d.ts +66 -0
- package/dist/commands/game-widgets.js +274 -0
- package/dist/commands/game-world.d.ts +8 -1
- package/dist/commands/game-world.js +23 -3
- package/dist/commands/image.js +2 -3
- package/dist/commands/import.d.ts +47 -0
- package/dist/commands/import.js +390 -0
- package/dist/commands/index.js +6 -0
- package/dist/commands/init.js +2 -2
- package/dist/commands/install.js +2 -1
- package/dist/commands/instructions.js +26 -1
- package/dist/commands/mode.js +3 -1
- package/dist/commands/move.d.ts +2 -0
- package/dist/commands/move.js +86 -12
- package/dist/commands/package.d.ts +85 -9
- package/dist/commands/package.js +378 -50
- package/dist/commands/parts.d.ts +3 -0
- package/dist/commands/parts.js +5 -0
- package/dist/commands/problems.js +6 -0
- package/dist/commands/rename.js +3 -0
- package/dist/commands/reveal.js +12 -7
- package/dist/commands/roll.d.ts +2 -0
- package/dist/commands/roll.js +23 -7
- package/dist/commands/route.js +4 -5
- package/dist/commands/rules.d.ts +3 -0
- package/dist/commands/rules.js +38 -6
- package/dist/commands/save.d.ts +1 -1
- package/dist/commands/save.js +2 -2
- package/dist/commands/scene.d.ts +10 -1
- package/dist/commands/scene.js +146 -29
- package/dist/commands/sheet.d.ts +47 -6
- package/dist/commands/sheet.js +179 -33
- package/dist/commands/show.d.ts +33 -0
- package/dist/commands/show.js +19 -2
- package/dist/commands/status.d.ts +9 -3
- package/dist/commands/status.js +59 -17
- package/dist/commands/thoughts.d.ts +11 -0
- package/dist/commands/thoughts.js +54 -0
- package/dist/commands/trade.d.ts +17 -0
- package/dist/commands/trade.js +273 -0
- package/dist/commands/travel.d.ts +2 -0
- package/dist/commands/travel.js +40 -14
- package/dist/commands/validate.js +2 -1
- package/dist/commands/view.d.ts +99 -2
- package/dist/commands/view.js +273 -57
- package/dist/commands/worked-out.d.ts +16 -0
- package/dist/commands/worked-out.js +108 -13
- package/dist/commands/write.d.ts +1 -0
- package/dist/commands/write.js +93 -21
- package/dist/confirm/confirm.d.ts +35 -0
- package/dist/confirm/confirm.js +94 -0
- package/dist/confirm/index.d.ts +1 -0
- package/dist/confirm/index.js +3 -0
- package/dist/core/archive-paths.d.ts +8 -0
- package/dist/core/archive-paths.js +39 -0
- package/dist/core/context.d.ts +131 -5
- package/dist/core/context.js +4 -3
- package/dist/core/download.d.ts +2 -0
- package/dist/core/download.js +31 -0
- package/dist/core/field-kind.d.ts +4 -3
- package/dist/core/field-kind.js +4 -3
- package/dist/core/files.d.ts +10 -0
- package/dist/core/files.js +58 -2
- package/dist/core/formula.d.ts +3 -1
- package/dist/core/formula.js +13 -2
- package/dist/core/progression-rule.d.ts +2 -0
- package/dist/core/version.d.ts +2 -0
- package/dist/core/version.js +7 -0
- package/dist/dashboard/act-names.js +27 -0
- package/dist/dashboard/act-sheet.js +100 -0
- package/dist/dashboard/act-strip.js +49 -0
- package/dist/dashboard/acts.js +140 -0
- package/dist/dashboard/address.js +16 -12
- package/dist/dashboard/api.js +140 -10
- package/dist/dashboard/app.js +370 -41
- package/dist/dashboard/asked.js +297 -19
- package/dist/dashboard/calendar.js +56 -0
- package/dist/dashboard/card.js +13 -12
- package/dist/dashboard/coins.js +13 -0
- package/dist/dashboard/death-save.js +67 -0
- package/dist/dashboard/dice/pool.js +22 -0
- package/dist/dashboard/dice/roller.js +1 -1
- package/dist/dashboard/dice/stage.js +12 -4
- package/dist/dashboard/dice/tray.js +28 -15
- package/dist/dashboard/dying.js +46 -0
- package/dist/dashboard/extension-widgets.js +160 -0
- package/dist/dashboard/game-words.js +33 -4
- package/dist/dashboard/guide/ar.md +105 -100
- package/dist/dashboard/guide/cs.md +111 -106
- package/dist/dashboard/guide/da.md +95 -90
- package/dist/dashboard/guide/de.md +93 -88
- package/dist/dashboard/guide/el.md +110 -105
- package/dist/dashboard/guide/en.md +21 -16
- package/dist/dashboard/guide/es.md +79 -74
- package/dist/dashboard/guide/fi.md +99 -94
- package/dist/dashboard/guide/fr.md +83 -78
- package/dist/dashboard/guide/he.md +109 -104
- package/dist/dashboard/guide/hi.md +103 -98
- package/dist/dashboard/guide/hu.md +113 -108
- package/dist/dashboard/guide/is.md +102 -97
- package/dist/dashboard/guide/it.md +22 -17
- package/dist/dashboard/guide/ja.md +108 -103
- package/dist/dashboard/guide/ko.md +113 -108
- package/dist/dashboard/guide/nb.md +95 -90
- package/dist/dashboard/guide/nl.md +89 -84
- package/dist/dashboard/guide/pl.md +104 -99
- package/dist/dashboard/guide/pt.md +82 -77
- package/dist/dashboard/guide/ro.md +113 -108
- package/dist/dashboard/guide/ru.md +109 -104
- package/dist/dashboard/guide/sv.md +96 -91
- package/dist/dashboard/guide/tr.md +102 -97
- package/dist/dashboard/guide/uk.md +113 -108
- package/dist/dashboard/guide/zh.md +110 -105
- package/dist/dashboard/guide-markdown.js +4 -0
- package/dist/dashboard/help.js +4 -5
- package/dist/dashboard/i18n/ar.json +361 -16
- package/dist/dashboard/i18n/cs.json +361 -16
- package/dist/dashboard/i18n/da.json +361 -16
- package/dist/dashboard/i18n/de.json +361 -16
- package/dist/dashboard/i18n/el.json +361 -16
- package/dist/dashboard/i18n/es.json +361 -16
- package/dist/dashboard/i18n/fi.json +361 -16
- package/dist/dashboard/i18n/fr.json +361 -16
- package/dist/dashboard/i18n/he.json +361 -16
- package/dist/dashboard/i18n/hi.json +361 -16
- package/dist/dashboard/i18n/hu.json +361 -16
- package/dist/dashboard/i18n/is.json +361 -16
- package/dist/dashboard/i18n/it.json +363 -18
- package/dist/dashboard/i18n/ja.json +361 -16
- package/dist/dashboard/i18n/ko.json +361 -16
- package/dist/dashboard/i18n/nb.json +361 -16
- package/dist/dashboard/i18n/nl.json +361 -16
- package/dist/dashboard/i18n/pl.json +361 -16
- package/dist/dashboard/i18n/pt.json +361 -16
- package/dist/dashboard/i18n/ro.json +361 -16
- package/dist/dashboard/i18n/ru.json +361 -16
- package/dist/dashboard/i18n/sv.json +361 -16
- package/dist/dashboard/i18n/tr.json +361 -16
- package/dist/dashboard/i18n/uk.json +361 -16
- package/dist/dashboard/i18n/zh.json +361 -16
- package/dist/dashboard/icons.js +38 -4
- package/dist/dashboard/journal.js +203 -49
- package/dist/dashboard/labels.js +42 -4
- package/dist/dashboard/languages.js +2 -2
- package/dist/dashboard/layout.js +35 -0
- package/dist/dashboard/lore.js +44 -0
- package/dist/dashboard/markdown.js +136 -30
- package/dist/dashboard/master.js +2 -2
- package/dist/dashboard/notes.js +5 -5
- package/dist/dashboard/notices.js +24 -4
- package/dist/dashboard/packages.js +678 -0
- package/dist/dashboard/pages.js +0 -8
- package/dist/dashboard/party.js +17 -4
- package/dist/dashboard/place-map-view.js +47 -9
- package/dist/dashboard/rolls.js +35 -93
- package/dist/dashboard/save-outcome.js +42 -0
- package/dist/dashboard/saves.js +14 -11
- package/dist/dashboard/scene.js +114 -20
- package/dist/dashboard/settings.js +70 -12
- package/dist/dashboard/setup.js +4 -4
- package/dist/dashboard/sheet.js +123 -19
- package/dist/dashboard/spend.js +115 -0
- package/dist/dashboard/status.js +22 -10
- package/dist/dashboard/story.js +6 -6
- package/dist/dashboard/style.css +8047 -3468
- package/dist/dashboard/table.js +145 -0
- package/dist/dashboard/tabs.js +34 -0
- package/dist/dashboard/text.js +19 -1
- package/dist/dashboard/top.js +91 -31
- package/dist/dashboard/turns.js +150 -0
- package/dist/dashboard/widgets.js +21 -14
- package/dist/dashboard/world-calendar.js +101 -0
- package/dist/dashboard/world-lore.js +231 -0
- package/dist/dashboard/world.js +87 -29
- package/dist/dashboard-server.d.ts +10 -1
- package/dist/dashboard-server.js +738 -26
- package/dist/documents/index.d.ts +2 -0
- package/dist/documents/index.js +5 -0
- package/dist/documents/markup.d.ts +10 -0
- package/dist/documents/markup.js +124 -0
- package/dist/documents/ocr.d.ts +9 -0
- package/dist/documents/ocr.js +101 -0
- package/dist/documents/png.d.ts +9 -0
- package/dist/documents/png.js +75 -0
- package/dist/documents/read.d.ts +54 -0
- package/dist/documents/read.js +375 -0
- package/dist/extensions/api.d.ts +91 -9
- package/dist/extensions/extension.d.ts +28 -2
- package/dist/extensions/extension.js +49 -11
- package/dist/extensions/index.d.ts +5 -3
- package/dist/extensions/index.js +4 -2
- package/dist/extensions/packages.d.ts +13 -4
- package/dist/extensions/packages.js +127 -15
- package/dist/extensions/tarball.d.ts +6 -0
- package/dist/extensions/tarball.js +87 -0
- package/dist/extensions/words.d.ts +13 -0
- package/dist/extensions/words.js +42 -0
- package/dist/importer/index.d.ts +1 -0
- package/dist/importer/index.js +3 -0
- package/dist/importer/work.d.ts +132 -0
- package/dist/importer/work.js +306 -0
- package/dist/index.d.ts +3 -1
- package/dist/instructions/index.d.ts +7 -0
- package/dist/instructions/index.js +10 -0
- package/dist/languages/index.d.ts +1 -0
- package/dist/languages/index.js +3 -0
- package/dist/languages/language-pack.d.ts +32 -0
- package/dist/languages/language-pack.js +86 -0
- package/dist/library/books.d.ts +76 -0
- package/dist/library/books.js +378 -0
- package/dist/library/folders.d.ts +11 -0
- package/dist/library/folders.js +70 -0
- package/dist/library/index.d.ts +3 -0
- package/dist/library/index.js +5 -0
- package/dist/library/language.d.ts +2 -0
- package/dist/library/language.js +40 -0
- package/dist/library-reader.d.ts +7 -0
- package/dist/library-reader.js +36 -0
- package/dist/mcp-server.js +90 -7
- package/dist/money/index.d.ts +1 -1
- package/dist/money/index.js +1 -1
- package/dist/money/money.d.ts +6 -0
- package/dist/money/money.js +11 -0
- package/dist/page-words.js +4 -1
- package/dist/pages/check.d.ts +5 -0
- package/dist/pages/check.js +111 -5
- package/dist/pages/containers.d.ts +19 -1
- package/dist/pages/containers.js +50 -7
- package/dist/pages/index.d.ts +8 -5
- package/dist/pages/index.js +8 -5
- package/dist/pages/load.d.ts +11 -0
- package/dist/pages/load.js +69 -0
- package/dist/pages/markdown.d.ts +7 -0
- package/dist/pages/markdown.js +27 -3
- package/dist/pages/page-file.d.ts +2 -0
- package/dist/pages/page-file.js +28 -5
- package/dist/pages/rename-page.js +3 -2
- package/dist/pages/stack-entry.d.ts +47 -0
- package/dist/pages/stack-entry.js +83 -0
- package/dist/pages/stack-writes.d.ts +22 -0
- package/dist/pages/stack-writes.js +128 -0
- package/dist/pages/stacks.d.ts +52 -0
- package/dist/pages/stacks.js +168 -0
- package/dist/pages/standard-fields.js +1 -1
- package/dist/pages/system-pages.d.ts +5 -2
- package/dist/pages/system-pages.js +11 -5
- package/dist/pages/world.d.ts +29 -3
- package/dist/pages/world.js +66 -12
- package/dist/pages/write-page.js +15 -6
- package/dist/pictures/chosen.d.ts +5 -1
- package/dist/pictures/chosen.js +12 -3
- package/dist/pictures/claude.d.ts +3 -1
- package/dist/pictures/claude.js +38 -0
- package/dist/pictures/codex.d.ts +3 -1
- package/dist/pictures/codex.js +32 -0
- package/dist/pictures/helpers.d.ts +10 -0
- package/dist/pictures/helpers.js +53 -6
- package/dist/pictures/index.d.ts +5 -4
- package/dist/pictures/index.js +5 -4
- package/dist/pictures/stop.d.ts +2 -0
- package/dist/pictures/stop.js +18 -0
- package/dist/player-acts.d.ts +27 -0
- package/dist/player-acts.js +56 -0
- package/dist/rules/index.d.ts +1 -0
- package/dist/rules/index.js +3 -1
- package/dist/rules/page-search.d.ts +36 -0
- package/dist/rules/page-search.js +216 -0
- package/dist/rules/search.d.ts +7 -0
- package/dist/rules/search.js +2 -2
- package/dist/scene/scene.d.ts +2 -0
- package/dist/scene/scene.js +1 -0
- package/dist/systems/game-system.d.ts +161 -4
- package/dist/systems/game-system.js +237 -34
- package/dist/systems/index.d.ts +3 -1
- package/dist/systems/index.js +3 -1
- package/dist/systems/system-code.d.ts +97 -0
- package/dist/systems/system-code.js +62 -0
- package/dist/systems/system-folders.d.ts +11 -0
- package/dist/systems/system-folders.js +11 -0
- package/dist/systems/words.d.ts +2 -0
- package/dist/systems/words.js +3 -3
- package/instructions/author.md +1 -1
- package/instructions/buttons-physical-dice.md +1 -1
- package/instructions/buttons.md +1 -1
- package/instructions/character.md +15 -0
- package/instructions/combat.md +3 -1
- package/instructions/core.md +4 -4
- package/instructions/dashboard.md +4 -4
- package/instructions/import.md +14 -0
- package/instructions/mentor-hints.md +1 -1
- package/instructions/party.md +11 -0
- package/instructions/play.md +5 -5
- package/instructions/session-zero.md +1 -1
- package/instructions/setup.md +1 -1
- package/instructions/voices-always.md +1 -0
- package/instructions/voices-important.md +1 -0
- package/instructions/voices.md +14 -0
- package/package.json +6 -2
- package/systems/5e/LICENSE.md +1 -1
- package/systems/5e/dist/dying.js +193 -0
- package/systems/5e/dist/index.js +3 -0
- package/systems/5e/images/abacus.svg +1 -0
- package/systems/5e/images/acid-tube.svg +1 -0
- package/systems/5e/images/animal-hide.svg +1 -0
- package/systems/5e/images/anvil.svg +1 -0
- package/systems/5e/images/arrow-cluster.svg +1 -0
- package/systems/5e/images/backpack.svg +1 -0
- package/systems/5e/images/bagpipes.svg +1 -0
- package/systems/5e/images/barbed-spear.svg +1 -0
- package/systems/5e/images/barrel.svg +1 -0
- package/systems/5e/images/basket.svg +1 -0
- package/systems/5e/images/battle-axe.svg +1 -0
- package/systems/5e/images/beer-horn.svg +1 -0
- package/systems/5e/images/belt-buckles.svg +1 -0
- package/systems/5e/images/bird-scepter.svg +1 -0
- package/systems/5e/images/blanket.svg +1 -0
- package/systems/5e/images/book-cover.svg +1 -0
- package/systems/5e/images/boots.svg +1 -0
- package/systems/5e/images/bottle-vapors.svg +1 -0
- package/systems/5e/images/bow-arrow.svg +1 -0
- package/systems/5e/images/bowl-spiral.svg +1 -0
- package/systems/5e/images/bracer.svg +1 -0
- package/systems/5e/images/broadsword.svg +1 -0
- package/systems/5e/images/broom.svg +1 -0
- package/systems/5e/images/bullets.svg +1 -0
- package/systems/5e/images/caltrops.svg +1 -0
- package/systems/5e/images/camp-cooking-pot.svg +1 -0
- package/systems/5e/images/campfire.svg +1 -0
- package/systems/5e/images/camping-tent.svg +1 -0
- package/systems/5e/images/candle-flame.svg +1 -0
- package/systems/5e/images/candle-light.svg +1 -0
- package/systems/5e/images/canoe.svg +1 -0
- package/systems/5e/images/cape.svg +1 -0
- package/systems/5e/images/caravel.svg +1 -0
- package/systems/5e/images/card-pick.svg +1 -0
- package/systems/5e/images/chain-mail.svg +1 -0
- package/systems/5e/images/chained-arrow-heads.svg +1 -0
- package/systems/5e/images/chariot.svg +1 -0
- package/systems/5e/images/chest.svg +1 -0
- package/systems/5e/images/chisel.svg +1 -0
- package/systems/5e/images/claw-hammer.svg +1 -0
- package/systems/5e/images/colombian-statue.svg +1 -0
- package/systems/5e/images/cooking-pot.svg +1 -0
- package/systems/5e/images/crescent-staff.svg +1 -0
- package/systems/5e/images/crossbow.svg +1 -0
- package/systems/5e/images/crossed-chains.svg +1 -0
- package/systems/5e/images/crowbar.svg +1 -0
- package/systems/5e/images/crystal-ball.svg +1 -0
- package/systems/5e/images/crystal-cluster.svg +1 -0
- package/systems/5e/images/crystal-eye.svg +1 -0
- package/systems/5e/images/cubes.svg +1 -0
- package/systems/5e/images/dart.svg +1 -0
- package/systems/5e/images/dice-six-faces-five.svg +1 -0
- package/systems/5e/images/dragon-orb.svg +1 -0
- package/systems/5e/images/drakkar.svg +1 -0
- package/systems/5e/images/drum.svg +1 -0
- package/systems/5e/images/empty-wood-bucket-handle.svg +1 -0
- package/systems/5e/images/eye-shield.svg +1 -0
- package/systems/5e/images/fairy-wand.svg +1 -0
- package/systems/5e/images/feather.svg +1 -0
- package/systems/5e/images/feathered-wing.svg +1 -0
- package/systems/5e/images/fire-bottle.svg +1 -0
- package/systems/5e/images/fire-gem.svg +1 -0
- package/systems/5e/images/first-aid-kit.svg +1 -0
- package/systems/5e/images/fishing-hook.svg +1 -0
- package/systems/5e/images/fishing-net.svg +1 -0
- package/systems/5e/images/fishing-pole.svg +1 -0
- package/systems/5e/images/fist.svg +1 -0
- package/systems/5e/images/flail.svg +1 -0
- package/systems/5e/images/flanged-mace.svg +1 -0
- package/systems/5e/images/flat-hammer.svg +1 -0
- package/systems/5e/images/flint-spark.svg +1 -0
- package/systems/5e/images/floating-crystal.svg +1 -0
- package/systems/5e/images/flute.svg +1 -0
- package/systems/5e/images/galleon.svg +1 -0
- package/systems/5e/images/gauntlet.svg +1 -0
- package/systems/5e/images/gem-necklace.svg +1 -0
- package/systems/5e/images/gem-pendant.svg +1 -0
- package/systems/5e/images/gems.svg +1 -0
- package/systems/5e/images/gladius.svg +1 -0
- package/systems/5e/images/glaive.svg +1 -0
- package/systems/5e/images/glass-ball.svg +1 -0
- package/systems/5e/images/gloves.svg +1 -0
- package/systems/5e/images/gold-scarab.svg +1 -0
- package/systems/5e/images/grain-bundle.svg +1 -0
- package/systems/5e/images/halberd.svg +1 -0
- package/systems/5e/images/hand-saw.svg +1 -0
- package/systems/5e/images/handheld-fan.svg +1 -0
- package/systems/5e/images/harp.svg +1 -0
- package/systems/5e/images/hatchet.svg +1 -0
- package/systems/5e/images/headband-knot.svg +1 -0
- package/systems/5e/images/health-potion.svg +1 -0
- package/systems/5e/images/heart-bottle.svg +1 -0
- package/systems/5e/images/herbs-bundle.svg +1 -0
- package/systems/5e/images/hole-ladder.svg +1 -0
- package/systems/5e/images/holy-symbol.svg +1 -0
- package/systems/5e/images/holy-water.svg +1 -0
- package/systems/5e/images/honey-jar.svg +1 -0
- package/systems/5e/images/hood.svg +1 -0
- package/systems/5e/images/horseshoe.svg +1 -0
- package/systems/5e/images/hourglass.svg +1 -0
- package/systems/5e/images/hunting-horn.svg +1 -0
- package/systems/5e/images/jester-hat.svg +1 -0
- package/systems/5e/images/jug.svg +1 -0
- package/systems/5e/images/katana.svg +1 -0
- package/systems/5e/images/key-lock.svg +1 -0
- package/systems/5e/images/kitchen-scale.svg +1 -0
- package/systems/5e/images/knapsack.svg +1 -0
- package/systems/5e/images/ladder.svg +1 -0
- package/systems/5e/images/lantern.svg +1 -0
- package/systems/5e/images/leather-armor.svg +1 -0
- package/systems/5e/images/leather-boot.svg +1 -0
- package/systems/5e/images/leather-vest.svg +1 -0
- package/systems/5e/images/light-backpack.svg +1 -0
- package/systems/5e/images/light-helm.svg +1 -0
- package/systems/5e/images/locked-box.svg +1 -0
- package/systems/5e/images/locked-fortress.svg +1 -0
- package/systems/5e/images/lockpicks.svg +1 -0
- package/systems/5e/images/lunar-wand.svg +1 -0
- package/systems/5e/images/lyre.svg +1 -0
- package/systems/5e/images/magic-lamp.svg +1 -0
- package/systems/5e/images/magnifying-glass.svg +1 -0
- package/systems/5e/images/mail-shirt.svg +1 -0
- package/systems/5e/images/manacles.svg +1 -0
- package/systems/5e/images/marbles.svg +1 -0
- package/systems/5e/images/meat.svg +1 -0
- package/systems/5e/images/medal.svg +1 -0
- package/systems/5e/images/mirror-mirror.svg +1 -0
- package/systems/5e/images/mountain-climbing.svg +1 -0
- package/systems/5e/images/oil-can.svg +1 -0
- package/systems/5e/images/old-lantern.svg +1 -0
- package/systems/5e/images/old-wagon.svg +1 -0
- package/systems/5e/images/orb-wand.svg +1 -0
- package/systems/5e/images/oyster-pearl.svg +1 -0
- package/systems/5e/images/paint-brush.svg +1 -0
- package/systems/5e/images/painted-pottery.svg +1 -0
- package/systems/5e/images/palette.svg +1 -0
- package/systems/5e/images/paper.svg +1 -0
- package/systems/5e/images/pencil.svg +1 -0
- package/systems/5e/images/perfume-bottle.svg +1 -0
- package/systems/5e/images/pilgrim-hat.svg +1 -0
- package/systems/5e/images/pipes.svg +1 -0
- package/systems/5e/images/plain-arrow.svg +1 -0
- package/systems/5e/images/plain-dagger.svg +1 -0
- package/systems/5e/images/poison-bottle.svg +1 -0
- package/systems/5e/images/powder-bag.svg +1 -0
- package/systems/5e/images/prayer-beads.svg +1 -0
- package/systems/5e/images/pulley-hook.svg +1 -0
- package/systems/5e/images/quill-ink.svg +1 -0
- package/systems/5e/images/quill.svg +1 -0
- package/systems/5e/images/quiver.svg +1 -0
- package/systems/5e/images/red-carpet.svg +1 -0
- package/systems/5e/images/ring.svg +1 -0
- package/systems/5e/images/ringing-bell.svg +1 -0
- package/systems/5e/images/robe.svg +1 -0
- package/systems/5e/images/rope-coil.svg +1 -0
- package/systems/5e/images/round-bottom-flask.svg +1 -0
- package/systems/5e/images/round-potion.svg +1 -0
- package/systems/5e/images/rune-stone.svg +1 -0
- package/systems/5e/images/saddle.svg +1 -0
- package/systems/5e/images/scale-mail.svg +1 -0
- package/systems/5e/images/scroll-unfurled.svg +1 -0
- package/systems/5e/images/secret-book.svg +1 -0
- package/systems/5e/images/sewing-needle.svg +1 -0
- package/systems/5e/images/shield.svg +1 -0
- package/systems/5e/images/shirt-button.svg +1 -0
- package/systems/5e/images/sickle.svg +1 -0
- package/systems/5e/images/siege-ram.svg +1 -0
- package/systems/5e/images/skull-staff.svg +1 -0
- package/systems/5e/images/sleeping-bag.svg +1 -0
- package/systems/5e/images/sling.svg +1 -0
- package/systems/5e/images/slippers.svg +1 -0
- package/systems/5e/images/small-fishing-sailboat.svg +1 -0
- package/systems/5e/images/smoking-orb.svg +1 -0
- package/systems/5e/images/soap.svg +1 -0
- package/systems/5e/images/spade.svg +1 -0
- package/systems/5e/images/sparkling-sabre.svg +1 -0
- package/systems/5e/images/spell-book.svg +1 -0
- package/systems/5e/images/spiked-armor.svg +1 -0
- package/systems/5e/images/spiked-mace.svg +1 -0
- package/systems/5e/images/spikes.svg +1 -0
- package/systems/5e/images/spinning-wheel.svg +1 -0
- package/systems/5e/images/spyglass.svg +1 -0
- package/systems/5e/images/steampunk-goggles.svg +1 -0
- package/systems/5e/images/stone-block.svg +1 -0
- package/systems/5e/images/stone-pile.svg +1 -0
- package/systems/5e/images/stone-sphere.svg +1 -0
- package/systems/5e/images/straight-pipe.svg +1 -0
- package/systems/5e/images/swap-bag.svg +1 -0
- package/systems/5e/images/thor-hammer.svg +1 -0
- package/systems/5e/images/thrown-spear.svg +1 -0
- package/systems/5e/images/tiara.svg +1 -0
- package/systems/5e/images/tied-scroll.svg +1 -0
- package/systems/5e/images/tinker.svg +1 -0
- package/systems/5e/images/torch.svg +1 -0
- package/systems/5e/images/totem.svg +1 -0
- package/systems/5e/images/trap-mask.svg +1 -0
- package/systems/5e/images/treasure-map.svg +1 -0
- package/systems/5e/images/tribal-pendant.svg +1 -0
- package/systems/5e/images/trident.svg +1 -0
- package/systems/5e/images/two-handed-sword.svg +1 -0
- package/systems/5e/images/vial.svg +1 -0
- package/systems/5e/images/violin.svg +1 -0
- package/systems/5e/images/war-axe.svg +1 -0
- package/systems/5e/images/war-pick.svg +1 -0
- package/systems/5e/images/warhammer.svg +1 -0
- package/systems/5e/images/water-bottle.svg +1 -0
- package/systems/5e/images/waterskin.svg +1 -0
- package/systems/5e/images/wavy-chains.svg +1 -0
- package/systems/5e/images/wax-seal.svg +1 -0
- package/systems/5e/images/wheelbarrow.svg +1 -0
- package/systems/5e/images/whip.svg +1 -0
- package/systems/5e/images/whistle.svg +1 -0
- package/systems/5e/images/wing-cloak.svg +1 -0
- package/systems/5e/images/winged-scepter.svg +1 -0
- package/systems/5e/images/wizard-staff.svg +1 -0
- package/systems/5e/images/wolf-trap.svg +1 -0
- package/systems/5e/images/wood-canoe.svg +1 -0
- package/systems/5e/images/wood-club.svg +1 -0
- package/systems/5e/instructions/import.md +1 -0
- package/systems/5e/instructions/play.md +5 -0
- package/systems/5e/instructions/session-zero.md +1 -1
- package/systems/5e/package.json +11 -0
- package/systems/5e/system.yaml +231 -31
- package/systems/5e/words/ar.yaml +74 -0
- package/systems/5e/words/cs.yaml +74 -0
- package/systems/5e/words/da.yaml +74 -0
- package/systems/5e/words/de.yaml +74 -0
- package/systems/5e/words/el.yaml +74 -0
- package/systems/5e/words/en.yaml +20 -0
- package/systems/5e/words/es.yaml +74 -0
- package/systems/5e/words/fi.yaml +74 -0
- package/systems/5e/words/fr.yaml +74 -0
- package/systems/5e/words/he.yaml +74 -0
- package/systems/5e/words/hi.yaml +74 -0
- package/systems/5e/words/hu.yaml +74 -0
- package/systems/5e/words/is.yaml +74 -0
- package/systems/5e/words/it.yaml +84 -1
- package/systems/5e/words/ja.yaml +74 -0
- package/systems/5e/words/ko.yaml +74 -0
- package/systems/5e/words/nb.yaml +74 -0
- package/systems/5e/words/nl.yaml +74 -0
- package/systems/5e/words/pl.yaml +74 -0
- package/systems/5e/words/pt.yaml +74 -0
- package/systems/5e/words/ro.yaml +74 -0
- package/systems/5e/words/ru.yaml +74 -0
- package/systems/5e/words/sv.yaml +74 -0
- package/systems/5e/words/tr.yaml +74 -0
- package/systems/5e/words/uk.yaml +74 -0
- package/systems/5e/words/zh.yaml +74 -0
- package/systems/5e/world/creatures/Aboleth.md +1 -0
- package/systems/5e/world/creatures/Adult Black Dragon.md +2 -0
- package/systems/5e/world/creatures/Adult Blue Dragon.md +2 -0
- package/systems/5e/world/creatures/Adult Brass Dragon.md +2 -0
- package/systems/5e/world/creatures/Adult Bronze Dragon.md +2 -0
- package/systems/5e/world/creatures/Adult Copper Dragon.md +2 -0
- package/systems/5e/world/creatures/Adult Gold Dragon.md +2 -0
- package/systems/5e/world/creatures/Adult Green Dragon.md +2 -0
- package/systems/5e/world/creatures/Adult Red Dragon.md +2 -0
- package/systems/5e/world/creatures/Adult Silver Dragon.md +2 -0
- package/systems/5e/world/creatures/Adult White Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient Black Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient Blue Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient Brass Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient Bronze Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient Copper Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient Gold Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient Green Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient Red Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient Silver Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient White Dragon.md +2 -0
- package/systems/5e/world/creatures/Androsphinx.md +1 -0
- package/systems/5e/world/creatures/Dwarf.md +1 -0
- package/systems/5e/world/creatures/Gynosphinx.md +1 -0
- package/systems/5e/world/creatures/Kraken.md +1 -0
- package/systems/5e/world/creatures/Lich.md +2 -0
- package/systems/5e/world/creatures/Mummy Lord.md +1 -0
- package/systems/5e/world/creatures/Solar.md +1 -0
- package/systems/5e/world/creatures/Tarrasque.md +2 -0
- package/systems/5e/world/creatures/Unicorn.md +1 -0
- package/systems/5e/world/creatures/Vampire.md +2 -0
- package/systems/5e/world/items/Abacus.md +1 -0
- package/systems/5e/world/items/Acid.md +1 -0
- package/systems/5e/world/items/Adamantine Armor.md +1 -0
- package/systems/5e/world/items/Alchemist's Fire.md +1 -0
- package/systems/5e/world/items/Alchemist's Supplies.md +1 -0
- package/systems/5e/world/items/Ammunition, +1, +2, or +3.md +1 -0
- package/systems/5e/world/items/Amulet of Health.md +2 -0
- package/systems/5e/world/items/Amulet of Proof against Detection and Location.md +1 -0
- package/systems/5e/world/items/Amulet of the Planes.md +1 -0
- package/systems/5e/world/items/Amulet.md +1 -0
- package/systems/5e/world/items/Animated Shield.md +1 -0
- package/systems/5e/world/items/Antitoxin.md +1 -0
- package/systems/5e/world/items/Apparatus of the Crab.md +1 -0
- package/systems/5e/world/items/Armor of Invulnerability.md +2 -0
- package/systems/5e/world/items/Armor of Resistance.md +1 -0
- package/systems/5e/world/items/Armor of Vulnerability.md +1 -0
- package/systems/5e/world/items/Armor, +1, +2, or +3.md +1 -0
- package/systems/5e/world/items/Arrow of Slaying.md +1 -0
- package/systems/5e/world/items/Arrow-Catching Shield.md +1 -0
- package/systems/5e/world/items/Arrows.md +2 -0
- package/systems/5e/world/items/Backpack.md +1 -0
- package/systems/5e/world/items/Bag of Beans.md +1 -0
- package/systems/5e/world/items/Bag of Devouring.md +1 -0
- package/systems/5e/world/items/Bag of Holding.md +3 -0
- package/systems/5e/world/items/Bag of Tricks.md +1 -0
- package/systems/5e/world/items/Bagpipes.md +1 -0
- package/systems/5e/world/items/Ball Bearings.md +1 -0
- package/systems/5e/world/items/Barding.md +1 -0
- package/systems/5e/world/items/Barrel.md +1 -0
- package/systems/5e/world/items/Basic Poison.md +1 -0
- package/systems/5e/world/items/Basket.md +1 -0
- package/systems/5e/world/items/Battleaxe.md +1 -0
- package/systems/5e/world/items/Bead of Force.md +1 -0
- package/systems/5e/world/items/Bedroll.md +1 -0
- package/systems/5e/world/items/Bell.md +1 -0
- package/systems/5e/world/items/Belt of Dwarvenkind.md +1 -0
- package/systems/5e/world/items/Belt of Giant Strength.md +1 -0
- package/systems/5e/world/items/Berserker Axe.md +1 -0
- package/systems/5e/world/items/Bit and Bridle.md +1 -0
- package/systems/5e/world/items/Blanket.md +1 -0
- package/systems/5e/world/items/Block and Tackle.md +1 -0
- package/systems/5e/world/items/Blowgun Needles.md +2 -0
- package/systems/5e/world/items/Blowgun.md +1 -0
- package/systems/5e/world/items/Book.md +1 -0
- package/systems/5e/world/items/Boots of Elvenkind.md +1 -0
- package/systems/5e/world/items/Boots of Levitation.md +1 -0
- package/systems/5e/world/items/Boots of Speed.md +1 -0
- package/systems/5e/world/items/Boots of Striding and Springing.md +1 -0
- package/systems/5e/world/items/Boots of the Winterlands.md +2 -0
- package/systems/5e/world/items/Bowl of Commanding Water Elementals.md +1 -0
- package/systems/5e/world/items/Bracers of Archery.md +1 -0
- package/systems/5e/world/items/Bracers of Defense.md +1 -0
- package/systems/5e/world/items/Brazier of Commanding Fire Elementals.md +1 -0
- package/systems/5e/world/items/Breastplate.md +1 -0
- package/systems/5e/world/items/Brewer's Supplies.md +1 -0
- package/systems/5e/world/items/Brooch of Shielding.md +2 -0
- package/systems/5e/world/items/Broom of Flying.md +1 -0
- package/systems/5e/world/items/Bucket.md +1 -0
- package/systems/5e/world/items/Bullseye Lantern.md +1 -0
- package/systems/5e/world/items/Burglar's Pack.md +3 -0
- package/systems/5e/world/items/Calligrapher's Supplies.md +1 -0
- package/systems/5e/world/items/Caltrops.md +1 -0
- package/systems/5e/world/items/Candle of Invocation.md +1 -0
- package/systems/5e/world/items/Candle.md +1 -0
- package/systems/5e/world/items/Cape of the Mountebank.md +1 -0
- package/systems/5e/world/items/Carpenter's Tools.md +1 -0
- package/systems/5e/world/items/Carpet of Flying.md +1 -0
- package/systems/5e/world/items/Carriage.md +1 -0
- package/systems/5e/world/items/Cart.md +1 -0
- package/systems/5e/world/items/Cartographer's Tools.md +1 -0
- package/systems/5e/world/items/Censer of Controlling Air Elementals.md +1 -0
- package/systems/5e/world/items/Chain Mail.md +2 -0
- package/systems/5e/world/items/Chain Shirt.md +1 -0
- package/systems/5e/world/items/Chain.md +1 -0
- package/systems/5e/world/items/Chalk.md +1 -0
- package/systems/5e/world/items/Chariot.md +1 -0
- package/systems/5e/world/items/Chest.md +1 -0
- package/systems/5e/world/items/Chime of Opening.md +1 -0
- package/systems/5e/world/items/Circlet of Blasting.md +1 -0
- package/systems/5e/world/items/Climber's Kit.md +1 -0
- package/systems/5e/world/items/Cloak of Arachnida.md +2 -0
- package/systems/5e/world/items/Cloak of Displacement.md +1 -0
- package/systems/5e/world/items/Cloak of Elvenkind.md +1 -0
- package/systems/5e/world/items/Cloak of Protection.md +3 -0
- package/systems/5e/world/items/Cloak of the Bat.md +1 -0
- package/systems/5e/world/items/Cloak of the Manta Ray.md +1 -0
- package/systems/5e/world/items/Club.md +1 -0
- package/systems/5e/world/items/Cobbler's Tools.md +1 -0
- package/systems/5e/world/items/Common Clothes.md +1 -0
- package/systems/5e/world/items/Component Pouch.md +1 -0
- package/systems/5e/world/items/Cook's Utensils.md +1 -0
- package/systems/5e/world/items/Costume Clothes.md +1 -0
- package/systems/5e/world/items/Crossbow Bolt Case.md +1 -0
- package/systems/5e/world/items/Crossbow Bolts.md +2 -0
- package/systems/5e/world/items/Crowbar.md +1 -0
- package/systems/5e/world/items/Crystal Ball.md +1 -0
- package/systems/5e/world/items/Crystal.md +1 -0
- package/systems/5e/world/items/Cube of Force.md +2 -0
- package/systems/5e/world/items/Cubic Gate.md +2 -0
- package/systems/5e/world/items/Dagger of Venom.md +1 -0
- package/systems/5e/world/items/Dagger.md +1 -0
- package/systems/5e/world/items/Dancing Sword.md +1 -0
- package/systems/5e/world/items/Dart.md +1 -0
- package/systems/5e/world/items/Decanter of Endless Water.md +1 -0
- package/systems/5e/world/items/Deck of Illusions.md +1 -0
- package/systems/5e/world/items/Deck of Many Things.md +1 -0
- package/systems/5e/world/items/Defender.md +1 -0
- package/systems/5e/world/items/Demon Armor.md +1 -0
- package/systems/5e/world/items/Dice Set.md +1 -0
- package/systems/5e/world/items/Dimensional Shackles.md +1 -0
- package/systems/5e/world/items/Diplomat's Pack.md +3 -0
- package/systems/5e/world/items/Disguise Kit.md +1 -0
- package/systems/5e/world/items/Dragon Scale Mail.md +1 -0
- package/systems/5e/world/items/Dragon Slayer.md +1 -0
- package/systems/5e/world/items/Drum.md +1 -0
- package/systems/5e/world/items/Dulcimer.md +1 -0
- package/systems/5e/world/items/Dungeoneer's Pack.md +3 -0
- package/systems/5e/world/items/Dust of Disappearance.md +1 -0
- package/systems/5e/world/items/Dust of Dryness.md +1 -0
- package/systems/5e/world/items/Dust of Sneezing and Choking.md +1 -0
- package/systems/5e/world/items/Dwarven Plate.md +1 -0
- package/systems/5e/world/items/Dwarven Thrower.md +1 -0
- package/systems/5e/world/items/Efficient Quiver.md +1 -0
- package/systems/5e/world/items/Efreeti Bottle.md +1 -0
- package/systems/5e/world/items/Elemental Gem.md +1 -0
- package/systems/5e/world/items/Elven Chain.md +1 -0
- package/systems/5e/world/items/Emblem.md +1 -0
- package/systems/5e/world/items/Entertainer's Pack.md +3 -0
- package/systems/5e/world/items/Eversmoking Bottle.md +1 -0
- package/systems/5e/world/items/Exotic Saddle.md +1 -0
- package/systems/5e/world/items/Explorer's Pack.md +3 -0
- package/systems/5e/world/items/Eyes of Charming.md +1 -0
- package/systems/5e/world/items/Eyes of Minute Seeing.md +1 -0
- package/systems/5e/world/items/Eyes of the Eagle.md +1 -0
- package/systems/5e/world/items/Feather Token.md +1 -0
- package/systems/5e/world/items/Feed.md +1 -0
- package/systems/5e/world/items/Figurine of Wondrous Power.md +1 -0
- package/systems/5e/world/items/Fine Clothes.md +1 -0
- package/systems/5e/world/items/Fishing Tackle.md +1 -0
- package/systems/5e/world/items/Flail.md +1 -0
- package/systems/5e/world/items/Flame Tongue.md +1 -0
- package/systems/5e/world/items/Flask or Tankard.md +1 -0
- package/systems/5e/world/items/Flute.md +1 -0
- package/systems/5e/world/items/Folding Boat.md +1 -0
- package/systems/5e/world/items/Forgery Kit.md +1 -0
- package/systems/5e/world/items/Frost Brand.md +2 -0
- package/systems/5e/world/items/Galley.md +1 -0
- package/systems/5e/world/items/Gauntlets of Ogre Power.md +2 -0
- package/systems/5e/world/items/Gem of Brightness.md +2 -0
- package/systems/5e/world/items/Gem of Seeing.md +2 -0
- package/systems/5e/world/items/Giant Slayer.md +1 -0
- package/systems/5e/world/items/Glaive.md +1 -0
- package/systems/5e/world/items/Glamoured Studded Leather.md +1 -0
- package/systems/5e/world/items/Glass Bottle.md +1 -0
- package/systems/5e/world/items/Glassblower's Tools.md +1 -0
- package/systems/5e/world/items/Gloves of Missile Snaring.md +1 -0
- package/systems/5e/world/items/Gloves of Swimming and Climbing.md +1 -0
- package/systems/5e/world/items/Goggles of Night.md +1 -0
- package/systems/5e/world/items/Grappling Hook.md +1 -0
- package/systems/5e/world/items/Greataxe.md +1 -0
- package/systems/5e/world/items/Greatclub.md +1 -0
- package/systems/5e/world/items/Greatsword.md +1 -0
- package/systems/5e/world/items/Halberd.md +1 -0
- package/systems/5e/world/items/Half Plate Armor.md +1 -0
- package/systems/5e/world/items/Hammer of Thunderbolts.md +2 -0
- package/systems/5e/world/items/Hammer.md +1 -0
- package/systems/5e/world/items/Hand Crossbow.md +1 -0
- package/systems/5e/world/items/Handaxe.md +1 -0
- package/systems/5e/world/items/Handy Haversack.md +3 -0
- package/systems/5e/world/items/Hat of Disguise.md +1 -0
- package/systems/5e/world/items/Headband of Intellect.md +2 -0
- package/systems/5e/world/items/Healer's Kit.md +1 -0
- package/systems/5e/world/items/Heavy Crossbow.md +1 -0
- package/systems/5e/world/items/Helm of Brilliance.md +1 -0
- package/systems/5e/world/items/Helm of Comprehending Languages.md +1 -0
- package/systems/5e/world/items/Helm of Telepathy.md +1 -0
- package/systems/5e/world/items/Helm of Teleportation.md +2 -0
- package/systems/5e/world/items/Hempen Rope.md +1 -0
- package/systems/5e/world/items/Herbalism Kit.md +1 -0
- package/systems/5e/world/items/Hide Armor.md +1 -0
- package/systems/5e/world/items/Holy Avenger.md +1 -0
- package/systems/5e/world/items/Holy Water.md +1 -0
- package/systems/5e/world/items/Hooded Lantern.md +1 -0
- package/systems/5e/world/items/Horn of Blasting.md +1 -0
- package/systems/5e/world/items/Horn of Valhalla.md +1 -0
- package/systems/5e/world/items/Horn.md +1 -0
- package/systems/5e/world/items/Horseshoes of Speed.md +1 -0
- package/systems/5e/world/items/Horseshoes of a Zephyr.md +1 -0
- package/systems/5e/world/items/Hourglass.md +1 -0
- package/systems/5e/world/items/Hunting Trap.md +1 -0
- package/systems/5e/world/items/Immovable Rod.md +1 -0
- package/systems/5e/world/items/Ink Pen.md +1 -0
- package/systems/5e/world/items/Ink.md +1 -0
- package/systems/5e/world/items/Instant Fortress.md +1 -0
- package/systems/5e/world/items/Ioun Stone.md +1 -0
- package/systems/5e/world/items/Iron Bands of Binding.md +1 -0
- package/systems/5e/world/items/Iron Flask.md +1 -0
- package/systems/5e/world/items/Iron Pot.md +1 -0
- package/systems/5e/world/items/Iron Spikes.md +2 -0
- package/systems/5e/world/items/Javelin of Lightning.md +1 -0
- package/systems/5e/world/items/Javelin.md +1 -0
- package/systems/5e/world/items/Jeweler's Tools.md +1 -0
- package/systems/5e/world/items/Jug or Pitcher.md +1 -0
- package/systems/5e/world/items/Keelboat.md +1 -0
- package/systems/5e/world/items/Ladder.md +1 -0
- package/systems/5e/world/items/Lamp.md +1 -0
- package/systems/5e/world/items/Lance.md +1 -0
- package/systems/5e/world/items/Lantern of Revealing.md +1 -0
- package/systems/5e/world/items/Leather Armor.md +1 -0
- package/systems/5e/world/items/Leatherworker's Tools.md +1 -0
- package/systems/5e/world/items/Light Crossbow.md +1 -0
- package/systems/5e/world/items/Light Hammer.md +1 -0
- package/systems/5e/world/items/Lock.md +1 -0
- package/systems/5e/world/items/Longbow.md +1 -0
- package/systems/5e/world/items/Longship.md +1 -0
- package/systems/5e/world/items/Longsword.md +1 -0
- package/systems/5e/world/items/Luck Blade.md +1 -0
- package/systems/5e/world/items/Lute.md +1 -0
- package/systems/5e/world/items/Lyre.md +1 -0
- package/systems/5e/world/items/Mace of Disruption.md +1 -0
- package/systems/5e/world/items/Mace of Smiting.md +1 -0
- package/systems/5e/world/items/Mace of Terror.md +2 -0
- package/systems/5e/world/items/Mace.md +1 -0
- package/systems/5e/world/items/Magnifying Glass.md +1 -0
- package/systems/5e/world/items/Manacles.md +1 -0
- package/systems/5e/world/items/Mantle of Spell Resistance.md +1 -0
- package/systems/5e/world/items/Manual of Bodily Health.md +1 -0
- package/systems/5e/world/items/Manual of Gainful Exercise.md +1 -0
- package/systems/5e/world/items/Manual of Golems.md +1 -0
- package/systems/5e/world/items/Manual of Quickness of Action.md +1 -0
- package/systems/5e/world/items/Map or Scroll Case.md +1 -0
- package/systems/5e/world/items/Marvelous Pigments.md +1 -0
- package/systems/5e/world/items/Mason's Tools.md +1 -0
- package/systems/5e/world/items/Maul.md +1 -0
- package/systems/5e/world/items/Medallion of Thoughts.md +2 -0
- package/systems/5e/world/items/Merchant's Scale.md +1 -0
- package/systems/5e/world/items/Mess Kit.md +1 -0
- package/systems/5e/world/items/Military Saddle.md +1 -0
- package/systems/5e/world/items/Miner's Pick.md +1 -0
- package/systems/5e/world/items/Mirror of Life Trapping.md +1 -0
- package/systems/5e/world/items/Mithral Armor.md +1 -0
- package/systems/5e/world/items/Morningstar.md +1 -0
- package/systems/5e/world/items/Navigator's Tools.md +1 -0
- package/systems/5e/world/items/Necklace of Adaptation.md +1 -0
- package/systems/5e/world/items/Necklace of Fireballs.md +1 -0
- package/systems/5e/world/items/Necklace of Prayer Beads.md +1 -0
- package/systems/5e/world/items/Net.md +1 -0
- package/systems/5e/world/items/Nine Lives Stealer.md +1 -0
- package/systems/5e/world/items/Oathbow.md +1 -0
- package/systems/5e/world/items/Oil of Etherealness.md +1 -0
- package/systems/5e/world/items/Oil of Sharpness.md +1 -0
- package/systems/5e/world/items/Oil of Slipperiness.md +1 -0
- package/systems/5e/world/items/Oil.md +1 -0
- package/systems/5e/world/items/Orb of Dragonkind.md +2 -0
- package/systems/5e/world/items/Orb.md +1 -0
- package/systems/5e/world/items/Pack Saddle.md +1 -0
- package/systems/5e/world/items/Padded Armor.md +1 -0
- package/systems/5e/world/items/Painter's Supplies.md +1 -0
- package/systems/5e/world/items/Pan Flute.md +1 -0
- package/systems/5e/world/items/Paper.md +1 -0
- package/systems/5e/world/items/Parchment.md +1 -0
- package/systems/5e/world/items/Pearl of Power.md +1 -0
- package/systems/5e/world/items/Perfume.md +1 -0
- package/systems/5e/world/items/Periapt of Health.md +1 -0
- package/systems/5e/world/items/Periapt of Proof against Poison.md +1 -0
- package/systems/5e/world/items/Periapt of Wound Closure.md +1 -0
- package/systems/5e/world/items/Philter of Love.md +1 -0
- package/systems/5e/world/items/Pike.md +1 -0
- package/systems/5e/world/items/Pipes of Haunting.md +1 -0
- package/systems/5e/world/items/Pipes of the Sewers.md +1 -0
- package/systems/5e/world/items/Piton.md +1 -0
- package/systems/5e/world/items/Plate Armor of Etherealness.md +1 -0
- package/systems/5e/world/items/Plate Armor.md +2 -0
- package/systems/5e/world/items/Playing Card Set.md +1 -0
- package/systems/5e/world/items/Poisoner's Kit.md +1 -0
- package/systems/5e/world/items/Pole.md +1 -0
- package/systems/5e/world/items/Portable Hole.md +2 -0
- package/systems/5e/world/items/Portable Ram.md +1 -0
- package/systems/5e/world/items/Potion of Animal Friendship.md +1 -0
- package/systems/5e/world/items/Potion of Clairvoyance.md +1 -0
- package/systems/5e/world/items/Potion of Climbing.md +1 -0
- package/systems/5e/world/items/Potion of Diminution.md +1 -0
- package/systems/5e/world/items/Potion of Flying.md +1 -0
- package/systems/5e/world/items/Potion of Gaseous Form.md +1 -0
- package/systems/5e/world/items/Potion of Giant Strength.md +1 -0
- package/systems/5e/world/items/Potion of Growth.md +1 -0
- package/systems/5e/world/items/Potion of Healing.md +1 -0
- package/systems/5e/world/items/Potion of Heroism.md +1 -0
- package/systems/5e/world/items/Potion of Invisibility.md +1 -0
- package/systems/5e/world/items/Potion of Mind Reading.md +1 -0
- package/systems/5e/world/items/Potion of Poison.md +1 -0
- package/systems/5e/world/items/Potion of Resistance.md +1 -0
- package/systems/5e/world/items/Potion of Speed.md +1 -0
- package/systems/5e/world/items/Potion of Water Breathing.md +1 -0
- package/systems/5e/world/items/Potter's Tools.md +1 -0
- package/systems/5e/world/items/Pouch.md +1 -0
- package/systems/5e/world/items/Priest's Pack.md +3 -0
- package/systems/5e/world/items/Quarterstaff.md +1 -0
- package/systems/5e/world/items/Quiver.md +1 -0
- package/systems/5e/world/items/Rapier.md +1 -0
- package/systems/5e/world/items/Rations.md +1 -0
- package/systems/5e/world/items/Reliquary.md +1 -0
- package/systems/5e/world/items/Restorative Ointment.md +1 -0
- package/systems/5e/world/items/Riding Saddle.md +1 -0
- package/systems/5e/world/items/Ring Mail.md +1 -0
- package/systems/5e/world/items/Ring of Animal Influence.md +2 -0
- package/systems/5e/world/items/Ring of Djinni Summoning.md +1 -0
- package/systems/5e/world/items/Ring of Elemental Command.md +2 -0
- package/systems/5e/world/items/Ring of Evasion.md +2 -0
- package/systems/5e/world/items/Ring of Feather Falling.md +1 -0
- package/systems/5e/world/items/Ring of Free Action.md +1 -0
- package/systems/5e/world/items/Ring of Invisibility.md +1 -0
- package/systems/5e/world/items/Ring of Jumping.md +1 -0
- package/systems/5e/world/items/Ring of Mind Shielding.md +1 -0
- package/systems/5e/world/items/Ring of Protection.md +3 -0
- package/systems/5e/world/items/Ring of Regeneration.md +1 -0
- package/systems/5e/world/items/Ring of Resistance.md +1 -0
- package/systems/5e/world/items/Ring of Shooting Stars.md +2 -0
- package/systems/5e/world/items/Ring of Spell Storing.md +1 -0
- package/systems/5e/world/items/Ring of Spell Turning.md +1 -0
- package/systems/5e/world/items/Ring of Swimming.md +1 -0
- package/systems/5e/world/items/Ring of Telekinesis.md +1 -0
- package/systems/5e/world/items/Ring of Three Wishes.md +1 -0
- package/systems/5e/world/items/Ring of Warmth.md +2 -0
- package/systems/5e/world/items/Ring of Water Walking.md +1 -0
- package/systems/5e/world/items/Ring of X-ray Vision.md +1 -0
- package/systems/5e/world/items/Ring of the Ram.md +2 -0
- package/systems/5e/world/items/Robe of Eyes.md +1 -0
- package/systems/5e/world/items/Robe of Scintillating Colors.md +2 -0
- package/systems/5e/world/items/Robe of Stars.md +1 -0
- package/systems/5e/world/items/Robe of Useful Items.md +1 -0
- package/systems/5e/world/items/Robe of the Archmagi.md +3 -0
- package/systems/5e/world/items/Robes.md +1 -0
- package/systems/5e/world/items/Rod of Absorption.md +1 -0
- package/systems/5e/world/items/Rod of Alertness.md +1 -0
- package/systems/5e/world/items/Rod of Lordly Might.md +1 -0
- package/systems/5e/world/items/Rod of Rulership.md +1 -0
- package/systems/5e/world/items/Rod of Security.md +1 -0
- package/systems/5e/world/items/Rod.md +1 -0
- package/systems/5e/world/items/Rope of Climbing.md +1 -0
- package/systems/5e/world/items/Rope of Entanglement.md +1 -0
- package/systems/5e/world/items/Rowboat.md +1 -0
- package/systems/5e/world/items/Sack.md +1 -0
- package/systems/5e/world/items/Saddlebags.md +1 -0
- package/systems/5e/world/items/Sailing Ship.md +1 -0
- package/systems/5e/world/items/Scale Mail.md +1 -0
- package/systems/5e/world/items/Scarab of Protection.md +2 -0
- package/systems/5e/world/items/Scholar's Pack.md +3 -0
- package/systems/5e/world/items/Scimitar of Speed.md +1 -0
- package/systems/5e/world/items/Scimitar.md +1 -0
- package/systems/5e/world/items/Sealing Wax.md +1 -0
- package/systems/5e/world/items/Shawm.md +1 -0
- package/systems/5e/world/items/Shield of Missile Attraction.md +2 -0
- package/systems/5e/world/items/Shield, +1, +2, or +3.md +1 -0
- package/systems/5e/world/items/Shield.md +1 -0
- package/systems/5e/world/items/Shortbow.md +1 -0
- package/systems/5e/world/items/Shortsword.md +1 -0
- package/systems/5e/world/items/Shovel.md +1 -0
- package/systems/5e/world/items/Sickle.md +1 -0
- package/systems/5e/world/items/Signal Whistle.md +1 -0
- package/systems/5e/world/items/Signet Ring.md +1 -0
- package/systems/5e/world/items/Silk Rope.md +1 -0
- package/systems/5e/world/items/Sled.md +1 -0
- package/systems/5e/world/items/Sledgehammer.md +1 -0
- package/systems/5e/world/items/Sling Bullets.md +2 -0
- package/systems/5e/world/items/Sling.md +1 -0
- package/systems/5e/world/items/Slippers of Spider Climbing.md +1 -0
- package/systems/5e/world/items/Smith's Tools.md +1 -0
- package/systems/5e/world/items/Soap.md +1 -0
- package/systems/5e/world/items/Sovereign Glue.md +1 -0
- package/systems/5e/world/items/Spear.md +1 -0
- package/systems/5e/world/items/Spell Scroll.md +1 -0
- package/systems/5e/world/items/Spellbook.md +1 -0
- package/systems/5e/world/items/Spellguard Shield.md +1 -0
- package/systems/5e/world/items/Sphere of Annihilation.md +1 -0
- package/systems/5e/world/items/Splint Armor.md +2 -0
- package/systems/5e/world/items/Sprig of Mistletoe.md +1 -0
- package/systems/5e/world/items/Spyglass.md +1 -0
- package/systems/5e/world/items/Staff of Charming.md +1 -0
- package/systems/5e/world/items/Staff of Fire.md +3 -0
- package/systems/5e/world/items/Staff of Frost.md +3 -0
- package/systems/5e/world/items/Staff of Healing.md +2 -0
- package/systems/5e/world/items/Staff of Power.md +5 -0
- package/systems/5e/world/items/Staff of Striking.md +2 -0
- package/systems/5e/world/items/Staff of Swarming Insects.md +2 -0
- package/systems/5e/world/items/Staff of Thunder and Lightning.md +1 -0
- package/systems/5e/world/items/Staff of Withering.md +2 -0
- package/systems/5e/world/items/Staff of the Magi.md +3 -0
- package/systems/5e/world/items/Staff of the Python.md +1 -0
- package/systems/5e/world/items/Staff of the Woodlands.md +2 -0
- package/systems/5e/world/items/Staff.md +1 -0
- package/systems/5e/world/items/Steel Mirror.md +1 -0
- package/systems/5e/world/items/Stone of Controlling Earth Elementals.md +1 -0
- package/systems/5e/world/items/Stone of Good Luck.md +4 -0
- package/systems/5e/world/items/Studded Leather Armor.md +1 -0
- package/systems/5e/world/items/Sun Blade.md +1 -0
- package/systems/5e/world/items/Sword of Life Stealing.md +1 -0
- package/systems/5e/world/items/Sword of Sharpness.md +1 -0
- package/systems/5e/world/items/Sword of Wounding.md +1 -0
- package/systems/5e/world/items/Talisman of Pure Good.md +2 -0
- package/systems/5e/world/items/Talisman of Ultimate Evil.md +2 -0
- package/systems/5e/world/items/Talisman of the Sphere.md +1 -0
- package/systems/5e/world/items/Thieves' Tools.md +1 -0
- package/systems/5e/world/items/Tinderbox.md +1 -0
- package/systems/5e/world/items/Tinker's Tools.md +1 -0
- package/systems/5e/world/items/Tome of Clear Thought.md +1 -0
- package/systems/5e/world/items/Tome of Leadership and Influence.md +1 -0
- package/systems/5e/world/items/Tome of Understanding.md +1 -0
- package/systems/5e/world/items/Torch.md +1 -0
- package/systems/5e/world/items/Totem.md +1 -0
- package/systems/5e/world/items/Traveler's Clothes.md +1 -0
- package/systems/5e/world/items/Trident of Fish Command.md +2 -0
- package/systems/5e/world/items/Trident.md +1 -0
- package/systems/5e/world/items/Two-Person Tent.md +1 -0
- package/systems/5e/world/items/Unarmed Strike.md +1 -0
- package/systems/5e/world/items/Universal Solvent.md +1 -0
- package/systems/5e/world/items/Vial.md +1 -0
- package/systems/5e/world/items/Vicious Weapon.md +1 -0
- package/systems/5e/world/items/Viol.md +1 -0
- package/systems/5e/world/items/Vorpal Sword.md +1 -0
- package/systems/5e/world/items/Wagon.md +1 -0
- package/systems/5e/world/items/Wand of Binding.md +2 -0
- package/systems/5e/world/items/Wand of Enemy Detection.md +2 -0
- package/systems/5e/world/items/Wand of Fear.md +2 -0
- package/systems/5e/world/items/Wand of Fireballs.md +2 -0
- package/systems/5e/world/items/Wand of Lightning Bolts.md +2 -0
- package/systems/5e/world/items/Wand of Magic Detection.md +2 -0
- package/systems/5e/world/items/Wand of Magic Missiles.md +2 -0
- package/systems/5e/world/items/Wand of Paralysis.md +2 -0
- package/systems/5e/world/items/Wand of Polymorph.md +2 -0
- package/systems/5e/world/items/Wand of Secrets.md +2 -0
- package/systems/5e/world/items/Wand of Web.md +2 -0
- package/systems/5e/world/items/Wand of Wonder.md +2 -0
- package/systems/5e/world/items/Wand of the War Mage, +1, +2, or +3.md +1 -0
- package/systems/5e/world/items/Wand.md +1 -0
- package/systems/5e/world/items/War Pick.md +1 -0
- package/systems/5e/world/items/Warhammer.md +1 -0
- package/systems/5e/world/items/Warship.md +1 -0
- package/systems/5e/world/items/Waterskin.md +1 -0
- package/systems/5e/world/items/Weapon, +1, +2, or +3.md +1 -0
- package/systems/5e/world/items/Weaver's Tools.md +1 -0
- package/systems/5e/world/items/Well of Many Worlds.md +1 -0
- package/systems/5e/world/items/Whetstone.md +1 -0
- package/systems/5e/world/items/Whip.md +1 -0
- package/systems/5e/world/items/Wind Fan.md +1 -0
- package/systems/5e/world/items/Winged Boots.md +1 -0
- package/systems/5e/world/items/Wings of Flying.md +1 -0
- package/systems/5e/world/items/Woodcarver's Tools.md +1 -0
- package/systems/5e/world/items/Wooden Staff.md +1 -0
- package/systems/5e/world/items/Yew Wand.md +1 -0
- package/systems/free/instructions/play.md +5 -0
- package/systems/free/instructions/session-zero.md +1 -0
- package/systems/free/system.yaml +12 -0
- package/dist/dashboard/combat.js +0 -72
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
// The catalog of the packages one may add (D-485, D-486): what npm has for this rpg-engine, extensions, game systems and languages, and the adventures
|
|
2
|
+
// GitHub has by their topic, each with what the player needs to trust it and whether it is here already.
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { readManifest } from "../adventures/index.js";
|
|
5
|
+
import { files } from "../core/store.js";
|
|
6
|
+
import { comparableText } from "../core/text.js";
|
|
7
|
+
import { isNewerVersion } from "../core/version.js";
|
|
8
|
+
import { installedExtensions, isVerified, readExtension, readsApi, shortName } from "../extensions/index.js";
|
|
9
|
+
import { installedLanguages } from "../languages/index.js";
|
|
10
|
+
import { systemFolders } from "../systems/index.js";
|
|
11
|
+
import { installedAdventures } from "./game-adventures.js";
|
|
12
|
+
/** The topic a GitHub repository carries to be found as an adventure (D-485 (4)). */
|
|
13
|
+
export const adventureTopic = "rpg-engine-adventure";
|
|
14
|
+
// How many repositories are read, each with its adventure.yaml: GitHub answers without a login only so many times an hour.
|
|
15
|
+
const mostAdventures = 30;
|
|
16
|
+
const kinds = new Set(["system", "extension", "language"]);
|
|
17
|
+
/** What npm and GitHub offer now, ours first, then by title; each source asked once, side by side. */
|
|
18
|
+
export async function catalog(root, context) {
|
|
19
|
+
const [npm, github] = await Promise.all([npmEntries(root, context), githubEntries(root, context)]);
|
|
20
|
+
const entries = [...npm.entries, ...github.entries].sort((first, second) => Number(second.verified) - Number(first.verified) || first.title.localeCompare(second.title));
|
|
21
|
+
return { entries, failed: { ...(npm.failed === undefined ? {} : { npm: npm.failed }), ...(github.failed === undefined ? {} : { github: github.failed }) } };
|
|
22
|
+
}
|
|
23
|
+
async function npmEntries(root, context) {
|
|
24
|
+
const searched = context.packages === undefined ? { failed: "only the game's server and the command line reach npm" } : await context.packages.search();
|
|
25
|
+
if ("failed" in searched) {
|
|
26
|
+
return { entries: [], failed: searched.failed };
|
|
27
|
+
}
|
|
28
|
+
const listed = searched.filter((one) => kinds.has(one.kind ?? "") && (one.kind !== "extension" || readsApi(one.api)));
|
|
29
|
+
return { entries: listed.map((one) => npmEntry(one, installedVersion(root, context, one))) };
|
|
30
|
+
}
|
|
31
|
+
function npmEntry(found, installed) {
|
|
32
|
+
const ours = isVerified(found.name, false);
|
|
33
|
+
return {
|
|
34
|
+
kind: found.kind,
|
|
35
|
+
title: shortName(found.name).replace(/^system-/, ""),
|
|
36
|
+
...(found.description === undefined ? {} : { description: found.description }),
|
|
37
|
+
...(found.author === undefined ? {} : { author: found.author }),
|
|
38
|
+
version: found.version,
|
|
39
|
+
verified: ours,
|
|
40
|
+
code: found.code === true,
|
|
41
|
+
// Ours by its name alone, as package install reads it; another's by its npm name, never mistaken for one of ours.
|
|
42
|
+
source: ours ? shortName(found.name) : found.name.startsWith("@") ? found.name : `npm:${found.name}`,
|
|
43
|
+
...(installed === undefined ? {} : { installed }),
|
|
44
|
+
update: installed !== undefined && isNewerVersion(found.version, installed),
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/** The version of this npm package installed here: an extension's, or a game system's. */
|
|
48
|
+
function installedVersion(root, context, found) {
|
|
49
|
+
if (found.kind === "extension") {
|
|
50
|
+
const here = installedExtensions(context.extensionFolders ?? []).find((one) => one.package === found.name);
|
|
51
|
+
try {
|
|
52
|
+
return here === undefined ? undefined : readExtension(here.folder).version;
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
return "broken";
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (found.kind === "language") {
|
|
59
|
+
return installedLanguages(context.extensionFolders ?? []).find((one) => one.package === found.name)?.version;
|
|
60
|
+
}
|
|
61
|
+
// A system npm installed, by its package's own version.
|
|
62
|
+
const folder = systemFolders(context.systemFolders).find((one) => packageNameIn(one.folder) === found.name)?.folder;
|
|
63
|
+
return folder === undefined ? undefined : packageVersionIn(folder);
|
|
64
|
+
}
|
|
65
|
+
function packageNameIn(folder) {
|
|
66
|
+
return packageIn(folder)?.name;
|
|
67
|
+
}
|
|
68
|
+
function packageVersionIn(folder) {
|
|
69
|
+
return packageIn(folder)?.version;
|
|
70
|
+
}
|
|
71
|
+
function packageIn(folder) {
|
|
72
|
+
try {
|
|
73
|
+
return JSON.parse(files().text(join(folder, "package.json")) ?? "");
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
return undefined;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/** The adventures GitHub has by their topic, each read from its adventure.yaml; a repository without one that reads is left out. */
|
|
80
|
+
async function githubEntries(root, context) {
|
|
81
|
+
if (context.download === undefined) {
|
|
82
|
+
return { entries: [], failed: "only the game's server and the command line reach GitHub" };
|
|
83
|
+
}
|
|
84
|
+
const download = context.download;
|
|
85
|
+
let repositories;
|
|
86
|
+
try {
|
|
87
|
+
const found = JSON.parse(new TextDecoder().decode(await download(`https://api.github.com/search/repositories?q=topic:${adventureTopic}&sort=stars&per_page=${mostAdventures}`, 2 * 1024 * 1024, context.signal)));
|
|
88
|
+
repositories = found.items ?? [];
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
return { entries: [], failed: `GitHub could not be asked: ${error instanceof Error ? error.message : String(error)}` };
|
|
92
|
+
}
|
|
93
|
+
const here = installedAdventures(root);
|
|
94
|
+
const read = await Promise.all(repositories.map(async (repository) => {
|
|
95
|
+
try {
|
|
96
|
+
const text = new TextDecoder().decode(await download(`https://raw.githubusercontent.com/${repository.full_name}/${repository.default_branch}/adventure.yaml`, 64 * 1024, context.signal));
|
|
97
|
+
const manifest = readManifest(text, repository.full_name);
|
|
98
|
+
const installed = here.find((one) => comparableText(one.title) === comparableText(manifest.title))?.version;
|
|
99
|
+
const levels = manifest.levels === undefined ? undefined : manifest.levels.from === manifest.levels.to ? String(manifest.levels.from) : `${manifest.levels.from}-${manifest.levels.to}`;
|
|
100
|
+
return {
|
|
101
|
+
kind: "adventure",
|
|
102
|
+
title: manifest.title,
|
|
103
|
+
description: manifest.about,
|
|
104
|
+
author: manifest.author ?? repository.owner?.login,
|
|
105
|
+
version: manifest.version,
|
|
106
|
+
verified: false,
|
|
107
|
+
code: false,
|
|
108
|
+
source: repository.html_url,
|
|
109
|
+
...(installed === undefined ? {} : { installed }),
|
|
110
|
+
update: installed !== undefined && isNewerVersion(manifest.version, installed),
|
|
111
|
+
...(levels === undefined ? {} : { levels }),
|
|
112
|
+
...(manifest.length === undefined ? {} : { length: manifest.length }),
|
|
113
|
+
language: manifest.language,
|
|
114
|
+
...(repository.stargazers_count === undefined ? {} : { stars: repository.stargazers_count }),
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
catch {
|
|
118
|
+
return undefined;
|
|
119
|
+
}
|
|
120
|
+
}));
|
|
121
|
+
return { entries: read.filter((one) => one !== undefined) };
|
|
122
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Context } from "../core/context.ts";
|
|
2
|
+
import type { Problem } from "../core/problem.ts";
|
|
3
|
+
import { type Page } from "../pages/index.ts";
|
|
4
|
+
/** A contradiction in the state: the rule that found it, the page it is on, and the line for the master. */
|
|
5
|
+
export interface Contradiction {
|
|
6
|
+
rule: string;
|
|
7
|
+
page: Page;
|
|
8
|
+
line: string;
|
|
9
|
+
}
|
|
10
|
+
/** Every contradiction now (CHK-3), for status and validate. */
|
|
11
|
+
export declare function allStateChecks(root: string, context: Context): Contradiction[];
|
|
12
|
+
/** The contradictions not yet told in this chat, for scene next and advance (CHK-3): each once while it lasts, again when it comes back; every one without a chat. */
|
|
13
|
+
export declare function newStateChecks(root: string, context: Context): string[];
|
|
14
|
+
/** Every contradiction as a problem of validate, on the page it is on (CHK-3). */
|
|
15
|
+
export declare function stateCheckProblems(root: string, context: Context): Problem[];
|
|
16
|
+
/** Marks these contradictions told, the whole of them now, and forgets those that hold no more, so that one that comes back is told again (CHK-3). */
|
|
17
|
+
export declare function markStateChecksTold(context: Context, found: Contradiction[]): void;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { comparableText, sameName, valueNamed } from "../core/text.js";
|
|
2
|
+
import { formatCounter, readCounter } from "../counters/index.js";
|
|
3
|
+
import { keeperOf } from "../effects/index.js";
|
|
4
|
+
import { inheritedFields, isPartyMember, pagesWithName, parsePageReference } from "../pages/index.js";
|
|
5
|
+
import { effectsOf } from "./effect-layer.js";
|
|
6
|
+
import { keptEffects } from "./game-effects.js";
|
|
7
|
+
import { readOpenScene } from "./game-scene.js";
|
|
8
|
+
import { campaignSystem, campaignWorld } from "./game-world.js";
|
|
9
|
+
/** Every contradiction now (CHK-3), for status and validate. */
|
|
10
|
+
export function allStateChecks(root, context) {
|
|
11
|
+
const system = campaignSystem(root, context);
|
|
12
|
+
if (system === undefined) {
|
|
13
|
+
return [];
|
|
14
|
+
}
|
|
15
|
+
const world = campaignWorld(root, context);
|
|
16
|
+
const scene = readOpenScene(root).scene;
|
|
17
|
+
return checkedPages(world, scene).flatMap((page) => [
|
|
18
|
+
...said("kept-broken", page, keptWhileBroken(world, scene, system, page)),
|
|
19
|
+
...said("awake-at-dying", page, awakeAtDying(world, system, page)),
|
|
20
|
+
...system.checks.flatMap((check, index) => said(`system-${index}`, page, systemCheck(world, check, page))),
|
|
21
|
+
]);
|
|
22
|
+
}
|
|
23
|
+
/** The contradictions not yet told in this chat, for scene next and advance (CHK-3): each once while it lasts, again when it comes back; every one without a chat. */
|
|
24
|
+
export function newStateChecks(root, context) {
|
|
25
|
+
const all = allStateChecks(root, context);
|
|
26
|
+
const told = context.told;
|
|
27
|
+
if (told === undefined) {
|
|
28
|
+
return all.map((found) => found.line);
|
|
29
|
+
}
|
|
30
|
+
const fresh = all.filter((found) => !told.has(checkKey(found)));
|
|
31
|
+
markStateChecksTold(context, all);
|
|
32
|
+
return fresh.map((found) => found.line);
|
|
33
|
+
}
|
|
34
|
+
/** Every contradiction as a problem of validate, on the page it is on (CHK-3). */
|
|
35
|
+
export function stateCheckProblems(root, context) {
|
|
36
|
+
return allStateChecks(root, context).map((found) => ({ path: found.page.path, message: found.line }));
|
|
37
|
+
}
|
|
38
|
+
/** Marks these contradictions told, the whole of them now, and forgets those that hold no more, so that one that comes back is told again (CHK-3). */
|
|
39
|
+
export function markStateChecksTold(context, found) {
|
|
40
|
+
const told = context.told;
|
|
41
|
+
const now = new Set(found.map(checkKey));
|
|
42
|
+
for (const key of [...(told ?? [])].filter((name) => name.startsWith(keyPrefix) && !now.has(name))) {
|
|
43
|
+
told?.delete(key);
|
|
44
|
+
}
|
|
45
|
+
now.forEach((key) => told?.add(key));
|
|
46
|
+
}
|
|
47
|
+
const keyPrefix = "check:";
|
|
48
|
+
function checkKey(found) {
|
|
49
|
+
return `${keyPrefix}${found.rule}:${comparableText(found.page.name)}`;
|
|
50
|
+
}
|
|
51
|
+
function said(rule, page, line) {
|
|
52
|
+
return line === undefined ? [] : [{ rule, page, line }];
|
|
53
|
+
}
|
|
54
|
+
/** Who is checked (CHK-1): the party, alive or dead, and the characters of the open scene; never a copy nor the rest of the world. */
|
|
55
|
+
function checkedPages(world, scene) {
|
|
56
|
+
const inScene = (scene?.with ?? []).flatMap((link) => pagesWithName(world, parsePageReference(link).name).slice(0, 1));
|
|
57
|
+
return [...new Set([...world.pages.filter(isPartyMember), ...inScene].filter((page) => page.type === "character" && page.system === undefined))];
|
|
58
|
+
}
|
|
59
|
+
/** Who keeps an effect alive while a condition that breaks it is on them (EFF-14), as concentration held while Unconscious. */
|
|
60
|
+
function keptWhileBroken(world, scene, system, page) {
|
|
61
|
+
const keeping = system.keeping;
|
|
62
|
+
const condition = effectsOf(page).find((effect) => sameName(keeping?.conditions ?? [], effect.name) !== undefined)?.name;
|
|
63
|
+
const kept = keeping === undefined || condition === undefined ? [] : keptEffects(world, scene, page.name);
|
|
64
|
+
return kept.length === 0 ? undefined : `${page.name} keeps ${kept.join(" · ")} but is ${condition}, which breaks it: effect end, by [[${page.name}]]. Read rules ${keeping?.rules}.`;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* One of the party at the system's dying value, or below, with none of the conditions that keep from acting (DIE-1), as when one was ended by hand; never anyone
|
|
68
|
+
* else, as a foe at 0 is dead in the game's rules (review of 19 October).
|
|
69
|
+
*/
|
|
70
|
+
function awakeAtDying(world, system, page) {
|
|
71
|
+
const dying = system.dying;
|
|
72
|
+
if (!isPartyMember(page)) {
|
|
73
|
+
return undefined;
|
|
74
|
+
}
|
|
75
|
+
const inactive = system.combat?.inactive ?? [];
|
|
76
|
+
// The page's own counter: what a form that gives it holds is not the page's (DIE-8).
|
|
77
|
+
const counter = dying === undefined ? undefined : readCounter(valueNamed(inheritedFields(world, page), dying.field));
|
|
78
|
+
if (dying === undefined || counter === undefined || counter.value > dying.value || inactive.length === 0 || page.fields.status === "dead") {
|
|
79
|
+
return undefined;
|
|
80
|
+
}
|
|
81
|
+
if (effectsOf(page).some((effect) => sameName(inactive, effect.name) !== undefined)) {
|
|
82
|
+
return undefined;
|
|
83
|
+
}
|
|
84
|
+
const rule = system.thresholds.find((threshold) => comparableText(threshold.field) === comparableText(dying.field) && threshold.value === dying.value)?.rule;
|
|
85
|
+
const read = rule === undefined ? "" : ` Read rules ${rule}.`;
|
|
86
|
+
return `${page.name} is at ${dying.field} ${formatCounter(counter)}, not marked dead, with none of ${inactive.join(", ")}: raise its ${dying.field} as its rules say, `
|
|
87
|
+
+ `give it one of them back, or write status=dead.${read}`;
|
|
88
|
+
}
|
|
89
|
+
/** A check of the system (CHK-2): its line when `when` holds and `needs` does not; nothing when a field it reads is not on the page. */
|
|
90
|
+
function systemCheck(world, check, page) {
|
|
91
|
+
const fields = inheritedFields(world, page);
|
|
92
|
+
const when = holds(page, fields, check.when);
|
|
93
|
+
const needs = holds(page, fields, check.needs);
|
|
94
|
+
if (when !== true || needs !== false) {
|
|
95
|
+
return undefined;
|
|
96
|
+
}
|
|
97
|
+
return check.say.replace(/\{([^{}]+)\}/g, (whole, name) => {
|
|
98
|
+
if (name === "page") {
|
|
99
|
+
return page.name;
|
|
100
|
+
}
|
|
101
|
+
const value = valueNamed(fields, name);
|
|
102
|
+
return value === undefined ? whole : `${name} ${String(value)}`;
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
/** Whether an atom holds on a page: an effect without end or keeper on it, or a field against a number; undefined when the field is not there. */
|
|
106
|
+
function holds(page, fields, atom) {
|
|
107
|
+
if ("effect" in atom) {
|
|
108
|
+
return effectsOf(page).some((effect) => comparableText(effect.name) === comparableText(atom.effect) && effect.end === undefined && keeperOf(effect) === undefined);
|
|
109
|
+
}
|
|
110
|
+
const value = readCounter(valueNamed(fields, atom.field))?.value;
|
|
111
|
+
return value === undefined ? undefined : compare(value, atom.op, atom.value);
|
|
112
|
+
}
|
|
113
|
+
function compare(value, op, against) {
|
|
114
|
+
switch (op) {
|
|
115
|
+
case "<":
|
|
116
|
+
return value < against;
|
|
117
|
+
case "<=":
|
|
118
|
+
return value <= against;
|
|
119
|
+
case "=":
|
|
120
|
+
return value === against;
|
|
121
|
+
case "!=":
|
|
122
|
+
return value !== against;
|
|
123
|
+
case ">=":
|
|
124
|
+
return value >= against;
|
|
125
|
+
case ">":
|
|
126
|
+
return value > against;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type Page, type World } from "../pages/index.ts";
|
|
2
|
+
import type { DamageRule, GameSystem } from "../systems/index.ts";
|
|
3
|
+
/** What a page takes of an amount of damage of a type, and the note that says why when it is not the amount. */
|
|
4
|
+
export interface DamageTaken {
|
|
5
|
+
amount: number;
|
|
6
|
+
note: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The damage a page takes of a type (DMG-1, DMG-2): none when its ignoring list names the type, half rounded down when its halving list does, then doubled when
|
|
10
|
+
* its doubling list does. An item that names the type with a condition, as "slashing from nonmagical attacks", waits for the master to say whether it holds
|
|
11
|
+
* for this damage (DMG-3): "slashing (applies)" or "slashing (does not apply)".
|
|
12
|
+
*/
|
|
13
|
+
export declare function damageTaken(system: GameSystem, rule: DamageRule, fields: Record<string, unknown>, amount: number, written: string, page: string): DamageTaken;
|
|
14
|
+
/**
|
|
15
|
+
* The lists of a page that change damage, each the union of what it writes, what the pages of the system's bonus lists give, as a ring one is attuned to,
|
|
16
|
+
* and what its effects give, as a rage (DMG-1): an effect adds to the list, never covers it. A list written as text stays text, for damageTaken to refuse.
|
|
17
|
+
*/
|
|
18
|
+
export declare function damageLists(world: World, page: Page, rule: DamageRule): Record<string, unknown>;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// Damage of a type (D-449, DMG-1–DMG-3): what the lists of who takes it ignore, halve or double, before the counter loses it.
|
|
2
|
+
import { comparableText, valueNamed } from "../core/text.js";
|
|
3
|
+
import { bonusPages, inheritedFields, textsIn } from "../pages/index.js";
|
|
4
|
+
import { effectsOf } from "./effect-layer.js";
|
|
5
|
+
/**
|
|
6
|
+
* The damage a page takes of a type (DMG-1, DMG-2): none when its ignoring list names the type, half rounded down when its halving list does, then doubled when
|
|
7
|
+
* its doubling list does. An item that names the type with a condition, as "slashing from nonmagical attacks", waits for the master to say whether it holds
|
|
8
|
+
* for this damage (DMG-3): "slashing (applies)" or "slashing (does not apply)".
|
|
9
|
+
*/
|
|
10
|
+
export function damageTaken(system, rule, fields, amount, written, page) {
|
|
11
|
+
const { type, applies } = readDamageType(written);
|
|
12
|
+
const named = typeNames(system, rule);
|
|
13
|
+
checkKnownType(system, named, type);
|
|
14
|
+
const found = ["ignores", "halves", "doubles"].map((key) => {
|
|
15
|
+
const value = valueNamed(fields, rule[key]);
|
|
16
|
+
if (typeof value === "string" && value.includes(",")) {
|
|
17
|
+
throw new Error(`${page}'s ${rule[key]} is text, "${value}": write it as a list, such as ${rule[key]}: [${named.slice(0, 2).join(", ") || "fire, cold"}]. Nothing changed.`);
|
|
18
|
+
}
|
|
19
|
+
const items = textsIn(value);
|
|
20
|
+
const exact = items.some((item) => comparableText(item) === comparableText(type));
|
|
21
|
+
// An item that names the type with a condition, or names no type at all, as "damage from spells", holds only for some damage (DMG-3).
|
|
22
|
+
const conditional = items.filter((item) => comparableText(item) !== comparableText(type) && (namesWord(item, type) || (named.length > 0 && !named.some((name) => namesWord(item, name)))));
|
|
23
|
+
return { list: rule[key], exact, conditional };
|
|
24
|
+
});
|
|
25
|
+
const pending = found.flatMap((entry) => entry.conditional.map((item) => `"${item}" in ${entry.list}`));
|
|
26
|
+
if (pending.length > 0 && applies === undefined) {
|
|
27
|
+
const several = found.filter((entry) => entry.conditional.length > 0).length > 1 ? "; when they do not all hold, give the damage worked out, without damage" : "";
|
|
28
|
+
throw new Error(`${page} has ${pending.join(" and ")}, which hold only for some damage: give damage "${type} (applies)" when it holds for this one, or "${type} (does not apply)"${several} `
|
|
29
|
+
+ `(read rules "${rule.rules}"). Nothing changed.`);
|
|
30
|
+
}
|
|
31
|
+
const [ignored, halved, doubled] = found.map((entry) => entry.exact || (applies === true && entry.conditional.length > 0));
|
|
32
|
+
if (ignored) {
|
|
33
|
+
return { amount: 0, note: `${type} ignored, in ${rule.ignores}` };
|
|
34
|
+
}
|
|
35
|
+
const taken = (halved ? Math.floor(amount / 2) : amount) * (doubled ? 2 : 1);
|
|
36
|
+
const why = [halved ? `halved, in ${rule.halves}` : "", doubled ? `doubled, in ${rule.doubles}` : ""].filter((part) => part !== "");
|
|
37
|
+
return { amount: taken, note: why.length === 0 ? "" : `${type} ${amount} ${why.join(", then ")}: ${taken}` };
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The lists of a page that change damage, each the union of what it writes, what the pages of the system's bonus lists give, as a ring one is attuned to,
|
|
41
|
+
* and what its effects give, as a rage (DMG-1): an effect adds to the list, never covers it. A list written as text stays text, for damageTaken to refuse.
|
|
42
|
+
*/
|
|
43
|
+
export function damageLists(world, page, rule) {
|
|
44
|
+
const own = inheritedFields(world, page);
|
|
45
|
+
const given = bonusPages(world, own);
|
|
46
|
+
const effects = effectsOf(page);
|
|
47
|
+
return Object.fromEntries([rule.ignores, rule.halves, rule.doubles].map((list) => {
|
|
48
|
+
const written = valueNamed(own, list);
|
|
49
|
+
const fromPages = given.flatMap((other) => textsIn(valueNamed(inheritedFields(world, other), list)));
|
|
50
|
+
const fromEffects = effects.flatMap((effect) => effect.values.filter(([field]) => comparableText(field) === comparableText(list)).flatMap(([, value]) => value.split(/\s*,\s*/)));
|
|
51
|
+
const added = [...fromPages, ...fromEffects].filter((item) => item.trim() !== "");
|
|
52
|
+
return [list, typeof written === "string" && added.length === 0 ? written : [...textsIn(written), ...added]];
|
|
53
|
+
}));
|
|
54
|
+
}
|
|
55
|
+
/** "slashing (applies)": the type, and whether a condition on it holds, when the master said so. */
|
|
56
|
+
function readDamageType(written) {
|
|
57
|
+
const match = /^(.*?)\s*\(\s*(applies|does not apply)\s*\)\s*$/i.exec(written.trim());
|
|
58
|
+
return match === null ? { type: written.trim() } : { type: match[1], applies: match[2].toLowerCase() === "applies" };
|
|
59
|
+
}
|
|
60
|
+
/** The types the system names in its closed lists; none when it has no such list. */
|
|
61
|
+
function typeNames(system, rule) {
|
|
62
|
+
return [...new Set([...(system.values[rule.halves] ?? []), ...(system.sheetValues[rule.halves] ?? [])])];
|
|
63
|
+
}
|
|
64
|
+
/** A type the system names, when it names them: a typo would change nothing in silence. */
|
|
65
|
+
function checkKnownType(system, named, type) {
|
|
66
|
+
if (type === "" || (named.length > 0 && !named.some((name) => comparableText(name) === comparableText(type)))) {
|
|
67
|
+
throw new Error(`"${type}" is no damage type of ${system.name}: give one of ${named.join(", ")}. Nothing changed.`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/** Whether a text names a word, whole: "bludgeoning, piercing, and slashing from nonmagical attacks" names slashing. */
|
|
71
|
+
function namesWord(text, word) {
|
|
72
|
+
const words = (value) => ` ${comparableText(value).replace(/[^\p{L}\p{N}]+/gu, " ").trim()} `;
|
|
73
|
+
return words(text).includes(words(word));
|
|
74
|
+
}
|
|
@@ -44,6 +44,11 @@ export interface SeenEffect {
|
|
|
44
44
|
condition?: true;
|
|
45
45
|
/** The condition's drawing, when the system gives one (D-419): the d of an SVG path on a grid of 24. */
|
|
46
46
|
icon?: string;
|
|
47
|
+
/** For something that burns, as a torch, what it spends and how many of it are still carried (UPK-3). */
|
|
48
|
+
burns?: {
|
|
49
|
+
fuel: string;
|
|
50
|
+
left: number;
|
|
51
|
+
};
|
|
47
52
|
}
|
|
48
53
|
/** An effect as the dashboard shows it on someone of the party: its name, its end, the line status gives, and whether it is a condition (D-276, D-314, D-419). */
|
|
49
54
|
export declare function effectParts(world: World, system: GameSystem | undefined, effect: Effect): SeenEffect;
|
|
@@ -8,7 +8,7 @@ import { effectiveFields, effectsField, effectsOf, valuesChanged, withEffects }
|
|
|
8
8
|
import { copyPage, updateScene } from "./game-scene.js";
|
|
9
9
|
import { newDatedLogEntry } from "./game-time.js";
|
|
10
10
|
import { shortList } from "./notes.js";
|
|
11
|
-
import { computedField,
|
|
11
|
+
import { computedField, directBonuses } from "./worked-out.js";
|
|
12
12
|
/**
|
|
13
13
|
* Writes a holder's effects; the field goes when none is left. What a current has above its written maximum that the maximum, as these effects leave it, no
|
|
14
14
|
* longer allows goes, as when Aid ends, with a line in the log (FOR-6). Returns the page as written, or undefined for a copy.
|
|
@@ -181,7 +181,7 @@ function computedValueProblems(world, page, path, effect, endIt) {
|
|
|
181
181
|
const fields = effectiveFields(world, page);
|
|
182
182
|
return effect.values.flatMap(([field]) => {
|
|
183
183
|
const computed = computedField(world, field, fields);
|
|
184
|
-
const instead = computed === undefined ? [] : [...
|
|
184
|
+
const instead = computed === undefined ? [] : [...directBonuses(world, computed), ...computed.from];
|
|
185
185
|
return computed === undefined ? [] : [{
|
|
186
186
|
path,
|
|
187
187
|
message: `${effect.name} on ${page.name} gives ${computed.name}, which the system ${world.system?.name ?? ""} works out, so it does not count.`,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { appendLogEntry } from "../core/log.js";
|
|
2
2
|
import { comparableText } from "../core/text.js";
|
|
3
3
|
import { formatCounter, readCounter } from "../counters/index.js";
|
|
4
|
-
import { backlinks, containerFieldOf, isEmptyField, isInParty, linksIn, locate, newPageFields, pagesWithName, pageWithPath, parsePageReference, standardValues, systemLabel, systemPageNamed, withPage, writePage, } from "../pages/index.js";
|
|
4
|
+
import { backlinks, containerFieldOf, isCountedItem, isEmptyField, isInParty, linksIn, locate, newPageFields, pagesWithName, pageWithPath, parsePageReference, standardValues, systemLabel, systemPageNamed, withPage, writePage, } from "../pages/index.js";
|
|
5
5
|
import { formatDuration, formatGameDate, minutesBetween, readGameDate } from "../time/index.js";
|
|
6
6
|
import { formatTrigger, readTriggers, triggerHolds } from "../triggers/index.js";
|
|
7
7
|
import { newDatedLogEntry } from "./game-time.js";
|
|
@@ -72,8 +72,8 @@ export function plannedText(event, now) {
|
|
|
72
72
|
/** What to do with due events (D-106): seen or heard, a scene; out of sight, off screen; then their status, or a later date. */
|
|
73
73
|
export function dueAdvice(count) {
|
|
74
74
|
return count === 1
|
|
75
|
-
? "If the characters see or hear it, play it as a scene; if not, it happens off screen, and they will find its traces. Then set its status: happened if it went as written, cancelled if it never will; or give it a later date if it is put off or tried again."
|
|
76
|
-
: "Play as scenes those the characters see or hear; the others happen off screen, and they will find their traces. Then set each one's status: happened if it went as written, cancelled if it never will; or give it a later date if it is put off or tried again.";
|
|
75
|
+
? "If the characters see or hear it, play it as a scene; if not, it happens off screen, and they will find its traces. Then set its status: happened if it went as written, cancelled if it never will; or give it a later date if it is put off or tried again. If what it needs is gone, cancel it, or let whoever wanted it try another way; never bend the world back to the written story."
|
|
76
|
+
: "Play as scenes those the characters see or hear; the others happen off screen, and they will find their traces. Then set each one's status: happened if it went as written, cancelled if it never will; or give it a later date if it is put off or tried again. If what it needs is gone, cancel it, or let whoever wanted it try another way; never bend the world back to the written story.";
|
|
77
77
|
}
|
|
78
78
|
/**
|
|
79
79
|
* Fires the planned events that a command set off (EVT-4): each gets the present date, unless it has one that has come, and a hidden line in the log.
|
|
@@ -247,12 +247,16 @@ function whenProblem(world, when) {
|
|
|
247
247
|
const read = readTriggers(when);
|
|
248
248
|
return "problem" in read ? read.problem : read.triggers.map((trigger) => statusProblem(world, trigger) ?? systemConditionProblem(world, trigger)).find((problem) => problem !== undefined);
|
|
249
249
|
}
|
|
250
|
-
/** A condition on a page of the game system, which no page of the campaign hides: it can never hold (SYS-2). */
|
|
250
|
+
/** A condition on a page of the game system, which no page of the campaign hides, or on a kind counted in stacks: it can never hold (SYS-2, STK-3). */
|
|
251
251
|
function systemConditionProblem(world, trigger) {
|
|
252
252
|
const system = namedPages(trigger)
|
|
253
253
|
.filter((name) => pagesWithName(world, name).length === 0)
|
|
254
254
|
.map((name) => systemPageNamed(world, name))
|
|
255
255
|
.find((page) => page !== undefined);
|
|
256
|
+
const kind = namedPages(trigger).flatMap((name) => pagesWithName(world, name).slice(0, 1)).find((page) => isCountedItem(world, page));
|
|
257
|
+
if (system === undefined && kind !== undefined) {
|
|
258
|
+
return `[[${kind.name}]] is a kind, counted in stacks: never anywhere, so the condition on it can never hold. Name a thing with a story of its own instead.`;
|
|
259
|
+
}
|
|
256
260
|
return system === undefined ? undefined : systemConditionText(system);
|
|
257
261
|
}
|
|
258
262
|
/** "[[Wolf]] is a creature of the system 5e, a kind: never anywhere, never dead, so the condition on it can never hold. …" */
|
|
@@ -63,8 +63,8 @@ export function levelDueNote(name, experience, companion) {
|
|
|
63
63
|
}
|
|
64
64
|
const rules = experience.rules === undefined ? "" : `: read rules "${experience.rules}"`;
|
|
65
65
|
const how = companion
|
|
66
|
-
? "level up the companion:
|
|
67
|
-
: "level up with the player, out of the story, now or at the next rest as they prefer; they choose
|
|
66
|
+
? "level up the companion: what the new level asks is yours to choose, as the story has shaped the companion, or the player's if they made it"
|
|
67
|
+
: "level up with the player, out of the story, now or at the next rest as they prefer; they choose what the new level asks";
|
|
68
68
|
return `${name} has the ${experience.field} for level ${experience.due}: ${how}${rules}.`;
|
|
69
69
|
}
|
|
70
70
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Context } from "../core/context.ts";
|
|
2
2
|
import type { Problem } from "../core/problem.ts";
|
|
3
3
|
import { type Command } from "../core/registry.ts";
|
|
4
|
-
import type { Extension } from "../extensions/index.ts";
|
|
4
|
+
import type { Extension, ExtensionCode, GameView } from "../extensions/index.ts";
|
|
5
5
|
import { type GameDate } from "../time/index.ts";
|
|
6
6
|
/** The folder of the campaign where an extension keeps its own files, its state among them (D-433, D-436). */
|
|
7
7
|
export declare const extensionsFolderName = "extensions";
|
|
@@ -25,3 +25,10 @@ export declare function extensionCodeProblems(root: string, context: Context, ta
|
|
|
25
25
|
* whatever they do: one that fails says so in its line, never in place of the output.
|
|
26
26
|
*/
|
|
27
27
|
export declare function timePassedLines(root: string, context: Context, from: GameDate, to: GameDate): Promise<string[]>;
|
|
28
|
+
/**
|
|
29
|
+
* The code of an extension, when it may run (D-441): its module's default export, given the kit. Where the engine itself runs from its source, as in the tests,
|
|
30
|
+
* an extension that ships its source too is loaded from it.
|
|
31
|
+
*/
|
|
32
|
+
export declare function extensionCode(extension: Extension): Promise<ExtensionCode | undefined>;
|
|
33
|
+
/** The game as a widget of an extension reads it (D-502): the game its commands reach, without the dice, the log or writing. */
|
|
34
|
+
export declare function gameViewOf(root: string, context: Context, extension: Extension): GameView;
|
|
@@ -16,7 +16,7 @@ import { appendLogEntry } from "../core/log.js";
|
|
|
16
16
|
import { defineCommand } from "../core/registry.js";
|
|
17
17
|
import { files } from "../core/store.js";
|
|
18
18
|
import { rollDice } from "../dice/index.js";
|
|
19
|
-
import { environmentAt, isInParty, locate } from "../pages/index.js";
|
|
19
|
+
import { environmentAt, isInParty, locate, playerCharacters } from "../pages/index.js";
|
|
20
20
|
import { formatGameDate } from "../time/index.js";
|
|
21
21
|
import { campaignExtensions, runsCode } from "./game-extension-list.js";
|
|
22
22
|
import { calendarDayOf, newDatedLogEntry, presentDate } from "./game-time.js";
|
|
@@ -119,7 +119,7 @@ let installs = 0;
|
|
|
119
119
|
* The code of an extension, when it may run (D-441): its module's default export, given the kit. Where the engine itself runs from its source, as in the tests,
|
|
120
120
|
* an extension that ships its source too is loaded from it.
|
|
121
121
|
*/
|
|
122
|
-
function extensionCode(extension) {
|
|
122
|
+
export function extensionCode(extension) {
|
|
123
123
|
const source = join(extension.folder, "src", "index.ts");
|
|
124
124
|
const entry = !runsCode(extension) ? undefined : import.meta.url.endsWith(".ts") && files().exists(source) ? source : extension.code;
|
|
125
125
|
if (entry === undefined) {
|
|
@@ -151,7 +151,7 @@ function gameOf(root, context, extension) {
|
|
|
151
151
|
units: () => (readTextSetting(root, "units") === "imperial" ? "imperial" : "metric"),
|
|
152
152
|
party: () => {
|
|
153
153
|
const world = campaignWorld(root, context);
|
|
154
|
-
const player = world.
|
|
154
|
+
const player = playerCharacters(world).find(isInParty);
|
|
155
155
|
return player === undefined
|
|
156
156
|
? undefined
|
|
157
157
|
: {
|
|
@@ -166,6 +166,11 @@ function gameOf(root, context, extension) {
|
|
|
166
166
|
log: (text, visibility = "hidden") => appendLogEntry(root, newDatedLogEntry(root, context, "extension", visibility, { extension: extension.name, text })),
|
|
167
167
|
};
|
|
168
168
|
}
|
|
169
|
+
/** The game as a widget of an extension reads it (D-502): the game its commands reach, without the dice, the log or writing. */
|
|
170
|
+
export function gameViewOf(root, context, extension) {
|
|
171
|
+
const { now, calendarDay, units, party, state } = gameOf(root, context, extension);
|
|
172
|
+
return { now, calendarDay, units, party, state: { read: state.read } };
|
|
173
|
+
}
|
|
169
174
|
/** A game date as the API gives it: as written, its day and minute, and its day of the calendar. */
|
|
170
175
|
function momentOf(root, context, date) {
|
|
171
176
|
const calendar = calendarDayOf(root, context, date.day);
|
|
@@ -26,7 +26,10 @@ export declare function sideOf(world: World, rules: GridRules, scene: Scene | un
|
|
|
26
26
|
export declare function isTurnOf(scene: Scene | undefined, name: string): boolean;
|
|
27
27
|
/** How many squares the one whose turn it is has moved in it, as the scene keeps it (GRD-5): 0 at the start of a turn. */
|
|
28
28
|
export declare function movedThisTurn(scene: Scene): number;
|
|
29
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* One's walking speed (GRD-5, SPD-1): the one the system works out now, in its unit, where it has a value; else the field the system names as written. With its
|
|
31
|
+
* first length in metres, when it gives one.
|
|
32
|
+
*/
|
|
30
33
|
export declare function walkingSpeed(world: World, rules: GridRules, measures: Measures, scene: Scene | undefined, one: Standing): {
|
|
31
34
|
written: unknown;
|
|
32
35
|
metres?: number;
|
|
@@ -6,6 +6,7 @@ import { closedSquare, coveredSquares, isNextTo, shortestWay, squareName } from
|
|
|
6
6
|
import { isEmptyField, isPartyMember } from "../pages/index.js";
|
|
7
7
|
import { effectiveFields } from "./effect-layer.js";
|
|
8
8
|
import { copyPage } from "./game-scene.js";
|
|
9
|
+
import { signedText, workedFields } from "./worked-out.js";
|
|
9
10
|
/** The facts of a move on a place's map (GRD-5), as the game's grid counts them; nothing to tell when the game has no grid. */
|
|
10
11
|
export function moveFacts(world, system, measures, scene, move) {
|
|
11
12
|
const rules = system?.grid;
|
|
@@ -54,10 +55,15 @@ export function movedThisTurn(scene) {
|
|
|
54
55
|
const counted = scene.moved !== undefined && scene.turn !== undefined && scene.moved.round === (scene.round ?? 1) && comparableText(scene.moved.turn) === comparableText(scene.turn);
|
|
55
56
|
return counted ? (scene.moved?.squares ?? 0) : 0;
|
|
56
57
|
}
|
|
57
|
-
/**
|
|
58
|
+
/**
|
|
59
|
+
* One's walking speed (GRD-5, SPD-1): the one the system works out now, in its unit, where it has a value; else the field the system names as written. With its
|
|
60
|
+
* first length in metres, when it gives one.
|
|
61
|
+
*/
|
|
58
62
|
export function walkingSpeed(world, rules, measures, scene, one) {
|
|
59
63
|
const page = standingPage(scene, one);
|
|
60
|
-
const
|
|
64
|
+
const fields = page === undefined ? undefined : effectiveFields(world, page);
|
|
65
|
+
const worked = fields === undefined || rules.walking === undefined ? undefined : workedFields(world, fields).find((field) => comparableText(field.field) === comparableText(rules.walking ?? ""));
|
|
66
|
+
const written = typeof worked?.value === "number" ? signedText(world, worked.field, worked.value) : fields === undefined ? undefined : valueNamed(fields, rules.speed);
|
|
61
67
|
const metres = readFirstLength(written, measures.imperial);
|
|
62
68
|
return { written, ...(metres === undefined ? {} : { metres }) };
|
|
63
69
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { Context } from "../core/context.ts";
|
|
2
|
+
import { type Page, type World } from "../pages/index.ts";
|
|
3
|
+
import type { GameSystem, Recipe } from "../systems/index.ts";
|
|
4
|
+
/** Dice spent: the line that says it, with the rules they touched; the faces, what each die adds and what they gave, and the id of the roll's line in the log. */
|
|
5
|
+
export interface DiceSpent {
|
|
6
|
+
text: string;
|
|
7
|
+
notes: string[];
|
|
8
|
+
faces: number[];
|
|
9
|
+
adds: number;
|
|
10
|
+
total: number;
|
|
11
|
+
id: string;
|
|
12
|
+
}
|
|
13
|
+
/** A counter of dice a recipe lets a page spend, as hit-dice-d8 3/5: its die, what each adds, and the counter it gives to. */
|
|
14
|
+
export interface RestDice {
|
|
15
|
+
field: string;
|
|
16
|
+
sides: number;
|
|
17
|
+
value: number;
|
|
18
|
+
max: number;
|
|
19
|
+
adds: number;
|
|
20
|
+
gives: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Spends dice of a counter named after its die, as hit-dice-d8, in a recipe that lets one (D-449): each die rolled with what the recipe adds, at least 0, the
|
|
24
|
+
* total given to its counter up to the maximum, the dice taken from theirs, each on the effect that gives it, if one does (EFF-7); the line that says it, with the
|
|
25
|
+
* rules a party member's counters touch (DAT-3). `how` gives the why, the check that names the roll in the log, as the player's own rolls are named (ASK-14),
|
|
26
|
+
* and the faces of physical dice, one for each die (ASK-8). Refused when the recipe spends no such counter, there are not as many, or the faces are not one a die.
|
|
27
|
+
*/
|
|
28
|
+
export declare function spendDice(root: string, context: Context, world: World, spending: {
|
|
29
|
+
system: GameSystem;
|
|
30
|
+
recipe: Recipe;
|
|
31
|
+
}, name: string, field: string, amount: unknown, how: {
|
|
32
|
+
why: string;
|
|
33
|
+
check?: string;
|
|
34
|
+
values?: number[];
|
|
35
|
+
}): DiceSpent;
|
|
36
|
+
/** The counters of dice a recipe lets this page spend, as the page reads them, with a maximum above 0: those at 0 too, as a page shows them spent. */
|
|
37
|
+
export declare function restDice(world: World, recipe: Recipe, page: Page): RestDice[];
|
|
38
|
+
/** The counters of dice worth spending, as hit-dice-d8 2/3: some left, and the counter they give to below its maximum, where they would give something. */
|
|
39
|
+
export declare function spendableDice(world: World, recipe: Recipe, page: Page): string[];
|