rpg-engine 0.14.1 → 0.16.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/dist/campaign/index.d.ts +1 -1
- package/dist/campaign/index.js +1 -1
- package/dist/campaign/last-choices.js +1 -1
- package/dist/campaign/settings.d.ts +25 -5
- package/dist/campaign/settings.js +38 -9
- package/dist/cli/cli.js +1 -1
- package/dist/cli/command-line.js +1 -1
- package/dist/commands/advance.d.ts +1 -1
- package/dist/commands/advance.js +6 -6
- package/dist/commands/ask.js +7 -7
- package/dist/commands/change/amounts.d.ts +32 -0
- package/dist/commands/change/amounts.js +150 -0
- package/dist/commands/change/change.d.ts +4 -54
- package/dist/commands/change/change.js +19 -749
- package/dist/commands/change/damage.d.ts +30 -0
- package/dist/commands/change/damage.js +73 -2
- package/dist/commands/change/dice.d.ts +34 -0
- package/dist/commands/change/dice.js +59 -0
- package/dist/commands/change/fields.d.ts +37 -0
- package/dist/commands/change/fields.js +156 -0
- package/dist/commands/change/holder.d.ts +48 -0
- package/dist/commands/change/holder.js +162 -0
- package/dist/commands/change/recipe-pace.js +1 -1
- package/dist/commands/change/recipe.d.ts +58 -0
- package/dist/commands/change/recipe.js +179 -0
- package/dist/commands/choices.js +3 -3
- package/dist/commands/config/config.d.ts +15 -0
- package/dist/commands/config/config.js +355 -0
- package/dist/commands/config/custom-levels.d.ts +7 -0
- package/dist/commands/config/custom-levels.js +32 -0
- package/dist/commands/{config.d.ts → config/dashboard.d.ts} +4 -26
- package/dist/commands/config/dashboard.js +171 -0
- package/dist/commands/config/entries.d.ts +17 -0
- package/dist/commands/config/entries.js +76 -0
- package/dist/commands/config/news.d.ts +7 -0
- package/dist/commands/config/news.js +88 -0
- package/dist/commands/config/shown.d.ts +9 -0
- package/dist/commands/config/shown.js +80 -0
- package/dist/commands/config/words.d.ts +27 -0
- package/dist/commands/config/words.js +204 -0
- package/dist/commands/effect.js +9 -9
- package/dist/commands/find.d.ts +4 -4
- package/dist/commands/find.js +1 -1
- package/dist/commands/image.js +6 -6
- package/dist/commands/import/import.d.ts +0 -2
- package/dist/commands/import/import.js +45 -44
- package/dist/commands/import/run.js +1 -1
- package/dist/commands/index.js +3 -3
- package/dist/commands/init.js +2 -2
- package/dist/commands/install.js +1 -1
- package/dist/commands/instructions.js +17 -6
- package/dist/commands/mode.d.ts +2 -2
- package/dist/commands/mode.js +17 -9
- package/dist/commands/mood.js +4 -4
- package/dist/commands/move.js +10 -10
- package/dist/commands/package/consent.d.ts +11 -0
- package/dist/commands/package/consent.js +52 -0
- package/dist/commands/package/here.d.ts +51 -0
- package/dist/commands/package/here.js +128 -0
- package/dist/commands/package/install.d.ts +10 -0
- package/dist/commands/package/install.js +337 -0
- package/dist/commands/package/package.d.ts +18 -0
- package/dist/commands/package/package.js +236 -0
- package/dist/commands/package/result.d.ts +90 -0
- package/dist/commands/package/result.js +1 -0
- package/dist/commands/package/uninstall.d.ts +6 -0
- package/dist/commands/package/uninstall.js +70 -0
- package/dist/commands/rename.js +3 -3
- package/dist/commands/reveal.js +5 -5
- package/dist/commands/roll/roll.js +11 -9
- package/dist/commands/roll/tables.js +1 -1
- package/dist/commands/rules.d.ts +2 -2
- package/dist/commands/rules.js +3 -3
- package/dist/commands/save.d.ts +1 -1
- package/dist/commands/save.js +2 -2
- package/dist/commands/scene/close.d.ts +18 -0
- package/dist/commands/scene/close.js +179 -0
- package/dist/commands/scene/members.d.ts +14 -0
- package/dist/commands/scene/members.js +32 -0
- package/dist/commands/scene/open.d.ts +6 -0
- package/dist/commands/scene/open.js +298 -0
- package/dist/commands/scene/result.d.ts +98 -0
- package/dist/commands/scene/result.js +2 -0
- package/dist/commands/{scene.d.ts → scene/scene.d.ts} +10 -36
- package/dist/commands/scene/scene.js +210 -0
- package/dist/commands/scene/turns.d.ts +18 -0
- package/dist/commands/scene/turns.js +229 -0
- package/dist/commands/shared/{adventures.d.ts → books/adventures.d.ts} +5 -3
- package/dist/commands/shared/{adventures.js → books/adventures.js} +23 -19
- package/dist/commands/shared/{library-reader.js → books/library-reader.js} +3 -3
- package/dist/commands/shared/{library.d.ts → books/library.d.ts} +2 -2
- package/dist/commands/shared/{library.js → books/library.js} +9 -9
- package/dist/commands/shared/{rules.d.ts → books/rules.d.ts} +2 -2
- package/dist/commands/shared/{rules.js → books/rules.js} +5 -5
- package/dist/commands/shared/{system-texts.d.ts → books/system-texts.d.ts} +2 -2
- package/dist/commands/shared/{system-texts.js → books/system-texts.js} +9 -8
- package/dist/commands/shared/{page-words.d.ts → books/words.d.ts} +2 -2
- package/dist/commands/shared/{page-words.js → books/words.js} +4 -4
- package/dist/commands/shared/{checks.d.ts → campaign/checks.d.ts} +3 -3
- package/dist/commands/shared/{checks.js → campaign/checks.js} +7 -7
- package/dist/commands/shared/{images.d.ts → campaign/images.d.ts} +3 -3
- package/dist/commands/shared/{images.js → campaign/images.js} +5 -5
- package/dist/commands/shared/{mode.d.ts → campaign/mode.d.ts} +4 -4
- package/dist/commands/shared/{mode.js → campaign/mode.js} +28 -13
- package/dist/commands/shared/{money.d.ts → campaign/money.d.ts} +3 -3
- package/dist/commands/shared/{money.js → campaign/money.js} +2 -2
- package/dist/commands/shared/{offers.d.ts → campaign/offers.d.ts} +3 -3
- package/dist/commands/shared/{offers.js → campaign/offers.js} +3 -3
- package/dist/commands/shared/{outside.d.ts → campaign/outside.d.ts} +3 -3
- package/dist/commands/shared/{outside.js → campaign/outside.js} +7 -7
- package/dist/commands/shared/{parts.d.ts → campaign/parts.d.ts} +10 -3
- package/dist/commands/shared/{parts.js → campaign/parts.js} +26 -3
- package/dist/commands/shared/{problems.d.ts → campaign/problems.d.ts} +3 -3
- package/dist/commands/shared/{problems.js → campaign/problems.js} +17 -17
- package/dist/commands/shared/{quests.d.ts → campaign/quests.d.ts} +4 -4
- package/dist/commands/shared/{quests.js → campaign/quests.js} +6 -6
- package/dist/commands/shared/{saves.d.ts → campaign/saves.d.ts} +4 -4
- package/dist/commands/shared/{saves.js → campaign/saves.js} +10 -10
- package/dist/commands/shared/{theme.d.ts → campaign/theme.d.ts} +3 -3
- package/dist/commands/shared/{theme.js → campaign/theme.js} +1 -1
- package/dist/commands/shared/{world.d.ts → campaign/world.d.ts} +5 -5
- package/dist/commands/shared/{world.js → campaign/world.js} +17 -14
- package/dist/commands/shared/{knowledge.d.ts → characters/knowledge.d.ts} +3 -3
- package/dist/commands/shared/{knowledge.js → characters/knowledge.js} +4 -4
- package/dist/commands/shared/{moods.d.ts → characters/moods.d.ts} +3 -3
- package/dist/commands/shared/{moods.js → characters/moods.js} +3 -3
- package/dist/commands/shared/characters/orders.d.ts +4 -0
- package/dist/commands/shared/characters/orders.js +10 -0
- package/dist/commands/shared/{thoughts.d.ts → characters/thoughts.d.ts} +2 -2
- package/dist/commands/shared/{thoughts.js → characters/thoughts.js} +3 -3
- package/dist/commands/shared/{voices.d.ts → characters/voices.d.ts} +1 -1
- package/dist/commands/shared/{voices.js → characters/voices.js} +2 -2
- package/dist/commands/shared/examples.js +2 -2
- package/dist/commands/shared/packages/catalog.js +2 -2
- package/dist/commands/shared/packages/code.d.ts +1 -1
- package/dist/commands/shared/packages/code.js +8 -8
- package/dist/commands/shared/packages/extensions.d.ts +1 -1
- package/dist/commands/shared/packages/extensions.js +1 -1
- package/dist/commands/shared/packages/hooks.d.ts +1 -1
- package/dist/commands/shared/packages/hooks.js +1 -1
- package/dist/commands/shared/packages/widgets.d.ts +3 -3
- package/dist/commands/shared/packages/widgets.js +3 -3
- package/dist/commands/shared/{environment.d.ts → places/environment.d.ts} +1 -1
- package/dist/commands/shared/{environment.js → places/environment.js} +4 -4
- package/dist/commands/shared/{grid-moves.d.ts → places/grid-moves.d.ts} +4 -4
- package/dist/commands/shared/{grid-moves.js → places/grid-moves.js} +8 -7
- package/dist/commands/shared/{grids.d.ts → places/grids.d.ts} +4 -4
- package/dist/commands/shared/{grids.js → places/grids.js} +6 -6
- package/dist/commands/shared/{journey.d.ts → places/journey.d.ts} +3 -3
- package/dist/commands/shared/{journey.js → places/journey.js} +6 -6
- package/dist/commands/shared/{moves.d.ts → places/moves.d.ts} +2 -2
- package/dist/commands/shared/{moves.js → places/moves.js} +4 -4
- package/dist/commands/shared/{positions.d.ts → places/positions.d.ts} +2 -2
- package/dist/commands/shared/{positions.js → places/positions.js} +4 -4
- package/dist/commands/shared/{roads.d.ts → places/roads.d.ts} +5 -5
- package/dist/commands/shared/{roads.js → places/roads.js} +6 -6
- package/dist/commands/shared/{effects.d.ts → scene/effects.d.ts} +7 -7
- package/dist/commands/shared/{effects.js → scene/effects.js} +10 -10
- package/dist/commands/shared/{loot.d.ts → scene/loot.d.ts} +2 -2
- package/dist/commands/shared/{loot.js → scene/loot.js} +3 -3
- package/dist/commands/shared/{master-rolls.d.ts → scene/master-rolls.d.ts} +2 -2
- package/dist/commands/shared/{master-rolls.js → scene/master-rolls.js} +5 -5
- package/dist/commands/shared/{reminders.d.ts → scene/reminders.d.ts} +4 -4
- package/dist/commands/shared/{reminders.js → scene/reminders.js} +4 -4
- package/dist/commands/shared/{scene.d.ts → scene/scene.d.ts} +3 -3
- package/dist/commands/shared/{scene.js → scene/scene.js} +7 -7
- package/dist/commands/shared/{bonds.d.ts → sheet/bonds.d.ts} +3 -3
- package/dist/commands/shared/{bonds.js → sheet/bonds.js} +2 -2
- package/dist/commands/shared/{page-counters.d.ts → sheet/counters.d.ts} +3 -3
- package/dist/commands/shared/{page-counters.js → sheet/counters.js} +5 -5
- package/dist/commands/shared/{effect-layer.d.ts → sheet/effect-layer.d.ts} +2 -2
- package/dist/commands/shared/{effect-layer.js → sheet/effect-layer.js} +9 -6
- package/dist/commands/shared/sheet/effect-values.d.ts +9 -0
- package/dist/commands/shared/sheet/effect-values.js +69 -0
- package/dist/commands/shared/{experience.d.ts → sheet/experience.d.ts} +3 -3
- package/dist/commands/shared/{experience.js → sheet/experience.js} +5 -5
- package/dist/commands/shared/sheet/formula-problems.d.ts +8 -0
- package/dist/commands/shared/sheet/formula-problems.js +140 -0
- package/dist/commands/shared/sheet/formula-scope.d.ts +32 -0
- package/dist/commands/shared/sheet/formula-scope.js +235 -0
- package/dist/commands/shared/{limits.d.ts → sheet/limits.d.ts} +3 -3
- package/dist/commands/shared/{limits.js → sheet/limits.js} +5 -4
- package/dist/commands/shared/{progression.d.ts → sheet/progression.d.ts} +2 -2
- package/dist/commands/shared/{progression.js → sheet/progression.js} +4 -4
- package/dist/commands/shared/{sheet.d.ts → sheet/sheet.d.ts} +5 -5
- package/dist/commands/shared/{sheet.js → sheet/sheet.js} +11 -7
- package/dist/commands/shared/{stacks.d.ts → sheet/stacks.d.ts} +2 -2
- package/dist/commands/shared/{stacks.js → sheet/stacks.js} +4 -4
- package/dist/commands/shared/sheet/system-fields.d.ts +21 -0
- package/dist/commands/shared/sheet/system-fields.js +45 -0
- package/dist/commands/shared/{thresholds.d.ts → sheet/thresholds.d.ts} +1 -1
- package/dist/commands/shared/{thresholds.js → sheet/thresholds.js} +4 -4
- package/dist/commands/shared/{turn-uses.d.ts → sheet/turn-uses.d.ts} +3 -3
- package/dist/commands/shared/{turn-uses.js → sheet/turn-uses.js} +4 -3
- package/dist/commands/shared/{worked-out.d.ts → sheet/worked-out.d.ts} +11 -46
- package/dist/commands/shared/sheet/worked-out.js +291 -0
- package/dist/commands/shared/sheet/worked-text.d.ts +14 -0
- package/dist/commands/shared/sheet/worked-text.js +55 -0
- package/dist/commands/shared/{advance.d.ts → time/advance.d.ts} +3 -3
- package/dist/commands/shared/{advance.js → time/advance.js} +11 -11
- package/dist/commands/shared/{dice-pool.d.ts → time/dice-pool.d.ts} +3 -3
- package/dist/commands/shared/{dice-pool.js → time/dice-pool.js} +11 -11
- package/dist/commands/shared/{events.d.ts → time/events.d.ts} +5 -5
- package/dist/commands/shared/{events.js → time/events.js} +10 -13
- package/dist/commands/shared/{recipes.d.ts → time/recipes.d.ts} +3 -3
- package/dist/commands/shared/{recipes.js → time/recipes.js} +6 -5
- package/dist/commands/shared/{time.d.ts → time/time.d.ts} +4 -4
- package/dist/commands/shared/{time.js → time/time.js} +6 -6
- package/dist/commands/shared/{upkeep.d.ts → time/upkeep.d.ts} +3 -3
- package/dist/commands/shared/{upkeep.js → time/upkeep.js} +14 -13
- package/dist/commands/show.d.ts +4 -1
- package/dist/commands/show.js +28 -9
- package/dist/commands/status.d.ts +2 -1
- package/dist/commands/status.js +34 -23
- package/dist/commands/thoughts.js +3 -3
- package/dist/commands/trade.js +8 -8
- package/dist/commands/translate.d.ts +1 -1
- package/dist/commands/translate.js +3 -3
- package/dist/commands/travel/open.d.ts +1 -1
- package/dist/commands/travel/open.js +2 -2
- package/dist/commands/travel/route.js +7 -6
- package/dist/commands/travel/travel.d.ts +1 -1
- package/dist/commands/travel/travel.js +8 -8
- package/dist/commands/validate.js +3 -3
- package/dist/commands/view/journal.d.ts +2 -2
- package/dist/commands/view/journal.js +2 -2
- package/dist/commands/view/map.d.ts +1 -1
- package/dist/commands/view/map.js +6 -6
- package/dist/commands/view/memory.d.ts +16 -0
- package/dist/commands/view/memory.js +90 -0
- package/dist/commands/view/page.d.ts +32 -0
- package/dist/commands/view/page.js +163 -0
- package/dist/commands/view/place.d.ts +7 -2
- package/dist/commands/view/place.js +30 -12
- package/dist/commands/view/result.d.ts +245 -0
- package/dist/commands/view/result.js +1 -0
- package/dist/commands/view/saves.d.ts +6 -0
- package/dist/commands/view/saves.js +53 -0
- package/dist/commands/view/story.d.ts +32 -0
- package/dist/commands/view/story.js +227 -0
- package/dist/commands/view/view.d.ts +26 -292
- package/dist/commands/view/view.js +26 -534
- package/dist/commands/view/world.d.ts +1 -1
- package/dist/commands/view/world.js +3 -3
- package/dist/commands/write/checks.d.ts +42 -0
- package/dist/commands/write/checks.js +291 -0
- package/dist/commands/write/here.d.ts +1 -1
- package/dist/commands/write/here.js +5 -5
- package/dist/commands/write/inheritance.d.ts +40 -0
- package/dist/commands/write/inheritance.js +189 -0
- package/dist/commands/write/input.d.ts +29 -0
- package/dist/commands/write/input.js +124 -0
- package/dist/commands/write/layer.d.ts +36 -0
- package/dist/commands/write/layer.js +48 -0
- package/dist/commands/write/notes.d.ts +22 -0
- package/dist/commands/write/notes.js +76 -0
- package/dist/commands/write/progression.d.ts +27 -0
- package/dist/commands/write/progression.js +175 -0
- package/dist/commands/write/write.d.ts +2 -1
- package/dist/commands/write/write.js +33 -817
- package/dist/core/files.d.ts +2 -0
- package/dist/core/files.js +7 -0
- package/dist/core/{package-declarations.d.ts → packages/declarations.d.ts} +1 -1
- package/dist/core/{package-declarations.js → packages/declarations.js} +1 -1
- package/dist/core/session-store.js +3 -3
- package/dist/core/store.d.ts +2 -2
- package/dist/core/store.js +18 -4
- package/dist/dashboard/acts/acts.js +1 -1
- package/dist/dashboard/acts/sending.js +110 -0
- package/dist/dashboard/acts/sheet.js +2 -2
- package/dist/dashboard/acts/strip.js +1 -1
- package/dist/dashboard/address.js +6 -0
- package/dist/dashboard/api.js +1 -1
- package/dist/dashboard/app.js +47 -171
- package/dist/dashboard/dice/roller.js +1 -1
- package/dist/dashboard/dice/sets.js +2 -2
- package/dist/dashboard/dice/stage.js +1 -1
- package/dist/dashboard/dice/tray.js +6 -6
- package/dist/dashboard/guide/ar.md +9 -4
- package/dist/dashboard/guide/cs.md +10 -5
- package/dist/dashboard/guide/da.md +9 -4
- package/dist/dashboard/guide/de.md +9 -4
- package/dist/dashboard/guide/el.md +10 -5
- package/dist/dashboard/guide/en.md +7 -2
- package/dist/dashboard/guide/es.md +9 -4
- package/dist/dashboard/guide/fi.md +9 -4
- package/dist/dashboard/guide/fr.md +9 -4
- package/dist/dashboard/guide/he.md +9 -4
- package/dist/dashboard/guide/hi.md +10 -5
- package/dist/dashboard/guide/hu.md +10 -5
- package/dist/dashboard/guide/is.md +9 -4
- package/dist/dashboard/guide/it.md +9 -4
- package/dist/dashboard/guide/ja.md +12 -7
- package/dist/dashboard/guide/ko.md +11 -6
- package/dist/dashboard/guide/nb.md +9 -4
- package/dist/dashboard/guide/nl.md +10 -5
- package/dist/dashboard/guide/pl.md +9 -4
- package/dist/dashboard/guide/pt.md +9 -4
- package/dist/dashboard/guide/ro.md +9 -4
- package/dist/dashboard/guide/ru.md +9 -4
- package/dist/dashboard/guide/sv.md +9 -4
- package/dist/dashboard/guide/tr.md +11 -6
- package/dist/dashboard/guide/uk.md +9 -4
- package/dist/dashboard/guide/zh.md +9 -4
- package/dist/dashboard/help/help.js +3 -3
- package/dist/dashboard/i18n/ar.json +20 -0
- package/dist/dashboard/i18n/cs.json +20 -0
- package/dist/dashboard/i18n/da.json +20 -0
- package/dist/dashboard/i18n/de.json +20 -0
- package/dist/dashboard/i18n/el.json +20 -0
- package/dist/dashboard/i18n/es.json +20 -0
- package/dist/dashboard/i18n/fi.json +20 -0
- package/dist/dashboard/i18n/fr.json +20 -0
- package/dist/dashboard/i18n/he.json +20 -0
- package/dist/dashboard/i18n/hi.json +20 -0
- package/dist/dashboard/i18n/hu.json +20 -0
- package/dist/dashboard/i18n/is.json +20 -0
- package/dist/dashboard/i18n/it.json +20 -0
- package/dist/dashboard/i18n/ja.json +21 -1
- package/dist/dashboard/i18n/ko.json +20 -0
- package/dist/dashboard/i18n/nb.json +20 -0
- package/dist/dashboard/i18n/nl.json +20 -0
- package/dist/dashboard/i18n/pl.json +20 -0
- package/dist/dashboard/i18n/pt.json +20 -0
- package/dist/dashboard/i18n/ro.json +20 -0
- package/dist/dashboard/i18n/ru.json +20 -0
- package/dist/dashboard/i18n/sv.json +20 -0
- package/dist/dashboard/i18n/tr.json +20 -0
- package/dist/dashboard/i18n/uk.json +20 -0
- package/dist/dashboard/i18n/zh.json +20 -0
- package/dist/dashboard/{journal.js → journal/journal.js} +16 -16
- package/dist/dashboard/{notes.js → journal/notes.js} +4 -4
- package/dist/dashboard/kit.js +3 -3
- package/dist/dashboard/packages/ask-card.js +3 -3
- package/dist/dashboard/packages/catalog.js +196 -0
- package/dist/dashboard/packages/engine.js +87 -0
- package/dist/dashboard/packages/installed.js +53 -0
- package/dist/dashboard/packages/library.js +97 -0
- package/dist/dashboard/packages/outcomes.js +45 -0
- package/dist/dashboard/packages/packages.js +20 -576
- package/dist/dashboard/packages/page-code.js +15 -2
- package/dist/dashboard/packages/{package-page.js → page.js} +12 -5
- package/dist/dashboard/packages/rows.js +84 -0
- package/dist/dashboard/packages/share.js +44 -0
- package/dist/dashboard/packages/widgets.js +3 -3
- package/dist/dashboard/{card.js → parts/card.js} +1 -1
- package/dist/dashboard/{faces.js → parts/faces.js} +5 -5
- package/dist/dashboard/{game-words.js → parts/game-words.js} +1 -1
- package/dist/dashboard/{icons.js → parts/icons.js} +1 -1
- package/dist/dashboard/{labels.js → parts/labels.js} +8 -1
- package/dist/dashboard/{map-symbols.js → parts/map-symbols.js} +1 -1
- package/dist/dashboard/{markdown.js → parts/markdown.js} +2 -2
- package/dist/dashboard/{mood.js → parts/mood.js} +1 -1
- package/dist/dashboard/{refusals.js → parts/refusals.js} +1 -1
- package/dist/dashboard/{status.js → parts/status.js} +4 -4
- package/dist/dashboard/{widgets.js → parts/widgets.js} +2 -2
- package/dist/dashboard/place/key.js +24 -0
- package/dist/dashboard/place/paper.js +67 -0
- package/dist/dashboard/place/{map-sheet.js → sheet.js} +2 -2
- package/dist/dashboard/place/things.js +129 -0
- package/dist/dashboard/place/tokens.js +93 -0
- package/dist/dashboard/place/view.js +124 -0
- package/dist/dashboard/{asked-dice.js → play/asked-dice.js} +3 -3
- package/dist/dashboard/{asked.js → play/asked.js} +10 -10
- package/dist/dashboard/{choices.js → play/choices.js} +9 -9
- package/dist/dashboard/{requested.js → play/requested.js} +1 -1
- package/dist/dashboard/{rolls.js → play/rolls.js} +9 -9
- package/dist/dashboard/{scene.js → play/scene.js} +14 -14
- package/dist/dashboard/{turns.js → play/turns.js} +12 -12
- package/dist/dashboard/{language-choice.js → settings/language-choice.js} +1 -1
- package/dist/dashboard/{languages.js → settings/languages.js} +1 -1
- package/dist/dashboard/{saves.js → settings/saves.js} +8 -8
- package/dist/dashboard/{settings.js → settings/settings.js} +17 -15
- package/dist/dashboard/{setup.js → settings/setup.js} +6 -6
- package/dist/dashboard/{party.js → sheet/party.js} +8 -8
- package/dist/dashboard/{person-panel.js → sheet/person-panel.js} +4 -4
- package/dist/dashboard/{sheet.js → sheet/sheet.js} +17 -17
- package/dist/dashboard/{story.js → sheet/story.js} +3 -3
- package/dist/dashboard/{columns.js → shell/columns.js} +1 -1
- package/dist/dashboard/{footer.js → shell/footer.js} +3 -3
- package/dist/dashboard/{master.js → shell/master.js} +2 -2
- package/dist/dashboard/{notices.js → shell/notices.js} +3 -3
- package/dist/dashboard/{pages.js → shell/pages.js} +5 -5
- package/dist/dashboard/shell/shown.js +37 -0
- package/dist/dashboard/{table.js → shell/table.js} +2 -2
- package/dist/dashboard/{tabs.js → shell/tabs.js} +2 -2
- package/dist/dashboard/{top.js → shell/top.js} +7 -7
- package/dist/dashboard/style.css +90 -9
- package/dist/dashboard/world/calendar.js +4 -4
- package/dist/dashboard/world/drawing.js +92 -0
- package/dist/dashboard/world/key.js +21 -0
- package/dist/dashboard/world/lore.js +5 -5
- package/dist/dashboard/world/map-card.js +186 -0
- package/dist/dashboard/world/place-card.js +39 -0
- package/dist/dashboard/world/places.js +29 -0
- package/dist/dashboard/world/world.js +9 -341
- package/dist/extensions/extension.d.ts +1 -1
- package/dist/extensions/extension.js +1 -1
- package/dist/images/images.js +12 -9
- package/dist/index.d.ts +1 -1
- package/dist/languages/index.d.ts +1 -1
- package/dist/languages/index.js +1 -1
- package/dist/library/books.js +2 -0
- package/dist/packages/npm.js +1 -1
- package/dist/page.d.ts +2 -2
- package/dist/page.js +1 -1
- package/dist/pages/check.js +23 -1
- package/dist/pages/containers.d.ts +1 -1
- package/dist/pages/containers.js +1 -1
- package/dist/pages/index.d.ts +4 -2
- package/dist/pages/index.js +4 -2
- package/dist/pages/inheritance.d.ts +2 -2
- package/dist/pages/layers.d.ts +50 -0
- package/dist/pages/layers.js +97 -0
- package/dist/pages/rename-page.js +1 -1
- package/dist/pages/stacks/writes.js +48 -22
- package/dist/pages/standard-fields.d.ts +1 -1
- package/dist/pages/system-pages.d.ts +5 -3
- package/dist/pages/system-pages.js +16 -7
- package/dist/pages/world.d.ts +8 -1
- package/dist/pages/world.js +16 -4
- package/dist/pages/write-layer.d.ts +18 -0
- package/dist/pages/write-layer.js +108 -0
- package/dist/pages/write-page.d.ts +2 -2
- package/dist/pages/write-page.js +2 -2
- package/dist/rules/index.d.ts +1 -1
- package/dist/rules/index.js +1 -1
- package/dist/rules/search.d.ts +1 -1
- package/dist/rules/shown.d.ts +1 -1
- package/dist/server/dashboard/choices.js +3 -3
- package/dist/server/dashboard/files.js +5 -5
- package/dist/server/dashboard/index.d.ts +2 -2
- package/dist/server/dashboard/index.js +2 -2
- package/dist/server/dashboard/news.js +4 -3
- package/dist/server/dashboard/player.js +1 -1
- package/dist/server/dashboard/writes.js +10 -8
- package/dist/server/mcp.js +28 -13
- package/dist/systems/campaign-data.d.ts +15 -0
- package/dist/systems/campaign-data.js +85 -0
- package/dist/systems/{system-code.d.ts → code.d.ts} +1 -1
- package/dist/systems/{system-code.js → code.js} +2 -2
- package/dist/systems/game-system.d.ts +7 -61
- package/dist/systems/game-system.js +1 -984
- package/dist/systems/index.d.ts +6 -3
- package/dist/systems/index.js +6 -3
- package/dist/systems/installed.d.ts +31 -0
- package/dist/systems/installed.js +89 -0
- package/dist/systems/maps.d.ts +3 -0
- package/dist/systems/maps.js +9 -0
- package/dist/systems/read.d.ts +3 -0
- package/dist/systems/read.js +471 -0
- package/dist/systems/schema.d.ts +289 -0
- package/dist/systems/schema.js +243 -0
- package/dist/systems/settings.d.ts +19 -0
- package/dist/systems/settings.js +78 -0
- package/dist/systems/versions.d.ts +12 -0
- package/dist/systems/versions.js +52 -0
- package/dist/testing/index.js +1 -1
- package/instructions/import.md +1 -1
- package/instructions/length-a-few-sessions.md +1 -0
- package/instructions/length-one-evening.md +1 -0
- package/instructions/play.md +1 -1
- package/instructions/session-zero.md +1 -1
- package/instructions/setup.md +1 -1
- package/package.json +1 -1
- package/dist/commands/config.js +0 -917
- package/dist/commands/package.d.ts +0 -143
- package/dist/commands/package.js +0 -785
- package/dist/commands/scene.js +0 -894
- package/dist/commands/shared/worked-out.js +0 -805
- package/dist/dashboard/place/map-view.js +0 -417
- /package/dist/commands/shared/{library-reader.d.ts → books/library-reader.d.ts} +0 -0
- /package/dist/core/{package-api.d.ts → packages/api.d.ts} +0 -0
- /package/dist/core/{package-api.js → packages/api.js} +0 -0
- /package/dist/dashboard/{coins.js → parts/coins.js} +0 -0
- /package/dist/dashboard/{glass.js → parts/glass.js} +0 -0
- /package/dist/dashboard/{layout.js → parts/layout.js} +0 -0
- /package/dist/dashboard/{mood-faces.js → parts/mood-faces.js} +0 -0
- /package/dist/dashboard/{free-rolls.js → play/free-rolls.js} +0 -0
- /package/dist/dashboard/{reactions.js → play/reactions.js} +0 -0
- /package/dist/dashboard/{prefs.js → shell/prefs.js} +0 -0
- /package/dist/dashboard/{system-style.js → shell/system-style.js} +0 -0
- /package/dist/dashboard/{theme.js → shell/theme.js} +0 -0
- /package/dist/languages/{language-pack.d.ts → pack.d.ts} +0 -0
- /package/dist/languages/{language-pack.js → pack.js} +0 -0
- /package/dist/pages/{page-file.d.ts → file.d.ts} +0 -0
- /package/dist/pages/{page-file.js → file.js} +0 -0
- /package/dist/pages/{page-types.d.ts → types.d.ts} +0 -0
- /package/dist/pages/{page-types.js → types.js} +0 -0
- /package/dist/rules/{rule-book.d.ts → book.d.ts} +0 -0
- /package/dist/rules/{rule-book.js → book.js} +0 -0
- /package/dist/systems/{system-folders.d.ts → folders.d.ts} +0 -0
- /package/dist/systems/{system-folders.js → folders.js} +0 -0
package/dist/campaign/index.d.ts
CHANGED
|
@@ -4,5 +4,5 @@ export { campaignFileName, findCampaign, houseRulesFolderName, requireCampaign }
|
|
|
4
4
|
export { hasCharacterAgent, hostFileNames, refreshHostFiles, writeEffortFiles } from "./host-files.ts";
|
|
5
5
|
export { lastChoices, rememberChoice, rememberedSettings } from "./last-choices.ts";
|
|
6
6
|
export { type CountedByGame, customLevel, customLevels, customSettings, difficulties, difficultyItems, itemMeaning, leveled, type LeveledSetting, rigorItems, rigors, startingLevels } from "./levels.ts";
|
|
7
|
-
export { type CampaignSettings, changeExtensions, changeListSetting, changeListSettingToNone, changeMapSetting, changeOtherSetting, changeSetting, checkSettingName, checkSettings, clearSetting, closedSettings, companionWays, diceWays, efforts, entrySettingNames, lethalities, listSettingNames, mapSettingNames, masterRollWays, mentorWays, missingSettings, pictureWays, preparations, proseWays, readCampaignData, readListSetting, readOneSetting, readSettings, readTextSetting, saveModes, settingDescription, settingMeaning, type SettingName, settingNames, setupSettingNames, storyWays, styleTextLengths, unansweredSettings, unitSystems, voiceWays, } from "./settings.ts";
|
|
7
|
+
export { type CampaignSettings, changeExtensions, changeListSetting, changeListSettingToNone, changeMapSetting, changeOtherSetting, changeSetting, characterWays, checkSettingName, checkSettings, clearSetting, closedSettings, companionWays, diceWays, efforts, entrySettingNames, lengths, lethalities, listLimits, listSettingNames, mapSettingNames, masterRollWays, mentorWays, missingSettings, pictureWays, preparations, proseWays, readCampaignData, readListSetting, readOneSetting, readSettings, readTextSetting, saveModes, settingDescription, settingMeaning, type SettingName, settingNames, setupSettingNames, storyWays, styleTextLengths, unansweredSettings, unitSystems, voiceWays, } from "./settings.ts";
|
|
8
8
|
export { type CampaignState, changeState, changeStateAt, readState, readStateValues } from "./state.ts";
|
package/dist/campaign/index.js
CHANGED
|
@@ -5,5 +5,5 @@ export { campaignFileName, findCampaign, houseRulesFolderName, requireCampaign }
|
|
|
5
5
|
export { hasCharacterAgent, hostFileNames, refreshHostFiles, writeEffortFiles } from "./host-files.js";
|
|
6
6
|
export { lastChoices, rememberChoice, rememberedSettings } from "./last-choices.js";
|
|
7
7
|
export { customLevel, customLevels, customSettings, difficulties, difficultyItems, itemMeaning, leveled, rigorItems, rigors, startingLevels } from "./levels.js";
|
|
8
|
-
export { changeExtensions, changeListSetting, changeListSettingToNone, changeMapSetting, changeOtherSetting, changeSetting, checkSettingName, checkSettings, clearSetting, closedSettings, companionWays, diceWays, efforts, entrySettingNames, lethalities, listSettingNames, mapSettingNames, masterRollWays, mentorWays, missingSettings, pictureWays, preparations, proseWays, readCampaignData, readListSetting, readOneSetting, readSettings, readTextSetting, saveModes, settingDescription, settingMeaning, settingNames, setupSettingNames, storyWays, styleTextLengths, unansweredSettings, unitSystems, voiceWays, } from "./settings.js";
|
|
8
|
+
export { changeExtensions, changeListSetting, changeListSettingToNone, changeMapSetting, changeOtherSetting, changeSetting, characterWays, checkSettingName, checkSettings, clearSetting, closedSettings, companionWays, diceWays, efforts, entrySettingNames, lengths, lethalities, listLimits, listSettingNames, mapSettingNames, masterRollWays, mentorWays, missingSettings, pictureWays, preparations, proseWays, readCampaignData, readListSetting, readOneSetting, readSettings, readTextSetting, saveModes, settingDescription, settingMeaning, settingNames, setupSettingNames, storyWays, styleTextLengths, unansweredSettings, unitSystems, voiceWays, } from "./settings.js";
|
|
9
9
|
export { changeState, changeStateAt, readState, readStateValues } from "./state.js";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
3
3
|
import { dirname, join } from "node:path";
|
|
4
4
|
/** The settings whose last choice a new campaign's setup suggests: how the player likes to play, never what belongs to one game, as how well they know it. */
|
|
5
|
-
export const rememberedSettings = ["difficulty", "lethality", "saves", "rigor", "dice", "master-rolls", "units", "companions", "preparation"];
|
|
5
|
+
export const rememberedSettings = ["difficulty", "lethality", "saves", "rigor", "dice", "master-rolls", "units", "companions", "preparation", "length"];
|
|
6
6
|
const fileName = "last-choices.json";
|
|
7
7
|
/** The last choice of each remembered setting, from the player's folder on this computer; none when there is no folder or the file does not read. */
|
|
8
8
|
export function lastChoices(home) {
|
|
@@ -62,9 +62,9 @@ export declare function checkSettings(root: string): Problem[];
|
|
|
62
62
|
export declare function missingSettings(settings: CampaignSettings): SettingName[];
|
|
63
63
|
/**
|
|
64
64
|
* The settings the setup still has to ask, in order (MOD-3): those every campaign needs, how the companions come, the lines and veils until answered, even
|
|
65
|
-
* with none, and, for a campaign without a written world, its premise and
|
|
65
|
+
* with none, how the character comes until one exists, and, for a campaign without a written world, its premise, preparation and length.
|
|
66
66
|
*/
|
|
67
|
-
export declare function unansweredSettings(settings: CampaignSettings, writtenWorld: boolean): SettingName[];
|
|
67
|
+
export declare function unansweredSettings(settings: CampaignSettings, writtenWorld: boolean, characterMade?: boolean): SettingName[];
|
|
68
68
|
export declare function checkSettingName(name: string): SettingName;
|
|
69
69
|
/** How much the master teaches the game, out of the story (D-347): the story alone, a hint now and then, or each rule as it first comes up. */
|
|
70
70
|
export declare const mentorWays: readonly ["off", "hints", "tutorial"];
|
|
@@ -86,6 +86,10 @@ export declare const efforts: readonly ["low", "medium", "high"];
|
|
|
86
86
|
export declare const companionWays: readonly ["none", "made with the player", "made by the master", "met in play"];
|
|
87
87
|
/** How far ahead a world without a written campaign is made (D-80): as it is needed, or all at the start. */
|
|
88
88
|
export declare const preparations: readonly ["on the fly", "all at the start"];
|
|
89
|
+
/** How long a campaign without a written world plays (D-558): one evening, a few sessions, or open, its adventures one after another. */
|
|
90
|
+
export declare const lengths: readonly ["one evening", "a few sessions", "open"];
|
|
91
|
+
/** How the player character comes (D-557): made with the player, made by the master, or the player's own, a character they already have. */
|
|
92
|
+
export declare const characterWays: readonly ["made with the player", "made by the master", "the player's own"];
|
|
89
93
|
/** How the master writes (D-395): plain, the core's own, literary, pulp or wry; the tone stays in the premise, and an author takes its place. */
|
|
90
94
|
export declare const proseWays: readonly ["plain", "literary", "pulp", "wry"];
|
|
91
95
|
/** How the master builds what they invent (D-395): situations, the core's own, arcs, episodes or a mystery; a written adventure keeps its own. */
|
|
@@ -112,6 +116,11 @@ export declare const settingsSchema: z.ZodObject<{
|
|
|
112
116
|
"on the fly": "on the fly";
|
|
113
117
|
"all at the start": "all at the start";
|
|
114
118
|
}>>;
|
|
119
|
+
length: z.ZodOptional<z.ZodEnum<{
|
|
120
|
+
"one evening": "one evening";
|
|
121
|
+
"a few sessions": "a few sessions";
|
|
122
|
+
open: "open";
|
|
123
|
+
}>>;
|
|
115
124
|
prose: z.ZodOptional<z.ZodEnum<{
|
|
116
125
|
plain: "plain";
|
|
117
126
|
literary: "literary";
|
|
@@ -195,10 +204,15 @@ export declare const settingsSchema: z.ZodObject<{
|
|
|
195
204
|
important: "important";
|
|
196
205
|
always: "always";
|
|
197
206
|
}>>;
|
|
207
|
+
character: z.ZodOptional<z.ZodEnum<{
|
|
208
|
+
"made with the player": "made with the player";
|
|
209
|
+
"made by the master": "made by the master";
|
|
210
|
+
"the player's own": "the player's own";
|
|
211
|
+
}>>;
|
|
198
212
|
companions: z.ZodOptional<z.ZodEnum<{
|
|
199
|
-
none: "none";
|
|
200
213
|
"made with the player": "made with the player";
|
|
201
214
|
"made by the master": "made by the master";
|
|
215
|
+
none: "none";
|
|
202
216
|
"met in play": "met in play";
|
|
203
217
|
}>>;
|
|
204
218
|
"calendar-start": z.ZodOptional<z.ZodString>;
|
|
@@ -215,6 +229,7 @@ export declare const settingsSchema: z.ZodObject<{
|
|
|
215
229
|
}>>;
|
|
216
230
|
lines: z.ZodOptional<z.ZodNullable<z.ZodPreprocess<z.ZodArray<z.ZodPreprocess<z.ZodString, unknown>>, unknown>>>;
|
|
217
231
|
veils: z.ZodOptional<z.ZodNullable<z.ZodPreprocess<z.ZodArray<z.ZodPreprocess<z.ZodString, unknown>>, unknown>>>;
|
|
232
|
+
orders: z.ZodOptional<z.ZodNullable<z.ZodPreprocess<z.ZodArray<z.ZodPreprocess<z.ZodString, unknown>>, unknown>>>;
|
|
218
233
|
table: z.ZodOptional<z.ZodNullable<z.ZodPreprocess<z.ZodArray<z.ZodPreprocess<z.ZodString, unknown>>, unknown>>>;
|
|
219
234
|
precedents: z.ZodOptional<z.ZodNullable<z.ZodPreprocess<z.ZodArray<z.ZodPreprocess<z.ZodString, unknown>>, unknown>>>;
|
|
220
235
|
learned: z.ZodOptional<z.ZodNullable<z.ZodPreprocess<z.ZodArray<z.ZodPreprocess<z.ZodString, unknown>>, unknown>>>;
|
|
@@ -236,12 +251,17 @@ export declare const settingsSchema: z.ZodObject<{
|
|
|
236
251
|
export declare const settingNames: SettingName[];
|
|
237
252
|
/** The settings that hold a list, changed one item at a time; none of them is ever missing in play. */
|
|
238
253
|
export declare const listSettingNames: SettingName[];
|
|
254
|
+
/** The most items a list setting takes, and the longest each may be, where it has a limit: the player's standing orders, always before the master (D-563). */
|
|
255
|
+
export declare const listLimits: Partial<Record<SettingName, {
|
|
256
|
+
items: number;
|
|
257
|
+
length: number;
|
|
258
|
+
}>>;
|
|
239
259
|
/** The settings that hold entries by name, what the campaign adds to its game system (CAM-1): given or removed one entry at a time. */
|
|
240
260
|
export declare const mapSettingNames: SettingName[];
|
|
241
261
|
/** The settings that hold entries by name: what the campaign adds to its game system, where the dashboard shows the extensions' widgets (D-502), and the items of a custom difficulty or rigor (T-132). */
|
|
242
262
|
export declare const entrySettingNames: SettingName[];
|
|
243
263
|
/**
|
|
244
|
-
* What only the setup asks (D-241, MOD-3, D-347, D-287): how much the master teaches the game, whether the master's rolls are shown, how the
|
|
245
|
-
* when the story starts, and the lines and veils, which "none" answers too.
|
|
264
|
+
* What only the setup asks (D-241, MOD-3, D-347, D-287, D-557): how much the master teaches the game, whether the master's rolls are shown, how the player
|
|
265
|
+
* character and the companions come, when the story starts, and the lines and veils, which "none" answers too.
|
|
246
266
|
*/
|
|
247
267
|
export declare const setupSettingNames: SettingName[];
|
|
@@ -134,6 +134,7 @@ export function changeListSetting(root, name, change) {
|
|
|
134
134
|
list.add(document.createNode(item.trim().normalize("NFC")));
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
|
+
checkListLimits(setting, change.add ?? [], held.length, list.items.length);
|
|
137
138
|
// A list emptied stays, as []: it still answers the setup (MOD-3).
|
|
138
139
|
if (JSON.stringify(list.toJSON()) === before) {
|
|
139
140
|
return false;
|
|
@@ -241,10 +242,10 @@ export function missingSettings(settings) {
|
|
|
241
242
|
}
|
|
242
243
|
/**
|
|
243
244
|
* The settings the setup still has to ask, in order (MOD-3): those every campaign needs, how the companions come, the lines and veils until answered, even
|
|
244
|
-
* with none, and, for a campaign without a written world, its premise and
|
|
245
|
+
* with none, how the character comes until one exists, and, for a campaign without a written world, its premise, preparation and length.
|
|
245
246
|
*/
|
|
246
|
-
export function unansweredSettings(settings, writtenWorld) {
|
|
247
|
-
const asked = [...setupSettingNames, ...(writtenWorld ? [] : premiseSettingNames)];
|
|
247
|
+
export function unansweredSettings(settings, writtenWorld, characterMade = false) {
|
|
248
|
+
const asked = [...setupSettingNames.filter((name) => !characterMade || name !== "character"), ...(writtenWorld ? [] : premiseSettingNames)];
|
|
248
249
|
return settingNames.filter((name) => missingSettings(settings).includes(name) || (asked.includes(name) && (settings[name] === undefined || settings[name] === null)));
|
|
249
250
|
}
|
|
250
251
|
export function checkSettingName(name) {
|
|
@@ -280,6 +281,10 @@ export const efforts = ["low", "medium", "high"];
|
|
|
280
281
|
export const companionWays = ["none", "made with the player", "made by the master", "met in play"];
|
|
281
282
|
/** How far ahead a world without a written campaign is made (D-80): as it is needed, or all at the start. */
|
|
282
283
|
export const preparations = ["on the fly", "all at the start"];
|
|
284
|
+
/** How long a campaign without a written world plays (D-558): one evening, a few sessions, or open, its adventures one after another. */
|
|
285
|
+
export const lengths = ["one evening", "a few sessions", "open"];
|
|
286
|
+
/** How the player character comes (D-557): made with the player, made by the master, or the player's own, a character they already have. */
|
|
287
|
+
export const characterWays = ["made with the player", "made by the master", "the player's own"];
|
|
283
288
|
/** How the master writes (D-395): plain, the core's own, literary, pulp or wry; the tone stays in the premise, and an author takes its place. */
|
|
284
289
|
export const proseWays = ["plain", "literary", "pulp", "wry"];
|
|
285
290
|
/** How the master builds what they invent (D-395): situations, the core's own, arcs, episodes or a mystery; a written adventure keeps its own. */
|
|
@@ -299,6 +304,8 @@ export const closedSettings = {
|
|
|
299
304
|
effort: efforts,
|
|
300
305
|
companions: companionWays,
|
|
301
306
|
preparation: preparations,
|
|
307
|
+
length: lengths,
|
|
308
|
+
character: characterWays,
|
|
302
309
|
prose: proseWays,
|
|
303
310
|
story: storyWays,
|
|
304
311
|
};
|
|
@@ -335,6 +342,7 @@ export const settingsSchema = z.object({
|
|
|
335
342
|
mentor: z.enum(mentorWays).optional().describe("how much the master teaches the game, out of the story: off, hints or tutorial; asked as how well the player knows the game: never played (tutorial), a little (hints), well (off)"),
|
|
336
343
|
premise: z.string().min(1).optional().describe("without a written campaign: the genre, the tone, a few elements of the world and what the player enjoys most in a game, such as fights, mysteries, talk or exploring, in the player's words"),
|
|
337
344
|
preparation: z.enum(preparations).optional().describe("without a written campaign: on the fly (the master makes the world just before it is needed) or all at the start"),
|
|
345
|
+
length: z.enum(lengths).optional().describe("without a written campaign: how long it plays, one evening, a few sessions or open; the master sizes each adventure to it, and at its end asks whether to go on"),
|
|
338
346
|
prose: z.enum(proseWays).optional().describe("how the master writes, as the player chose it: plain, literary, pulp or wry; the tone stays in the premise; an author takes its place"),
|
|
339
347
|
story: z.enum(storyWays).optional().describe("how the master builds what they invent: situations, arcs, episodes or mystery; a written adventure keeps its own"),
|
|
340
348
|
author: oneLine(styleTextLengths.author).optional().describe("an author the master writes like, as the player named them: their way, never their sentences, names or places"),
|
|
@@ -354,6 +362,7 @@ export const settingsSchema = z.object({
|
|
|
354
362
|
voices: z.enum(voiceWays).optional().describe("who voices the characters, where the AI app has subagents, from the master to the characters: master (the master, always), auto (at key moments, as the master chooses, "
|
|
355
363
|
+ "a character answers as a subagent of its own, knowing only what it knows), important (always a subagent for the companions and the characters with kind main), "
|
|
356
364
|
+ "always (always a subagent, for everyone); unset, auto"),
|
|
365
|
+
character: z.enum(characterWays).optional().describe("how the player character comes in session zero: made with the player, made by the master from a few words of theirs, or the player's own, a character they bring, at the level it has"),
|
|
357
366
|
companions: z.enum(companionWays).optional().describe("how the companions come: none, made with the player or made by the master in session zero, or met in play"),
|
|
358
367
|
// Checked by the time module against the calendar (TIM-8).
|
|
359
368
|
"calendar-start": z.string().min(1).optional().describe("when the story starts: day 1 to count only the days, or the day of the world's calendar that is day 1, such as 14 April 1491"),
|
|
@@ -366,6 +375,7 @@ export const settingsSchema = z.object({
|
|
|
366
375
|
+ "unset, each app keeps its own"),
|
|
367
376
|
lines: listSetting.describe("what never appears in the game"),
|
|
368
377
|
veils: listSetting.describe("what happens only off screen, without details"),
|
|
378
|
+
orders: listSetting.describe("the player's standing orders to the companions, in their words, kept until they lift one"),
|
|
369
379
|
table: listSetting.describe("the table's agreements: what the master promised about how the game is played"),
|
|
370
380
|
precedents: listSetting.describe("the rulings made without the text, each starting with the name of the rule in the system's language: Poisoned: …"),
|
|
371
381
|
learned: listSetting.describe("the game's mechanics the master has explained, by their names in the system's language: explained again only when the player gets one wrong"),
|
|
@@ -391,18 +401,20 @@ export const settingsSchema = z.object({
|
|
|
391
401
|
/** The settings that the config command shows and changes. */
|
|
392
402
|
export const settingNames = Object.keys(settingsSchema.shape);
|
|
393
403
|
/** The settings that hold a list, changed one item at a time; none of them is ever missing in play. */
|
|
394
|
-
export const listSettingNames = ["lines", "veils", "table", "precedents", "learned", "library", "status-line"];
|
|
404
|
+
export const listSettingNames = ["lines", "veils", "orders", "table", "precedents", "learned", "library", "status-line"];
|
|
405
|
+
/** The most items a list setting takes, and the longest each may be, where it has a limit: the player's standing orders, always before the master (D-563). */
|
|
406
|
+
export const listLimits = { orders: { items: 6, length: 120 } };
|
|
395
407
|
/** The settings that hold entries by name, what the campaign adds to its game system (CAM-1): given or removed one entry at a time. */
|
|
396
408
|
export const mapSettingNames = ["fields", "tables", "computed", "counters", "recipes", "travel", "values", "condition-icons"];
|
|
397
409
|
/** The settings that hold entries by name: what the campaign adds to its game system, where the dashboard shows the extensions' widgets (D-502), and the items of a custom difficulty or rigor (T-132). */
|
|
398
410
|
export const entrySettingNames = [...mapSettingNames, "widgets", "custom-difficulty", "custom-rigor"];
|
|
399
411
|
/**
|
|
400
|
-
* What only the setup asks (D-241, MOD-3, D-347, D-287): how much the master teaches the game, whether the master's rolls are shown, how the
|
|
401
|
-
* when the story starts, and the lines and veils, which "none" answers too.
|
|
412
|
+
* What only the setup asks (D-241, MOD-3, D-347, D-287, D-557): how much the master teaches the game, whether the master's rolls are shown, how the player
|
|
413
|
+
* character and the companions come, when the story starts, and the lines and veils, which "none" answers too.
|
|
402
414
|
*/
|
|
403
|
-
export const setupSettingNames = ["mentor", "master-rolls", "companions", "calendar-start", "lines", "veils"];
|
|
404
|
-
/** What the setup asks only of a campaign without a written world (D-79, D-80, MOD-3). */
|
|
405
|
-
const premiseSettingNames = ["premise", "preparation"];
|
|
415
|
+
export const setupSettingNames = ["mentor", "master-rolls", "character", "companions", "calendar-start", "lines", "veils"];
|
|
416
|
+
/** What the setup asks only of a campaign without a written world (D-79, D-80, D-558, MOD-3). */
|
|
417
|
+
const premiseSettingNames = ["premise", "preparation", "length"];
|
|
406
418
|
// Settings that only some games have, or that only the setup asks: never asked for in play when missing.
|
|
407
419
|
// The pictures: status asks for them once, only where they can be made (D-308).
|
|
408
420
|
// How the master writes: the core's own until the player chooses (D-395).
|
|
@@ -425,6 +437,23 @@ function listNode(document, setting) {
|
|
|
425
437
|
}
|
|
426
438
|
return node;
|
|
427
439
|
}
|
|
440
|
+
/**
|
|
441
|
+
* Refuses an item longer than its list takes, or a list grown past its most items (D-563); one written longer by hand still reads, and still loses items.
|
|
442
|
+
* Characters are counted as a reader counts them.
|
|
443
|
+
*/
|
|
444
|
+
function checkListLimits(setting, added, before, after) {
|
|
445
|
+
const limits = listLimits[setting];
|
|
446
|
+
if (limits === undefined) {
|
|
447
|
+
return;
|
|
448
|
+
}
|
|
449
|
+
const long = added.map((item) => [...item.trim().normalize("NFC")].length).find((length) => length > limits.length);
|
|
450
|
+
if (long !== undefined) {
|
|
451
|
+
throw new Error(`"${setting}" takes items of at most ${limits.length} characters, and this one has ${long}: ask the player for a shorter one. Nothing changed.`);
|
|
452
|
+
}
|
|
453
|
+
if (after > limits.items && after > before) {
|
|
454
|
+
throw new Error(`"${setting}" holds at most ${limits.items} items, and has ${before}: remove one the player lifted first, or ask which to drop. Nothing changed.`);
|
|
455
|
+
}
|
|
456
|
+
}
|
|
428
457
|
/** Writes campaign.yaml, if the settings are still valid; long values stay on one line. */
|
|
429
458
|
function saveSettings(root, document) {
|
|
430
459
|
validateSettings(document.toJS());
|
package/dist/cli/cli.js
CHANGED
|
@@ -9,7 +9,7 @@ if (args.length === 1 && args[0] === "mcp") {
|
|
|
9
9
|
await startMcpServer();
|
|
10
10
|
}
|
|
11
11
|
else if (args[0] === "--read-library") {
|
|
12
|
-
const { readLibraryHere } = await import("../commands/shared/library-reader.js");
|
|
12
|
+
const { readLibraryHere } = await import("../commands/shared/books/library-reader.js");
|
|
13
13
|
await readLibraryHere();
|
|
14
14
|
}
|
|
15
15
|
else if (args.length === 1 && args[0] === "--listen") {
|
package/dist/cli/command-line.js
CHANGED
|
@@ -2,7 +2,7 @@ import { parseArgs } from "node:util";
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { findCampaign } from "../campaign/index.js";
|
|
4
4
|
import { commands } from "../commands/index.js";
|
|
5
|
-
import { libraryRunner } from "../commands/shared/library-reader.js";
|
|
5
|
+
import { libraryRunner } from "../commands/shared/books/library-reader.js";
|
|
6
6
|
import { loadCampaignCode, packageCommands } from "../commands/shared/packages/code.js";
|
|
7
7
|
import { systemConfirm } from "../confirm/index.js";
|
|
8
8
|
import { defaultContext, packagesFolder } from "../core/context.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { type TimePassed } from "./shared/advance.ts";
|
|
2
|
+
import { type TimePassed } from "./shared/time/advance.ts";
|
|
3
3
|
export declare const advance: import("../core/registry.ts").Command<z.ZodObject<{
|
|
4
4
|
by: z.ZodOptional<z.ZodString>;
|
|
5
5
|
to: z.ZodOptional<z.ZodString>;
|
package/dist/commands/advance.js
CHANGED
|
@@ -3,13 +3,13 @@ import { changeState, requireCampaign } from "../campaign/index.js";
|
|
|
3
3
|
import { appendLogEntry } from "../core/log.js";
|
|
4
4
|
import { defineCommand } from "../core/registry.js";
|
|
5
5
|
import { addDuration, formatDuration, formatGameDate, lastGameDay, minutesBetween, readDuration, readGameDate } from "../time/index.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { newStateChecks } from "./shared/campaign/checks.js";
|
|
7
|
+
import { firstInChat } from "./shared/campaign/parts.js";
|
|
8
|
+
import { campaignWorld } from "./shared/campaign/world.js";
|
|
9
9
|
import { timePassedLines } from "./shared/packages/code.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
10
|
+
import { calendarText, nextAfter, passedLines, passTime, unreadNotes } from "./shared/time/advance.js";
|
|
11
|
+
import { dueEvents, dueText, isDated, plannedEvents } from "./shared/time/events.js";
|
|
12
|
+
import { newDatedLogEntry, presentDate } from "./shared/time/time.js";
|
|
13
13
|
export const advance = defineCommand({
|
|
14
14
|
name: "advance",
|
|
15
15
|
description: "Let time pass in the story: by a duration or to a later game date. "
|
package/dist/commands/ask.js
CHANGED
|
@@ -10,15 +10,15 @@ import { findPage, loadWorld, locate, playerCharacters } from "../pages/index.js
|
|
|
10
10
|
import { rollName } from "../systems/index.js";
|
|
11
11
|
import { placeOnMap } from "./move.js";
|
|
12
12
|
import { hasNames, namesAsZero, rollerOf, sheetDiceOf, withSheetValues } from "./roll/roll.js";
|
|
13
|
-
import {
|
|
14
|
-
import { effectiveFields } from "./shared/effect-layer.js";
|
|
15
|
-
import { placeGrid } from "./shared/grids.js";
|
|
13
|
+
import { campaignSystem, campaignWorld, systemWordsOf } from "./shared/campaign/world.js";
|
|
16
14
|
import { textList } from "./shared/inputs.js";
|
|
17
15
|
import { allSaid, packagesAsking, packagesRolled } from "./shared/packages/hooks.js";
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
16
|
+
import { placeGrid } from "./shared/places/grids.js";
|
|
17
|
+
import { effectiveFields } from "./shared/sheet/effect-layer.js";
|
|
18
|
+
import { knowledgeNote } from "./shared/sheet/sheet.js";
|
|
19
|
+
import { restDice, spendDice } from "./shared/time/dice-pool.js";
|
|
20
|
+
import { recipeNamed } from "./shared/time/recipes.js";
|
|
21
|
+
import { newDatedLogEntry } from "./shared/time/time.js";
|
|
22
22
|
// The words of the buttons, in the campaign's language, as the dashboard's languages (playtest 15); English for the others (ASK-7). A toss's for one coin and for
|
|
23
23
|
// more (ASK-15).
|
|
24
24
|
const buttonWords = {
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type Coin, type Purse } from "../../money/index.ts";
|
|
2
|
+
/** One change worked out on a counter or on money, before it is written (D-92, MON-4). */
|
|
3
|
+
export interface Step {
|
|
4
|
+
before: number | string;
|
|
5
|
+
after: number | string;
|
|
6
|
+
/** How it was asked, for the log: by, spend or to, and how far it went beyond a limit. */
|
|
7
|
+
amount: Record<string, unknown>;
|
|
8
|
+
note: string;
|
|
9
|
+
/** For money: what the purse is worth in the first coin, when it holds other coins. */
|
|
10
|
+
total?: string;
|
|
11
|
+
/** Whether a base's value is the one the change leads to (INH-9). */
|
|
12
|
+
same(value: unknown): boolean;
|
|
13
|
+
}
|
|
14
|
+
/** A change to a counter: by, spend or to, within its limits (D-92). */
|
|
15
|
+
export declare function counterStep(input: {
|
|
16
|
+
by?: number | string;
|
|
17
|
+
spend?: number | string;
|
|
18
|
+
to?: number | string;
|
|
19
|
+
}, value: unknown, page: string, field: string, coins: Coin[] | undefined, limits?: {
|
|
20
|
+
min?: number;
|
|
21
|
+
max?: number;
|
|
22
|
+
hint?: {
|
|
23
|
+
made: string;
|
|
24
|
+
raise?: string;
|
|
25
|
+
};
|
|
26
|
+
}): Step;
|
|
27
|
+
/** A change to money (MON-4, MON-5): coins received with by, paid with spend or a negative by, the purse set with to. */
|
|
28
|
+
export declare function moneyStep(input: {
|
|
29
|
+
by?: number | string;
|
|
30
|
+
spend?: number | string;
|
|
31
|
+
to?: number | string;
|
|
32
|
+
}, purse: Purse, coins: Coin[], page: string, field: string): Step;
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
// Works out a change of a counter or money from by, spend or to, before anything is written
|
|
2
|
+
import { canSpend, changeCounter, counterLimit, formatCounter, isSafeCounter, readCounter, readCounterText } from "../../counters/index.js";
|
|
3
|
+
import { addCoins, formatAmount, formatTotal, isSafePurse, namesCoins, payCoins, readAmount, readSignedAmount, totalOf } from "../../money/index.js";
|
|
4
|
+
import { coinExamples } from "../shared/examples.js";
|
|
5
|
+
/** A change to a counter: by, spend or to, within its limits (D-92). */
|
|
6
|
+
export function counterStep(input, value, page, field, coins, limits = {}) {
|
|
7
|
+
const read = readCounter(value);
|
|
8
|
+
if (read === undefined) {
|
|
9
|
+
throw new Error(notCounterMessage(page, field, value, coins));
|
|
10
|
+
}
|
|
11
|
+
const before = limits.min === undefined ? read : { ...read, min: limits.min };
|
|
12
|
+
const counterChange = readChange(input, before, page, field, coins);
|
|
13
|
+
// How to change a maximum the game system works out, said when a value goes past it.
|
|
14
|
+
const raise = limits.hint?.raise === undefined ? "" : `; to raise the maximum, write ${limits.hint.raise}; to change it for a while, as a drain, give an effect that sets ${limits.hint.raise}`;
|
|
15
|
+
// A maximum the game system works out is given only as it works it out (FOR-7).
|
|
16
|
+
if ("to" in counterChange && limits.max !== undefined && counterChange.to.max !== undefined && counterChange.to.max !== limits.max) {
|
|
17
|
+
throw new Error(`The maximum of ${field} on ${page} is worked out by the game system: ${limits.hint?.made ?? limits.max}. Give the current value alone, such as to ${Math.min(counterChange.to.value, limits.max)}${raise}. Nothing changed.`);
|
|
18
|
+
}
|
|
19
|
+
// A value given with to keeps the minimum the system gives, for where it stands: 0 is no limit of a counter that goes below it.
|
|
20
|
+
const { counter: after, beyond } = changeCounter(before, counterChange);
|
|
21
|
+
// Above a maximum the game system works out, a value reads as the maximum (FOR-6): what change says it wrote would not be what is read.
|
|
22
|
+
if ("to" in counterChange && limits.max !== undefined && after.value > limits.max) {
|
|
23
|
+
throw new Error(`${field} on ${page} goes no higher than its maximum, which the game system works out: ${limits.hint?.made ?? limits.max}. Give to ${limits.max} or less${raise}. Nothing changed.`);
|
|
24
|
+
}
|
|
25
|
+
if (!isSafeCounter(after)) {
|
|
26
|
+
throw new Error(`${field} on ${page} would be too large to count exactly. Nothing changed.`);
|
|
27
|
+
}
|
|
28
|
+
const same = (base) => {
|
|
29
|
+
const counter = readCounter(base);
|
|
30
|
+
return counter !== undefined && formatCounter(counter) === formatCounter(after);
|
|
31
|
+
};
|
|
32
|
+
return { before: formatCounter(before), after: formatCounter(after), amount: { ...amountOf(counterChange), beyond: beyond === 0 ? undefined : beyond }, note: limitNote({ ...after, min: after.min ?? before.min }, beyond), same };
|
|
33
|
+
}
|
|
34
|
+
/** A change to money (MON-4, MON-5): coins received with by, paid with spend or a negative by, the purse set with to. */
|
|
35
|
+
export function moneyStep(input, purse, coins, page, field) {
|
|
36
|
+
const given = [input.by, input.spend, input.to].filter((part) => part !== undefined);
|
|
37
|
+
if (given.length !== 1) {
|
|
38
|
+
throw new Error(`Give one of by (coins received, or paid with a minus), spend (what is paid) or to (what the purse holds), such as spend "5 ${coinExamples(coins).smallCoin}".`);
|
|
39
|
+
}
|
|
40
|
+
// Coins in quotes, as a model may send "\"5 sp\"", are the coins.
|
|
41
|
+
const asked = typeof given[0] === "string" ? given[0].trim().replace(/^"(.*)"$/s, "$1") : given[0];
|
|
42
|
+
const parameter = input.by !== undefined ? "by" : input.spend !== undefined ? "spend" : "to";
|
|
43
|
+
const signed = typeof asked === "string" ? readSignedAmount(asked, coins) : undefined;
|
|
44
|
+
if (signed === undefined || (parameter !== "by" && String(asked).trim().startsWith("-"))) {
|
|
45
|
+
const example = `${parameter === "by" ? "+" : ""}${Math.abs(Number(String(asked).trim())) || 5} ${coins[0].name}`;
|
|
46
|
+
const what = parameter === "by" ? "coins to add or, with a minus, to pay" : "coins";
|
|
47
|
+
throw new Error(`"${String(asked)}" is not ${what} for ${field} on ${page}: give coins of the campaign (${coinNames(coins)}), such as ${parameter} "${example}".`);
|
|
48
|
+
}
|
|
49
|
+
const paying = parameter === "spend" || (parameter === "by" && signed.sign === -1);
|
|
50
|
+
if (paying && totalOf(signed.purse, coins) === 0) {
|
|
51
|
+
throw new Error(`Give ${parameter} the coins paid, such as ${parameter} "${parameter === "by" ? "-" : ""}5 ${coins[0].name}".`);
|
|
52
|
+
}
|
|
53
|
+
const payment = paying ? payCoins(purse, signed.purse, coins) : undefined;
|
|
54
|
+
if (paying && payment === undefined) {
|
|
55
|
+
throw new Error(`${page} has ${field} ${formatAmount(purse, coins)} (${formatTotal(purse, coins)}): cannot pay ${formatAmount(signed.purse, coins)} (${formatTotal(signed.purse, coins)}). Nothing changed.`);
|
|
56
|
+
}
|
|
57
|
+
const after = payment?.purse ?? (parameter === "to" ? signed.purse : addCoins(purse, signed.purse));
|
|
58
|
+
if (!isSafePurse(after, coins)) {
|
|
59
|
+
throw new Error(`${field} on ${page} would be too large to count exactly. Nothing changed.`);
|
|
60
|
+
}
|
|
61
|
+
const text = (coinsGiven) => (coinsGiven === undefined || Object.keys(coinsGiven).length === 0 ? undefined : formatAmount(coinsGiven, coins));
|
|
62
|
+
const handed = text(payment?.given);
|
|
63
|
+
const back = text(payment?.back);
|
|
64
|
+
const amount = formatAmount(signed.purse, coins);
|
|
65
|
+
const request = parameter === "to" ? { to: amount } : parameter === "spend" ? { spend: amount } : { by: `${signed.sign === -1 ? "-" : "+"}${amount}` };
|
|
66
|
+
const others = Object.keys(after).some((name) => name !== coins[0].name);
|
|
67
|
+
const same = (base) => {
|
|
68
|
+
const basePurse = readAmount(base, coins);
|
|
69
|
+
return basePurse !== undefined && formatAmount(basePurse, coins) === formatAmount(after, coins);
|
|
70
|
+
};
|
|
71
|
+
return {
|
|
72
|
+
before: formatAmount(purse, coins),
|
|
73
|
+
after: formatAmount(after, coins),
|
|
74
|
+
amount: { ...request, given: handed, back },
|
|
75
|
+
note: back !== undefined ? `${handed} given, ${back} back` : handed === undefined ? "" : `paid with ${handed}`,
|
|
76
|
+
total: others ? formatTotal(after, coins) : undefined,
|
|
77
|
+
same,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
function readChange(input, counter, page, field, coins) {
|
|
81
|
+
const given = [input.by, input.spend, input.to].filter((part) => part !== undefined);
|
|
82
|
+
if (given.length !== 1) {
|
|
83
|
+
throw new Error("Give one of by (damage, healing), spend (what is paid or used up) or to (a value, max, or current/max).");
|
|
84
|
+
}
|
|
85
|
+
if (typeof input.by === "string" || typeof input.spend === "string") {
|
|
86
|
+
const parameter = typeof input.by === "string" ? "by" : "spend";
|
|
87
|
+
// A plain number given coins may be money written without them; a current/max counter is no purse.
|
|
88
|
+
const coinsAsked = counter.max === undefined && coins !== undefined && readSignedAmount(String(input.by ?? input.spend), coins) !== undefined;
|
|
89
|
+
const money = coinsAsked && coins !== undefined
|
|
90
|
+
? `${field} on ${page} is a number, not money: to count it in coins, set it with its coins, such as set ${field}=${counter.value} ${coins[0].name}; or give ${parameter} a whole number.`
|
|
91
|
+
: undefined;
|
|
92
|
+
throw new Error(money ?? `${field} on ${page} is a counter: give ${parameter} a whole number, such as ${parameter === "by" ? "by -7" : "spend 1"}.`);
|
|
93
|
+
}
|
|
94
|
+
if (input.by !== undefined) {
|
|
95
|
+
return { by: input.by };
|
|
96
|
+
}
|
|
97
|
+
if (input.spend !== undefined) {
|
|
98
|
+
if (!canSpend(counter, input.spend)) {
|
|
99
|
+
const floor = (counter.min ?? 0) > 0 ? `, which goes no lower than ${counter.min}` : "";
|
|
100
|
+
throw new Error(input.spend > 0 ? `${page} has ${field} ${formatCounter(counter)}${floor}: cannot spend ${input.spend}. Nothing changed.` : "Give spend a number above 0.");
|
|
101
|
+
}
|
|
102
|
+
return { spend: input.spend };
|
|
103
|
+
}
|
|
104
|
+
return { to: readTarget(String(input.to).trim(), counter, page, field) };
|
|
105
|
+
}
|
|
106
|
+
/** The value given to `to`: max, a whole number, or current/max. */
|
|
107
|
+
function readTarget(target, counter, page, field) {
|
|
108
|
+
if (target.toLowerCase() === "max") {
|
|
109
|
+
if (counter.max === undefined) {
|
|
110
|
+
throw new Error(`${field} on ${page} has no maximum: give to a number, or write the field as current/max with write.`);
|
|
111
|
+
}
|
|
112
|
+
return { ...counter, value: counter.max };
|
|
113
|
+
}
|
|
114
|
+
const given = readCounterText(target);
|
|
115
|
+
if (given === undefined) {
|
|
116
|
+
throw new Error(`"${target}" is not a value for to: give a whole number, max, or current/max such as 15/15.`);
|
|
117
|
+
}
|
|
118
|
+
return given.max === undefined ? { ...counter, value: given.value } : given;
|
|
119
|
+
}
|
|
120
|
+
function amountOf(change) {
|
|
121
|
+
return "to" in change ? { to: formatCounter(change.to) } : change;
|
|
122
|
+
}
|
|
123
|
+
/** Where the counter stands, when it matters: at 0 or at its maximum, how far a change went beyond, or outside the limits. */
|
|
124
|
+
function limitNote(counter, beyond) {
|
|
125
|
+
const limit = counterLimit(counter);
|
|
126
|
+
const lowest = counter.min ?? 0;
|
|
127
|
+
const where = limit === "outside" ? (counter.max === undefined ? `below ${lowest}` : `outside ${lowest}–${counter.max}`) : limit ?? "";
|
|
128
|
+
return [where, beyond === 0 ? "" : `${Math.abs(beyond)} beyond`].filter((part) => part !== "").join(", ");
|
|
129
|
+
}
|
|
130
|
+
function notCounterMessage(page, field, value, coins) {
|
|
131
|
+
if (typeof value === "string" && readCounterText(value) !== undefined) {
|
|
132
|
+
return `${field} on ${page} is the text "${value}": write it without quotes, such as ${field}: ${value}, to make it a counter.`;
|
|
133
|
+
}
|
|
134
|
+
// Coins of the campaign after a number, such as "34 mo e 4 ma", meant money that does not read as an amount (MON-2).
|
|
135
|
+
if (typeof value === "string" && coins !== undefined && namesCoins(value, coins)) {
|
|
136
|
+
return `${field} on ${page} is "${value}", not money: write the coins one after the other, such as set ${field}=12 ${coins[0].name}.`;
|
|
137
|
+
}
|
|
138
|
+
const notCounter = `${field} on ${page} is ${JSON.stringify(value)}, not a counter: write a counter as a number (20) or as current/max (12/12).`;
|
|
139
|
+
const word = typeof value === "string" ? /\d+\s*(\p{L}[\p{L}\p{M}]*)/u.exec(value)?.[1] : undefined;
|
|
140
|
+
if (word === undefined) {
|
|
141
|
+
return notCounter;
|
|
142
|
+
}
|
|
143
|
+
return coins === undefined
|
|
144
|
+
? `${notCounter} If it is money, the campaign needs its coins: set them with config, naming them as written here (${word}), each with its value in the smallest.`
|
|
145
|
+
: `${notCounter} If it is money, ${word} is not a coin of the campaign (${coinNames(coins)}): write it with those, or give a coin that name too with config, such as ${coins[0].name}/${word}.`;
|
|
146
|
+
}
|
|
147
|
+
/** "gp/mo, pp, sp, cp": the coins of the campaign, by all their names. */
|
|
148
|
+
function coinNames(coins) {
|
|
149
|
+
return coins.map((coin) => coin.names.join("/")).join(", ");
|
|
150
|
+
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { fireEvents } from "../shared/events.ts";
|
|
3
2
|
export declare const change: import("../../core/registry.ts").Command<z.ZodObject<{
|
|
4
3
|
page: z.ZodOptional<z.ZodString>;
|
|
5
4
|
field: z.ZodOptional<z.ZodString>;
|
|
@@ -13,7 +12,7 @@ export declare const change: import("../../core/registry.ts").Command<z.ZodObjec
|
|
|
13
12
|
}, z.core.$strip>, {
|
|
14
13
|
recipe: string;
|
|
15
14
|
system: string;
|
|
16
|
-
outcomes: RecipeOutcome[];
|
|
15
|
+
outcomes: import("./recipe.ts").RecipeOutcome[];
|
|
17
16
|
rules: string[];
|
|
18
17
|
lasts?: string;
|
|
19
18
|
buttons?: boolean;
|
|
@@ -26,19 +25,17 @@ export declare const change: import("../../core/registry.ts").Command<z.ZodObjec
|
|
|
26
25
|
before: string;
|
|
27
26
|
after: string;
|
|
28
27
|
total?: string;
|
|
29
|
-
/** "in Forma d'orso; at max; again as Lupo": the effect it changed on, the limit it reached, the base whose value the page reads again. */
|
|
30
28
|
note: string;
|
|
31
29
|
effect?: string;
|
|
32
30
|
again?: string;
|
|
33
31
|
changed: boolean;
|
|
34
|
-
due: ReturnType<typeof fireEvents>["due"];
|
|
32
|
+
due: ReturnType<typeof import("../shared/time/events.ts").fireEvents>["due"];
|
|
35
33
|
followers: string[];
|
|
36
34
|
keepers: string[];
|
|
37
35
|
thresholds: string[];
|
|
38
|
-
/** What the change may break that someone keeps alive, and what shields the counter it lowered (EFF-14, DAT-14). */
|
|
39
36
|
reminders: string[];
|
|
40
37
|
} | {
|
|
41
|
-
hiddenRoll?: HiddenDice | undefined;
|
|
38
|
+
hiddenRoll?: import("./dice.ts").HiddenDice | undefined;
|
|
42
39
|
rolled: string;
|
|
43
40
|
problems: string[];
|
|
44
41
|
page: string;
|
|
@@ -46,60 +43,13 @@ export declare const change: import("../../core/registry.ts").Command<z.ZodObjec
|
|
|
46
43
|
before: string;
|
|
47
44
|
after: string;
|
|
48
45
|
total?: string;
|
|
49
|
-
/** "in Forma d'orso; at max; again as Lupo": the effect it changed on, the limit it reached, the base whose value the page reads again. */
|
|
50
46
|
note: string;
|
|
51
47
|
effect?: string;
|
|
52
48
|
again?: string;
|
|
53
49
|
changed: boolean;
|
|
54
|
-
due: ReturnType<typeof fireEvents>["due"];
|
|
50
|
+
due: ReturnType<typeof import("../shared/time/events.ts").fireEvents>["due"];
|
|
55
51
|
followers: string[];
|
|
56
52
|
keepers: string[];
|
|
57
53
|
thresholds: string[];
|
|
58
|
-
/** What the change may break that someone keeps alive, and what shields the counter it lowered (EFF-14, DAT-14). */
|
|
59
54
|
reminders: string[];
|
|
60
55
|
}>;
|
|
61
|
-
/** The dice in by, hidden: the roll's id, the fingerprint the player may ask for, and whether master-rolls hid them. */
|
|
62
|
-
interface HiddenDice {
|
|
63
|
-
id: string;
|
|
64
|
-
fingerprint: string;
|
|
65
|
-
screened: boolean;
|
|
66
|
-
}
|
|
67
|
-
/** What a step did to a counter or to money. */
|
|
68
|
-
interface StepOutcome {
|
|
69
|
-
page: string;
|
|
70
|
-
field: string;
|
|
71
|
-
before: string;
|
|
72
|
-
after: string;
|
|
73
|
-
total?: string;
|
|
74
|
-
/** "in Forma d'orso; at max; again as Lupo": the effect it changed on, the limit it reached, the base whose value the page reads again. */
|
|
75
|
-
note: string;
|
|
76
|
-
effect?: string;
|
|
77
|
-
again?: string;
|
|
78
|
-
changed: boolean;
|
|
79
|
-
due: ReturnType<typeof fireEvents>["due"];
|
|
80
|
-
followers: string[];
|
|
81
|
-
keepers: string[];
|
|
82
|
-
thresholds: string[];
|
|
83
|
-
/** What the change may break that someone keeps alive, and what shields the counter it lowered (EFF-14, DAT-14). */
|
|
84
|
-
reminders: string[];
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* What a recipe did to a page: the effects it ended, the steps it wrote, what it leaves to the player or, for a companion, to the master (D-206), and the
|
|
88
|
-
* counters it leaves to the master.
|
|
89
|
-
*/
|
|
90
|
-
interface RecipeOutcome {
|
|
91
|
-
page: string;
|
|
92
|
-
pc: boolean;
|
|
93
|
-
ended: string[];
|
|
94
|
-
steps: StepOutcome[];
|
|
95
|
-
choices: string[];
|
|
96
|
-
/** The dice the recipe lets the page spend that would give something, as hit-dice-d8 2/3, which the player chooses for the player character (ASK-14). */
|
|
97
|
-
spendable: string[];
|
|
98
|
-
notBroughtBack: string[];
|
|
99
|
-
kept: string[];
|
|
100
|
-
/** The effects without an end still on the page, which a rest may ask something of (EFF-15). */
|
|
101
|
-
resting: string;
|
|
102
|
-
/** Whether the recipe gave the page nothing, at 0 of what it needs or too soon after the last (RST-1). */
|
|
103
|
-
barred: boolean;
|
|
104
|
-
}
|
|
105
|
-
export {};
|