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
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Context } from "../core/context.ts";
|
|
2
|
+
import { type Page, type World } from "../pages/index.ts";
|
|
3
|
+
import type { GameSystem } from "../systems/index.ts";
|
|
4
|
+
/** The upkeep of each midnight passed (UPK-1–UPK-3), for the party members who keep a sheet, under the rigor «rules» or «simulation»; the lines that say it. */
|
|
5
|
+
export declare function dailyUpkeep(root: string, context: Context, system: GameSystem | undefined, days: number): string[];
|
|
6
|
+
/**
|
|
7
|
+
* What an effect named after something that burns asks (UPK-3), as Torch: the kind it spends, its own or its fuel, such as Oil for a lantern, and how long it lasts;
|
|
8
|
+
* refused when the holder carries none. Undefined for any other effect.
|
|
9
|
+
*/
|
|
10
|
+
export declare function burning(system: GameSystem | undefined, world: World, holder: Page, name: string): {
|
|
11
|
+
kind: Page;
|
|
12
|
+
lasts: string;
|
|
13
|
+
} | undefined;
|
|
14
|
+
/** For an effect named after something that burns (UPK-3), what it spends, by the holder's name for it, as Torcia, and how many of it the holder still carries. */
|
|
15
|
+
export declare function fuelLeft(system: GameSystem | undefined, world: World, holder: Page, name: string): {
|
|
16
|
+
fuel: string;
|
|
17
|
+
left: number;
|
|
18
|
+
} | undefined;
|
|
19
|
+
/** Spends one of what burns from what the holder carries (UPK-3), with its line in the log; the line that says it. */
|
|
20
|
+
export declare function burnOne(root: string, context: Context, holderName: string, kind: Page): string;
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
// What the party uses up each day under the rigor «rules» (D-435, UPK-1–UPK-3): a ration each outside a settlement, the days without food and what they bring,
|
|
2
|
+
// and a word on water.
|
|
3
|
+
import { readSettings } from "../campaign/index.js";
|
|
4
|
+
import { parseFormula } from "../core/formula.js";
|
|
5
|
+
import { appendLogEntry } from "../core/log.js";
|
|
6
|
+
import { comparableText, valueNamed } from "../core/text.js";
|
|
7
|
+
import { formatCounter, readCounter } from "../counters/index.js";
|
|
8
|
+
import { formatAmount, payCoins, readAmount, totalOf } from "../money/index.js";
|
|
9
|
+
import { baseChain, heldStacksOfKind, kindNamed, locate, writePage } from "../pages/index.js";
|
|
10
|
+
import { effectiveFields } from "./effect-layer.js";
|
|
11
|
+
import { campaignCoins } from "./game-money.js";
|
|
12
|
+
import { partyPages } from "./game-recipes.js";
|
|
13
|
+
import { writeStacks } from "./game-stacks.js";
|
|
14
|
+
import { newDatedLogEntry } from "./game-time.js";
|
|
15
|
+
import { campaignWorld } from "./game-world.js";
|
|
16
|
+
import { formulaValue, hasSheet } from "./worked-out.js";
|
|
17
|
+
// Where a day's meals come from the lifestyle, not from what one carries: a place of these kinds, or one inside it (UPK-1).
|
|
18
|
+
const settlementKinds = ["city", "town", "village", "inn"];
|
|
19
|
+
/** The upkeep of each midnight passed (UPK-1–UPK-3), for the party members who keep a sheet, under the rigor «rules» or «simulation»; the lines that say it. */
|
|
20
|
+
export function dailyUpkeep(root, context, system, days) {
|
|
21
|
+
const upkeep = system?.upkeep;
|
|
22
|
+
const rigor = readSettings(root).rigor;
|
|
23
|
+
if (upkeep === undefined || days <= 0 || (rigor !== "rules" && rigor !== "simulation")) {
|
|
24
|
+
return [];
|
|
25
|
+
}
|
|
26
|
+
const lines = [];
|
|
27
|
+
let thirsty = false;
|
|
28
|
+
for (let day = 0; day < days; day++) {
|
|
29
|
+
const world = campaignWorld(root, context);
|
|
30
|
+
const members = partyPages(world).filter((page) => hasSheet(world, page));
|
|
31
|
+
thirsty ||= members.some((member) => !inSettlement(world, member));
|
|
32
|
+
lines.push(...members.map((member) => safeUpkeep(root, context, member.name, upkeep)).filter((line) => line !== ""));
|
|
33
|
+
}
|
|
34
|
+
// Water once, however many midnights passed outside a settlement; a line that says the same each day, once.
|
|
35
|
+
return [...new Set(lines), ...(thirsty && upkeep.water !== undefined ? [`Water: ${upkeep.water}. Read ${upkeep.rules}.`] : [])];
|
|
36
|
+
}
|
|
37
|
+
/** One member's day, which never stops the time that has passed: a page that cannot be written becomes a line with what to do (UPK-1). */
|
|
38
|
+
function safeUpkeep(root, context, name, upkeep) {
|
|
39
|
+
try {
|
|
40
|
+
return memberUpkeep(root, context, name, upkeep);
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
const why = (error instanceof Error ? error.message : String(error)).replace(/ ?Nothing (changed|moved)[^.]*\.?$/, "");
|
|
44
|
+
return `${name}'s day could not be counted: ${why} Fix it, then charge the day with change.`;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/** One member's day (UPK-1, UPK-2): a meal in a settlement, else a ration from what it carries, else a day more without food, and past the grace a level of what it brings. */
|
|
48
|
+
function memberUpkeep(root, context, name, upkeep) {
|
|
49
|
+
const world = campaignWorld(root, context);
|
|
50
|
+
const member = world.pages.find((page) => page.name === name);
|
|
51
|
+
if (member === undefined) {
|
|
52
|
+
return "";
|
|
53
|
+
}
|
|
54
|
+
const fields = effectiveFields(world, member);
|
|
55
|
+
const hungry = Number(valueNamed(fields, upkeep.short) ?? 0) || 0;
|
|
56
|
+
if (inSettlement(world, member)) {
|
|
57
|
+
const paid = upkeep.lifestyle === undefined ? "" : lifestylePaid(root, context, world, member, upkeep.lifestyle);
|
|
58
|
+
const ate = hungry !== 0 && setNumber(root, context, campaignWorld(root, context), member, upkeep.short, 0, "ate in a settlement") ? `${member.name} ate: ${upkeep.short} back to 0.` : "";
|
|
59
|
+
return [paid, ate].filter((line) => line !== "").join(" ");
|
|
60
|
+
}
|
|
61
|
+
// The system's kind, or one of the campaign that derives from it, as Razioni from Rations.
|
|
62
|
+
const kind = kindNamed(world, member, upkeep.daily);
|
|
63
|
+
const held = kind === undefined ? [] : heldStacksOfKind(world, member, kind);
|
|
64
|
+
if (kind !== undefined && held.length > 0) {
|
|
65
|
+
const { container, stack } = held[0];
|
|
66
|
+
const step = { container, kind: stack.kind, before: stack.count, after: stack.count - 1, ...(stack.label === undefined ? {} : { label: stack.label }) };
|
|
67
|
+
const spent = writeStacks(root, context, world, [step], "a day's food", { upkeep: true }).notes.join(" ");
|
|
68
|
+
const fed = hungry > 0 && setNumber(root, context, campaignWorld(root, context), member, upkeep.short, 0, "a day's food") ? ` ${upkeep.short} back to 0.` : "";
|
|
69
|
+
// The last one eaten is said, for the player to hear before the day without (UPK-2).
|
|
70
|
+
const left = held.reduce((total, holding) => total + holding.stack.count, 0) - 1;
|
|
71
|
+
const last = left === 0 ? ` That was the last ${upkeep.daily}: tell the player before tomorrow.` : "";
|
|
72
|
+
return `${member.name} eats a day's food: ${spent}${fed}${last}`;
|
|
73
|
+
}
|
|
74
|
+
const days = hungry + 1;
|
|
75
|
+
setNumber(root, context, world, member, upkeep.short, days, "a day without food");
|
|
76
|
+
const grace = Math.max(1, formulaValue(world, fields, parseFormula(upkeep.grace)) ?? 1);
|
|
77
|
+
if (days <= grace) {
|
|
78
|
+
return `${member.name} has no ${upkeep.daily}: ${upkeep.short} ${days}, of ${grace} before ${upkeep.worsens}. Read ${upkeep.rules}.`;
|
|
79
|
+
}
|
|
80
|
+
const worse = raise(root, context, campaignWorld(root, context), member.name, upkeep.worsens);
|
|
81
|
+
return `${member.name} has no ${upkeep.daily}: ${upkeep.short} ${days}, past ${grace}: ${upkeep.worsens} ${worse}. Read ${upkeep.rules}.`;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* A day in a settlement paid from the purse by the lifestyle chosen (UPK-4): the line that says it, or what to do when none is chosen or the purse is short.
|
|
85
|
+
*/
|
|
86
|
+
function lifestylePaid(root, context, world, member, lifestyle) {
|
|
87
|
+
const chosen = valueNamed(effectiveFields(world, member), lifestyle.field);
|
|
88
|
+
const named = Object.keys(lifestyle.costs).find((name) => typeof chosen === "string" && comparableText(name) === comparableText(chosen));
|
|
89
|
+
const { coins } = campaignCoins(root, context);
|
|
90
|
+
if (named === undefined) {
|
|
91
|
+
const names = Object.keys(lifestyle.costs);
|
|
92
|
+
const example = names[Math.floor(names.length / 2)];
|
|
93
|
+
const who = member.fields.role === "pc" ? "ask the player, then " : "";
|
|
94
|
+
// A lifestyle of the campaign's has no price the system knows: the master charges it.
|
|
95
|
+
return typeof chosen === "string" && chosen.trim() !== ""
|
|
96
|
+
? `${member.name}'s ${lifestyle.field} ${chosen} has no price here: charge the day with change ${member.name} money, or set one of ${names.join(", ")}. Read ${lifestyle.rules}.`
|
|
97
|
+
: `${member.name} has no ${lifestyle.field} to pay a day in a settlement: ${who}set ${lifestyle.field}=${example}, one of ${names.join(", ")}. Read ${lifestyle.rules}.`;
|
|
98
|
+
}
|
|
99
|
+
const price = coins === undefined ? undefined : readAmount(lifestyle.costs[named], coins);
|
|
100
|
+
if (coins === undefined || price === undefined || totalOf(price, coins) === 0) {
|
|
101
|
+
return "";
|
|
102
|
+
}
|
|
103
|
+
const purse = readAmount(valueNamed(member.fields, "money") ?? "", coins) ?? {};
|
|
104
|
+
const payment = payCoins(purse, price, coins);
|
|
105
|
+
const before = formatAmount(purse, coins);
|
|
106
|
+
if (payment === undefined) {
|
|
107
|
+
return `${member.name} cannot pay a ${named} day, ${lifestyle.costs[named]}, with money ${before}: a poorer lifestyle, work or a debt, as you judge. Read ${lifestyle.rules}.`;
|
|
108
|
+
}
|
|
109
|
+
const after = formatAmount(payment.purse, coins);
|
|
110
|
+
writePage(world, member.name, undefined, { set: { money: after } });
|
|
111
|
+
appendLogEntry(root, newDatedLogEntry(root, context, "counter-changed", "public", { page: member.name, field: "money", before, after, why: `a ${named} day`, upkeep: true }));
|
|
112
|
+
return `${member.name} pays a ${named} day: money ${before} → ${after}.`;
|
|
113
|
+
}
|
|
114
|
+
/** Whether a page stands in a settlement, or in a place inside one (UPK-1). */
|
|
115
|
+
function inSettlement(world, page) {
|
|
116
|
+
return locate(world, page).chain.some((place) => typeof place.fields.kind === "string" && settlementKinds.includes(comparableText(place.fields.kind.trim())));
|
|
117
|
+
}
|
|
118
|
+
/** Writes a plain number on a page, with its line in the log; false when it already held it. */
|
|
119
|
+
function setNumber(root, context, world, page, field, value, why) {
|
|
120
|
+
const before = Number(valueNamed(page.fields, field) ?? 0) || 0;
|
|
121
|
+
if (before === value) {
|
|
122
|
+
return false;
|
|
123
|
+
}
|
|
124
|
+
writePage(world, page.name, undefined, value === 0 ? { unset: [field] } : { set: { [field]: value } });
|
|
125
|
+
appendLogEntry(root, newDatedLogEntry(root, context, "counter-changed", "public", { page: page.name, field, before: String(before), after: String(value), why, upkeep: true }));
|
|
126
|
+
return true;
|
|
127
|
+
}
|
|
128
|
+
/** Raises a counter by one, up to its maximum, as the page writes it: "1 → 2". */
|
|
129
|
+
function raise(root, context, world, name, field) {
|
|
130
|
+
const page = world.pages.find((candidate) => candidate.name === name);
|
|
131
|
+
if (page === undefined) {
|
|
132
|
+
return "";
|
|
133
|
+
}
|
|
134
|
+
const read = readCounter(valueNamed(effectiveFields(world, page), field)) ?? { value: 0 };
|
|
135
|
+
const written = readCounter(valueNamed(page.fields, field));
|
|
136
|
+
const after = Math.min(read.value + 1, read.max ?? Number.POSITIVE_INFINITY);
|
|
137
|
+
const value = written?.max === undefined ? after : formatCounter({ ...written, value: after });
|
|
138
|
+
writePage(world, page.name, undefined, { set: { [field]: value } });
|
|
139
|
+
appendLogEntry(root, newDatedLogEntry(root, context, "counter-changed", "public", { page: page.name, field, before: String(read.value), after: String(after), why: "days without food", upkeep: true }));
|
|
140
|
+
return `${read.value} → ${after}`;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* What an effect named after something that burns asks (UPK-3), as Torch: the kind it spends, its own or its fuel, such as Oil for a lantern, and how long it lasts;
|
|
144
|
+
* refused when the holder carries none. Undefined for any other effect.
|
|
145
|
+
*/
|
|
146
|
+
export function burning(system, world, holder, name) {
|
|
147
|
+
const entry = burningEntry(system, world, holder, name);
|
|
148
|
+
if (entry === undefined) {
|
|
149
|
+
return undefined;
|
|
150
|
+
}
|
|
151
|
+
const [burns, { lasts, spends }] = entry;
|
|
152
|
+
const kind = kindNamed(world, holder, spends ?? burns);
|
|
153
|
+
if (kind === undefined || heldStacksOfKind(world, holder, kind).length === 0) {
|
|
154
|
+
throw new Error(`${holder.name} carries no ${spends ?? burns}, in what it holds, to light ${burns}. If the story gives some, add it to what ${holder.name} carries first. Nothing changed.`);
|
|
155
|
+
}
|
|
156
|
+
return { kind, lasts };
|
|
157
|
+
}
|
|
158
|
+
/** For an effect named after something that burns (UPK-3), what it spends, by the holder's name for it, as Torcia, and how many of it the holder still carries. */
|
|
159
|
+
export function fuelLeft(system, world, holder, name) {
|
|
160
|
+
if (Object.keys(system?.burning ?? {}).length === 0) {
|
|
161
|
+
return undefined;
|
|
162
|
+
}
|
|
163
|
+
// Only to show: a name two pages share, which a command would refuse, burns nothing here.
|
|
164
|
+
try {
|
|
165
|
+
const entry = burningEntry(system, world, holder, name);
|
|
166
|
+
const kind = entry === undefined ? undefined : kindNamed(world, holder, entry[1].spends ?? entry[0]);
|
|
167
|
+
return kind === undefined ? undefined : { fuel: kind.name, left: heldStacksOfKind(world, holder, kind).reduce((total, held) => total + held.stack.count, 0) };
|
|
168
|
+
}
|
|
169
|
+
catch {
|
|
170
|
+
return undefined;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
/** Spends one of what burns from what the holder carries (UPK-3), with its line in the log; the line that says it. */
|
|
174
|
+
export function burnOne(root, context, holderName, kind) {
|
|
175
|
+
const world = campaignWorld(root, context);
|
|
176
|
+
const holder = world.pages.find((page) => page.name === holderName);
|
|
177
|
+
const held = holder === undefined ? [] : heldStacksOfKind(world, holder, kind);
|
|
178
|
+
if (held.length === 0) {
|
|
179
|
+
return "";
|
|
180
|
+
}
|
|
181
|
+
const { container, stack } = held[0];
|
|
182
|
+
const step = { container, kind: stack.kind, before: stack.count, after: stack.count - 1, ...(stack.label === undefined ? {} : { label: stack.label }) };
|
|
183
|
+
return writeStacks(root, context, world, [step], "lit").notes.join(" ");
|
|
184
|
+
}
|
|
185
|
+
/** The system's entry of what burns that an effect is named after (UPK-3): by its name, or by a kind of the campaign that derives from it, as Torcia from Torch. */
|
|
186
|
+
function burningEntry(system, world, holder, name) {
|
|
187
|
+
const named = kindNamed(world, holder, name);
|
|
188
|
+
const names = [name, ...(named === undefined ? [] : [named, ...baseChain(world, named)].map((page) => page.name))];
|
|
189
|
+
return Object.entries(system?.burning ?? {}).find(([burns]) => names.some((candidate) => comparableText(burns) === comparableText(candidate)));
|
|
190
|
+
}
|
|
@@ -12,6 +12,11 @@ export interface ShownQuest {
|
|
|
12
12
|
place?: string;
|
|
13
13
|
/** Its text as the character knows it, without the goals. */
|
|
14
14
|
text: string;
|
|
15
|
+
/** Its secrets in that text that only some of the player characters discovered, each with who (VIEW-12). */
|
|
16
|
+
knownBy?: {
|
|
17
|
+
secret: string;
|
|
18
|
+
who: string[];
|
|
19
|
+
}[];
|
|
15
20
|
goals: {
|
|
16
21
|
text: string;
|
|
17
22
|
done: boolean;
|
|
@@ -63,6 +68,12 @@ export interface ShownChapter {
|
|
|
63
68
|
open: boolean;
|
|
64
69
|
facts: JournalFact[];
|
|
65
70
|
}
|
|
71
|
+
/** A line of a companion's diary as the journal shows it (DIA-4): who wrote it, as the character knows them, when in the game, and what. */
|
|
72
|
+
export interface ShownThought {
|
|
73
|
+
who: string;
|
|
74
|
+
date?: string;
|
|
75
|
+
text: string;
|
|
76
|
+
}
|
|
66
77
|
/**
|
|
67
78
|
* A fact of the story as the journal tells it (VIEW-9), as data the dashboard writes in its language, with its game date: who and where as the character knows
|
|
68
79
|
* them, someone, creature and somewhere for those it does not (D-254); an effect with its end, and the line status gives it.
|
|
@@ -90,6 +101,8 @@ export type StoryFact = {
|
|
|
90
101
|
field: string;
|
|
91
102
|
before: string;
|
|
92
103
|
after: string;
|
|
104
|
+
stack?: boolean;
|
|
105
|
+
upkeep?: true;
|
|
93
106
|
} | {
|
|
94
107
|
kind: "time";
|
|
95
108
|
from?: string;
|
|
@@ -128,7 +141,7 @@ export type StoryFact = {
|
|
|
128
141
|
export type JournalFact = Extract<StoryFact, {
|
|
129
142
|
kind: (typeof storyKinds)[number];
|
|
130
143
|
}>;
|
|
131
|
-
declare const storyKinds: readonly ["counter", "
|
|
144
|
+
declare const storyKinds: readonly ["counter", "moved", "learned", "effect", "effect-ended", "back", "quest"];
|
|
132
145
|
/** A page as the journal shows it: its kind and picture, as the player character knows it; a place's, else that of the nearest place that holds it. */
|
|
133
146
|
export type PlaceLook = (name: unknown) => Pick<ShownChapter, "kind" | "picture">;
|
|
134
147
|
/**
|
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
import { readLog } from "../core/log.js";
|
|
4
4
|
import { comparableText } from "../core/text.js";
|
|
5
5
|
import { goalsIn, links, textsIn } from "../pages/index.js";
|
|
6
|
-
import { knownText } from "./game-knowledge.js";
|
|
6
|
+
import { knownSecretsApart, knownText } from "./game-knowledge.js";
|
|
7
7
|
import { measuresText, questMeasures } from "./game-quests.js";
|
|
8
|
-
|
|
8
|
+
// The story tells what happened at its hour; time passing is no fact of it, the hours of the facts show it.
|
|
9
|
+
const storyKinds = ["counter", "moved", "learned", "effect", "effect-ended", "back", "quest"];
|
|
9
10
|
const statuses = ["open", "done", "failed"];
|
|
10
11
|
/**
|
|
11
12
|
* The journal (VIEW-8, VIEW-9): the quests the character knows, open ones first, the main ones first among them, then those changed last; and the chapters, the
|
|
@@ -41,6 +42,7 @@ function shownQuest(world, knowledge, page, now, named, look) {
|
|
|
41
42
|
const place = shownLink(page.fields.place, named);
|
|
42
43
|
const picture = look(page.name).picture;
|
|
43
44
|
const where = page.fields.place === undefined ? {} : look(textsIn(page.fields.place)[0]);
|
|
45
|
+
const apart = knownSecretsApart(world, knowledge, page);
|
|
44
46
|
return {
|
|
45
47
|
name: page.name,
|
|
46
48
|
status: page.fields.status,
|
|
@@ -51,6 +53,7 @@ function shownQuest(world, knowledge, page, now, named, look) {
|
|
|
51
53
|
...(where.picture === undefined ? {} : { placePicture: where.picture }),
|
|
52
54
|
...(where.kind === undefined ? {} : { placeKind: where.kind }),
|
|
53
55
|
text: rest,
|
|
56
|
+
...(apart.length === 0 ? {} : { knownBy: apart }),
|
|
54
57
|
goals,
|
|
55
58
|
};
|
|
56
59
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type Page } from "../pages/index.ts";
|
|
1
2
|
import { type Measures } from "./game-roads.ts";
|
|
2
3
|
import type { PlaceSight } from "./game-view-place.ts";
|
|
3
4
|
/** A point of a map, in km east and north of its centre; with the map it is on, by the place that holds it, none for the main map (POS-8). */
|
|
@@ -76,3 +77,5 @@ export declare function shownMap(sight: PlaceSight, measures: Measures, campaign
|
|
|
76
77
|
* the places of the other maps the character knows, by map.
|
|
77
78
|
*/
|
|
78
79
|
export declare function mapText(map: ShownMap): string;
|
|
80
|
+
/** A place's kind as the page writes it (POS-7), such as village; undefined when it has none, or an empty one (D-107). */
|
|
81
|
+
export declare function placeKind(page: Page): string | undefined;
|
|
@@ -76,7 +76,7 @@ function mapPlace(sight, roads, page, known, party) {
|
|
|
76
76
|
return undefined;
|
|
77
77
|
}
|
|
78
78
|
const region = regionsOf(world).find((candidate) => candidate.page === page);
|
|
79
|
-
const kind =
|
|
79
|
+
const kind = placeKind(page);
|
|
80
80
|
const voice = (name) => environmentAt(world, page).find(({ entry }) => comparableText(entry.name) === name)?.entry.value;
|
|
81
81
|
const image = shownImage(sight.root, sight.context, world, page, (base) => knowsPage(sight.knowledge, base));
|
|
82
82
|
const map = mapOf(world, page).root;
|
|
@@ -264,3 +264,7 @@ function fromText(from, unit) {
|
|
|
264
264
|
function km(metres) {
|
|
265
265
|
return Math.round(metres / 10) / 100;
|
|
266
266
|
}
|
|
267
|
+
/** A place's kind as the page writes it (POS-7), such as village; undefined when it has none, or an empty one (D-107). */
|
|
268
|
+
export function placeKind(page) {
|
|
269
|
+
return typeof page.fields.kind === "string" && page.fields.kind.trim() !== "" ? page.fields.kind.trim() : undefined;
|
|
270
|
+
}
|
|
@@ -49,6 +49,11 @@ export interface ShownPlace {
|
|
|
49
49
|
})[];
|
|
50
50
|
/** Its text as the character knows it (VIEW-3). */
|
|
51
51
|
text: string;
|
|
52
|
+
/** Its secrets in that text that only some of the player characters discovered, each with who (VIEW-12). */
|
|
53
|
+
knownBy?: {
|
|
54
|
+
secret: string;
|
|
55
|
+
who: string[];
|
|
56
|
+
}[];
|
|
52
57
|
/** The party and the characters the character knows who are there; never someone it does not know, who would give themselves away. */
|
|
53
58
|
here: ShownPerson[];
|
|
54
59
|
/** Its map, when it has one (GRD-6). */
|
|
@@ -102,6 +107,8 @@ export interface Fighter {
|
|
|
102
107
|
hostile?: true;
|
|
103
108
|
stranger?: true;
|
|
104
109
|
health?: string;
|
|
110
|
+
/** How hard a foe heard in words is hit: low in the lower half of the system's words, down at the last. */
|
|
111
|
+
wound?: "low" | "down";
|
|
105
112
|
effects: SeenEffect[];
|
|
106
113
|
inactive?: true;
|
|
107
114
|
keeps?: string[];
|
|
@@ -112,6 +119,12 @@ export interface DyingCounter {
|
|
|
112
119
|
field: string;
|
|
113
120
|
value: number;
|
|
114
121
|
limit?: number;
|
|
122
|
+
/** Which side of the death saves it counts, by the system's names (D-461): the successes or the failures. */
|
|
123
|
+
side?: "successes" | "failures";
|
|
124
|
+
/** Of the successes, what the system calls one whose counter is full, as Stable. */
|
|
125
|
+
full?: string;
|
|
126
|
+
/** The short word of its marks, as Successes. */
|
|
127
|
+
mark?: string;
|
|
115
128
|
}
|
|
116
129
|
/** The open scene as the player sees it (VIEW-6): who is in it as in VIEW-4, and the order of the turns. */
|
|
117
130
|
export interface ShownScene {
|
|
@@ -126,6 +139,11 @@ export interface ShownScene {
|
|
|
126
139
|
order?: string[];
|
|
127
140
|
turn?: string;
|
|
128
141
|
round?: number;
|
|
142
|
+
/** What who acts has used of the turn (TRN-4). */
|
|
143
|
+
marks?: {
|
|
144
|
+
use: string;
|
|
145
|
+
used: boolean;
|
|
146
|
+
}[];
|
|
129
147
|
/** In a fight, each one in it, in the order of the turns when there is one (D-314). */
|
|
130
148
|
fighters?: Fighter[];
|
|
131
149
|
}
|
|
@@ -143,12 +161,13 @@ export declare function shownPlace(sight: PlaceSight): ShownPlace | undefined;
|
|
|
143
161
|
export declare function shownScene(sight: PlaceSight): ShownScene | undefined;
|
|
144
162
|
/**
|
|
145
163
|
* Who is in the open scene, by the words the page gives them (D-416): a character by name when the character knows them, else by what it sees of them, else
|
|
146
|
-
* someone; a copy by its name when it knows its creature, else by what it sees of its kind and its number, else creature 1.
|
|
164
|
+
* someone; a copy by its name when it knows its creature, else by what it sees of its kind and its number, else creature 1. Without the one left out, as whose view
|
|
165
|
+
* a character agent's is (VIEW-10).
|
|
147
166
|
*/
|
|
148
|
-
export declare function sceneNames(sight: PlaceSight): string[];
|
|
167
|
+
export declare function sceneNames(sight: PlaceSight, leftOut?: Page): string[];
|
|
149
168
|
/**
|
|
150
169
|
* The panel of the dying of someone of the party (D-310 (7), D-314): at the value of the counter the system names, as hp 0, the counters it shows, with their
|
|
151
|
-
* limits; none
|
|
170
|
+
* limits, or below it in a game whose counter goes below; none above it, nor for the dead.
|
|
152
171
|
*/
|
|
153
172
|
export declare function dyingOf(world: World, system: GameSystem | undefined, page: Page): DyingCounter[] | undefined;
|
|
154
173
|
/** An effect on someone of the party as the player sees it: an end at someone's turn names them as the character knows them (VIEW-4), as creature 2. */
|
|
@@ -4,15 +4,16 @@ import { comparableText } from "../core/text.js";
|
|
|
4
4
|
import { readCounter } from "../counters/index.js";
|
|
5
5
|
import { reachable, squareName, squaresApart, withoutMapBlock } from "../grid/index.js";
|
|
6
6
|
import { hiddenImageName } from "../images/index.js";
|
|
7
|
-
import { environmentAt, locate, pagesWithName, pagesWithNameOrAlias, parsePageReference, placesAround } from "../pages/index.js";
|
|
7
|
+
import { environmentAt, isPlayerCharacter, locate, pagesWithName, pagesWithNameOrAlias, parsePageReference, placesAround } from "../pages/index.js";
|
|
8
8
|
import { effectsOf } from "./effect-layer.js";
|
|
9
9
|
import { conditionMark, effectParts, keptEffects } from "./game-effects.js";
|
|
10
10
|
import { isTurnOf, movedThisTurn, sideOf, walkingSpeed } from "./game-grid-moves.js";
|
|
11
11
|
import { placeGrid, placeLook, standing } from "./game-grids.js";
|
|
12
12
|
import { imageFile, ownImage, shownImage } from "./game-images.js";
|
|
13
|
-
import { knownText, knowsPage } from "./game-knowledge.js";
|
|
13
|
+
import { knownSecretsApart, knownText, knowsPage } from "./game-knowledge.js";
|
|
14
14
|
import { measuresOf } from "./game-roads.js";
|
|
15
15
|
import { copyPage, readOpenScene } from "./game-scene.js";
|
|
16
|
+
import { turnMarks } from "./game-turn-uses.js";
|
|
16
17
|
import { campaignSystem } from "./game-world.js";
|
|
17
18
|
import { pageCounters } from "./page-counters.js";
|
|
18
19
|
import { tokenIcon } from "./sheet.js";
|
|
@@ -35,6 +36,7 @@ export function shownPlace(sight) {
|
|
|
35
36
|
const image = picture(sight, place);
|
|
36
37
|
const grid = placeGrid(place)?.grid;
|
|
37
38
|
const text = knownText(world, knowledge, place);
|
|
39
|
+
const apart = knownSecretsApart(world, knowledge, place);
|
|
38
40
|
return {
|
|
39
41
|
name: place.name,
|
|
40
42
|
...(image === undefined ? {} : { image }),
|
|
@@ -42,8 +44,9 @@ export function shownPlace(sight) {
|
|
|
42
44
|
around,
|
|
43
45
|
// The map block is drawn, not read.
|
|
44
46
|
text: grid === undefined ? text : withoutMapBlock(text),
|
|
45
|
-
|
|
46
|
-
|
|
47
|
+
...(apart.length === 0 ? {} : { knownBy: apart }),
|
|
48
|
+
// The party first, the player character in the foreground at its head (VIEW-12).
|
|
49
|
+
here: [...partyFirst(sight).filter((page) => present.includes(page)), ...present.filter((page) => !sight.party.includes(page))].map((page) => ({
|
|
47
50
|
...person(sight, page),
|
|
48
51
|
...hostileMark(readOpenScene(sight.root).scene, page.name),
|
|
49
52
|
...stateOf(sight, page),
|
|
@@ -67,7 +70,7 @@ function shownGrid(sight, place, written) {
|
|
|
67
70
|
const system = campaignSystem(sight.root, sight.context);
|
|
68
71
|
const measures = measuresOf(sight.root, system);
|
|
69
72
|
const standings = standing(sight.world, place, here);
|
|
70
|
-
const self = standings.find((one) => one.page === sight.
|
|
73
|
+
const self = standings.find((one) => one.page === sight.knowledge.pc && one.square !== undefined);
|
|
71
74
|
const at = standings.flatMap((one) => {
|
|
72
75
|
const square = one.square === undefined ? undefined : squareName(one.square);
|
|
73
76
|
if (square === undefined) {
|
|
@@ -170,6 +173,10 @@ export function shownScene(sight) {
|
|
|
170
173
|
: { ...person(sight, page), count, ...hostile, ...state };
|
|
171
174
|
});
|
|
172
175
|
const turnName = (name) => shownTurn(sight, scene, name);
|
|
176
|
+
// What who acts has used of the turn, as marks beside them, for the party alone: a foe's are the master's to tell (TRN-4, D-453).
|
|
177
|
+
const acting = scene.turn;
|
|
178
|
+
const ours = acting !== undefined && sight.party.some((page) => comparableText(page.name) === comparableText(acting));
|
|
179
|
+
const marks = ours ? turnMarks(campaignSystem(sight.root, sight.context), scene, acting) : [];
|
|
173
180
|
return {
|
|
174
181
|
title: scene.title,
|
|
175
182
|
type: scene.type,
|
|
@@ -179,17 +186,21 @@ export function shownScene(sight) {
|
|
|
179
186
|
who: [...characters, ...creatures],
|
|
180
187
|
...(scene.order === undefined ? {} : { order: scene.order.map(turnName) }),
|
|
181
188
|
...(scene.turn === undefined ? {} : { turn: turnName(scene.turn) }),
|
|
182
|
-
|
|
189
|
+
// The round only where the game has rounds (D-314 (3)): Ironsworn has none.
|
|
190
|
+
...(scene.round === undefined || campaignSystem(sight.root, sight.context)?.roundSeconds === undefined ? {} : { round: scene.round }),
|
|
191
|
+
...(marks.length === 0 ? {} : { marks }),
|
|
183
192
|
...(scene.type === "combat" ? { fighters: fightersOf(sight, scene) } : {}),
|
|
184
193
|
};
|
|
185
194
|
}
|
|
186
195
|
/**
|
|
187
196
|
* Who is in the open scene, by the words the page gives them (D-416): a character by name when the character knows them, else by what it sees of them, else
|
|
188
|
-
* someone; a copy by its name when it knows its creature, else by what it sees of its kind and its number, else creature 1.
|
|
197
|
+
* someone; a copy by its name when it knows its creature, else by what it sees of its kind and its number, else creature 1. Without the one left out, as whose view
|
|
198
|
+
* a character agent's is (VIEW-10).
|
|
189
199
|
*/
|
|
190
|
-
export function sceneNames(sight) {
|
|
200
|
+
export function sceneNames(sight, leftOut) {
|
|
191
201
|
const { scene } = readOpenScene(sight.root);
|
|
192
|
-
const
|
|
202
|
+
const characters = scene === undefined ? [] : scene.with.map((link) => parsePageReference(link).name).filter((name) => leftOut === undefined || pagesWithName(sight.world, name)[0] !== leftOut);
|
|
203
|
+
const names = scene === undefined ? [] : [...characters, ...Object.keys(scene.copies)];
|
|
193
204
|
return scene === undefined ? [] : names.map((name) => shownTurn(sight, scene, name));
|
|
194
205
|
}
|
|
195
206
|
/** Everyone in a fight, in the order of the turns when there is one, else the characters then the copies; those the view cannot name are left out. */
|
|
@@ -221,12 +232,13 @@ function fighterOf(sight, scene, name) {
|
|
|
221
232
|
const icon = party ? tokenIcon(sight.world, system, page) : undefined;
|
|
222
233
|
return {
|
|
223
234
|
name: shown,
|
|
224
|
-
role:
|
|
235
|
+
role: partyRole(sight, page),
|
|
225
236
|
...(image === undefined ? {} : { image }),
|
|
226
237
|
...(icon === undefined ? {} : { icon }),
|
|
227
238
|
...(stranger ? { stranger: true } : {}),
|
|
228
239
|
...hostileMark(scene, name),
|
|
229
|
-
...(health === undefined ? {} : { health }),
|
|
240
|
+
...(health === undefined ? {} : { health: health.word }),
|
|
241
|
+
...(health?.wound === undefined ? {} : { wound: health.wound }),
|
|
230
242
|
effects,
|
|
231
243
|
...(keepsFromActing(system, effects) ? { inactive: true } : {}),
|
|
232
244
|
...(keeps.length === 0 ? {} : { keeps }),
|
|
@@ -235,15 +247,22 @@ function fighterOf(sight, scene, name) {
|
|
|
235
247
|
}
|
|
236
248
|
/**
|
|
237
249
|
* The panel of the dying of someone of the party (D-310 (7), D-314): at the value of the counter the system names, as hp 0, the counters it shows, with their
|
|
238
|
-
* limits; none
|
|
250
|
+
* limits, or below it in a game whose counter goes below; none above it, nor for the dead.
|
|
239
251
|
*/
|
|
240
252
|
export function dyingOf(world, system, page) {
|
|
241
253
|
const counters = pageCounters(world, page);
|
|
242
254
|
const dying = system?.dying;
|
|
243
|
-
|
|
255
|
+
const value = readCounter(counters[dying?.field ?? ""])?.value;
|
|
256
|
+
if (dying === undefined || page.fields.status === "dead" || value === undefined || value > dying.value) {
|
|
244
257
|
return undefined;
|
|
245
258
|
}
|
|
246
|
-
|
|
259
|
+
// Each counter by its side, as the system names them (D-461).
|
|
260
|
+
return ["successes", "failures"].flatMap((side) => {
|
|
261
|
+
const field = dying.show[side];
|
|
262
|
+
const full = side === "successes" && dying.stable !== undefined ? { full: dying.stable } : {};
|
|
263
|
+
const mark = dying.marks[side] === undefined ? {} : { mark: dying.marks[side] };
|
|
264
|
+
return field === undefined ? [] : [{ field, value: readCounter(counters[field] ?? page.fields[field])?.value ?? 0, ...limitOf(system?.thresholds ?? [], field), side, ...full, ...mark }];
|
|
265
|
+
});
|
|
247
266
|
}
|
|
248
267
|
/** An effect on someone of the party as the player sees it: an end at someone's turn names them as the character knows them (VIEW-4), as creature 2. */
|
|
249
268
|
export function seenEffect(sight, effect) {
|
|
@@ -264,7 +283,7 @@ function stateOf(sight, page) {
|
|
|
264
283
|
const party = sight.party.includes(page);
|
|
265
284
|
const effects = shownEffects(sight, system, page, party);
|
|
266
285
|
const dead = page.fields.status === "dead";
|
|
267
|
-
const down = !dead && (party ? dyingOf(sight.world, system, page) !== undefined : healthOf(sight.world, system, page, false) === "down");
|
|
286
|
+
const down = !dead && (party ? dyingOf(sight.world, system, page) !== undefined : healthOf(sight.world, system, page, false)?.wound === "down");
|
|
268
287
|
return {
|
|
269
288
|
...(effects.length === 0 ? {} : { effects }),
|
|
270
289
|
...(keepsFromActing(system, effects) ? { inactive: true } : {}),
|
|
@@ -288,23 +307,33 @@ function keepsFromActing(system, effects) {
|
|
|
288
307
|
const inactive = new Set((system?.combat?.inactive ?? []).map(comparableText));
|
|
289
308
|
return effects.some((effect) => inactive.has(comparableText(effect.name)));
|
|
290
309
|
}
|
|
291
|
-
/**
|
|
310
|
+
/**
|
|
311
|
+
* Someone's counter in a fight as the player may know it (D-238, D-314): a foe's in the system's words when it gives them, as the 5e's hit points; else as it
|
|
312
|
+
* is, as Ironsworn's progress track (D-314 (7)).
|
|
313
|
+
*/
|
|
292
314
|
function healthOf(world, system, page, party) {
|
|
293
315
|
const track = system?.combat === undefined ? undefined : readCounter(pageCounters(world, page)[system.combat.track]);
|
|
316
|
+
const words = party ? [] : system?.combat?.inWords ?? [];
|
|
294
317
|
if (track === undefined) {
|
|
295
318
|
return undefined;
|
|
296
319
|
}
|
|
297
|
-
|
|
320
|
+
if (words.length === 0) {
|
|
321
|
+
return { word: `${track.value}${track.max === undefined ? "" : `/${track.max}`}` };
|
|
322
|
+
}
|
|
323
|
+
const index = healthIndex(words.length, track.value, track.max);
|
|
324
|
+
const wound = index === words.length - 1 ? "down" : index > 0 && index >= words.length / 2 ? "low" : undefined;
|
|
325
|
+
return { word: words[index], ...(wound === undefined ? {} : { wound }) };
|
|
298
326
|
}
|
|
299
|
-
/**
|
|
300
|
-
function
|
|
327
|
+
/** Which of so many words a counter is heard in: the first full, the last at 0 or less, those between at equal shares of what is lost, as half or less the third of four. */
|
|
328
|
+
function healthIndex(count, value, most) {
|
|
301
329
|
if (value <= 0) {
|
|
302
|
-
return
|
|
330
|
+
return count - 1;
|
|
303
331
|
}
|
|
304
|
-
|
|
305
|
-
|
|
332
|
+
const between = count - 2;
|
|
333
|
+
if (most === undefined || value >= most || between === 0) {
|
|
334
|
+
return 0;
|
|
306
335
|
}
|
|
307
|
-
return
|
|
336
|
+
return 1 + Math.min(between - 1, Math.floor(((most - value) * between) / most));
|
|
308
337
|
}
|
|
309
338
|
/** The limit a threshold of the system gives a counter, as death-failures 3. */
|
|
310
339
|
function limitOf(thresholds, field) {
|
|
@@ -316,9 +345,17 @@ function hostileMark(scene, name) {
|
|
|
316
345
|
const hostile = scene?.type === "combat" && (scene.hostile ?? []).some((one) => comparableText(one) === comparableText(parsePageReference(name).name));
|
|
317
346
|
return hostile ? { hostile: true } : {};
|
|
318
347
|
}
|
|
348
|
+
/** Someone's role as the view gives it: a player character or a companion of the party, or other. */
|
|
349
|
+
function partyRole(sight, page) {
|
|
350
|
+
return !sight.party.includes(page) ? "other" : isPlayerCharacter(page) ? "pc" : "companion";
|
|
351
|
+
}
|
|
352
|
+
/** The party, the player character in the foreground first (VIEW-12). */
|
|
353
|
+
function partyFirst(sight) {
|
|
354
|
+
return [...sight.party.filter((page) => page === sight.knowledge.pc), ...sight.party.filter((page) => page !== sight.knowledge.pc)];
|
|
355
|
+
}
|
|
319
356
|
/** Someone the character knows, with their picture and their role. */
|
|
320
357
|
function person(sight, page) {
|
|
321
|
-
const role =
|
|
358
|
+
const role = partyRole(sight, page);
|
|
322
359
|
const image = picture(sight, page);
|
|
323
360
|
// Only the party's: what the others are, the character may not know.
|
|
324
361
|
const icon = role === "other" ? undefined : tokenIcon(sight.world, campaignSystem(sight.root, sight.context), page);
|