rpg-engine 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/adventures/index.d.ts +3 -0
- package/dist/adventures/index.js +5 -0
- package/dist/adventures/manifest.d.ts +39 -0
- package/dist/adventures/manifest.js +89 -0
- package/dist/adventures/placement.d.ts +4 -0
- package/dist/adventures/placement.js +14 -0
- package/dist/adventures/source.d.ts +21 -0
- package/dist/adventures/source.js +108 -0
- package/dist/bell-listener.d.ts +9 -0
- package/dist/bell-listener.js +83 -0
- package/dist/campaign/create-campaign.d.ts +3 -2
- package/dist/campaign/create-campaign.js +5 -5
- package/dist/campaign/host-files.d.ts +23 -6
- package/dist/campaign/host-files.js +130 -40
- package/dist/campaign/index.d.ts +2 -2
- package/dist/campaign/index.js +2 -2
- package/dist/campaign/settings.d.ts +33 -2
- package/dist/campaign/settings.js +49 -12
- package/dist/cli.js +10 -1
- package/dist/command-line.js +20 -2
- package/dist/commands/advance.js +6 -2
- package/dist/commands/ask.d.ts +11 -4
- package/dist/commands/ask.js +249 -23
- package/dist/commands/change.d.ts +29 -0
- package/dist/commands/change.js +260 -41
- package/dist/commands/config.d.ts +6 -3
- package/dist/commands/config.js +179 -79
- package/dist/commands/effect.js +38 -9
- package/dist/commands/game-advance.d.ts +11 -2
- package/dist/commands/game-advance.js +22 -7
- package/dist/commands/game-adventures.d.ts +70 -0
- package/dist/commands/game-adventures.js +418 -0
- package/dist/commands/game-bonds.d.ts +9 -0
- package/dist/commands/game-bonds.js +84 -0
- package/dist/commands/game-catalog.d.ts +36 -0
- package/dist/commands/game-catalog.js +122 -0
- package/dist/commands/game-checks.d.ts +17 -0
- package/dist/commands/game-checks.js +128 -0
- package/dist/commands/game-damage.d.ts +18 -0
- package/dist/commands/game-damage.js +74 -0
- package/dist/commands/game-effects.d.ts +5 -0
- package/dist/commands/game-effects.js +2 -2
- package/dist/commands/game-events.js +8 -4
- package/dist/commands/game-experience.js +2 -2
- package/dist/commands/game-extensions.d.ts +8 -1
- package/dist/commands/game-extensions.js +8 -3
- package/dist/commands/game-grid-moves.d.ts +4 -1
- package/dist/commands/game-grid-moves.js +8 -2
- package/dist/commands/game-hit-dice.d.ts +39 -0
- package/dist/commands/game-hit-dice.js +120 -0
- package/dist/commands/game-import.d.ts +11 -0
- package/dist/commands/game-import.js +154 -0
- package/dist/commands/game-journey.d.ts +6 -2
- package/dist/commands/game-journey.js +17 -6
- package/dist/commands/game-knowledge.d.ts +56 -6
- package/dist/commands/game-knowledge.js +152 -23
- package/dist/commands/game-library.d.ts +112 -0
- package/dist/commands/game-library.js +388 -0
- package/dist/commands/game-limits.d.ts +7 -0
- package/dist/commands/game-limits.js +67 -0
- package/dist/commands/game-mode.js +3 -3
- package/dist/commands/game-moves.d.ts +14 -1
- package/dist/commands/game-moves.js +24 -9
- package/dist/commands/game-recipe-pace.d.ts +6 -0
- package/dist/commands/game-recipe-pace.js +25 -0
- package/dist/commands/game-recipes.js +10 -3
- package/dist/commands/game-reminders.d.ts +3 -3
- package/dist/commands/game-reminders.js +10 -5
- package/dist/commands/game-roads.d.ts +11 -4
- package/dist/commands/game-roads.js +89 -26
- package/dist/commands/game-saves.d.ts +12 -0
- package/dist/commands/game-saves.js +44 -5
- package/dist/commands/game-scene.js +3 -1
- package/dist/commands/game-stacks.d.ts +78 -0
- package/dist/commands/game-stacks.js +198 -0
- package/dist/commands/game-system-code.d.ts +25 -0
- package/dist/commands/game-system-code.js +165 -0
- package/dist/commands/game-thoughts.d.ts +25 -0
- package/dist/commands/game-thoughts.js +57 -0
- package/dist/commands/game-turn-uses.d.ts +33 -0
- package/dist/commands/game-turn-uses.js +137 -0
- package/dist/commands/game-upkeep.d.ts +20 -0
- package/dist/commands/game-upkeep.js +190 -0
- package/dist/commands/game-view-journal.d.ts +14 -1
- package/dist/commands/game-view-journal.js +5 -2
- package/dist/commands/game-view-map.d.ts +3 -0
- package/dist/commands/game-view-map.js +5 -1
- package/dist/commands/game-view-place.d.ts +22 -3
- package/dist/commands/game-view-place.js +61 -24
- package/dist/commands/game-view-world.d.ts +98 -0
- package/dist/commands/game-view-world.js +98 -0
- package/dist/commands/game-voices.d.ts +5 -0
- package/dist/commands/game-voices.js +13 -0
- package/dist/commands/game-widgets.d.ts +66 -0
- package/dist/commands/game-widgets.js +274 -0
- package/dist/commands/game-world.d.ts +8 -1
- package/dist/commands/game-world.js +23 -3
- package/dist/commands/image.js +2 -3
- package/dist/commands/import.d.ts +47 -0
- package/dist/commands/import.js +390 -0
- package/dist/commands/index.js +6 -0
- package/dist/commands/init.js +2 -2
- package/dist/commands/install.js +2 -1
- package/dist/commands/instructions.js +26 -1
- package/dist/commands/mode.js +3 -1
- package/dist/commands/move.d.ts +2 -0
- package/dist/commands/move.js +86 -12
- package/dist/commands/package.d.ts +57 -3
- package/dist/commands/package.js +304 -49
- package/dist/commands/parts.d.ts +3 -0
- package/dist/commands/parts.js +5 -0
- package/dist/commands/problems.js +6 -0
- package/dist/commands/rename.js +3 -0
- package/dist/commands/reveal.js +12 -7
- package/dist/commands/roll.d.ts +2 -0
- package/dist/commands/roll.js +23 -7
- package/dist/commands/route.js +4 -5
- package/dist/commands/rules.d.ts +3 -0
- package/dist/commands/rules.js +38 -6
- package/dist/commands/save.d.ts +1 -1
- package/dist/commands/save.js +2 -2
- package/dist/commands/scene.d.ts +10 -1
- package/dist/commands/scene.js +146 -29
- package/dist/commands/sheet.d.ts +47 -6
- package/dist/commands/sheet.js +179 -33
- package/dist/commands/show.d.ts +33 -0
- package/dist/commands/show.js +19 -2
- package/dist/commands/status.d.ts +9 -3
- package/dist/commands/status.js +59 -17
- package/dist/commands/thoughts.d.ts +11 -0
- package/dist/commands/thoughts.js +54 -0
- package/dist/commands/trade.d.ts +17 -0
- package/dist/commands/trade.js +273 -0
- package/dist/commands/travel.d.ts +2 -0
- package/dist/commands/travel.js +40 -14
- package/dist/commands/validate.js +2 -1
- package/dist/commands/view.d.ts +99 -2
- package/dist/commands/view.js +273 -57
- package/dist/commands/worked-out.d.ts +16 -0
- package/dist/commands/worked-out.js +108 -13
- package/dist/commands/write.d.ts +1 -0
- package/dist/commands/write.js +93 -21
- package/dist/confirm/confirm.d.ts +35 -0
- package/dist/confirm/confirm.js +94 -0
- package/dist/confirm/index.d.ts +1 -0
- package/dist/confirm/index.js +3 -0
- package/dist/core/archive-paths.d.ts +8 -0
- package/dist/core/archive-paths.js +39 -0
- package/dist/core/context.d.ts +127 -5
- package/dist/core/context.js +4 -3
- package/dist/core/download.d.ts +2 -0
- package/dist/core/download.js +31 -0
- package/dist/core/field-kind.d.ts +4 -3
- package/dist/core/field-kind.js +4 -3
- package/dist/core/files.d.ts +10 -0
- package/dist/core/files.js +58 -2
- package/dist/core/formula.d.ts +3 -1
- package/dist/core/formula.js +13 -2
- package/dist/core/progression-rule.d.ts +2 -0
- package/dist/core/version.d.ts +2 -0
- package/dist/core/version.js +7 -0
- package/dist/dashboard/act-names.js +27 -0
- package/dist/dashboard/act-sheet.js +100 -0
- package/dist/dashboard/act-strip.js +49 -0
- package/dist/dashboard/acts.js +140 -0
- package/dist/dashboard/address.js +16 -12
- package/dist/dashboard/api.js +140 -10
- package/dist/dashboard/app.js +370 -41
- package/dist/dashboard/asked.js +297 -19
- package/dist/dashboard/calendar.js +56 -0
- package/dist/dashboard/card.js +13 -12
- package/dist/dashboard/coins.js +13 -0
- package/dist/dashboard/death-save.js +67 -0
- package/dist/dashboard/dice/pool.js +22 -0
- package/dist/dashboard/dice/roller.js +1 -1
- package/dist/dashboard/dice/stage.js +12 -4
- package/dist/dashboard/dice/tray.js +28 -15
- package/dist/dashboard/dying.js +46 -0
- package/dist/dashboard/extension-widgets.js +160 -0
- package/dist/dashboard/game-words.js +33 -4
- package/dist/dashboard/guide/ar.md +105 -100
- package/dist/dashboard/guide/cs.md +111 -106
- package/dist/dashboard/guide/da.md +95 -90
- package/dist/dashboard/guide/de.md +93 -88
- package/dist/dashboard/guide/el.md +110 -105
- package/dist/dashboard/guide/en.md +21 -16
- package/dist/dashboard/guide/es.md +79 -74
- package/dist/dashboard/guide/fi.md +99 -94
- package/dist/dashboard/guide/fr.md +83 -78
- package/dist/dashboard/guide/he.md +109 -104
- package/dist/dashboard/guide/hi.md +103 -98
- package/dist/dashboard/guide/hu.md +113 -108
- package/dist/dashboard/guide/is.md +102 -97
- package/dist/dashboard/guide/it.md +22 -17
- package/dist/dashboard/guide/ja.md +108 -103
- package/dist/dashboard/guide/ko.md +113 -108
- package/dist/dashboard/guide/nb.md +95 -90
- package/dist/dashboard/guide/nl.md +89 -84
- package/dist/dashboard/guide/pl.md +104 -99
- package/dist/dashboard/guide/pt.md +82 -77
- package/dist/dashboard/guide/ro.md +113 -108
- package/dist/dashboard/guide/ru.md +109 -104
- package/dist/dashboard/guide/sv.md +96 -91
- package/dist/dashboard/guide/tr.md +102 -97
- package/dist/dashboard/guide/uk.md +113 -108
- package/dist/dashboard/guide/zh.md +110 -105
- package/dist/dashboard/guide-markdown.js +4 -0
- package/dist/dashboard/help.js +4 -5
- package/dist/dashboard/i18n/ar.json +361 -16
- package/dist/dashboard/i18n/cs.json +361 -16
- package/dist/dashboard/i18n/da.json +361 -16
- package/dist/dashboard/i18n/de.json +361 -16
- package/dist/dashboard/i18n/el.json +361 -16
- package/dist/dashboard/i18n/es.json +361 -16
- package/dist/dashboard/i18n/fi.json +361 -16
- package/dist/dashboard/i18n/fr.json +361 -16
- package/dist/dashboard/i18n/he.json +361 -16
- package/dist/dashboard/i18n/hi.json +361 -16
- package/dist/dashboard/i18n/hu.json +361 -16
- package/dist/dashboard/i18n/is.json +361 -16
- package/dist/dashboard/i18n/it.json +363 -18
- package/dist/dashboard/i18n/ja.json +361 -16
- package/dist/dashboard/i18n/ko.json +361 -16
- package/dist/dashboard/i18n/nb.json +361 -16
- package/dist/dashboard/i18n/nl.json +361 -16
- package/dist/dashboard/i18n/pl.json +361 -16
- package/dist/dashboard/i18n/pt.json +361 -16
- package/dist/dashboard/i18n/ro.json +361 -16
- package/dist/dashboard/i18n/ru.json +361 -16
- package/dist/dashboard/i18n/sv.json +361 -16
- package/dist/dashboard/i18n/tr.json +361 -16
- package/dist/dashboard/i18n/uk.json +361 -16
- package/dist/dashboard/i18n/zh.json +361 -16
- package/dist/dashboard/icons.js +38 -4
- package/dist/dashboard/journal.js +203 -49
- package/dist/dashboard/labels.js +42 -4
- package/dist/dashboard/languages.js +2 -2
- package/dist/dashboard/layout.js +35 -0
- package/dist/dashboard/lore.js +44 -0
- package/dist/dashboard/markdown.js +136 -30
- package/dist/dashboard/master.js +2 -2
- package/dist/dashboard/notes.js +5 -5
- package/dist/dashboard/notices.js +24 -4
- package/dist/dashboard/packages.js +678 -0
- package/dist/dashboard/pages.js +0 -8
- package/dist/dashboard/party.js +17 -4
- package/dist/dashboard/place-map-view.js +47 -9
- package/dist/dashboard/rolls.js +35 -93
- package/dist/dashboard/save-outcome.js +42 -0
- package/dist/dashboard/saves.js +14 -11
- package/dist/dashboard/scene.js +114 -20
- package/dist/dashboard/settings.js +70 -12
- package/dist/dashboard/setup.js +4 -4
- package/dist/dashboard/sheet.js +123 -19
- package/dist/dashboard/spend.js +115 -0
- package/dist/dashboard/status.js +22 -10
- package/dist/dashboard/story.js +6 -6
- package/dist/dashboard/style.css +8047 -3468
- package/dist/dashboard/table.js +145 -0
- package/dist/dashboard/tabs.js +34 -0
- package/dist/dashboard/text.js +19 -1
- package/dist/dashboard/top.js +91 -31
- package/dist/dashboard/turns.js +150 -0
- package/dist/dashboard/widgets.js +21 -14
- package/dist/dashboard/world-calendar.js +101 -0
- package/dist/dashboard/world-lore.js +231 -0
- package/dist/dashboard/world.js +87 -29
- package/dist/dashboard-server.d.ts +10 -1
- package/dist/dashboard-server.js +738 -26
- package/dist/documents/index.d.ts +2 -0
- package/dist/documents/index.js +5 -0
- package/dist/documents/markup.d.ts +10 -0
- package/dist/documents/markup.js +124 -0
- package/dist/documents/ocr.d.ts +9 -0
- package/dist/documents/ocr.js +101 -0
- package/dist/documents/png.d.ts +9 -0
- package/dist/documents/png.js +75 -0
- package/dist/documents/read.d.ts +54 -0
- package/dist/documents/read.js +375 -0
- package/dist/extensions/api.d.ts +91 -9
- package/dist/extensions/extension.d.ts +28 -2
- package/dist/extensions/extension.js +49 -11
- package/dist/extensions/index.d.ts +5 -3
- package/dist/extensions/index.js +4 -2
- package/dist/extensions/packages.d.ts +13 -4
- package/dist/extensions/packages.js +114 -16
- package/dist/extensions/tarball.d.ts +6 -0
- package/dist/extensions/tarball.js +87 -0
- package/dist/extensions/words.d.ts +13 -0
- package/dist/extensions/words.js +42 -0
- package/dist/importer/index.d.ts +1 -0
- package/dist/importer/index.js +3 -0
- package/dist/importer/work.d.ts +132 -0
- package/dist/importer/work.js +306 -0
- package/dist/index.d.ts +3 -1
- package/dist/instructions/index.d.ts +7 -0
- package/dist/instructions/index.js +10 -0
- package/dist/languages/index.d.ts +1 -0
- package/dist/languages/index.js +3 -0
- package/dist/languages/language-pack.d.ts +32 -0
- package/dist/languages/language-pack.js +86 -0
- package/dist/library/books.d.ts +76 -0
- package/dist/library/books.js +378 -0
- package/dist/library/folders.d.ts +11 -0
- package/dist/library/folders.js +70 -0
- package/dist/library/index.d.ts +3 -0
- package/dist/library/index.js +5 -0
- package/dist/library/language.d.ts +2 -0
- package/dist/library/language.js +40 -0
- package/dist/library-reader.d.ts +7 -0
- package/dist/library-reader.js +36 -0
- package/dist/mcp-server.js +90 -7
- package/dist/money/index.d.ts +1 -1
- package/dist/money/index.js +1 -1
- package/dist/money/money.d.ts +6 -0
- package/dist/money/money.js +11 -0
- package/dist/page-words.js +4 -1
- package/dist/pages/check.d.ts +5 -0
- package/dist/pages/check.js +111 -5
- package/dist/pages/containers.d.ts +19 -1
- package/dist/pages/containers.js +50 -7
- package/dist/pages/index.d.ts +8 -5
- package/dist/pages/index.js +8 -5
- package/dist/pages/load.d.ts +11 -0
- package/dist/pages/load.js +69 -0
- package/dist/pages/markdown.d.ts +7 -0
- package/dist/pages/markdown.js +27 -3
- package/dist/pages/page-file.d.ts +2 -0
- package/dist/pages/page-file.js +28 -5
- package/dist/pages/rename-page.js +3 -2
- package/dist/pages/stack-entry.d.ts +47 -0
- package/dist/pages/stack-entry.js +83 -0
- package/dist/pages/stack-writes.d.ts +22 -0
- package/dist/pages/stack-writes.js +128 -0
- package/dist/pages/stacks.d.ts +52 -0
- package/dist/pages/stacks.js +168 -0
- package/dist/pages/standard-fields.js +1 -1
- package/dist/pages/system-pages.d.ts +5 -2
- package/dist/pages/system-pages.js +11 -5
- package/dist/pages/world.d.ts +29 -3
- package/dist/pages/world.js +66 -12
- package/dist/pages/write-page.js +15 -6
- package/dist/pictures/chosen.d.ts +5 -1
- package/dist/pictures/chosen.js +12 -3
- package/dist/pictures/claude.d.ts +3 -1
- package/dist/pictures/claude.js +38 -0
- package/dist/pictures/codex.d.ts +3 -1
- package/dist/pictures/codex.js +32 -0
- package/dist/pictures/helpers.d.ts +10 -0
- package/dist/pictures/helpers.js +53 -6
- package/dist/pictures/index.d.ts +5 -4
- package/dist/pictures/index.js +5 -4
- package/dist/pictures/stop.d.ts +2 -0
- package/dist/pictures/stop.js +18 -0
- package/dist/player-acts.d.ts +27 -0
- package/dist/player-acts.js +56 -0
- package/dist/rules/index.d.ts +1 -0
- package/dist/rules/index.js +3 -1
- package/dist/rules/page-search.d.ts +36 -0
- package/dist/rules/page-search.js +216 -0
- package/dist/rules/search.d.ts +7 -0
- package/dist/rules/search.js +2 -2
- package/dist/scene/scene.d.ts +2 -0
- package/dist/scene/scene.js +1 -0
- package/dist/systems/game-system.d.ts +161 -4
- package/dist/systems/game-system.js +237 -34
- package/dist/systems/index.d.ts +3 -1
- package/dist/systems/index.js +3 -1
- package/dist/systems/system-code.d.ts +97 -0
- package/dist/systems/system-code.js +62 -0
- package/dist/systems/system-folders.d.ts +11 -0
- package/dist/systems/system-folders.js +11 -0
- package/dist/systems/words.d.ts +2 -0
- package/dist/systems/words.js +3 -3
- package/instructions/author.md +1 -1
- package/instructions/buttons-physical-dice.md +1 -1
- package/instructions/buttons.md +1 -1
- package/instructions/character.md +15 -0
- package/instructions/combat.md +3 -1
- package/instructions/core.md +4 -4
- package/instructions/dashboard.md +4 -4
- package/instructions/import.md +14 -0
- package/instructions/mentor-hints.md +1 -1
- package/instructions/party.md +11 -0
- package/instructions/play.md +5 -5
- package/instructions/session-zero.md +1 -1
- package/instructions/setup.md +1 -1
- package/instructions/voices-always.md +1 -0
- package/instructions/voices-important.md +1 -0
- package/instructions/voices.md +14 -0
- package/package.json +6 -2
- package/systems/5e/LICENSE.md +1 -1
- package/systems/5e/dist/dying.js +193 -0
- package/systems/5e/dist/index.js +3 -0
- package/systems/5e/images/abacus.svg +1 -0
- package/systems/5e/images/acid-tube.svg +1 -0
- package/systems/5e/images/animal-hide.svg +1 -0
- package/systems/5e/images/anvil.svg +1 -0
- package/systems/5e/images/arrow-cluster.svg +1 -0
- package/systems/5e/images/backpack.svg +1 -0
- package/systems/5e/images/bagpipes.svg +1 -0
- package/systems/5e/images/barbed-spear.svg +1 -0
- package/systems/5e/images/barrel.svg +1 -0
- package/systems/5e/images/basket.svg +1 -0
- package/systems/5e/images/battle-axe.svg +1 -0
- package/systems/5e/images/beer-horn.svg +1 -0
- package/systems/5e/images/belt-buckles.svg +1 -0
- package/systems/5e/images/bird-scepter.svg +1 -0
- package/systems/5e/images/blanket.svg +1 -0
- package/systems/5e/images/book-cover.svg +1 -0
- package/systems/5e/images/boots.svg +1 -0
- package/systems/5e/images/bottle-vapors.svg +1 -0
- package/systems/5e/images/bow-arrow.svg +1 -0
- package/systems/5e/images/bowl-spiral.svg +1 -0
- package/systems/5e/images/bracer.svg +1 -0
- package/systems/5e/images/broadsword.svg +1 -0
- package/systems/5e/images/broom.svg +1 -0
- package/systems/5e/images/bullets.svg +1 -0
- package/systems/5e/images/caltrops.svg +1 -0
- package/systems/5e/images/camp-cooking-pot.svg +1 -0
- package/systems/5e/images/campfire.svg +1 -0
- package/systems/5e/images/camping-tent.svg +1 -0
- package/systems/5e/images/candle-flame.svg +1 -0
- package/systems/5e/images/candle-light.svg +1 -0
- package/systems/5e/images/canoe.svg +1 -0
- package/systems/5e/images/cape.svg +1 -0
- package/systems/5e/images/caravel.svg +1 -0
- package/systems/5e/images/card-pick.svg +1 -0
- package/systems/5e/images/chain-mail.svg +1 -0
- package/systems/5e/images/chained-arrow-heads.svg +1 -0
- package/systems/5e/images/chariot.svg +1 -0
- package/systems/5e/images/chest.svg +1 -0
- package/systems/5e/images/chisel.svg +1 -0
- package/systems/5e/images/claw-hammer.svg +1 -0
- package/systems/5e/images/colombian-statue.svg +1 -0
- package/systems/5e/images/cooking-pot.svg +1 -0
- package/systems/5e/images/crescent-staff.svg +1 -0
- package/systems/5e/images/crossbow.svg +1 -0
- package/systems/5e/images/crossed-chains.svg +1 -0
- package/systems/5e/images/crowbar.svg +1 -0
- package/systems/5e/images/crystal-ball.svg +1 -0
- package/systems/5e/images/crystal-cluster.svg +1 -0
- package/systems/5e/images/crystal-eye.svg +1 -0
- package/systems/5e/images/cubes.svg +1 -0
- package/systems/5e/images/dart.svg +1 -0
- package/systems/5e/images/dice-six-faces-five.svg +1 -0
- package/systems/5e/images/dragon-orb.svg +1 -0
- package/systems/5e/images/drakkar.svg +1 -0
- package/systems/5e/images/drum.svg +1 -0
- package/systems/5e/images/empty-wood-bucket-handle.svg +1 -0
- package/systems/5e/images/eye-shield.svg +1 -0
- package/systems/5e/images/fairy-wand.svg +1 -0
- package/systems/5e/images/feather.svg +1 -0
- package/systems/5e/images/feathered-wing.svg +1 -0
- package/systems/5e/images/fire-bottle.svg +1 -0
- package/systems/5e/images/fire-gem.svg +1 -0
- package/systems/5e/images/first-aid-kit.svg +1 -0
- package/systems/5e/images/fishing-hook.svg +1 -0
- package/systems/5e/images/fishing-net.svg +1 -0
- package/systems/5e/images/fishing-pole.svg +1 -0
- package/systems/5e/images/fist.svg +1 -0
- package/systems/5e/images/flail.svg +1 -0
- package/systems/5e/images/flanged-mace.svg +1 -0
- package/systems/5e/images/flat-hammer.svg +1 -0
- package/systems/5e/images/flint-spark.svg +1 -0
- package/systems/5e/images/floating-crystal.svg +1 -0
- package/systems/5e/images/flute.svg +1 -0
- package/systems/5e/images/galleon.svg +1 -0
- package/systems/5e/images/gauntlet.svg +1 -0
- package/systems/5e/images/gem-necklace.svg +1 -0
- package/systems/5e/images/gem-pendant.svg +1 -0
- package/systems/5e/images/gems.svg +1 -0
- package/systems/5e/images/gladius.svg +1 -0
- package/systems/5e/images/glaive.svg +1 -0
- package/systems/5e/images/glass-ball.svg +1 -0
- package/systems/5e/images/gloves.svg +1 -0
- package/systems/5e/images/gold-scarab.svg +1 -0
- package/systems/5e/images/grain-bundle.svg +1 -0
- package/systems/5e/images/halberd.svg +1 -0
- package/systems/5e/images/hand-saw.svg +1 -0
- package/systems/5e/images/handheld-fan.svg +1 -0
- package/systems/5e/images/harp.svg +1 -0
- package/systems/5e/images/hatchet.svg +1 -0
- package/systems/5e/images/headband-knot.svg +1 -0
- package/systems/5e/images/health-potion.svg +1 -0
- package/systems/5e/images/heart-bottle.svg +1 -0
- package/systems/5e/images/herbs-bundle.svg +1 -0
- package/systems/5e/images/hole-ladder.svg +1 -0
- package/systems/5e/images/holy-symbol.svg +1 -0
- package/systems/5e/images/holy-water.svg +1 -0
- package/systems/5e/images/honey-jar.svg +1 -0
- package/systems/5e/images/hood.svg +1 -0
- package/systems/5e/images/horseshoe.svg +1 -0
- package/systems/5e/images/hourglass.svg +1 -0
- package/systems/5e/images/hunting-horn.svg +1 -0
- package/systems/5e/images/jester-hat.svg +1 -0
- package/systems/5e/images/jug.svg +1 -0
- package/systems/5e/images/katana.svg +1 -0
- package/systems/5e/images/key-lock.svg +1 -0
- package/systems/5e/images/kitchen-scale.svg +1 -0
- package/systems/5e/images/knapsack.svg +1 -0
- package/systems/5e/images/ladder.svg +1 -0
- package/systems/5e/images/lantern.svg +1 -0
- package/systems/5e/images/leather-armor.svg +1 -0
- package/systems/5e/images/leather-boot.svg +1 -0
- package/systems/5e/images/leather-vest.svg +1 -0
- package/systems/5e/images/light-backpack.svg +1 -0
- package/systems/5e/images/light-helm.svg +1 -0
- package/systems/5e/images/locked-box.svg +1 -0
- package/systems/5e/images/locked-fortress.svg +1 -0
- package/systems/5e/images/lockpicks.svg +1 -0
- package/systems/5e/images/lunar-wand.svg +1 -0
- package/systems/5e/images/lyre.svg +1 -0
- package/systems/5e/images/magic-lamp.svg +1 -0
- package/systems/5e/images/magnifying-glass.svg +1 -0
- package/systems/5e/images/mail-shirt.svg +1 -0
- package/systems/5e/images/manacles.svg +1 -0
- package/systems/5e/images/marbles.svg +1 -0
- package/systems/5e/images/meat.svg +1 -0
- package/systems/5e/images/medal.svg +1 -0
- package/systems/5e/images/mirror-mirror.svg +1 -0
- package/systems/5e/images/mountain-climbing.svg +1 -0
- package/systems/5e/images/oil-can.svg +1 -0
- package/systems/5e/images/old-lantern.svg +1 -0
- package/systems/5e/images/old-wagon.svg +1 -0
- package/systems/5e/images/orb-wand.svg +1 -0
- package/systems/5e/images/oyster-pearl.svg +1 -0
- package/systems/5e/images/paint-brush.svg +1 -0
- package/systems/5e/images/painted-pottery.svg +1 -0
- package/systems/5e/images/palette.svg +1 -0
- package/systems/5e/images/paper.svg +1 -0
- package/systems/5e/images/pencil.svg +1 -0
- package/systems/5e/images/perfume-bottle.svg +1 -0
- package/systems/5e/images/pilgrim-hat.svg +1 -0
- package/systems/5e/images/pipes.svg +1 -0
- package/systems/5e/images/plain-arrow.svg +1 -0
- package/systems/5e/images/plain-dagger.svg +1 -0
- package/systems/5e/images/poison-bottle.svg +1 -0
- package/systems/5e/images/powder-bag.svg +1 -0
- package/systems/5e/images/prayer-beads.svg +1 -0
- package/systems/5e/images/pulley-hook.svg +1 -0
- package/systems/5e/images/quill-ink.svg +1 -0
- package/systems/5e/images/quill.svg +1 -0
- package/systems/5e/images/quiver.svg +1 -0
- package/systems/5e/images/red-carpet.svg +1 -0
- package/systems/5e/images/ring.svg +1 -0
- package/systems/5e/images/ringing-bell.svg +1 -0
- package/systems/5e/images/robe.svg +1 -0
- package/systems/5e/images/rope-coil.svg +1 -0
- package/systems/5e/images/round-bottom-flask.svg +1 -0
- package/systems/5e/images/round-potion.svg +1 -0
- package/systems/5e/images/rune-stone.svg +1 -0
- package/systems/5e/images/saddle.svg +1 -0
- package/systems/5e/images/scale-mail.svg +1 -0
- package/systems/5e/images/scroll-unfurled.svg +1 -0
- package/systems/5e/images/secret-book.svg +1 -0
- package/systems/5e/images/sewing-needle.svg +1 -0
- package/systems/5e/images/shield.svg +1 -0
- package/systems/5e/images/shirt-button.svg +1 -0
- package/systems/5e/images/sickle.svg +1 -0
- package/systems/5e/images/siege-ram.svg +1 -0
- package/systems/5e/images/skull-staff.svg +1 -0
- package/systems/5e/images/sleeping-bag.svg +1 -0
- package/systems/5e/images/sling.svg +1 -0
- package/systems/5e/images/slippers.svg +1 -0
- package/systems/5e/images/small-fishing-sailboat.svg +1 -0
- package/systems/5e/images/smoking-orb.svg +1 -0
- package/systems/5e/images/soap.svg +1 -0
- package/systems/5e/images/spade.svg +1 -0
- package/systems/5e/images/sparkling-sabre.svg +1 -0
- package/systems/5e/images/spell-book.svg +1 -0
- package/systems/5e/images/spiked-armor.svg +1 -0
- package/systems/5e/images/spiked-mace.svg +1 -0
- package/systems/5e/images/spikes.svg +1 -0
- package/systems/5e/images/spinning-wheel.svg +1 -0
- package/systems/5e/images/spyglass.svg +1 -0
- package/systems/5e/images/steampunk-goggles.svg +1 -0
- package/systems/5e/images/stone-block.svg +1 -0
- package/systems/5e/images/stone-pile.svg +1 -0
- package/systems/5e/images/stone-sphere.svg +1 -0
- package/systems/5e/images/straight-pipe.svg +1 -0
- package/systems/5e/images/swap-bag.svg +1 -0
- package/systems/5e/images/thor-hammer.svg +1 -0
- package/systems/5e/images/thrown-spear.svg +1 -0
- package/systems/5e/images/tiara.svg +1 -0
- package/systems/5e/images/tied-scroll.svg +1 -0
- package/systems/5e/images/tinker.svg +1 -0
- package/systems/5e/images/torch.svg +1 -0
- package/systems/5e/images/totem.svg +1 -0
- package/systems/5e/images/trap-mask.svg +1 -0
- package/systems/5e/images/treasure-map.svg +1 -0
- package/systems/5e/images/tribal-pendant.svg +1 -0
- package/systems/5e/images/trident.svg +1 -0
- package/systems/5e/images/two-handed-sword.svg +1 -0
- package/systems/5e/images/vial.svg +1 -0
- package/systems/5e/images/violin.svg +1 -0
- package/systems/5e/images/war-axe.svg +1 -0
- package/systems/5e/images/war-pick.svg +1 -0
- package/systems/5e/images/warhammer.svg +1 -0
- package/systems/5e/images/water-bottle.svg +1 -0
- package/systems/5e/images/waterskin.svg +1 -0
- package/systems/5e/images/wavy-chains.svg +1 -0
- package/systems/5e/images/wax-seal.svg +1 -0
- package/systems/5e/images/wheelbarrow.svg +1 -0
- package/systems/5e/images/whip.svg +1 -0
- package/systems/5e/images/whistle.svg +1 -0
- package/systems/5e/images/wing-cloak.svg +1 -0
- package/systems/5e/images/winged-scepter.svg +1 -0
- package/systems/5e/images/wizard-staff.svg +1 -0
- package/systems/5e/images/wolf-trap.svg +1 -0
- package/systems/5e/images/wood-canoe.svg +1 -0
- package/systems/5e/images/wood-club.svg +1 -0
- package/systems/5e/instructions/import.md +1 -0
- package/systems/5e/instructions/play.md +5 -0
- package/systems/5e/instructions/session-zero.md +1 -1
- package/systems/5e/package.json +11 -0
- package/systems/5e/system.yaml +231 -31
- package/systems/5e/words/ar.yaml +74 -0
- package/systems/5e/words/cs.yaml +74 -0
- package/systems/5e/words/da.yaml +74 -0
- package/systems/5e/words/de.yaml +74 -0
- package/systems/5e/words/el.yaml +74 -0
- package/systems/5e/words/en.yaml +20 -0
- package/systems/5e/words/es.yaml +74 -0
- package/systems/5e/words/fi.yaml +74 -0
- package/systems/5e/words/fr.yaml +74 -0
- package/systems/5e/words/he.yaml +74 -0
- package/systems/5e/words/hi.yaml +74 -0
- package/systems/5e/words/hu.yaml +74 -0
- package/systems/5e/words/is.yaml +74 -0
- package/systems/5e/words/it.yaml +84 -1
- package/systems/5e/words/ja.yaml +74 -0
- package/systems/5e/words/ko.yaml +74 -0
- package/systems/5e/words/nb.yaml +74 -0
- package/systems/5e/words/nl.yaml +74 -0
- package/systems/5e/words/pl.yaml +74 -0
- package/systems/5e/words/pt.yaml +74 -0
- package/systems/5e/words/ro.yaml +74 -0
- package/systems/5e/words/ru.yaml +74 -0
- package/systems/5e/words/sv.yaml +74 -0
- package/systems/5e/words/tr.yaml +74 -0
- package/systems/5e/words/uk.yaml +74 -0
- package/systems/5e/words/zh.yaml +74 -0
- package/systems/5e/world/creatures/Aboleth.md +1 -0
- package/systems/5e/world/creatures/Adult Black Dragon.md +2 -0
- package/systems/5e/world/creatures/Adult Blue Dragon.md +2 -0
- package/systems/5e/world/creatures/Adult Brass Dragon.md +2 -0
- package/systems/5e/world/creatures/Adult Bronze Dragon.md +2 -0
- package/systems/5e/world/creatures/Adult Copper Dragon.md +2 -0
- package/systems/5e/world/creatures/Adult Gold Dragon.md +2 -0
- package/systems/5e/world/creatures/Adult Green Dragon.md +2 -0
- package/systems/5e/world/creatures/Adult Red Dragon.md +2 -0
- package/systems/5e/world/creatures/Adult Silver Dragon.md +2 -0
- package/systems/5e/world/creatures/Adult White Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient Black Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient Blue Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient Brass Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient Bronze Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient Copper Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient Gold Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient Green Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient Red Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient Silver Dragon.md +2 -0
- package/systems/5e/world/creatures/Ancient White Dragon.md +2 -0
- package/systems/5e/world/creatures/Androsphinx.md +1 -0
- package/systems/5e/world/creatures/Dwarf.md +1 -0
- package/systems/5e/world/creatures/Gynosphinx.md +1 -0
- package/systems/5e/world/creatures/Kraken.md +1 -0
- package/systems/5e/world/creatures/Lich.md +2 -0
- package/systems/5e/world/creatures/Mummy Lord.md +1 -0
- package/systems/5e/world/creatures/Solar.md +1 -0
- package/systems/5e/world/creatures/Tarrasque.md +2 -0
- package/systems/5e/world/creatures/Unicorn.md +1 -0
- package/systems/5e/world/creatures/Vampire.md +2 -0
- package/systems/5e/world/items/Abacus.md +1 -0
- package/systems/5e/world/items/Acid.md +1 -0
- package/systems/5e/world/items/Adamantine Armor.md +1 -0
- package/systems/5e/world/items/Alchemist's Fire.md +1 -0
- package/systems/5e/world/items/Alchemist's Supplies.md +1 -0
- package/systems/5e/world/items/Ammunition, +1, +2, or +3.md +1 -0
- package/systems/5e/world/items/Amulet of Health.md +2 -0
- package/systems/5e/world/items/Amulet of Proof against Detection and Location.md +1 -0
- package/systems/5e/world/items/Amulet of the Planes.md +1 -0
- package/systems/5e/world/items/Amulet.md +1 -0
- package/systems/5e/world/items/Animated Shield.md +1 -0
- package/systems/5e/world/items/Antitoxin.md +1 -0
- package/systems/5e/world/items/Apparatus of the Crab.md +1 -0
- package/systems/5e/world/items/Armor of Invulnerability.md +2 -0
- package/systems/5e/world/items/Armor of Resistance.md +1 -0
- package/systems/5e/world/items/Armor of Vulnerability.md +1 -0
- package/systems/5e/world/items/Armor, +1, +2, or +3.md +1 -0
- package/systems/5e/world/items/Arrow of Slaying.md +1 -0
- package/systems/5e/world/items/Arrow-Catching Shield.md +1 -0
- package/systems/5e/world/items/Arrows.md +2 -0
- package/systems/5e/world/items/Backpack.md +1 -0
- package/systems/5e/world/items/Bag of Beans.md +1 -0
- package/systems/5e/world/items/Bag of Devouring.md +1 -0
- package/systems/5e/world/items/Bag of Holding.md +3 -0
- package/systems/5e/world/items/Bag of Tricks.md +1 -0
- package/systems/5e/world/items/Bagpipes.md +1 -0
- package/systems/5e/world/items/Ball Bearings.md +1 -0
- package/systems/5e/world/items/Barding.md +1 -0
- package/systems/5e/world/items/Barrel.md +1 -0
- package/systems/5e/world/items/Basic Poison.md +1 -0
- package/systems/5e/world/items/Basket.md +1 -0
- package/systems/5e/world/items/Battleaxe.md +1 -0
- package/systems/5e/world/items/Bead of Force.md +1 -0
- package/systems/5e/world/items/Bedroll.md +1 -0
- package/systems/5e/world/items/Bell.md +1 -0
- package/systems/5e/world/items/Belt of Dwarvenkind.md +1 -0
- package/systems/5e/world/items/Belt of Giant Strength.md +1 -0
- package/systems/5e/world/items/Berserker Axe.md +1 -0
- package/systems/5e/world/items/Bit and Bridle.md +1 -0
- package/systems/5e/world/items/Blanket.md +1 -0
- package/systems/5e/world/items/Block and Tackle.md +1 -0
- package/systems/5e/world/items/Blowgun Needles.md +2 -0
- package/systems/5e/world/items/Blowgun.md +1 -0
- package/systems/5e/world/items/Book.md +1 -0
- package/systems/5e/world/items/Boots of Elvenkind.md +1 -0
- package/systems/5e/world/items/Boots of Levitation.md +1 -0
- package/systems/5e/world/items/Boots of Speed.md +1 -0
- package/systems/5e/world/items/Boots of Striding and Springing.md +1 -0
- package/systems/5e/world/items/Boots of the Winterlands.md +2 -0
- package/systems/5e/world/items/Bowl of Commanding Water Elementals.md +1 -0
- package/systems/5e/world/items/Bracers of Archery.md +1 -0
- package/systems/5e/world/items/Bracers of Defense.md +1 -0
- package/systems/5e/world/items/Brazier of Commanding Fire Elementals.md +1 -0
- package/systems/5e/world/items/Breastplate.md +1 -0
- package/systems/5e/world/items/Brewer's Supplies.md +1 -0
- package/systems/5e/world/items/Brooch of Shielding.md +2 -0
- package/systems/5e/world/items/Broom of Flying.md +1 -0
- package/systems/5e/world/items/Bucket.md +1 -0
- package/systems/5e/world/items/Bullseye Lantern.md +1 -0
- package/systems/5e/world/items/Burglar's Pack.md +3 -0
- package/systems/5e/world/items/Calligrapher's Supplies.md +1 -0
- package/systems/5e/world/items/Caltrops.md +1 -0
- package/systems/5e/world/items/Candle of Invocation.md +1 -0
- package/systems/5e/world/items/Candle.md +1 -0
- package/systems/5e/world/items/Cape of the Mountebank.md +1 -0
- package/systems/5e/world/items/Carpenter's Tools.md +1 -0
- package/systems/5e/world/items/Carpet of Flying.md +1 -0
- package/systems/5e/world/items/Carriage.md +1 -0
- package/systems/5e/world/items/Cart.md +1 -0
- package/systems/5e/world/items/Cartographer's Tools.md +1 -0
- package/systems/5e/world/items/Censer of Controlling Air Elementals.md +1 -0
- package/systems/5e/world/items/Chain Mail.md +2 -0
- package/systems/5e/world/items/Chain Shirt.md +1 -0
- package/systems/5e/world/items/Chain.md +1 -0
- package/systems/5e/world/items/Chalk.md +1 -0
- package/systems/5e/world/items/Chariot.md +1 -0
- package/systems/5e/world/items/Chest.md +1 -0
- package/systems/5e/world/items/Chime of Opening.md +1 -0
- package/systems/5e/world/items/Circlet of Blasting.md +1 -0
- package/systems/5e/world/items/Climber's Kit.md +1 -0
- package/systems/5e/world/items/Cloak of Arachnida.md +2 -0
- package/systems/5e/world/items/Cloak of Displacement.md +1 -0
- package/systems/5e/world/items/Cloak of Elvenkind.md +1 -0
- package/systems/5e/world/items/Cloak of Protection.md +3 -0
- package/systems/5e/world/items/Cloak of the Bat.md +1 -0
- package/systems/5e/world/items/Cloak of the Manta Ray.md +1 -0
- package/systems/5e/world/items/Club.md +1 -0
- package/systems/5e/world/items/Cobbler's Tools.md +1 -0
- package/systems/5e/world/items/Common Clothes.md +1 -0
- package/systems/5e/world/items/Component Pouch.md +1 -0
- package/systems/5e/world/items/Cook's Utensils.md +1 -0
- package/systems/5e/world/items/Costume Clothes.md +1 -0
- package/systems/5e/world/items/Crossbow Bolt Case.md +1 -0
- package/systems/5e/world/items/Crossbow Bolts.md +2 -0
- package/systems/5e/world/items/Crowbar.md +1 -0
- package/systems/5e/world/items/Crystal Ball.md +1 -0
- package/systems/5e/world/items/Crystal.md +1 -0
- package/systems/5e/world/items/Cube of Force.md +2 -0
- package/systems/5e/world/items/Cubic Gate.md +2 -0
- package/systems/5e/world/items/Dagger of Venom.md +1 -0
- package/systems/5e/world/items/Dagger.md +1 -0
- package/systems/5e/world/items/Dancing Sword.md +1 -0
- package/systems/5e/world/items/Dart.md +1 -0
- package/systems/5e/world/items/Decanter of Endless Water.md +1 -0
- package/systems/5e/world/items/Deck of Illusions.md +1 -0
- package/systems/5e/world/items/Deck of Many Things.md +1 -0
- package/systems/5e/world/items/Defender.md +1 -0
- package/systems/5e/world/items/Demon Armor.md +1 -0
- package/systems/5e/world/items/Dice Set.md +1 -0
- package/systems/5e/world/items/Dimensional Shackles.md +1 -0
- package/systems/5e/world/items/Diplomat's Pack.md +3 -0
- package/systems/5e/world/items/Disguise Kit.md +1 -0
- package/systems/5e/world/items/Dragon Scale Mail.md +1 -0
- package/systems/5e/world/items/Dragon Slayer.md +1 -0
- package/systems/5e/world/items/Drum.md +1 -0
- package/systems/5e/world/items/Dulcimer.md +1 -0
- package/systems/5e/world/items/Dungeoneer's Pack.md +3 -0
- package/systems/5e/world/items/Dust of Disappearance.md +1 -0
- package/systems/5e/world/items/Dust of Dryness.md +1 -0
- package/systems/5e/world/items/Dust of Sneezing and Choking.md +1 -0
- package/systems/5e/world/items/Dwarven Plate.md +1 -0
- package/systems/5e/world/items/Dwarven Thrower.md +1 -0
- package/systems/5e/world/items/Efficient Quiver.md +1 -0
- package/systems/5e/world/items/Efreeti Bottle.md +1 -0
- package/systems/5e/world/items/Elemental Gem.md +1 -0
- package/systems/5e/world/items/Elven Chain.md +1 -0
- package/systems/5e/world/items/Emblem.md +1 -0
- package/systems/5e/world/items/Entertainer's Pack.md +3 -0
- package/systems/5e/world/items/Eversmoking Bottle.md +1 -0
- package/systems/5e/world/items/Exotic Saddle.md +1 -0
- package/systems/5e/world/items/Explorer's Pack.md +3 -0
- package/systems/5e/world/items/Eyes of Charming.md +1 -0
- package/systems/5e/world/items/Eyes of Minute Seeing.md +1 -0
- package/systems/5e/world/items/Eyes of the Eagle.md +1 -0
- package/systems/5e/world/items/Feather Token.md +1 -0
- package/systems/5e/world/items/Feed.md +1 -0
- package/systems/5e/world/items/Figurine of Wondrous Power.md +1 -0
- package/systems/5e/world/items/Fine Clothes.md +1 -0
- package/systems/5e/world/items/Fishing Tackle.md +1 -0
- package/systems/5e/world/items/Flail.md +1 -0
- package/systems/5e/world/items/Flame Tongue.md +1 -0
- package/systems/5e/world/items/Flask or Tankard.md +1 -0
- package/systems/5e/world/items/Flute.md +1 -0
- package/systems/5e/world/items/Folding Boat.md +1 -0
- package/systems/5e/world/items/Forgery Kit.md +1 -0
- package/systems/5e/world/items/Frost Brand.md +2 -0
- package/systems/5e/world/items/Galley.md +1 -0
- package/systems/5e/world/items/Gauntlets of Ogre Power.md +2 -0
- package/systems/5e/world/items/Gem of Brightness.md +2 -0
- package/systems/5e/world/items/Gem of Seeing.md +2 -0
- package/systems/5e/world/items/Giant Slayer.md +1 -0
- package/systems/5e/world/items/Glaive.md +1 -0
- package/systems/5e/world/items/Glamoured Studded Leather.md +1 -0
- package/systems/5e/world/items/Glass Bottle.md +1 -0
- package/systems/5e/world/items/Glassblower's Tools.md +1 -0
- package/systems/5e/world/items/Gloves of Missile Snaring.md +1 -0
- package/systems/5e/world/items/Gloves of Swimming and Climbing.md +1 -0
- package/systems/5e/world/items/Goggles of Night.md +1 -0
- package/systems/5e/world/items/Grappling Hook.md +1 -0
- package/systems/5e/world/items/Greataxe.md +1 -0
- package/systems/5e/world/items/Greatclub.md +1 -0
- package/systems/5e/world/items/Greatsword.md +1 -0
- package/systems/5e/world/items/Halberd.md +1 -0
- package/systems/5e/world/items/Half Plate Armor.md +1 -0
- package/systems/5e/world/items/Hammer of Thunderbolts.md +2 -0
- package/systems/5e/world/items/Hammer.md +1 -0
- package/systems/5e/world/items/Hand Crossbow.md +1 -0
- package/systems/5e/world/items/Handaxe.md +1 -0
- package/systems/5e/world/items/Handy Haversack.md +3 -0
- package/systems/5e/world/items/Hat of Disguise.md +1 -0
- package/systems/5e/world/items/Headband of Intellect.md +2 -0
- package/systems/5e/world/items/Healer's Kit.md +1 -0
- package/systems/5e/world/items/Heavy Crossbow.md +1 -0
- package/systems/5e/world/items/Helm of Brilliance.md +1 -0
- package/systems/5e/world/items/Helm of Comprehending Languages.md +1 -0
- package/systems/5e/world/items/Helm of Telepathy.md +1 -0
- package/systems/5e/world/items/Helm of Teleportation.md +2 -0
- package/systems/5e/world/items/Hempen Rope.md +1 -0
- package/systems/5e/world/items/Herbalism Kit.md +1 -0
- package/systems/5e/world/items/Hide Armor.md +1 -0
- package/systems/5e/world/items/Holy Avenger.md +1 -0
- package/systems/5e/world/items/Holy Water.md +1 -0
- package/systems/5e/world/items/Hooded Lantern.md +1 -0
- package/systems/5e/world/items/Horn of Blasting.md +1 -0
- package/systems/5e/world/items/Horn of Valhalla.md +1 -0
- package/systems/5e/world/items/Horn.md +1 -0
- package/systems/5e/world/items/Horseshoes of Speed.md +1 -0
- package/systems/5e/world/items/Horseshoes of a Zephyr.md +1 -0
- package/systems/5e/world/items/Hourglass.md +1 -0
- package/systems/5e/world/items/Hunting Trap.md +1 -0
- package/systems/5e/world/items/Immovable Rod.md +1 -0
- package/systems/5e/world/items/Ink Pen.md +1 -0
- package/systems/5e/world/items/Ink.md +1 -0
- package/systems/5e/world/items/Instant Fortress.md +1 -0
- package/systems/5e/world/items/Ioun Stone.md +1 -0
- package/systems/5e/world/items/Iron Bands of Binding.md +1 -0
- package/systems/5e/world/items/Iron Flask.md +1 -0
- package/systems/5e/world/items/Iron Pot.md +1 -0
- package/systems/5e/world/items/Iron Spikes.md +2 -0
- package/systems/5e/world/items/Javelin of Lightning.md +1 -0
- package/systems/5e/world/items/Javelin.md +1 -0
- package/systems/5e/world/items/Jeweler's Tools.md +1 -0
- package/systems/5e/world/items/Jug or Pitcher.md +1 -0
- package/systems/5e/world/items/Keelboat.md +1 -0
- package/systems/5e/world/items/Ladder.md +1 -0
- package/systems/5e/world/items/Lamp.md +1 -0
- package/systems/5e/world/items/Lance.md +1 -0
- package/systems/5e/world/items/Lantern of Revealing.md +1 -0
- package/systems/5e/world/items/Leather Armor.md +1 -0
- package/systems/5e/world/items/Leatherworker's Tools.md +1 -0
- package/systems/5e/world/items/Light Crossbow.md +1 -0
- package/systems/5e/world/items/Light Hammer.md +1 -0
- package/systems/5e/world/items/Lock.md +1 -0
- package/systems/5e/world/items/Longbow.md +1 -0
- package/systems/5e/world/items/Longship.md +1 -0
- package/systems/5e/world/items/Longsword.md +1 -0
- package/systems/5e/world/items/Luck Blade.md +1 -0
- package/systems/5e/world/items/Lute.md +1 -0
- package/systems/5e/world/items/Lyre.md +1 -0
- package/systems/5e/world/items/Mace of Disruption.md +1 -0
- package/systems/5e/world/items/Mace of Smiting.md +1 -0
- package/systems/5e/world/items/Mace of Terror.md +2 -0
- package/systems/5e/world/items/Mace.md +1 -0
- package/systems/5e/world/items/Magnifying Glass.md +1 -0
- package/systems/5e/world/items/Manacles.md +1 -0
- package/systems/5e/world/items/Mantle of Spell Resistance.md +1 -0
- package/systems/5e/world/items/Manual of Bodily Health.md +1 -0
- package/systems/5e/world/items/Manual of Gainful Exercise.md +1 -0
- package/systems/5e/world/items/Manual of Golems.md +1 -0
- package/systems/5e/world/items/Manual of Quickness of Action.md +1 -0
- package/systems/5e/world/items/Map or Scroll Case.md +1 -0
- package/systems/5e/world/items/Marvelous Pigments.md +1 -0
- package/systems/5e/world/items/Mason's Tools.md +1 -0
- package/systems/5e/world/items/Maul.md +1 -0
- package/systems/5e/world/items/Medallion of Thoughts.md +2 -0
- package/systems/5e/world/items/Merchant's Scale.md +1 -0
- package/systems/5e/world/items/Mess Kit.md +1 -0
- package/systems/5e/world/items/Military Saddle.md +1 -0
- package/systems/5e/world/items/Miner's Pick.md +1 -0
- package/systems/5e/world/items/Mirror of Life Trapping.md +1 -0
- package/systems/5e/world/items/Mithral Armor.md +1 -0
- package/systems/5e/world/items/Morningstar.md +1 -0
- package/systems/5e/world/items/Navigator's Tools.md +1 -0
- package/systems/5e/world/items/Necklace of Adaptation.md +1 -0
- package/systems/5e/world/items/Necklace of Fireballs.md +1 -0
- package/systems/5e/world/items/Necklace of Prayer Beads.md +1 -0
- package/systems/5e/world/items/Net.md +1 -0
- package/systems/5e/world/items/Nine Lives Stealer.md +1 -0
- package/systems/5e/world/items/Oathbow.md +1 -0
- package/systems/5e/world/items/Oil of Etherealness.md +1 -0
- package/systems/5e/world/items/Oil of Sharpness.md +1 -0
- package/systems/5e/world/items/Oil of Slipperiness.md +1 -0
- package/systems/5e/world/items/Oil.md +1 -0
- package/systems/5e/world/items/Orb of Dragonkind.md +2 -0
- package/systems/5e/world/items/Orb.md +1 -0
- package/systems/5e/world/items/Pack Saddle.md +1 -0
- package/systems/5e/world/items/Padded Armor.md +1 -0
- package/systems/5e/world/items/Painter's Supplies.md +1 -0
- package/systems/5e/world/items/Pan Flute.md +1 -0
- package/systems/5e/world/items/Paper.md +1 -0
- package/systems/5e/world/items/Parchment.md +1 -0
- package/systems/5e/world/items/Pearl of Power.md +1 -0
- package/systems/5e/world/items/Perfume.md +1 -0
- package/systems/5e/world/items/Periapt of Health.md +1 -0
- package/systems/5e/world/items/Periapt of Proof against Poison.md +1 -0
- package/systems/5e/world/items/Periapt of Wound Closure.md +1 -0
- package/systems/5e/world/items/Philter of Love.md +1 -0
- package/systems/5e/world/items/Pike.md +1 -0
- package/systems/5e/world/items/Pipes of Haunting.md +1 -0
- package/systems/5e/world/items/Pipes of the Sewers.md +1 -0
- package/systems/5e/world/items/Piton.md +1 -0
- package/systems/5e/world/items/Plate Armor of Etherealness.md +1 -0
- package/systems/5e/world/items/Plate Armor.md +2 -0
- package/systems/5e/world/items/Playing Card Set.md +1 -0
- package/systems/5e/world/items/Poisoner's Kit.md +1 -0
- package/systems/5e/world/items/Pole.md +1 -0
- package/systems/5e/world/items/Portable Hole.md +2 -0
- package/systems/5e/world/items/Portable Ram.md +1 -0
- package/systems/5e/world/items/Potion of Animal Friendship.md +1 -0
- package/systems/5e/world/items/Potion of Clairvoyance.md +1 -0
- package/systems/5e/world/items/Potion of Climbing.md +1 -0
- package/systems/5e/world/items/Potion of Diminution.md +1 -0
- package/systems/5e/world/items/Potion of Flying.md +1 -0
- package/systems/5e/world/items/Potion of Gaseous Form.md +1 -0
- package/systems/5e/world/items/Potion of Giant Strength.md +1 -0
- package/systems/5e/world/items/Potion of Growth.md +1 -0
- package/systems/5e/world/items/Potion of Healing.md +1 -0
- package/systems/5e/world/items/Potion of Heroism.md +1 -0
- package/systems/5e/world/items/Potion of Invisibility.md +1 -0
- package/systems/5e/world/items/Potion of Mind Reading.md +1 -0
- package/systems/5e/world/items/Potion of Poison.md +1 -0
- package/systems/5e/world/items/Potion of Resistance.md +1 -0
- package/systems/5e/world/items/Potion of Speed.md +1 -0
- package/systems/5e/world/items/Potion of Water Breathing.md +1 -0
- package/systems/5e/world/items/Potter's Tools.md +1 -0
- package/systems/5e/world/items/Pouch.md +1 -0
- package/systems/5e/world/items/Priest's Pack.md +3 -0
- package/systems/5e/world/items/Quarterstaff.md +1 -0
- package/systems/5e/world/items/Quiver.md +1 -0
- package/systems/5e/world/items/Rapier.md +1 -0
- package/systems/5e/world/items/Rations.md +1 -0
- package/systems/5e/world/items/Reliquary.md +1 -0
- package/systems/5e/world/items/Restorative Ointment.md +1 -0
- package/systems/5e/world/items/Riding Saddle.md +1 -0
- package/systems/5e/world/items/Ring Mail.md +1 -0
- package/systems/5e/world/items/Ring of Animal Influence.md +2 -0
- package/systems/5e/world/items/Ring of Djinni Summoning.md +1 -0
- package/systems/5e/world/items/Ring of Elemental Command.md +2 -0
- package/systems/5e/world/items/Ring of Evasion.md +2 -0
- package/systems/5e/world/items/Ring of Feather Falling.md +1 -0
- package/systems/5e/world/items/Ring of Free Action.md +1 -0
- package/systems/5e/world/items/Ring of Invisibility.md +1 -0
- package/systems/5e/world/items/Ring of Jumping.md +1 -0
- package/systems/5e/world/items/Ring of Mind Shielding.md +1 -0
- package/systems/5e/world/items/Ring of Protection.md +3 -0
- package/systems/5e/world/items/Ring of Regeneration.md +1 -0
- package/systems/5e/world/items/Ring of Resistance.md +1 -0
- package/systems/5e/world/items/Ring of Shooting Stars.md +2 -0
- package/systems/5e/world/items/Ring of Spell Storing.md +1 -0
- package/systems/5e/world/items/Ring of Spell Turning.md +1 -0
- package/systems/5e/world/items/Ring of Swimming.md +1 -0
- package/systems/5e/world/items/Ring of Telekinesis.md +1 -0
- package/systems/5e/world/items/Ring of Three Wishes.md +1 -0
- package/systems/5e/world/items/Ring of Warmth.md +2 -0
- package/systems/5e/world/items/Ring of Water Walking.md +1 -0
- package/systems/5e/world/items/Ring of X-ray Vision.md +1 -0
- package/systems/5e/world/items/Ring of the Ram.md +2 -0
- package/systems/5e/world/items/Robe of Eyes.md +1 -0
- package/systems/5e/world/items/Robe of Scintillating Colors.md +2 -0
- package/systems/5e/world/items/Robe of Stars.md +1 -0
- package/systems/5e/world/items/Robe of Useful Items.md +1 -0
- package/systems/5e/world/items/Robe of the Archmagi.md +3 -0
- package/systems/5e/world/items/Robes.md +1 -0
- package/systems/5e/world/items/Rod of Absorption.md +1 -0
- package/systems/5e/world/items/Rod of Alertness.md +1 -0
- package/systems/5e/world/items/Rod of Lordly Might.md +1 -0
- package/systems/5e/world/items/Rod of Rulership.md +1 -0
- package/systems/5e/world/items/Rod of Security.md +1 -0
- package/systems/5e/world/items/Rod.md +1 -0
- package/systems/5e/world/items/Rope of Climbing.md +1 -0
- package/systems/5e/world/items/Rope of Entanglement.md +1 -0
- package/systems/5e/world/items/Rowboat.md +1 -0
- package/systems/5e/world/items/Sack.md +1 -0
- package/systems/5e/world/items/Saddlebags.md +1 -0
- package/systems/5e/world/items/Sailing Ship.md +1 -0
- package/systems/5e/world/items/Scale Mail.md +1 -0
- package/systems/5e/world/items/Scarab of Protection.md +2 -0
- package/systems/5e/world/items/Scholar's Pack.md +3 -0
- package/systems/5e/world/items/Scimitar of Speed.md +1 -0
- package/systems/5e/world/items/Scimitar.md +1 -0
- package/systems/5e/world/items/Sealing Wax.md +1 -0
- package/systems/5e/world/items/Shawm.md +1 -0
- package/systems/5e/world/items/Shield of Missile Attraction.md +2 -0
- package/systems/5e/world/items/Shield, +1, +2, or +3.md +1 -0
- package/systems/5e/world/items/Shield.md +1 -0
- package/systems/5e/world/items/Shortbow.md +1 -0
- package/systems/5e/world/items/Shortsword.md +1 -0
- package/systems/5e/world/items/Shovel.md +1 -0
- package/systems/5e/world/items/Sickle.md +1 -0
- package/systems/5e/world/items/Signal Whistle.md +1 -0
- package/systems/5e/world/items/Signet Ring.md +1 -0
- package/systems/5e/world/items/Silk Rope.md +1 -0
- package/systems/5e/world/items/Sled.md +1 -0
- package/systems/5e/world/items/Sledgehammer.md +1 -0
- package/systems/5e/world/items/Sling Bullets.md +2 -0
- package/systems/5e/world/items/Sling.md +1 -0
- package/systems/5e/world/items/Slippers of Spider Climbing.md +1 -0
- package/systems/5e/world/items/Smith's Tools.md +1 -0
- package/systems/5e/world/items/Soap.md +1 -0
- package/systems/5e/world/items/Sovereign Glue.md +1 -0
- package/systems/5e/world/items/Spear.md +1 -0
- package/systems/5e/world/items/Spell Scroll.md +1 -0
- package/systems/5e/world/items/Spellbook.md +1 -0
- package/systems/5e/world/items/Spellguard Shield.md +1 -0
- package/systems/5e/world/items/Sphere of Annihilation.md +1 -0
- package/systems/5e/world/items/Splint Armor.md +2 -0
- package/systems/5e/world/items/Sprig of Mistletoe.md +1 -0
- package/systems/5e/world/items/Spyglass.md +1 -0
- package/systems/5e/world/items/Staff of Charming.md +1 -0
- package/systems/5e/world/items/Staff of Fire.md +3 -0
- package/systems/5e/world/items/Staff of Frost.md +3 -0
- package/systems/5e/world/items/Staff of Healing.md +2 -0
- package/systems/5e/world/items/Staff of Power.md +5 -0
- package/systems/5e/world/items/Staff of Striking.md +2 -0
- package/systems/5e/world/items/Staff of Swarming Insects.md +2 -0
- package/systems/5e/world/items/Staff of Thunder and Lightning.md +1 -0
- package/systems/5e/world/items/Staff of Withering.md +2 -0
- package/systems/5e/world/items/Staff of the Magi.md +3 -0
- package/systems/5e/world/items/Staff of the Python.md +1 -0
- package/systems/5e/world/items/Staff of the Woodlands.md +2 -0
- package/systems/5e/world/items/Staff.md +1 -0
- package/systems/5e/world/items/Steel Mirror.md +1 -0
- package/systems/5e/world/items/Stone of Controlling Earth Elementals.md +1 -0
- package/systems/5e/world/items/Stone of Good Luck.md +4 -0
- package/systems/5e/world/items/Studded Leather Armor.md +1 -0
- package/systems/5e/world/items/Sun Blade.md +1 -0
- package/systems/5e/world/items/Sword of Life Stealing.md +1 -0
- package/systems/5e/world/items/Sword of Sharpness.md +1 -0
- package/systems/5e/world/items/Sword of Wounding.md +1 -0
- package/systems/5e/world/items/Talisman of Pure Good.md +2 -0
- package/systems/5e/world/items/Talisman of Ultimate Evil.md +2 -0
- package/systems/5e/world/items/Talisman of the Sphere.md +1 -0
- package/systems/5e/world/items/Thieves' Tools.md +1 -0
- package/systems/5e/world/items/Tinderbox.md +1 -0
- package/systems/5e/world/items/Tinker's Tools.md +1 -0
- package/systems/5e/world/items/Tome of Clear Thought.md +1 -0
- package/systems/5e/world/items/Tome of Leadership and Influence.md +1 -0
- package/systems/5e/world/items/Tome of Understanding.md +1 -0
- package/systems/5e/world/items/Torch.md +1 -0
- package/systems/5e/world/items/Totem.md +1 -0
- package/systems/5e/world/items/Traveler's Clothes.md +1 -0
- package/systems/5e/world/items/Trident of Fish Command.md +2 -0
- package/systems/5e/world/items/Trident.md +1 -0
- package/systems/5e/world/items/Two-Person Tent.md +1 -0
- package/systems/5e/world/items/Unarmed Strike.md +1 -0
- package/systems/5e/world/items/Universal Solvent.md +1 -0
- package/systems/5e/world/items/Vial.md +1 -0
- package/systems/5e/world/items/Vicious Weapon.md +1 -0
- package/systems/5e/world/items/Viol.md +1 -0
- package/systems/5e/world/items/Vorpal Sword.md +1 -0
- package/systems/5e/world/items/Wagon.md +1 -0
- package/systems/5e/world/items/Wand of Binding.md +2 -0
- package/systems/5e/world/items/Wand of Enemy Detection.md +2 -0
- package/systems/5e/world/items/Wand of Fear.md +2 -0
- package/systems/5e/world/items/Wand of Fireballs.md +2 -0
- package/systems/5e/world/items/Wand of Lightning Bolts.md +2 -0
- package/systems/5e/world/items/Wand of Magic Detection.md +2 -0
- package/systems/5e/world/items/Wand of Magic Missiles.md +2 -0
- package/systems/5e/world/items/Wand of Paralysis.md +2 -0
- package/systems/5e/world/items/Wand of Polymorph.md +2 -0
- package/systems/5e/world/items/Wand of Secrets.md +2 -0
- package/systems/5e/world/items/Wand of Web.md +2 -0
- package/systems/5e/world/items/Wand of Wonder.md +2 -0
- package/systems/5e/world/items/Wand of the War Mage, +1, +2, or +3.md +1 -0
- package/systems/5e/world/items/Wand.md +1 -0
- package/systems/5e/world/items/War Pick.md +1 -0
- package/systems/5e/world/items/Warhammer.md +1 -0
- package/systems/5e/world/items/Warship.md +1 -0
- package/systems/5e/world/items/Waterskin.md +1 -0
- package/systems/5e/world/items/Weapon, +1, +2, or +3.md +1 -0
- package/systems/5e/world/items/Weaver's Tools.md +1 -0
- package/systems/5e/world/items/Well of Many Worlds.md +1 -0
- package/systems/5e/world/items/Whetstone.md +1 -0
- package/systems/5e/world/items/Whip.md +1 -0
- package/systems/5e/world/items/Wind Fan.md +1 -0
- package/systems/5e/world/items/Winged Boots.md +1 -0
- package/systems/5e/world/items/Wings of Flying.md +1 -0
- package/systems/5e/world/items/Woodcarver's Tools.md +1 -0
- package/systems/5e/world/items/Wooden Staff.md +1 -0
- package/systems/5e/world/items/Yew Wand.md +1 -0
- package/systems/free/instructions/play.md +5 -0
- package/systems/free/instructions/session-zero.md +1 -0
- package/systems/free/system.yaml +12 -0
- package/dist/dashboard/combat.js +0 -72
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
// What the game system works out from the fields of a page (D-199, FOR-3–FOR-8): its computed fields, each with the values it came from, and the limits of
|
|
2
2
|
// its counters. The formulas are the system's data; this is where they meet the pages and the counters.
|
|
3
|
-
import { chosenDice, contributingReads, diceFields, fieldsRead, listItems, numberOf, parseRollFormula, tablesRead, workOut, } from "../core/formula.js";
|
|
3
|
+
import { chosenDice, contributingReads, diceFields, factorOf, fieldsRead, listItems, numberOf, parseRollFormula, tablesRead, workOut, } from "../core/formula.js";
|
|
4
4
|
import { comparableText, sameName } from "../core/text.js";
|
|
5
5
|
import { formatCounter, readCounter } from "../counters/index.js";
|
|
6
6
|
import { readEffects } from "../effects/index.js";
|
|
7
|
-
import { declaredKind, inheritedFields, isEmptyField, pagesWithName, readFieldValue, systemPageNamed } from "../pages/index.js";
|
|
7
|
+
import { bonusPages, carriedWeight, declaredKind, inheritedFields, isEmptyField, pagesWithName, readFieldValue, systemPageNamed, weightUnit } from "../pages/index.js";
|
|
8
|
+
import { formatDuration } from "../time/index.js";
|
|
8
9
|
import { progressionOf, progressionProblems, progressionValue } from "./progression.js";
|
|
9
10
|
/**
|
|
10
11
|
* The computed fields of the game system that have a value with these fields (FOR-4), in the order the system gives them; `explained`, each with only the
|
|
@@ -63,9 +64,12 @@ export function hasSheet(world, page) {
|
|
|
63
64
|
return page.type === "character" && keepsSheet(world, page.fields.role === "companion" ? inheritedFields(world, page) : page.fields);
|
|
64
65
|
}
|
|
65
66
|
/** Whether a character with these fields keeps the sheet (DAT-2): the player character, and a companion with a level or classes, or that derives from no creature. */
|
|
66
|
-
function keepsSheet(world, fields) {
|
|
67
|
-
|
|
68
|
-
const
|
|
67
|
+
export function keepsSheet(world, fields) {
|
|
68
|
+
// The level's field is the game's, as its list is: a game without levels has none (review of 17 October).
|
|
69
|
+
const progression = world.system?.progression;
|
|
70
|
+
const list = progression === undefined ? undefined : keyOf(fields, progression.list);
|
|
71
|
+
const level = progression?.level === undefined ? undefined : (keyOf(fields, progression.level) ?? progression.level);
|
|
72
|
+
const levelled = (level !== undefined && !isEmptyField(fields[level])) || (list !== undefined && !isEmptyField(fields[list]));
|
|
69
73
|
return fields.role === "pc" || (fields.role === "companion" && (isEmptyField(fields.creature) || levelled));
|
|
70
74
|
}
|
|
71
75
|
/**
|
|
@@ -84,15 +88,42 @@ export function withEffectValues(world, page) {
|
|
|
84
88
|
return { ...known };
|
|
85
89
|
}
|
|
86
90
|
const layeredByWorld = new WeakMap();
|
|
91
|
+
// Where a character's fields keep what it carries weighs, for its formulas alone.
|
|
92
|
+
const carriedKey = Symbol("carried weight");
|
|
93
|
+
/** What a character carries weighs, as its effective fields keep it (LOAD-1): worked out once with them; undefined for fields that do not keep it. */
|
|
94
|
+
export function carriedIn(fields) {
|
|
95
|
+
const value = fields[carriedKey];
|
|
96
|
+
return typeof value === "number" ? value : undefined;
|
|
97
|
+
}
|
|
87
98
|
function effectValuesOver(world, page) {
|
|
88
99
|
const fields = { ...inheritedFields(world, page) };
|
|
89
100
|
const read = readEffects(Object.entries(page.fields).find(([field]) => comparableText(field) === "effects")?.[1]);
|
|
101
|
+
// What the pages of the system's bonus lists give, as a Ring of Protection one is attuned to or a feat, adds up as effects do (FOR-5, D-449); an at-least
|
|
102
|
+
// field rises to theirs, as Gauntlets of Ogre Power's str 19, and stays when higher.
|
|
103
|
+
for (const page of bonusPages(world, fields)) {
|
|
104
|
+
for (const [field, value] of Object.entries(inheritedFields(world, page))) {
|
|
105
|
+
const kind = declaredKind(world, field);
|
|
106
|
+
const amount = kind === "bonus" || kind === "at-least" ? numberOf(value) : undefined;
|
|
107
|
+
const key = keyOf(fields, field) ?? field;
|
|
108
|
+
const current = numberOf(fields[key]);
|
|
109
|
+
fields[key] = amount === undefined ? fields[key] : kind === "bonus" ? (current ?? 0) + amount : Math.max(current ?? amount, amount);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
90
112
|
for (const effect of "effects" in read ? read.effects : []) {
|
|
91
113
|
for (const [field, value] of effect.values) {
|
|
92
114
|
const key = keyOf(fields, field) ?? field;
|
|
93
|
-
|
|
115
|
+
const kind = declaredKind(world, field);
|
|
116
|
+
fields[key] = kind === "bonus"
|
|
117
|
+
? (numberOf(fields[key]) ?? 0) + (numberOf(effectValue(value)) ?? 0)
|
|
118
|
+
: kind === "factor"
|
|
119
|
+
? (factorOf(fields[key]) ?? 1) * (factorOf(value) ?? 1)
|
|
120
|
+
: effectValue(value);
|
|
94
121
|
}
|
|
95
122
|
}
|
|
123
|
+
// What a character carries weighs, for the formulas that read it as load, as a speed; under a key no list of fields shows (FOR-2, LOAD-1).
|
|
124
|
+
if (page.type === "character" && world.system?.load !== undefined) {
|
|
125
|
+
fields[carriedKey] = carriedWeight(world, world.system.load, page);
|
|
126
|
+
}
|
|
96
127
|
return fields;
|
|
97
128
|
}
|
|
98
129
|
/** A value of an effect as a page would hold it: a number, a link, a counter as text; text as it is when it does not read. */
|
|
@@ -162,7 +193,8 @@ function progressionFields(world, scope) {
|
|
|
162
193
|
function itemFields(world, scope, explained) {
|
|
163
194
|
return Object.values(world.system?.itemFormulas ?? {}).flat().flatMap((field) => {
|
|
164
195
|
const worked = scope.each(field, explained);
|
|
165
|
-
|
|
196
|
+
// A bonus an item gives as nothing, as the speed a heavy armor takes from who has its Strength, says nothing (FOR-8).
|
|
197
|
+
return worked === undefined || (worked.value === 0 && declaredKind(world, field) === "bonus") ? [] : [worked];
|
|
166
198
|
});
|
|
167
199
|
}
|
|
168
200
|
/** The list whose items' pages give a field as a formula, as classes for spell-save-dc (PRO-5); undefined when none does. */
|
|
@@ -333,7 +365,7 @@ export function computedField(world, field, fields) {
|
|
|
333
365
|
}
|
|
334
366
|
// Of several formulas, the one that gave the value says what it comes from (D-210).
|
|
335
367
|
const used = entry[1].kind === "first" ? (entry[1].options.find((option) => workOut(option, scope).value !== undefined) ?? entry[1]) : entry[1];
|
|
336
|
-
return { name: entry[0], value, from: writtenSources(world, used, scope) };
|
|
368
|
+
return { name: entry[0], value, from: writtenSources(world, used, scope), direct: fieldsRead(used) };
|
|
337
369
|
}
|
|
338
370
|
/** The written fields the maximum of a counter comes from with these fields, as hp-base, level and con for hp (FOR-6); none when the system works out no maximum. */
|
|
339
371
|
export function maximumSources(world, field, fields) {
|
|
@@ -369,6 +401,10 @@ function writtenSources(world, formula, scope, seen = new Set()) {
|
|
|
369
401
|
const list = itemList(world, name);
|
|
370
402
|
return list === undefined ? (scope.progression()?.lists ?? [name]) : [list];
|
|
371
403
|
}
|
|
404
|
+
// What the engine gives a formula, as the campaign's rigor or a character's load, is no field anyone writes (FOR-2).
|
|
405
|
+
if (["rigor", "effects", "load", "load-limit"].includes(comparableText(name))) {
|
|
406
|
+
return [];
|
|
407
|
+
}
|
|
372
408
|
if (entry === undefined || scope.computed(name)?.value === undefined) {
|
|
373
409
|
return [name];
|
|
374
410
|
}
|
|
@@ -382,10 +418,20 @@ function writtenSources(world, formula, scope, seen = new Set()) {
|
|
|
382
418
|
}
|
|
383
419
|
/** Why a computed field is not written or changed, and what to change instead: the fields it comes from, or an effect on a bonus among them (FOR-7). */
|
|
384
420
|
export function computedMessage(world, computed, page) {
|
|
385
|
-
const bonuses =
|
|
386
|
-
const instead = bonuses.length === 0 ? "change one of those" : `change one of those, or give ${bonuses.join(" or ")} with an effect`;
|
|
421
|
+
const bonuses = directBonuses(world, computed);
|
|
422
|
+
const instead = bonuses.length === 0 ? "change one of those" : `change one of those, or give ${bonuses.join(" or ")} with an effect${aloneNote(world, computed.name, bonuses)}`;
|
|
387
423
|
return `${computed.name} on ${page} is ${signedText(world, computed.name, computed.value)}, worked out by the system ${world.system?.name ?? ""} from ${computed.from.join(", ")}: ${instead}`;
|
|
388
424
|
}
|
|
425
|
+
/**
|
|
426
|
+
* "; bonus-skills also changes the other fields that read it…": of these bonuses, those other computed fields read too, as bonus-skills for every skill, which
|
|
427
|
+
* are no bonus to one alone (playtest 14); nothing when none is.
|
|
428
|
+
*/
|
|
429
|
+
export function aloneNote(world, field, bonuses) {
|
|
430
|
+
const readers = (bonus) => (world.system?.formulas?.computed ?? []).filter(([, formula]) => fieldsRead(formula).some((name) => comparableText(name) === comparableText(bonus))).length;
|
|
431
|
+
const shared = bonuses.filter((bonus) => readers(bonus) > 1);
|
|
432
|
+
const one = shared.length === 1;
|
|
433
|
+
return shared.length === 0 ? "" : `; ${shared.join(" and ")} also ${one ? "changes" : "change"} the other fields that read ${one ? "it" : "them"}, so for ${field} alone add the number to its roll`;
|
|
434
|
+
}
|
|
389
435
|
/**
|
|
390
436
|
* The bonus fields among those a computed field comes from, which an effect on the page gives to change it, as bonus-ac for ac (FOR-5); not those the items of a
|
|
391
437
|
* list give, as a shield's armor-class-bonus, which change on the item (PRO-5).
|
|
@@ -393,6 +439,10 @@ export function computedMessage(world, computed, page) {
|
|
|
393
439
|
export function effectBonuses(world, from) {
|
|
394
440
|
return from.filter((field) => declaredKind(world, field) === "bonus" && itemList(world, field) === undefined);
|
|
395
441
|
}
|
|
442
|
+
/** The bonus fields an effect gives to change a computed field that its formula reads itself, as bonus-skills for insight, not bonus-proficiency through proficiency. */
|
|
443
|
+
export function directBonuses(world, computed) {
|
|
444
|
+
return effectBonuses(world, computed.from).filter((field) => computed.direct?.some((name) => comparableText(name) === comparableText(field)) === true);
|
|
445
|
+
}
|
|
396
446
|
/**
|
|
397
447
|
* The first item of its list whose page gives a field, with the fields of its own that its formula reads, as a shield's bonus (PRO-5): a page of the campaign,
|
|
398
448
|
* which an effect can change, not one of the system, as the unarmed strike (D-235).
|
|
@@ -412,6 +462,19 @@ export function itemSource(world, fields, field) {
|
|
|
412
462
|
/** A value of a field as the outputs show it: with its sign when the system declares the field a modifier or a bonus (FOR-8). */
|
|
413
463
|
export function signedText(world, field, value) {
|
|
414
464
|
const kind = declaredKind(world, field);
|
|
465
|
+
// A length in the system's unit, at most one decimal: 12.5 ft (SPD-1).
|
|
466
|
+
if (typeof value === "number" && kind === "length") {
|
|
467
|
+
return `${Math.round(value * 10) / 10}${world.system?.lengthUnit === undefined ? "" : ` ${world.system.lengthUnit}`}`;
|
|
468
|
+
}
|
|
469
|
+
// A weight in the unit the system's items are weighed in: 420 lb.
|
|
470
|
+
if (typeof value === "number" && kind === "weight") {
|
|
471
|
+
const unit = world.system?.load === undefined ? undefined : weightUnit(world, world.system.load.field);
|
|
472
|
+
return `${Math.round(value * 10) / 10}${unit === undefined ? "" : ` ${unit}`}`;
|
|
473
|
+
}
|
|
474
|
+
// A duration in minutes as the engine writes them, half a minute in seconds: 3m, 30s.
|
|
475
|
+
if (typeof value === "number" && kind === "duration") {
|
|
476
|
+
return value > 0 && value < 1 ? `${Math.round(value * 60)}s` : formatDuration(Math.round(value));
|
|
477
|
+
}
|
|
415
478
|
return typeof value === "number" && (kind === "modifier" || kind === "bonus") && value >= 0 ? `+${value}` : String(value);
|
|
416
479
|
}
|
|
417
480
|
/** "insight +5: wis-mod +3, proficiency +2, Insight in skill-proficiencies": a computed field and what it came from, leaving out what adds nothing (FOR-8). */
|
|
@@ -432,7 +495,9 @@ export function workedParts(world, reads) {
|
|
|
432
495
|
return [`${read.field} ${read.dice}`];
|
|
433
496
|
}
|
|
434
497
|
if ("field" in read) {
|
|
435
|
-
|
|
498
|
+
// A bonus of 0 and a factor of 1 change nothing (FOR-5).
|
|
499
|
+
const kind = declaredKind(world, read.field);
|
|
500
|
+
return (read.value === 0 && kind === "bonus") || (read.value === 1 && kind === "factor") ? [] : [`${read.field} ${signedText(world, read.field, read.value)}`];
|
|
436
501
|
}
|
|
437
502
|
if ("item" in read) {
|
|
438
503
|
return read.value === 0 ? [] : [read.value === 1 && !/\d/.test(read.item) ? `${read.item} in ${read.list}` : `${read.item} ${read.value} in ${read.list}`];
|
|
@@ -525,6 +590,10 @@ function itemFormulaProblems(world, page, fields) {
|
|
|
525
590
|
...Object.values(system?.itemFormulas ?? {}).flat(),
|
|
526
591
|
...(scope.progression()?.values.map((value) => value.field) ?? []),
|
|
527
592
|
...Object.keys(fields),
|
|
593
|
+
// What every formula reads besides the fields (FOR-2).
|
|
594
|
+
"effects",
|
|
595
|
+
"rigor",
|
|
596
|
+
...(system?.load === undefined ? [] : ["load", "load-limit"]),
|
|
528
597
|
].map(comparableText));
|
|
529
598
|
return Object.entries(system?.itemFormulas ?? {}).flatMap(([list, names]) => listItems(keyOf(fields, list) === undefined ? undefined : fields[keyOf(fields, list) ?? ""]).flatMap((item) => {
|
|
530
599
|
const holder = scope.page(item.name);
|
|
@@ -573,7 +642,7 @@ function withoutDiceField(text, field) {
|
|
|
573
642
|
}
|
|
574
643
|
/** Whether a field is a number for the system: declared as one, or read by one of its computed fields, as an armor's armor-class by ac. */
|
|
575
644
|
function isReadAsNumber(world, field) {
|
|
576
|
-
return ["number", "modifier", "bonus"].includes(declaredKind(world, field) ?? "")
|
|
645
|
+
return ["number", "at-least", "modifier", "bonus"].includes(declaredKind(world, field) ?? "")
|
|
577
646
|
|| (world.system?.formulas?.computed ?? []).some(([, formula]) => fieldsRead(formula).some((name) => comparableText(name) === comparableText(field)));
|
|
578
647
|
}
|
|
579
648
|
/** Why a formula of an item's page can give no value: it reads itself, a table the system lacks, or a name no one has; undefined when none of these. */
|
|
@@ -590,6 +659,27 @@ function formulaGap(world, known, item, field, formula) {
|
|
|
590
659
|
const unknown = read.find((name) => !known.has(comparableText(name)) && keyOf(item, name) === undefined);
|
|
591
660
|
return unknown === undefined ? undefined : `reads ${unknown}, which neither the system nor the character has`;
|
|
592
661
|
}
|
|
662
|
+
/**
|
|
663
|
+
* What a formula reads for a field the page lacks (FOR-2, FOR-4, FOR-5): a bonus as 0, a factor as 1, the effects by their names, the campaign's rigor; the
|
|
664
|
+
* page's own value, as always-in lists give it, for anything else.
|
|
665
|
+
*/
|
|
666
|
+
function missingValue(world, fields, name) {
|
|
667
|
+
const kind = declaredKind(world, name);
|
|
668
|
+
if (kind === "bonus" || kind === "factor") {
|
|
669
|
+
return kind === "bonus" ? 0 : 1;
|
|
670
|
+
}
|
|
671
|
+
if (comparableText(name) === "rigor") {
|
|
672
|
+
return world.rigor;
|
|
673
|
+
}
|
|
674
|
+
// What a character carries weighs, and its limit by the system's formula (LOAD-1, LOAD-4).
|
|
675
|
+
if (comparableText(name) === "load") {
|
|
676
|
+
return fields[carriedKey];
|
|
677
|
+
}
|
|
678
|
+
if (comparableText(name) === "load-limit" && world.system?.load !== undefined) {
|
|
679
|
+
return formulaValue(world, fields, world.system.load.limit);
|
|
680
|
+
}
|
|
681
|
+
return withAlwaysIn(world, fields, name, undefined);
|
|
682
|
+
}
|
|
593
683
|
/** The scope a formula reads on these fields: computed fields by their formulas, each worked out once; a bonus field the page lacks as 0 (FOR-4, FOR-5). */
|
|
594
684
|
function formulaScope(world, fields) {
|
|
595
685
|
const formulas = world.system?.formulas;
|
|
@@ -649,7 +739,12 @@ function formulaScope(world, fields) {
|
|
|
649
739
|
}
|
|
650
740
|
const key = keys.get(comparableText(name));
|
|
651
741
|
const value = key === undefined ? undefined : fields[key];
|
|
652
|
-
|
|
742
|
+
// The effects read by their names, as has(effects, Grappled) (FOR-2).
|
|
743
|
+
if (comparableText(name) === "effects") {
|
|
744
|
+
const read = readEffects(value);
|
|
745
|
+
return "effects" in read ? read.effects.map((effect) => effect.name) : [];
|
|
746
|
+
}
|
|
747
|
+
return value === undefined ? missingValue(world, fields, name) : withAlwaysIn(world, fields, name, value);
|
|
653
748
|
},
|
|
654
749
|
table: (name) => index?.tables.get(comparableText(name)),
|
|
655
750
|
// The page an item names, of the campaign or of the system, with its effects, as a class with its hit die (D-215) or a weapon under Magic Weapon.
|
package/dist/commands/write.d.ts
CHANGED
|
@@ -47,5 +47,6 @@ export declare const write: import("../core/registry.ts").Command<z.ZodObject<{
|
|
|
47
47
|
append: z.ZodOptional<z.ZodBoolean>;
|
|
48
48
|
secret: z.ZodOptional<z.ZodBoolean>;
|
|
49
49
|
here: z.ZodOptional<z.ZodBoolean>;
|
|
50
|
+
why: z.ZodOptional<z.ZodString>;
|
|
50
51
|
}, z.core.$strip>, WriteResult>;
|
|
51
52
|
export {};
|
package/dist/commands/write.js
CHANGED
|
@@ -7,27 +7,30 @@ import { comparableText, sameName, valueNamed, withArticle } from "../core/text.
|
|
|
7
7
|
import { formatCounter, readCounter } from "../counters/index.js";
|
|
8
8
|
import { readEffects } from "../effects/index.js";
|
|
9
9
|
import { formatAmount, namesCoins, readAmount } from "../money/index.js";
|
|
10
|
-
import { alwaysInList, baseFieldOf, baseValue, changedEnvironment, changedFields, checkFieldChange, concernsPlayer, declaredKind, derivedPages, environmentAt, equippedNotes, findPage, followersOf, formatEnvironmentEntry, hidingMessage, holdsField, inheritedFields, introductionFollowersOf, introductionText, isCounterField, isDeclaredUncounted, isEmptyField, isNeverInherited, isPartyMember, isStandardField, keepersOf, linksIn, listFieldNames, misspelledFieldProblem, misspelledStandardField, namesakes, newBaseProblem, newPageFields, ownFieldChange, pageNamed, pagesWithName, pageTypeNames, parsePageReference, readEnvironment, readFieldValue, readOnlyMessage, removedFieldName, sameAsBase, sectionFollowersOf, systemKnowsReason, systemLabel, systemPageNamed, textParts, withPage, writePage, writtenFieldName, } from "../pages/index.js";
|
|
10
|
+
import { alwaysInList, baseFieldOf, baseValue, changedEnvironment, changedFields, checkFieldChange, concernsPlayer, containerFieldOf, countedText as countInText, declaredKind, derivedPages, environmentAt, equippedNotes, findPage, followersOf, formatEnvironmentEntry, goodsFieldProblems, hidingMessage, holdsField, inheritedFields, introductionFollowersOf, introductionText, isCounterField, isDeclaredUncounted, isEmptyField, isNeverInherited, isPartyMember, isPlayerCharacter, isStandardField, keepersOf, linksIn, listFieldNames, misspelledFieldProblem, misspelledStandardField, namesakes, newBaseProblem, newPageFields, ownFieldChange, pageNamed, pagesWithName, pageTypeNames, parsePageReference, readEntry, readEnvironment, readFieldValue, readOnlyMessage, removedFieldName, sameAsBase, sectionFollowersOf, systemKnowsReason, systemLabel, systemPageNamed, textParts, textsIn, withPage, writePage, writtenFieldName, } from "../pages/index.js";
|
|
11
11
|
import { featureParts, mergedFeatures } from "../progression/index.js";
|
|
12
12
|
import { effectiveFields, effectsField } from "./effect-layer.js";
|
|
13
|
+
import { bondNotes, checkBonds } from "./game-bonds.js";
|
|
13
14
|
import { conditionNotes, consequencesNotes, eventFieldsProblem, fireEvents, heldNote, nowDueNote, plannedEventDateProblem } from "./game-events.js";
|
|
14
15
|
import { experienceOf, leastNotes, newLevelNotes } from "./game-experience.js";
|
|
15
16
|
import { gridNotes } from "./game-grids.js";
|
|
16
17
|
import { hereFields, hereOf, placeHere, positionToWrite, writeOrigin } from "./game-here.js";
|
|
17
18
|
import { questPictureNote } from "./game-images.js";
|
|
19
|
+
import { checkLimits } from "./game-limits.js";
|
|
18
20
|
import { campaignCoins } from "./game-money.js";
|
|
19
21
|
import { mapLookNotes, shortRoadNotes } from "./game-positions.js";
|
|
20
22
|
import { logQuestChange, newQuestNotes, tickedQuestNotes } from "./game-quests.js";
|
|
21
|
-
import { deathNotes, isPlayerDead } from "./game-saves.js";
|
|
23
|
+
import { deathNotes, isPlayerDead, partyDeathNotes } from "./game-saves.js";
|
|
22
24
|
import { checkNotCopied, copyChanges, copyLink, copyName, copyPage, readOpenScene, updateScene } from "./game-scene.js";
|
|
25
|
+
import { diaryDueLine } from "./game-thoughts.js";
|
|
23
26
|
import { thresholdNotes } from "./game-thresholds.js";
|
|
24
27
|
import { newDatedLogEntry, readPresent } from "./game-time.js";
|
|
25
28
|
import { campaignSystem, campaignWorld, foreignSystemLanguage, leftOutNote, missingSystemHint, systemBaseHint, systemProblems, systemSearchHint } from "./game-world.js";
|
|
26
29
|
import { followersNote, keepersNote, skippedPagesNote } from "./notes.js";
|
|
27
|
-
import { partText, situationPart } from "./parts.js";
|
|
30
|
+
import { partText, partyPart, situationPart } from "./parts.js";
|
|
28
31
|
import { givenItems, progressionOf } from "./progression.js";
|
|
29
|
-
import { checkListValues, joiningNotes } from "./sheet.js";
|
|
30
|
-
import { computedField, counterLimits, hasSheet, isUse, itemLines, maximumHint, maximumSources, missingUses, signedText, startingAtZero, workedMaximum, workedParts } from "./worked-out.js";
|
|
32
|
+
import { checkListValues, joiningNotes, weightlessNote } from "./sheet.js";
|
|
33
|
+
import { computedField, counterLimits, directBonuses, hasSheet, isUse, itemLines, maximumHint, maximumSources, missingUses, signedText, startingAtZero, workedMaximum, workedParts } from "./worked-out.js";
|
|
31
34
|
// How the output names each way of writing text.
|
|
32
35
|
const textChanges = { replace: "wrote", append: "added to", remove: "removed" };
|
|
33
36
|
// Fields arrive as field=value strings from a command line, or as an object through MCP.
|
|
@@ -56,6 +59,7 @@ export const write = defineCommand({
|
|
|
56
59
|
append: z.boolean().optional().describe("add the text at the end instead of replacing"),
|
|
57
60
|
secret: z.boolean().optional().describe("with a section: create it, if missing, as a secret block > [!secret] Name"),
|
|
58
61
|
here: z.boolean().optional().describe("a new place where the journey stopped: on a road it becomes a stop there, in the open it takes the point; those who travel go into it"),
|
|
62
|
+
why: z.string().optional().describe("what the change is for, kept in the master's log"),
|
|
59
63
|
}),
|
|
60
64
|
run(input, context) {
|
|
61
65
|
const root = requireCampaign(context.folder);
|
|
@@ -67,6 +71,7 @@ export const write = defineCommand({
|
|
|
67
71
|
if ((section !== undefined || input.append) && input.text === undefined) {
|
|
68
72
|
throw new Error("Give the text to write.");
|
|
69
73
|
}
|
|
74
|
+
const why = input.why?.trim() === "" ? undefined : input.why;
|
|
70
75
|
const { coins, problem: coinsProblem } = campaignCoins(root, context);
|
|
71
76
|
const world = campaignWorld(root, context);
|
|
72
77
|
const system = campaignSystem(root, context);
|
|
@@ -91,7 +96,7 @@ export const write = defineCommand({
|
|
|
91
96
|
const moneyNotes = [...computedNotes, ...moneyNotesOf(world, reference.name, fields.set, coins, coinsProblem)];
|
|
92
97
|
if (open.scene !== undefined && copy !== undefined) {
|
|
93
98
|
checkNoEffects(fields, copyPage(copy, open.scene.copies[copy]));
|
|
94
|
-
const written = writeCopy(root, world, context, open.scene, copy, { type: input.type, text: input.text, section }, fields, coins);
|
|
99
|
+
const written = writeCopy(root, world, context, open.scene, copy, { type: input.type, text: input.text, section, why }, fields, coins);
|
|
95
100
|
return { ...written, notes: [...written.notes, ...moneyNotes] };
|
|
96
101
|
}
|
|
97
102
|
const existing = findPage(world, reference.name);
|
|
@@ -120,8 +125,11 @@ export const write = defineCommand({
|
|
|
120
125
|
checkFieldChange(type, fields);
|
|
121
126
|
environmentAsSet(world, existing, type, reference.name, fields);
|
|
122
127
|
checkValues(fields);
|
|
123
|
-
|
|
124
|
-
|
|
128
|
+
// A page that keeps the sheet, as it will be written, takes only the names the sheet closes (D-435).
|
|
129
|
+
const asWritten = { name: reference.name, path: existing?.path ?? "", body: existing?.body ?? "", ...(type === undefined ? {} : { type }), fields: { ...existing?.fields, ...fields.set } };
|
|
130
|
+
const onSheet = hasSheet(world, asWritten);
|
|
131
|
+
checkListValues(system, fields.set ?? {}, onSheet);
|
|
132
|
+
checkListValues(system, fields.add ?? {}, onSheet);
|
|
125
133
|
checkKnows(world, fields);
|
|
126
134
|
if (existing !== undefined) {
|
|
127
135
|
if (changedFieldNames(fields).some(passesOn)) {
|
|
@@ -133,11 +141,13 @@ export const write = defineCommand({
|
|
|
133
141
|
checkLists(world, existing, fields);
|
|
134
142
|
}
|
|
135
143
|
checkBase(world, existing?.name ?? reference.name, type, fields.set);
|
|
144
|
+
checkBonds(world, system, existing, existing?.name ?? reference.name, fields);
|
|
145
|
+
checkLimits(world, system, existing, existing?.name ?? reference.name, fields);
|
|
136
146
|
checkEventFields(world, existing, type, fields);
|
|
137
147
|
const written = writePage(world, reference.name, input.type, { ...fields, text: input.text, section, append: input.append, secret: input.secret });
|
|
138
148
|
const { created, changed, mode, retyped } = written;
|
|
139
149
|
if (changed) {
|
|
140
|
-
const data = { page: written.page.name, type: written.page.type, was: retyped?.type, ...fields, section, secret: input.secret, text: input.text, mode };
|
|
150
|
+
const data = { page: written.page.name, type: written.page.type, was: retyped?.type, ...fields, section, secret: input.secret, text: input.text, mode, why };
|
|
141
151
|
appendLogEntry(root, newDatedLogEntry(root, context, created ? "page-created" : "page-updated", "hidden", data));
|
|
142
152
|
}
|
|
143
153
|
// The maximum of a counter follows what the game system works out from the page as it is now (FOR-6).
|
|
@@ -157,8 +167,12 @@ export const write = defineCommand({
|
|
|
157
167
|
const self = changedNames(existing, page).some((field) => comparableText(field) === baseFieldOf(page.type)) ? [[existing, page]] : [];
|
|
158
168
|
logCounterChanges(root, context, world, now, [...self, ...followers.pages.map((follower) => [follower, follower])], coins);
|
|
159
169
|
}
|
|
160
|
-
const notes = !changed
|
|
161
|
-
|
|
170
|
+
const notes = !changed
|
|
171
|
+
? []
|
|
172
|
+
: existing === undefined
|
|
173
|
+
? baseNotesOrWeight(system, now, page)
|
|
174
|
+
: [...keepersNotes(now, existing, page), ...ownValuesNote(now, existing, page, coins)];
|
|
175
|
+
const dropped = changed ? [...droppedFromBaseNotes(now, page, fields.set), ...bondNotes(now, system, existing, page)] : [];
|
|
162
176
|
const story = changed && changedFieldNames(fields).length > 0 ? storyNotes(root, context, world, now, existing, page) : [];
|
|
163
177
|
const was = retyped === undefined ? undefined : `${retyped.type ?? "free page"} (${retyped.path})`;
|
|
164
178
|
const result = { page: page.name, type: page.type, path: page.path, created, changed, ...writtenNames(world, existing, fields, page), section, mode, was };
|
|
@@ -175,7 +189,9 @@ export const write = defineCommand({
|
|
|
175
189
|
const leftOut = changed ? changedFieldNames(fields).flatMap((field) => leftOutNote(root, context, field) ?? []) : [];
|
|
176
190
|
const opened = newQuestNotes(existing, page);
|
|
177
191
|
const picture = opened.length === 0 ? undefined : questPictureNote(root, context, now, page);
|
|
178
|
-
|
|
192
|
+
// A quest that ends is a time to write a diary (DIA-2).
|
|
193
|
+
const diary = changed && questEnds(existing, page) ? diaryDueLine(root, context, now) : "";
|
|
194
|
+
const quest = changed ? [...questEndNotes(context, system, existing, page), ...(diary === "" ? [] : [diary]), ...tickedQuestNotes(existing, page), ...opened, ...(picture === undefined ? [] : [picture])] : [];
|
|
179
195
|
// The story tells a quest taken, done or failed (D-369).
|
|
180
196
|
if (changed) {
|
|
181
197
|
logQuestChange(root, context, existing, page);
|
|
@@ -186,6 +202,8 @@ export const write = defineCommand({
|
|
|
186
202
|
// What a character has equipped and does not carry, as after its armor left its inventory (CON-12); what a formula reads of two items (PRO-5).
|
|
187
203
|
const carried = changed && page.type === "character" && changedFieldNames(fields).some((field) => ["inventory", "equipped"].includes(comparableText(field))) ? equippedNotes(now, page) : [];
|
|
188
204
|
const firsts = changed && page.type === "character" ? firstItemNotes(world, now, existing, page) : [];
|
|
205
|
+
// A count inside a text, or a field named as goods, as torches: 7: what a stack counts (STK-10, STK-13).
|
|
206
|
+
const counts = changed ? [...countedTextNotes(existing, page), ...goodsFieldProblems(now, page, changedFieldNames(fields)).map((problem) => `${problem.message} Fix: ${problem.fix}.`)] : [];
|
|
189
207
|
const map = changed
|
|
190
208
|
? [
|
|
191
209
|
...positioned.placed.notes,
|
|
@@ -196,12 +214,38 @@ export const write = defineCommand({
|
|
|
196
214
|
]
|
|
197
215
|
: [];
|
|
198
216
|
// The death of the last living player character: what the saves allow, said at once (SAV-7).
|
|
199
|
-
const
|
|
217
|
+
const died = changed && existing !== undefined && isPlayerCharacter(page) && page.fields.status === "dead" && existing.fields.status !== "dead";
|
|
218
|
+
const death = changed && isPlayerDead(now) && !isPlayerDead(world) ? deathNotes(root, page.name) : died ? partyDeathNotes(root, page.name) : [];
|
|
219
|
+
// A second living player character: how to run the table for them, once in a chat (D-480).
|
|
220
|
+
// Or one back from the dead (Elena, 24 October).
|
|
221
|
+
const risen = changed && existing?.fields.status === "dead" && page.fields.status !== "dead";
|
|
222
|
+
const partyInstructions = (joined || risen) && isPlayerCharacter(page) ? partyPart(context, system, now) : "";
|
|
200
223
|
return {
|
|
201
224
|
...result,
|
|
202
225
|
followers: followers.pages.map((follower) => follower.name),
|
|
203
226
|
followersWhy: followers.why,
|
|
204
|
-
notes: [
|
|
227
|
+
notes: [
|
|
228
|
+
...story,
|
|
229
|
+
...notes,
|
|
230
|
+
...dropped,
|
|
231
|
+
...limits.notes,
|
|
232
|
+
...gained,
|
|
233
|
+
...thresholds,
|
|
234
|
+
...levels,
|
|
235
|
+
...leftOut,
|
|
236
|
+
...quest,
|
|
237
|
+
...twice,
|
|
238
|
+
...shadows,
|
|
239
|
+
...links,
|
|
240
|
+
...carried,
|
|
241
|
+
...firsts,
|
|
242
|
+
...counts,
|
|
243
|
+
...map,
|
|
244
|
+
...sheet,
|
|
245
|
+
...death,
|
|
246
|
+
...moneyNotes,
|
|
247
|
+
...(partyInstructions === "" ? [] : [partyInstructions]),
|
|
248
|
+
],
|
|
205
249
|
problems: world.problems,
|
|
206
250
|
};
|
|
207
251
|
},
|
|
@@ -221,9 +265,21 @@ export const write = defineCommand({
|
|
|
221
265
|
return [[summary, followers, ...result.notes].filter((line) => line !== "").join("\n"), skippedPagesNote(result.problems)].filter((block) => block !== "").join("\n\n");
|
|
222
266
|
},
|
|
223
267
|
});
|
|
268
|
+
/** "torce 7" written in an inventory: a count inside a text, which nothing counts, and how goods are counted instead (STK-10). */
|
|
269
|
+
function countedTextNotes(existing, page) {
|
|
270
|
+
const field = containerFieldOf(page.type);
|
|
271
|
+
const before = field === undefined ? [] : textsIn(existing?.fields[field]).map((entry) => entry.trim());
|
|
272
|
+
const added = field === undefined ? [] : textsIn(page.fields[field]).filter((entry) => !before.includes(entry.trim()));
|
|
273
|
+
return added.filter((entry) => readEntry(entry).shape === "text" && countInText(entry) !== undefined).map((entry) => `"${entry}" is a count inside a text, which nothing counts: goods are a stack, a kind and how many. The system's kinds go by their English names, as find shows them: `
|
|
274
|
+
+ `write the one it has with your word as its label, such as [[Torch|torcia]] 3; only what the system lacks becomes a kind of the campaign, made first with write "<name>", type item.`);
|
|
275
|
+
}
|
|
224
276
|
/** A type as the parameter names it, with what tells a place from an item (D-155, D-156). */
|
|
225
277
|
function typeText(type) {
|
|
226
|
-
return type === "place"
|
|
278
|
+
return type === "place"
|
|
279
|
+
? "place (a room, a house, a ship, a region)"
|
|
280
|
+
: type === "item"
|
|
281
|
+
? "item (a thing, even one with someone inside, such as a cart; one with words or a drawing to read again, such as a letter, a notice or a map, has document=letter, notice, map…)"
|
|
282
|
+
: type;
|
|
227
283
|
}
|
|
228
284
|
/** Writes the fields of a copy in the open scene (INH-14): only what differs from its creature, never its text, the creature it copies or fixed fields. */
|
|
229
285
|
function writeCopy(root, world, context, scene, name, input, requested, coins) {
|
|
@@ -260,7 +316,7 @@ function writeCopy(root, world, context, scene, name, input, requested, coins) {
|
|
|
260
316
|
const changed = [...new Set([...Object.keys(own), ...Object.keys(after)])].filter((field) => JSON.stringify(own[field]) !== JSON.stringify(after[field]));
|
|
261
317
|
if (changed.length > 0) {
|
|
262
318
|
updateScene(root, changed.map((field) => [["copies", name, field], after[field]]));
|
|
263
|
-
appendLogEntry(root, newDatedLogEntry(root, context, "page-updated", "hidden", { page: name, copy: true, ...requested }));
|
|
319
|
+
appendLogEntry(root, newDatedLogEntry(root, context, "page-updated", "hidden", { page: name, copy: true, ...requested, why: input.why }));
|
|
264
320
|
}
|
|
265
321
|
const result = { page: name, type: before.type, path: "state.yaml", created: false, changed: changed.length > 0, ...writtenNames(world, before, requested, copyPage(name, { creature, ...after })) };
|
|
266
322
|
return { ...result, copyOf: creature, followers: [], followersWhy: "", notes: [], problems: world.problems };
|
|
@@ -573,6 +629,11 @@ function droppedFromBaseNotes(now, page, set) {
|
|
|
573
629
|
return missing.length === 0 ? [] : [`${field} on ${page.name} leaves out ${missing.join(", ")}, which it read from ${base.base.name}: if the character keeps ${them}, add ${them}, such as add ${field}=${missing[0]}.`];
|
|
574
630
|
});
|
|
575
631
|
}
|
|
632
|
+
/** What a new page is told of its base; a weight is asked only of an item with no base to look for, which would give one (LOAD-1). */
|
|
633
|
+
function baseNotesOrWeight(system, now, page) {
|
|
634
|
+
const notes = [...derivesFromNothingNote(now, page), ...noBaseNote(now, page)];
|
|
635
|
+
return notes.length > 0 ? notes : weightlessNote(system, now, page);
|
|
636
|
+
}
|
|
576
637
|
/** A page created with a name that other pages give as their creature or item, though it is not one: they derive from nothing (INH-2). */
|
|
577
638
|
function derivesFromNothingNote(now, page) {
|
|
578
639
|
return ["creature", "item"].filter((field) => field !== page.type).flatMap((field) => {
|
|
@@ -801,7 +862,7 @@ function withoutComputed(world, target, set, name, type) {
|
|
|
801
862
|
return `${found.name} ${value}${numberOf(found.given) === found.value ? ", as you gave it" : ` (you gave ${String(found.given)})`}`;
|
|
802
863
|
});
|
|
803
864
|
const sources = [...new Set(computed.flatMap((found) => found.from))];
|
|
804
|
-
const bonuses =
|
|
865
|
+
const bonuses = [...new Set(computed.flatMap((found) => directBonuses(world, found)))];
|
|
805
866
|
const bonus = bonuses.length === 0 ? "" : ` A bonus such as ${bonuses[0]} comes from an effect, for what gives one, such as a magic item.`;
|
|
806
867
|
const note = `Not written, the system ${world.system?.name ?? ""} works ${computed.length === 1 ? "it" : "them"} out: ${values.join("; ")}. They come from ${sources.join(", ")}.${bonus}`;
|
|
807
868
|
return { set: kept, note };
|
|
@@ -826,13 +887,17 @@ function listsWithoutComputed(world, target, lists) {
|
|
|
826
887
|
}
|
|
827
888
|
/** The part quest-ends when a quest is done or failed, such as the experience the story gives (D-233), once in a chat (D-97). */
|
|
828
889
|
function questEndNotes(context, system, existing, page) {
|
|
829
|
-
|
|
830
|
-
if (page.type !== "quest" || !ended(page) || ended(existing)) {
|
|
890
|
+
if (!questEnds(existing, page)) {
|
|
831
891
|
return [];
|
|
832
892
|
}
|
|
833
893
|
const part = situationPart("quest-ends", context, system);
|
|
834
894
|
return part === "" ? [] : [`${page.name} is ${String(page.fields.status)}. ${part}`];
|
|
835
895
|
}
|
|
896
|
+
/** Whether this write ends a quest: done or failed now, and not before. */
|
|
897
|
+
function questEnds(existing, page) {
|
|
898
|
+
const ended = (candidate) => ["done", "failed"].includes(String(candidate?.fields.status));
|
|
899
|
+
return page.type === "quest" && ended(page) && !ended(existing);
|
|
900
|
+
}
|
|
836
901
|
/** Items written in a list where the parts of the classes already put them, as a domain's spell in prepared: always there, they do not count with the rest (PRO-7). */
|
|
837
902
|
function givenListNotes(world, page, changed) {
|
|
838
903
|
const progression = progressionOf(world, effectiveFields(world, page));
|
|
@@ -1003,9 +1068,16 @@ function oneItemLists(world, set, type) {
|
|
|
1003
1068
|
};
|
|
1004
1069
|
return Object.fromEntries(Object.entries(set).map(([name, value]) => [name, listOf(name, value)]));
|
|
1005
1070
|
}
|
|
1006
|
-
/**
|
|
1071
|
+
/**
|
|
1072
|
+
* Text given through MCP to a field that is always a list, such as "[[A]], [[B]]", or written as a list, such as "[dex, int]", read as the command line reads it
|
|
1073
|
+
* (D-136); any other value as it is.
|
|
1074
|
+
*/
|
|
1007
1075
|
function listFromText(name, value) {
|
|
1008
|
-
|
|
1076
|
+
if (typeof value !== "string") {
|
|
1077
|
+
return value;
|
|
1078
|
+
}
|
|
1079
|
+
const writtenAsList = /^\[(?!\[).*\]$/s.test(value.trim());
|
|
1080
|
+
return writtenAsList || listFieldNames.some((field) => comparableText(field) === comparableText(name)) ? readFieldValue(value) : value;
|
|
1009
1081
|
}
|
|
1010
1082
|
function readAssignment(assignment) {
|
|
1011
1083
|
const separator = assignment.indexOf("=");
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Confirm, Confirmed } from "../core/context.ts";
|
|
2
|
+
/** A program that shows the window: its file, its arguments, and what it reads from the environment; how its exit reads. */
|
|
3
|
+
export interface DialogCommand {
|
|
4
|
+
file: string;
|
|
5
|
+
args: string[];
|
|
6
|
+
env: Record<string, string>;
|
|
7
|
+
/** How this program says yes: an exit code, or what it writes. */
|
|
8
|
+
yes: {
|
|
9
|
+
code?: number;
|
|
10
|
+
out?: string;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The window of the player's operating system (D-478): it asks, and says yes, no, or none when no window can be shown, as over SSH. `run` starts a program; a
|
|
15
|
+
* fake in tests.
|
|
16
|
+
*/
|
|
17
|
+
export declare function systemConfirm(platform: string, env: Record<string, string | undefined>, run?: typeof runDialog): Confirm;
|
|
18
|
+
/** The programs that may show the window on this system, in turn, with its buttons, Windows' own Yes and No: none without a desktop (D-478). */
|
|
19
|
+
export declare function dialogCommands(platform: string, env: Record<string, string | undefined>, title: string, text: string, answers?: {
|
|
20
|
+
yes: string;
|
|
21
|
+
no: string;
|
|
22
|
+
}): DialogCommand[];
|
|
23
|
+
/** What a window said, from how its program ended: yes, no, or none when it could not show one. */
|
|
24
|
+
export declare function dialogAnswer(command: DialogCommand, ran: {
|
|
25
|
+
code: number | null;
|
|
26
|
+
out: string;
|
|
27
|
+
}): Confirmed;
|
|
28
|
+
/** A package's own words as a window shows them: no control or direction characters, which could hide or turn what it says, and no longer than `most`. */
|
|
29
|
+
export declare function plainText(text: string, most: number): string;
|
|
30
|
+
/** Runs a window's program: how it ended and what it wrote; "missing" when it is not on this computer. Closed when the call is stopped, or after half an hour. */
|
|
31
|
+
declare function runDialog(command: DialogCommand, signal?: AbortSignal): Promise<{
|
|
32
|
+
code: number | null;
|
|
33
|
+
out: string;
|
|
34
|
+
} | "missing">;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
// The longest text a window shows: what the package says of itself is cut there.
|
|
3
|
+
const mostText = 600;
|
|
4
|
+
// How long the window waits, as a form does.
|
|
5
|
+
const longestWait = 30 * 60 * 1000;
|
|
6
|
+
// The buttons of a window that asks nothing else: a package's install (D-478).
|
|
7
|
+
const installAnswers = { yes: "Install", no: "Do not install" };
|
|
8
|
+
// Windows' own PowerShell: a message box, No first, on top of the other windows; none at all without a desktop to show it on.
|
|
9
|
+
const windowsScript = [
|
|
10
|
+
"if (-not [Environment]::UserInteractive) { exit 12 }",
|
|
11
|
+
"Add-Type -AssemblyName System.Windows.Forms",
|
|
12
|
+
"$answer = [System.Windows.Forms.MessageBox]::Show($env:RPG_CONFIRM_TEXT, $env:RPG_CONFIRM_TITLE, 'YesNo', 'Warning', 'Button2', 'DefaultDesktopOnly')",
|
|
13
|
+
"if ($answer -eq 'Yes') { exit 10 } else { exit 11 }",
|
|
14
|
+
].join("; ");
|
|
15
|
+
// macOS's AppleScript: the title, the text and the buttons as its arguments, the no first and the answer to Escape.
|
|
16
|
+
const macScript = [
|
|
17
|
+
"on run argv",
|
|
18
|
+
"display dialog (item 2 of argv) with title (item 1 of argv) buttons {item 3 of argv, item 4 of argv} default button (item 3 of argv) cancel button (item 3 of argv) with icon caution",
|
|
19
|
+
'return "yes"',
|
|
20
|
+
"end run",
|
|
21
|
+
];
|
|
22
|
+
/**
|
|
23
|
+
* The window of the player's operating system (D-478): it asks, and says yes, no, or none when no window can be shown, as over SSH. `run` starts a program; a
|
|
24
|
+
* fake in tests.
|
|
25
|
+
*/
|
|
26
|
+
export function systemConfirm(platform, env, run = runDialog) {
|
|
27
|
+
return {
|
|
28
|
+
ask: async (title, text, signal, answers) => {
|
|
29
|
+
for (const command of dialogCommands(platform, env, title, text, answers)) {
|
|
30
|
+
const ran = await run(command, signal);
|
|
31
|
+
if (ran !== "missing") {
|
|
32
|
+
return dialogAnswer(command, ran);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return "none";
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/** The programs that may show the window on this system, in turn, with its buttons, Windows' own Yes and No: none without a desktop (D-478). */
|
|
40
|
+
export function dialogCommands(platform, env, title, text, answers = installAnswers) {
|
|
41
|
+
const [shownTitle, shownText] = [plainText(title, 100), plainText(text, mostText)];
|
|
42
|
+
const [yes, no] = [plainText(answers.yes, 40), plainText(answers.no, 40)];
|
|
43
|
+
if (platform === "win32") {
|
|
44
|
+
const shell = `${env.SystemRoot ?? "C:\\Windows"}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
|
|
45
|
+
return [{ file: shell, args: ["-NoProfile", "-NonInteractive", "-Command", windowsScript], env: { RPG_CONFIRM_TITLE: shownTitle, RPG_CONFIRM_TEXT: shownText }, yes: { code: 10 } }];
|
|
46
|
+
}
|
|
47
|
+
if (platform === "darwin") {
|
|
48
|
+
return [{ file: "/usr/bin/osascript", args: [...macScript.flatMap((line) => ["-e", line]), shownTitle, shownText, no, yes], env: {}, yes: { out: "yes" } }];
|
|
49
|
+
}
|
|
50
|
+
if ((env.DISPLAY ?? "") === "" && (env.WAYLAND_DISPLAY ?? "") === "") {
|
|
51
|
+
return [];
|
|
52
|
+
}
|
|
53
|
+
return [
|
|
54
|
+
{ file: "zenity", args: ["--question", "--default-cancel", "--no-markup", `--title=${shownTitle}`, `--text=${shownText}`, `--ok-label=${yes}`, `--cancel-label=${no}`], env: {}, yes: { code: 0 } },
|
|
55
|
+
{ file: "kdialog", args: ["--title", shownTitle, "--warningyesno", shownText, "--yes-label", yes, "--no-label", no], env: {}, yes: { code: 0 } },
|
|
56
|
+
];
|
|
57
|
+
}
|
|
58
|
+
/** What a window said, from how its program ended: yes, no, or none when it could not show one. */
|
|
59
|
+
export function dialogAnswer(command, ran) {
|
|
60
|
+
const said = command.yes.out === undefined ? ran.code === command.yes.code : ran.out.trim() === command.yes.out && ran.code === 0;
|
|
61
|
+
if (said) {
|
|
62
|
+
return "yes";
|
|
63
|
+
}
|
|
64
|
+
// Windows' script says when there is no desktop; anything else that ended is the player's no, or the window closed.
|
|
65
|
+
return command.yes.code === 10 && ran.code !== 11 ? "none" : "no";
|
|
66
|
+
}
|
|
67
|
+
/** A package's own words as a window shows them: no control or direction characters, which could hide or turn what it says, and no longer than `most`. */
|
|
68
|
+
export function plainText(text, most) {
|
|
69
|
+
const plain = text.replace(/[\u0000-\u0008\u000b-\u001f\u007f\u202a-\u202e\u2066-\u2069]/g, "").trim();
|
|
70
|
+
return plain.length <= most ? plain : `${plain.slice(0, most - 1)}…`;
|
|
71
|
+
}
|
|
72
|
+
/** Runs a window's program: how it ended and what it wrote; "missing" when it is not on this computer. Closed when the call is stopped, or after half an hour. */
|
|
73
|
+
function runDialog(command, signal) {
|
|
74
|
+
return new Promise((done) => {
|
|
75
|
+
const child = spawn(command.file, command.args, { env: { ...process.env, ...command.env }, stdio: ["ignore", "pipe", "ignore"], windowsHide: false });
|
|
76
|
+
let out = "";
|
|
77
|
+
const stop = () => {
|
|
78
|
+
child.kill();
|
|
79
|
+
};
|
|
80
|
+
const timer = setTimeout(stop, longestWait);
|
|
81
|
+
signal?.addEventListener("abort", stop, { once: true });
|
|
82
|
+
child.stdout.setEncoding("utf8");
|
|
83
|
+
child.stdout.on("data", (chunk) => (out += chunk));
|
|
84
|
+
child.on("error", (error) => {
|
|
85
|
+
clearTimeout(timer);
|
|
86
|
+
done(error.code === "ENOENT" ? "missing" : { code: null, out });
|
|
87
|
+
});
|
|
88
|
+
child.on("close", (code) => {
|
|
89
|
+
clearTimeout(timer);
|
|
90
|
+
signal?.removeEventListener("abort", stop);
|
|
91
|
+
done({ code, out });
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { dialogAnswer, type DialogCommand, dialogCommands, plainText, systemConfirm } from "./confirm.ts";
|