rpg-engine 0.15.0 → 0.17.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/adventures/source.d.ts +3 -1
- package/dist/adventures/source.js +31 -1
- package/dist/campaign/find-campaign.js +8 -4
- package/dist/campaign/index.d.ts +1 -1
- package/dist/campaign/index.js +1 -1
- package/dist/campaign/settings.d.ts +6 -0
- package/dist/campaign/settings.js +22 -1
- 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} +2 -24
- 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.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 +68 -45
- 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 +6 -6
- package/dist/commands/mode.d.ts +2 -2
- package/dist/commands/mode.js +8 -8
- 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 +270 -0
- package/dist/commands/package/result.d.ts +89 -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 +2 -2
- 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/books/adventure-layers.d.ts +89 -0
- package/dist/commands/shared/books/adventure-layers.js +201 -0
- package/dist/commands/shared/{adventures.d.ts → books/adventures.d.ts} +28 -9
- package/dist/commands/shared/{adventures.js → books/adventures.js} +77 -35
- 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} +24 -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} +3 -3
- package/dist/commands/shared/{parts.js → campaign/parts.js} +3 -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} +9 -6
- package/dist/commands/shared/{thoughts.js → characters/thoughts.js} +17 -7
- 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} +10 -8
- 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} +7 -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 +9 -0
- package/dist/commands/show.js +43 -10
- package/dist/commands/status.d.ts +2 -1
- package/dist/commands/status.js +28 -22
- package/dist/commands/thoughts.d.ts +1 -0
- package/dist/commands/thoughts.js +26 -18
- 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/layers.d.ts +34 -0
- package/dist/commands/view/layers.js +44 -0
- 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 +96 -0
- package/dist/commands/view/page.d.ts +32 -0
- package/dist/commands/view/page.js +166 -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 +252 -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 +29 -292
- package/dist/commands/view/view.js +31 -536
- 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 +185 -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 +44 -0
- package/dist/commands/write/layer.js +68 -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 -0
- package/dist/commands/write/write.js +36 -816
- 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/core/text.d.ts +2 -0
- package/dist/core/text.js +4 -0
- 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 +19 -1
- package/dist/dashboard/app.js +51 -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 +7 -3
- package/dist/dashboard/guide/cs.md +9 -5
- package/dist/dashboard/guide/da.md +9 -5
- package/dist/dashboard/guide/de.md +7 -3
- package/dist/dashboard/guide/el.md +9 -5
- package/dist/dashboard/guide/en.md +4 -0
- package/dist/dashboard/guide/es.md +8 -4
- package/dist/dashboard/guide/fi.md +9 -5
- package/dist/dashboard/guide/fr.md +8 -4
- package/dist/dashboard/guide/he.md +7 -3
- package/dist/dashboard/guide/hi.md +10 -6
- package/dist/dashboard/guide/hu.md +8 -4
- package/dist/dashboard/guide/is.md +9 -5
- package/dist/dashboard/guide/it.md +5 -1
- package/dist/dashboard/guide/ja.md +9 -5
- package/dist/dashboard/guide/ko.md +8 -4
- package/dist/dashboard/guide/nb.md +8 -4
- package/dist/dashboard/guide/nl.md +8 -4
- package/dist/dashboard/guide/pl.md +8 -4
- package/dist/dashboard/guide/pt.md +7 -3
- package/dist/dashboard/guide/ro.md +9 -5
- package/dist/dashboard/guide/ru.md +8 -4
- package/dist/dashboard/guide/sv.md +9 -5
- package/dist/dashboard/guide/tr.md +9 -5
- package/dist/dashboard/guide/uk.md +8 -4
- package/dist/dashboard/guide/zh.md +8 -4
- package/dist/dashboard/help/help.js +3 -3
- package/dist/dashboard/i18n/ar.json +29 -0
- package/dist/dashboard/i18n/cs.json +29 -0
- package/dist/dashboard/i18n/da.json +29 -0
- package/dist/dashboard/i18n/de.json +29 -0
- package/dist/dashboard/i18n/el.json +29 -0
- package/dist/dashboard/i18n/es.json +29 -0
- package/dist/dashboard/i18n/fi.json +29 -0
- package/dist/dashboard/i18n/fr.json +29 -0
- package/dist/dashboard/i18n/he.json +29 -0
- package/dist/dashboard/i18n/hi.json +29 -0
- package/dist/dashboard/i18n/hu.json +29 -0
- package/dist/dashboard/i18n/is.json +29 -0
- package/dist/dashboard/i18n/it.json +29 -0
- package/dist/dashboard/i18n/ja.json +30 -1
- package/dist/dashboard/i18n/ko.json +29 -0
- package/dist/dashboard/i18n/nb.json +29 -0
- package/dist/dashboard/i18n/nl.json +29 -0
- package/dist/dashboard/i18n/pl.json +29 -0
- package/dist/dashboard/i18n/pt.json +29 -0
- package/dist/dashboard/i18n/ro.json +29 -0
- package/dist/dashboard/i18n/ru.json +29 -0
- package/dist/dashboard/i18n/sv.json +29 -0
- package/dist/dashboard/i18n/tr.json +29 -0
- package/dist/dashboard/i18n/uk.json +29 -0
- package/dist/dashboard/i18n/zh.json +29 -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/changes.js +111 -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 +27 -578
- 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/parts/changed.js +37 -0
- 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} +2 -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} +5 -1
- package/dist/dashboard/{status.js → parts/status.js} +4 -4
- package/dist/dashboard/{widgets.js → parts/widgets.js} +5 -3
- 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} +11 -10
- 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} +5 -5
- 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} +27 -24
- 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 +38 -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 +288 -4
- 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 +10 -6
- 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/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 +52 -0
- package/dist/pages/layers.js +105 -0
- package/dist/pages/markdown.d.ts +5 -1
- package/dist/pages/markdown.js +13 -1
- 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 +23 -0
- package/dist/pages/write-layer.js +162 -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.d.ts +2 -0
- package/dist/server/dashboard/choices.js +6 -4
- package/dist/server/dashboard/files.js +5 -5
- package/dist/server/dashboard/index.d.ts +2 -2
- package/dist/server/dashboard/index.js +7 -3
- package/dist/server/dashboard/news.js +4 -3
- package/dist/server/dashboard/player.js +1 -1
- package/dist/server/dashboard/writes.d.ts +7 -0
- package/dist/server/dashboard/writes.js +48 -7
- 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/play.md +1 -1
- package/instructions/voices.md +1 -1
- package/package.json +1 -1
- package/dist/commands/config.js +0 -948
- 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
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type LeveledSetting } from "../../campaign/index.ts";
|
|
2
|
+
/** The difficulty or rigor whose items a setting holds: difficulty for custom-difficulty; undefined for any other (T-132). */
|
|
3
|
+
export declare function customOf(name: string): LeveledSetting | undefined;
|
|
4
|
+
/** The items of a custom difficulty or rigor as campaign.yaml writes them, for its meaning; undefined for another setting. */
|
|
5
|
+
export declare function customWritten(root: string, name: string): unknown;
|
|
6
|
+
/** The items of a custom difficulty or rigor as config takes them, food: rules, each checked and named as the engine names it (T-132). */
|
|
7
|
+
export declare function customEntries(setting: LeveledSetting, text: string): Record<string, string>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// The items of a custom difficulty or rigor: which setting holds them, as written, as given (T-132)
|
|
2
|
+
import { customSettings, leveled, readOneSetting } from "../../campaign/index.js";
|
|
3
|
+
import { comparableText } from "../../core/text.js";
|
|
4
|
+
import { entriesOf } from "./entries.js";
|
|
5
|
+
/** The difficulty or rigor whose items a setting holds: difficulty for custom-difficulty; undefined for any other (T-132). */
|
|
6
|
+
export function customOf(name) {
|
|
7
|
+
return name.trim() === customSettings.difficulty ? "difficulty" : name.trim() === customSettings.rigor ? "rigor" : undefined;
|
|
8
|
+
}
|
|
9
|
+
/** The items of a custom difficulty or rigor as campaign.yaml writes them, for its meaning; undefined for another setting. */
|
|
10
|
+
export function customWritten(root, name) {
|
|
11
|
+
return name === "difficulty" || name === "rigor" ? readOneSetting(root, customSettings[name]) : undefined;
|
|
12
|
+
}
|
|
13
|
+
/** The items of a custom difficulty or rigor as config takes them, food: rules, each checked and named as the engine names it (T-132). */
|
|
14
|
+
export function customEntries(setting, text) {
|
|
15
|
+
const { items, levels } = leveled[setting];
|
|
16
|
+
// food: rules, load: smooth as the master says it, and as YAML writes it, {food: rules, load: smooth}.
|
|
17
|
+
const written = text.trim().startsWith("{") ? text : `{${text}}`;
|
|
18
|
+
const entries = Object.entries(entriesOf(customSettings[setting], written)).map(([item, level]) => {
|
|
19
|
+
const known = items.find((one) => comparableText(one) === comparableText(item));
|
|
20
|
+
const at = levels.find((one) => typeof level === "string" && comparableText(one) === comparableText(level));
|
|
21
|
+
if (known === undefined) {
|
|
22
|
+
throw new Error(`${item} is no item of the custom ${setting}: they are ${items.join(", ")}. Nothing changed.`);
|
|
23
|
+
}
|
|
24
|
+
if (at === undefined) {
|
|
25
|
+
throw new Error(level === null
|
|
26
|
+
? `${known} needs its level, ${levels.join(", ")}: write it as ${known}: ${levels[1]}. Nothing changed.`
|
|
27
|
+
: `${known} takes ${levels.join(", ")}, not ${String(level)}. Nothing changed.`);
|
|
28
|
+
}
|
|
29
|
+
return [known, at];
|
|
30
|
+
});
|
|
31
|
+
return Object.fromEntries(entries);
|
|
32
|
+
}
|
|
@@ -1,18 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { type Context } from "../core/context.ts";
|
|
3
|
-
export declare const config: import("../core/registry.ts").Command<z.ZodObject<{
|
|
4
|
-
setting: z.ZodOptional<z.ZodString>;
|
|
5
|
-
value: z.ZodOptional<z.ZodString>;
|
|
6
|
-
add: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
7
|
-
remove: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
8
|
-
computer: z.ZodOptional<z.ZodBoolean>;
|
|
9
|
-
}, z.core.$strip>, ConfigResult>;
|
|
10
|
-
interface ConfigResult {
|
|
11
|
-
settings: Record<string, unknown>;
|
|
12
|
-
note: string;
|
|
13
|
-
replaced: string[];
|
|
14
|
-
part?: string;
|
|
15
|
-
}
|
|
1
|
+
import type { Context } from "../../core/context.ts";
|
|
16
2
|
/** A setting of the player's as the dashboard shows it (D-341): what it is, its value or a list's items, and its values with what each means to the player. */
|
|
17
3
|
export interface PlayerSetting {
|
|
18
4
|
name: string;
|
|
@@ -36,7 +22,7 @@ export interface PlayerSetting {
|
|
|
36
22
|
text: string;
|
|
37
23
|
fix?: true;
|
|
38
24
|
};
|
|
39
|
-
/** A setting of the player's own words, as the author the master writes like
|
|
25
|
+
/** A setting of the player's own words, as the author the master writes like, the longest its text may be (D-395); for a list, each item's (D-563). */
|
|
40
26
|
most?: number;
|
|
41
27
|
/** The items of a custom difficulty or rigor, each with its level, one of the choices (T-132). */
|
|
42
28
|
entries?: {
|
|
@@ -57,13 +43,5 @@ export declare function shownPlayerSettings(root: string, context: Context): Pla
|
|
|
57
43
|
export declare function playerSettings(root: string, context: Context): PlayerSetting[];
|
|
58
44
|
/** One of the player's settings by its name, in any case, as the dashboard changes them (D-341); undefined for a setting of the master's or none. */
|
|
59
45
|
export declare function playerSettingNamed(root: string, context: Context, name: string): PlayerSetting | undefined;
|
|
60
|
-
/**
|
|
61
|
-
* What the master hears, at the head of their next call, of a setting the player changed on the dashboard (D-341): how it is now against how it was before the
|
|
62
|
-
* player's first change since their last call, a value with what it means to the master; nothing for one that came back as it was.
|
|
63
|
-
*/
|
|
64
|
-
export declare function playerChangeNews(root: string, context: Context, before: PlayerSetting, after: PlayerSetting): string[];
|
|
65
|
-
/** The settings the player changes on the dashboard (D-341): how the game plays for them; the master's own, as house rules, coins and precedents, stay in the chat. */
|
|
66
|
-
export declare const playerSettingNames: readonly ["difficulty", "custom-difficulty", "lethality", "saves", "rigor", "custom-rigor", "between-sessions", "mentor", "learned", "prose", "story", "author", "style", "dice", "master-rolls", "units", "voices", "pictures", "effort", "lines", "veils", "language"];
|
|
67
46
|
/** Every note the pictures' setting may have, which the dashboard writes in its language (D-394). */
|
|
68
47
|
export declare const picturesNotes: string[];
|
|
69
|
-
export {};
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
// The player's settings and the setup's questions as the dashboard shows them (D-341, D-370)
|
|
2
|
+
import { customLevel, customLevels, customSettings, lastChoices, listSettingNames, readOneSetting, readSettings, setupSettingNames } from "../../campaign/index.js";
|
|
3
|
+
import { comparableText } from "../../core/text.js";
|
|
4
|
+
import { claudeSays, codexSays } from "../../helpers/index.js";
|
|
5
|
+
import { readBetweenSessions } from "../../time/index.js";
|
|
6
|
+
import { heldSystemSettings, isLeading, offeredValues, playedEngineSetting } from "../shared/campaign/offers.js";
|
|
7
|
+
import { playedSettingValue } from "../shared/campaign/world.js";
|
|
8
|
+
import { customOf } from "./custom-levels.js";
|
|
9
|
+
import { betweenSessionsWays, playerSettingNames, playerWords, setupWords, wordsOf } from "./words.js";
|
|
10
|
+
/**
|
|
11
|
+
* The setup's questions as the dashboard asks them (D-370), each with its value or items, if answered, and its values with what each means: the player's
|
|
12
|
+
* settings of the setup, how the character and the companions come, the preparation and length of a world not written, those the game system adds, then the lines and veils.
|
|
13
|
+
*/
|
|
14
|
+
export function setupQuestions(root, context, writtenWorld) {
|
|
15
|
+
const own = playerSettings(root, context);
|
|
16
|
+
const named = (name) => {
|
|
17
|
+
const setting = own.find((one) => one.name === name) ?? setupSettingNamed(root, name);
|
|
18
|
+
return setting === undefined ? [] : [setting];
|
|
19
|
+
};
|
|
20
|
+
const held = heldSystemSettings(root, context);
|
|
21
|
+
const system = held.map((setting) => setting.name);
|
|
22
|
+
const settings = readSettings(root);
|
|
23
|
+
const difficulty = settings.difficulty;
|
|
24
|
+
// The value a system's setting suggests (DAT-17).
|
|
25
|
+
const systemSuggests = Object.fromEntries(held.flatMap((setting) => setting.values.filter((value) => value.suggested === true).map((value) => [setting.name, value.value])));
|
|
26
|
+
// The player's last choices first: how they like to play, from their last campaign on this computer (T-134).
|
|
27
|
+
const last = lastChoices(context.home);
|
|
28
|
+
const suggested = { ...suggestedValues, ...(difficulty === undefined ? {} : { lethality: suggestedLethality[difficulty] ?? "dice" }), ...systemSuggests, ...last };
|
|
29
|
+
// The system's settings others depend on right after the mentor, before what they change (DAT-16, DAT-17).
|
|
30
|
+
const leading = held.filter(isLeading).map((setting) => setting.name);
|
|
31
|
+
const order = setupOrder.filter((name) => !writtenWorld || !worldSettingNames.includes(name));
|
|
32
|
+
const others = system.filter((name) => !leading.includes(name));
|
|
33
|
+
return [...order.slice(0, 1), ...leading, ...order.slice(1), ...others, "lines", "veils"].flatMap(named).map((question) => {
|
|
34
|
+
const suggestion = suggested[question.name];
|
|
35
|
+
// A suggestion the game does not offer is none (DAT-16).
|
|
36
|
+
const offered = suggestion !== undefined && (question.choices === undefined || question.choices.some((choice) => choice.value === suggestion));
|
|
37
|
+
const asked = { ...question, ...(question.choices === undefined ? {} : { choices: question.choices.filter((choice) => choice.value !== customLevel) }) };
|
|
38
|
+
const lastOne = offered && last[question.name] === suggestion ? { last: suggestion } : {};
|
|
39
|
+
return { ...(question.name === "mentor" ? mentorQuestion(asked) : unsetUnanswered(asked, settings)), ...(offered ? { suggested: suggestion } : {}), ...lastOne };
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/** A setting only the setup lets the dashboard change (D-370): how the character and the companions come, the preparation, the length, the name; undefined for any other. */
|
|
43
|
+
export function setupSettingNamed(root, name) {
|
|
44
|
+
const key = Object.keys(setupWords).find((one) => comparableText(one) === comparableText(name));
|
|
45
|
+
if (key === undefined) {
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
48
|
+
const words = setupWords[key];
|
|
49
|
+
const value = readSettings(root)[key];
|
|
50
|
+
return {
|
|
51
|
+
name: key,
|
|
52
|
+
about: words.about,
|
|
53
|
+
...(typeof value === "string" ? { value } : {}),
|
|
54
|
+
...(words.values === undefined ? {} : {
|
|
55
|
+
choices: words.values.map((one) => ({
|
|
56
|
+
value: one,
|
|
57
|
+
...(words.means?.[one] === undefined ? {} : { means: words.means[one] }),
|
|
58
|
+
...(words.labels?.[one] === undefined ? {} : { label: words.labels[one] }),
|
|
59
|
+
})),
|
|
60
|
+
}),
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/** The player's settings as the dashboard shows them (D-341): with what this computer lacks, as pictures without Codex, asked again. */
|
|
64
|
+
export function shownPlayerSettings(root, context) {
|
|
65
|
+
return playerSettings(root, context).map((setting) => (setting.name === "pictures" ? { ...setting, ...picturesReadyNote(context) } : setting));
|
|
66
|
+
}
|
|
67
|
+
/** The player's settings with their values, then those the game system adds (D-341). */
|
|
68
|
+
export function playerSettings(root, context) {
|
|
69
|
+
const settings = readSettings(root);
|
|
70
|
+
const own = heldSystemSettings(root, context).map((setting) => {
|
|
71
|
+
const value = playedSettingValue(root, context, setting);
|
|
72
|
+
const choices = setting.values.map((one) => ({ value: one.value, ...(one.player === undefined ? {} : { means: one.player }) }));
|
|
73
|
+
return { name: setting.name, about: setting.about ?? "a setting of the game system", ...(value === undefined ? {} : { value }), choices };
|
|
74
|
+
});
|
|
75
|
+
return [
|
|
76
|
+
...playerSettingNames.flatMap((name) => {
|
|
77
|
+
const words = playerWords[name];
|
|
78
|
+
const custom = customOf(name);
|
|
79
|
+
if (custom !== undefined) {
|
|
80
|
+
return customItems(root, context, custom, words);
|
|
81
|
+
}
|
|
82
|
+
// A list the setup never asks holds nothing yet, never unanswered (MOD-3).
|
|
83
|
+
const empty = listSettingNames.includes(name) && !setupSettingNames.includes(name) ? [] : undefined;
|
|
84
|
+
const written = settings[name] ?? words.unset ?? empty;
|
|
85
|
+
const value = name === "between-sessions" && typeof written === "string" ? shownBetweenSessions(written) : written;
|
|
86
|
+
const choices = words.values?.map((one) => ({ value: one, ...(words.means?.[one] === undefined ? {} : { means: words.means[one] }) }));
|
|
87
|
+
return [{
|
|
88
|
+
name,
|
|
89
|
+
about: words.about,
|
|
90
|
+
...(Array.isArray(value) ? { items: value.map(String) } : value === undefined || value === null ? {} : { value: String(value) }),
|
|
91
|
+
...(choices === undefined ? {} : { choices }),
|
|
92
|
+
...(words.most === undefined ? {} : { most: words.most }),
|
|
93
|
+
}];
|
|
94
|
+
}).flatMap((setting) => offeredSetting(root, context, setting)),
|
|
95
|
+
...own,
|
|
96
|
+
];
|
|
97
|
+
}
|
|
98
|
+
/** One of the player's settings by its name, in any case, as the dashboard changes them (D-341); undefined for a setting of the master's or none. */
|
|
99
|
+
export function playerSettingNamed(root, context, name) {
|
|
100
|
+
return playerSettings(root, context).find((setting) => comparableText(setting.name) === comparableText(name));
|
|
101
|
+
}
|
|
102
|
+
// The setup's questions, in the order the player meets them on the dashboard: how well they know the game, how it plays, how it is rolled, who comes along,
|
|
103
|
+
// the world and how long it plays, then the limits.
|
|
104
|
+
const setupOrder = ["mentor", "difficulty", "lethality", "saves", "rigor", "dice", "master-rolls", "units", "character", "companions", "preparation", "length"];
|
|
105
|
+
// The mentor as the setup asks it (D-347): how well the player knows the game, each answer a way of the mentor, from the newest player's.
|
|
106
|
+
const mentorAnswers = { tutorial: "never played it", hints: "a little", off: "I know it" };
|
|
107
|
+
// What the setup asks only of a world not written (D-80, D-558): a written one has its own.
|
|
108
|
+
const worldSettingNames = ["preparation", "length"];
|
|
109
|
+
// The values the game suggests in the setup, as the design has them by default (D-370): never chosen for the player.
|
|
110
|
+
const suggestedValues = { saves: "checkpoint", rigor: "smooth", "master-rolls": "behind the screen", character: "made with the player", preparation: "on the fly", length: "one evening" };
|
|
111
|
+
// The lethality the difficulty suggests (D-141).
|
|
112
|
+
const suggestedLethality = { story: "narrative", easy: "epic" };
|
|
113
|
+
/** A question whose value is only the one shown while it is unset, as master-rolls behind the screen (D-287): still unanswered in the setup. */
|
|
114
|
+
function unsetUnanswered(question, settings) {
|
|
115
|
+
const { value, ...unanswered } = question;
|
|
116
|
+
return value !== undefined && wordsOf(question.name)?.unset === value && settings[question.name] === undefined ? unanswered : question;
|
|
117
|
+
}
|
|
118
|
+
/** The mentor as the setup asks it (D-347): how well the player knows the game, never played it first. */
|
|
119
|
+
function mentorQuestion(question) {
|
|
120
|
+
const order = Object.keys(mentorAnswers);
|
|
121
|
+
const choices = (question.choices ?? []).map((choice) => ({ ...choice, label: mentorAnswers[choice.value] })).sort((one, other) => order.indexOf(one.value) - order.indexOf(other.value));
|
|
122
|
+
return { ...question, question: "How well do you know this game?", about: "the master teaches it as much as you need", choices };
|
|
123
|
+
}
|
|
124
|
+
/** A player's setting as the game offers it (DAT-16): none where it plays one value alone; only the values it offers, and no value written that it does not. */
|
|
125
|
+
function offeredSetting(root, context, setting) {
|
|
126
|
+
const offered = offeredValues(root, context, setting.name);
|
|
127
|
+
if (offered === undefined) {
|
|
128
|
+
return [setting];
|
|
129
|
+
}
|
|
130
|
+
if (offered.length === 1) {
|
|
131
|
+
return [];
|
|
132
|
+
}
|
|
133
|
+
const { value, ...rest } = setting;
|
|
134
|
+
const kept = offered.some((one) => comparableText(one) === comparableText(value ?? "")) ? { value } : {};
|
|
135
|
+
return [{ ...rest, ...kept, ...(setting.choices === undefined ? {} : { choices: setting.choices.filter((choice) => offered.some((one) => comparableText(one) === comparableText(choice.value))) }) }];
|
|
136
|
+
}
|
|
137
|
+
// Who makes the pictures on this computer, in the player's words (D-390).
|
|
138
|
+
const madeBy = { Codex: "Codex makes them on this computer, from your ChatGPT plan.", Claude: "Claude draws them on this computer, as vector pictures, from your Claude plan." };
|
|
139
|
+
/** Every note the pictures' setting may have, which the dashboard writes in its language (D-394). */
|
|
140
|
+
export const picturesNotes = [...Object.values(madeBy), ...[...Object.values(codexSays), ...Object.values(claudeSays)].map(notReadyText)];
|
|
141
|
+
/** Whether this computer makes pictures, and with whose plan, in the player's words (D-308, D-390); why not and how to have them; nothing where no maker is asked. */
|
|
142
|
+
function picturesReadyNote(context) {
|
|
143
|
+
const ready = context.pictures?.ready(true);
|
|
144
|
+
return ready === undefined ? {} : { note: ready.ready ? { text: madeBy[ready.maker ?? "Codex"] } : { text: notReadyText(ready), fix: true } };
|
|
145
|
+
}
|
|
146
|
+
/** How the player has pictures, or else why there are none. */
|
|
147
|
+
function notReadyText(said) {
|
|
148
|
+
return said.fix ?? `${said.why}.`;
|
|
149
|
+
}
|
|
150
|
+
/** The game time between sessions as the dashboard shows it (D-133): by the words of a way it offers that plays the same, as STOPS or 2d per 14d; any other as written. */
|
|
151
|
+
function shownBetweenSessions(written) {
|
|
152
|
+
const read = readBetweenSessions(written);
|
|
153
|
+
const same = (way) => {
|
|
154
|
+
const offered = readBetweenSessions(way);
|
|
155
|
+
return read === "stops" || offered === "stops" ? read === offered : read !== undefined && offered !== undefined && read.game * offered.real === offered.game * read.real;
|
|
156
|
+
};
|
|
157
|
+
return betweenSessionsWays.find(same) ?? written;
|
|
158
|
+
}
|
|
159
|
+
/** The items of a custom difficulty or rigor as the dashboard shows them, each with its level, only while the campaign plays it custom (T-132). */
|
|
160
|
+
function customItems(root, context, setting, words) {
|
|
161
|
+
if (playedEngineSetting(root, context, setting) !== customLevel) {
|
|
162
|
+
return [];
|
|
163
|
+
}
|
|
164
|
+
const levels = customLevels(setting, readOneSetting(root, customSettings[setting]));
|
|
165
|
+
return [{
|
|
166
|
+
name: customSettings[setting],
|
|
167
|
+
about: words.about,
|
|
168
|
+
entries: Object.entries(levels).map(([name, value]) => ({ name, value })),
|
|
169
|
+
choices: (words.values ?? []).map((value) => ({ value })),
|
|
170
|
+
}];
|
|
171
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Context } from "../../core/context.ts";
|
|
2
|
+
export declare const counterShape = "bulwark-dice: {max: \"4 * has(features, Bulwark)\"}";
|
|
3
|
+
/** The entries given to a setting that holds them, read as YAML, such as "bulwark-dice: {max: 4, refill: short rest}" (CAM-1). */
|
|
4
|
+
export declare function entriesOf(setting: string, text: string): Record<string, unknown>;
|
|
5
|
+
/** A value given as YAML text, read; what does not read says how to write it. */
|
|
6
|
+
export declare function yamlValue(text: string, what: string, example: string): unknown;
|
|
7
|
+
/**
|
|
8
|
+
* "counters channel-divinity takes the place of the system 5e's {max: …, refill: short rest}": what an entry given in place of one of the system's leaves out,
|
|
9
|
+
* said so that nothing is lost unseen (CAM-2). A recipe adds to the system's and replaces nothing.
|
|
10
|
+
*/
|
|
11
|
+
export declare function replacedEntries(root: string, context: Context, setting: string, names: string[]): string[];
|
|
12
|
+
/** Refuses what the campaign would add to its game system when the system would not read with it (CAM-3), saying where and why; and when it has no system yet. */
|
|
13
|
+
export declare function checkAdditions(root: string, context: Context, setting: string, change: {
|
|
14
|
+
set?: Record<string, unknown>;
|
|
15
|
+
remove?: string[];
|
|
16
|
+
}): void;
|
|
17
|
+
export declare function formatValue(value: unknown): string;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// Settings given as YAML entries by name: read, checked against the system, and what they replace (CAM-1 to CAM-3)
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { parse, stringify } from "yaml";
|
|
4
|
+
import { readCampaignData, readTextSetting } from "../../campaign/index.js";
|
|
5
|
+
import { files } from "../../core/store.js";
|
|
6
|
+
import { comparableText } from "../../core/text.js";
|
|
7
|
+
import { readYamlValues } from "../../core/yaml-file.js";
|
|
8
|
+
import { findCampaignSystem, findSystem, rulesetSetting, systemFileName } from "../../systems/index.js";
|
|
9
|
+
import { campaignSystem, systemLayers } from "../shared/campaign/world.js";
|
|
10
|
+
// The same in a message, which no system's names fill: its maximum alone.
|
|
11
|
+
export const counterShape = 'bulwark-dice: {max: "4 * has(features, Bulwark)"}';
|
|
12
|
+
/** The entries given to a setting that holds them, read as YAML, such as "bulwark-dice: {max: 4, refill: short rest}" (CAM-1). */
|
|
13
|
+
export function entriesOf(setting, text) {
|
|
14
|
+
const value = yamlValue(text, "the entries", "name: value");
|
|
15
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) {
|
|
16
|
+
throw new Error(`${setting} takes entries by name, written as in system.yaml, such as ${setting === "counters" ? `'${counterShape}'` : '"name: value"'}. Nothing changed.`);
|
|
17
|
+
}
|
|
18
|
+
return value;
|
|
19
|
+
}
|
|
20
|
+
/** A value given as YAML text, read; what does not read says how to write it. */
|
|
21
|
+
export function yamlValue(text, what, example) {
|
|
22
|
+
try {
|
|
23
|
+
return parse(text);
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
throw new Error(`"${text}" does not read: ${error instanceof Error ? error.message.split("\n")[0] : String(error)}. Write ${what} as in system.yaml, such as ${example}. Nothing changed.`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* "counters channel-divinity takes the place of the system 5e's {max: …, refill: short rest}": what an entry given in place of one of the system's leaves out,
|
|
31
|
+
* said so that nothing is lost unseen (CAM-2). A recipe adds to the system's and replaces nothing.
|
|
32
|
+
*/
|
|
33
|
+
export function replacedEntries(root, context, setting, names) {
|
|
34
|
+
const system = findSystem(context.systemFolders, readTextSetting(root, "system") ?? "");
|
|
35
|
+
if (system === undefined || setting === "recipes") {
|
|
36
|
+
return [];
|
|
37
|
+
}
|
|
38
|
+
// Its version's entries over its own (VER-3).
|
|
39
|
+
const version = campaignSystem(root, context)?.version?.folder;
|
|
40
|
+
const entries = [system.folder, ...(version === undefined ? [] : [version])].flatMap((folder) => {
|
|
41
|
+
const data = files().exists(join(folder, systemFileName)) ? readYamlValues(join(folder, systemFileName), "what the system is") : undefined;
|
|
42
|
+
const own = data !== null && typeof data === "object" ? data[setting] : undefined;
|
|
43
|
+
return own !== null && typeof own === "object" && !Array.isArray(own) ? Object.entries(own) : [];
|
|
44
|
+
}).reverse();
|
|
45
|
+
return names.flatMap((name) => {
|
|
46
|
+
const [found, value] = entries.find(([other]) => comparableText(other) === comparableText(name)) ?? [];
|
|
47
|
+
return found === undefined ? [] : [`${setting} ${name} takes the place of the system ${system.name}'s ${found}, ${formatValue(value)}: what this one leaves out of it is gone.`];
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
/** Refuses what the campaign would add to its game system when the system would not read with it (CAM-3), saying where and why; and when it has no system yet. */
|
|
51
|
+
export function checkAdditions(root, context, setting, change) {
|
|
52
|
+
const system = readTextSetting(root, "system");
|
|
53
|
+
if (system === undefined || findSystem(context.systemFolders, system) === undefined) {
|
|
54
|
+
throw new Error(`The campaign has no installed game system to add ${setting} to: set its system first. Nothing changed.`);
|
|
55
|
+
}
|
|
56
|
+
const data = readCampaignData(root);
|
|
57
|
+
const held = data[setting] !== null && typeof data[setting] === "object" && !Array.isArray(data[setting]) ? data[setting] : {};
|
|
58
|
+
const dropped = [...(change.remove ?? []), ...Object.keys(change.set ?? {})];
|
|
59
|
+
const entries = { ...Object.fromEntries(Object.entries(held).filter(([name]) => !dropped.some((other) => comparableText(other) === comparableText(name)))), ...change.set };
|
|
60
|
+
// Over what the campaign's extensions add, as the campaign plays it (CAM-2).
|
|
61
|
+
const layers = systemLayers(root, context, { ...data, [setting]: entries });
|
|
62
|
+
const problem = findCampaignSystem(context.systemFolders, system, layers, readTextSetting(root, rulesetSetting)).refused.find((layer) => layer.from === layers.at(-1)?.from)?.problem;
|
|
63
|
+
if (problem !== undefined) {
|
|
64
|
+
throw new Error(`With this, the system ${system} would not read: ${problem} Nothing changed.`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
export function formatValue(value) {
|
|
68
|
+
if (Array.isArray(value)) {
|
|
69
|
+
return value.length > 0 ? value.join("; ") : "(none)";
|
|
70
|
+
}
|
|
71
|
+
// Entries by name, as campaign.yaml writes them, on one line.
|
|
72
|
+
if (value !== null && typeof value === "object") {
|
|
73
|
+
return Object.keys(value).length === 0 ? "(none)" : stringify(value, { collectionStyle: "flow", lineWidth: 0 }).trim();
|
|
74
|
+
}
|
|
75
|
+
return value === undefined ? "(missing)" : String(value);
|
|
76
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Context } from "../../core/context.ts";
|
|
2
|
+
import type { PlayerSetting } from "./dashboard.ts";
|
|
3
|
+
/**
|
|
4
|
+
* What the master hears, at the head of their next call, of a setting the player changed on the dashboard (D-341): how it is now against how it was before the
|
|
5
|
+
* player's first change since their last call, a value with what it means to the master; nothing for one that came back as it was.
|
|
6
|
+
*/
|
|
7
|
+
export declare function playerChangeNews(root: string, context: Context, before: PlayerSetting, after: PlayerSetting): string[];
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// What the master hears of a setting the player changed on the dashboard
|
|
2
|
+
import { itemMeaning, readSettings, settingMeaning } from "../../campaign/index.js";
|
|
3
|
+
import { formatDuration, readBetweenSessions } from "../../time/index.js";
|
|
4
|
+
import { campaignMode } from "../shared/campaign/mode.js";
|
|
5
|
+
import { unofferedLines, valuePart } from "../shared/campaign/offers.js";
|
|
6
|
+
import { mentorPart, stylePart } from "../shared/campaign/parts.js";
|
|
7
|
+
import { campaignSystem, campaignWorld, countedByGame, systemSetting } from "../shared/campaign/world.js";
|
|
8
|
+
import { customOf, customWritten } from "./custom-levels.js";
|
|
9
|
+
import { styleSettingNames, wordsOf } from "./words.js";
|
|
10
|
+
/**
|
|
11
|
+
* What the master hears, at the head of their next call, of a setting the player changed on the dashboard (D-341): how it is now against how it was before the
|
|
12
|
+
* player's first change since their last call, a value with what it means to the master; nothing for one that came back as it was.
|
|
13
|
+
*/
|
|
14
|
+
export function playerChangeNews(root, context, before, after) {
|
|
15
|
+
if (before.entries !== undefined || after.entries !== undefined) {
|
|
16
|
+
return customNews(root, context, before, after);
|
|
17
|
+
}
|
|
18
|
+
if (before.items !== undefined || after.items !== undefined) {
|
|
19
|
+
const added = (after.items ?? []).filter((item) => !(before.items ?? []).includes(item));
|
|
20
|
+
const removed = (before.items ?? []).filter((item) => !(after.items ?? []).includes(item));
|
|
21
|
+
return [
|
|
22
|
+
...(added.length === 0 ? [] : [`The player added ${quotedItems(added)} to ${after.name} on the dashboard: ${addedText(after)}.`]),
|
|
23
|
+
...(removed.length === 0 ? [] : [`The player took ${quotedItems(removed)} off ${after.name} on the dashboard${takenOffText(after.name)}.`]),
|
|
24
|
+
];
|
|
25
|
+
}
|
|
26
|
+
if (after.value === before.value) {
|
|
27
|
+
return [];
|
|
28
|
+
}
|
|
29
|
+
// The master's effort is no rule of play: it changes how the next chat thinks, never this one (D-462).
|
|
30
|
+
if (after.name === "effort") {
|
|
31
|
+
return [`The player set how much you think to ${after.value ?? "their app's own"} on the dashboard: it applies from their next chat; nothing to do now.`];
|
|
32
|
+
}
|
|
33
|
+
// How the master writes comes with its parts as they are now, on a line of their own: the same for each of them the player changed (D-395).
|
|
34
|
+
const style = styleSettingNames.includes(after.name) ? stylePart(root, context) : "";
|
|
35
|
+
if (after.value === undefined) {
|
|
36
|
+
const cleared = wordsOf(after.name)?.cleared;
|
|
37
|
+
return cleared === undefined ? [] : [`The player took ${after.name} away on the dashboard: ${cleared}. Play by it from now on.`, ...(style === "" ? [] : [style])];
|
|
38
|
+
}
|
|
39
|
+
const meaning = settingMeaning(after.name, after.value, countedByGame(campaignSystem(root, context)), customWritten(root, after.name))
|
|
40
|
+
?? (after.name === "between-sessions" ? betweenSessionsMeaning(after.value) : undefined)
|
|
41
|
+
?? systemSetting(root, context, after.name)?.values.find((one) => one.value === after.value)?.means;
|
|
42
|
+
const value = after.most === undefined ? after.value : `"${after.value}"`;
|
|
43
|
+
const author = after.name === "prose" && readSettings(root).author !== undefined ? " An author is written: theirs takes its place until the player takes it away." : "";
|
|
44
|
+
// The mentor's new part comes with it, once in the chat (D-347); in play, a value of the system's with its own part (DAT-18).
|
|
45
|
+
const own = systemSetting(root, context, after.name) === undefined || campaignMode(root, campaignWorld(root, context)) !== "play" ? undefined : valuePart(root, context, after.name, after.value);
|
|
46
|
+
const part = after.name === "mentor" ? mentorPart(root, context, after.value) : (own ?? "");
|
|
47
|
+
return [
|
|
48
|
+
`The player set ${after.name} to ${value} on the dashboard${meaning === undefined ? "" : `: ${meaning}`}. Play by it from now on.${author}${part === "" ? "" : `\n\n${part}`}`,
|
|
49
|
+
...unofferedLines(root, context),
|
|
50
|
+
...(style === "" ? [] : [style]),
|
|
51
|
+
];
|
|
52
|
+
}
|
|
53
|
+
/** What the master hears of the items of a custom difficulty or rigor the player changed on the dashboard: those changed, then the whole as it plays now. */
|
|
54
|
+
function customNews(root, context, before, after) {
|
|
55
|
+
const setting = customOf(after.name);
|
|
56
|
+
const changed = (after.entries ?? []).filter((entry) => before.entries?.find((one) => one.name === entry.name)?.value !== entry.value);
|
|
57
|
+
if (setting === undefined || changed.length === 0) {
|
|
58
|
+
return [];
|
|
59
|
+
}
|
|
60
|
+
// Each item changed with what it means now: the whole custom one is in status, and comes with the news when the player chose it.
|
|
61
|
+
const counted = countedByGame(campaignSystem(root, context));
|
|
62
|
+
const set = changed.map((entry) => `${entry.name} to ${entry.value} (${itemMeaning(setting, entry.name, entry.value, counted) ?? entry.value})`).join("; ");
|
|
63
|
+
return [`The player set in the custom ${setting} on the dashboard ${set}. Play by it from now on.`];
|
|
64
|
+
}
|
|
65
|
+
/** What an item the player added to a list means to the master: what the list holds, or what to do, as for learned. */
|
|
66
|
+
function addedText(setting) {
|
|
67
|
+
return wordsOf(setting.name)?.added ?? setting.about;
|
|
68
|
+
}
|
|
69
|
+
/** What the master does when the player takes an item off a list, as for learned: explain it again. */
|
|
70
|
+
function takenOffText(name) {
|
|
71
|
+
const taken = wordsOf(name)?.takenOff;
|
|
72
|
+
return taken === undefined ? "" : `: ${taken}`;
|
|
73
|
+
}
|
|
74
|
+
/** Items in quotes, one after another: "spiders", "drowning". */
|
|
75
|
+
function quotedItems(items) {
|
|
76
|
+
return items.map((item) => `"${item}"`).join(", ");
|
|
77
|
+
}
|
|
78
|
+
/** What the game time between sessions means to the master (D-133): stopped, or a rate with what status asks of them after a pause; undefined for what does not read. */
|
|
79
|
+
function betweenSessionsMeaning(value) {
|
|
80
|
+
const read = readBetweenSessions(value);
|
|
81
|
+
if (read === "stops") {
|
|
82
|
+
return "no game time passes between sessions: the next one opens at the moment this one ends";
|
|
83
|
+
}
|
|
84
|
+
return read === undefined
|
|
85
|
+
? undefined
|
|
86
|
+
: `the game time runs ${formatDuration(read.game)} for each ${formatDuration(read.real)} of real time between sessions: after a pause, status says how much to let pass with advance `
|
|
87
|
+
+ "before you open the new session, and the opening tells what the world did meanwhile";
|
|
88
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type CampaignSettings, type SettingName } from "../../campaign/index.ts";
|
|
2
|
+
import { type Context } from "../../core/context.ts";
|
|
3
|
+
import { type SystemSetting } from "../../systems/index.ts";
|
|
4
|
+
/** A setting as config shows it: a list or entries by name, none when missing; the coins and the system as they read (MON-7, D-173); difficulty and rigor with what they mean (D-263). */
|
|
5
|
+
export declare function shownValue(root: string, context: Context, settings: CampaignSettings, name: SettingName): unknown;
|
|
6
|
+
/** An engine's setting as config shows it where the game offers only some of its values (DAT-16): the one it plays alone, or missing with those it offers. */
|
|
7
|
+
export declare function offeredShown(root: string, context: Context, name: string, shown: unknown): unknown;
|
|
8
|
+
/** A setting of the system as config shows it: its value with what it means, or missing with every value and what it means (DAT-10). */
|
|
9
|
+
export declare function systemShownValue(root: string, context: Context, setting: SystemSetting): string;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// A setting as config shows it
|
|
2
|
+
import { entrySettingNames, listSettingNames, readTextSetting, settingMeaning, setupSettingNames } from "../../campaign/index.js";
|
|
3
|
+
import { engineSystemsFolder } from "../../core/context.js";
|
|
4
|
+
import { isInside } from "../../core/store.js";
|
|
5
|
+
import { getVersion } from "../../core/version.js";
|
|
6
|
+
import { findSystem, readableSystems, rulesetSetting, systemPackage } from "../../systems/index.js";
|
|
7
|
+
import { libraryShown } from "../shared/books/library.js";
|
|
8
|
+
import { coinsShown } from "../shared/campaign/money.js";
|
|
9
|
+
import { isFixedSetting, offeredValues, playedEngineSetting } from "../shared/campaign/offers.js";
|
|
10
|
+
import { campaignSystem, countedByGame, playedRules, playedSettingValue } from "../shared/campaign/world.js";
|
|
11
|
+
import { customWritten } from "./custom-levels.js";
|
|
12
|
+
/** A setting as config shows it: a list or entries by name, none when missing; the coins and the system as they read (MON-7, D-173); difficulty and rigor with what they mean (D-263). */
|
|
13
|
+
export function shownValue(root, context, settings, name) {
|
|
14
|
+
const meaning = settingMeaning(name, settings[name], countedByGame(campaignSystem(root, context)), customWritten(root, name));
|
|
15
|
+
if (meaning !== undefined) {
|
|
16
|
+
return `${String(settings[name])}: ${meaning}`;
|
|
17
|
+
}
|
|
18
|
+
// The library with what is read of each entry, and what is skipped (LIB-5).
|
|
19
|
+
if (name === "library") {
|
|
20
|
+
return libraryShown(root, context);
|
|
21
|
+
}
|
|
22
|
+
// Lines and veils not yet answered are missing: [] is the answer none (MOD-3).
|
|
23
|
+
if (listSettingNames.includes(name)) {
|
|
24
|
+
return settings[name] ?? (setupSettingNames.includes(name) ? undefined : []);
|
|
25
|
+
}
|
|
26
|
+
if (entrySettingNames.includes(name)) {
|
|
27
|
+
return settings[name] ?? {};
|
|
28
|
+
}
|
|
29
|
+
// How the master writes, unset: the core's own ways, never missing (D-395).
|
|
30
|
+
// And the master's effort, unset: each app's own, the player's to choose (D-462); who voices the characters, unset: auto (D-490); the master's rolls, behind the screen (D-287); the game time between sessions, stopped (D-133).
|
|
31
|
+
const own = {
|
|
32
|
+
prose: "plain (as your instructions write)",
|
|
33
|
+
story: "situations (as your instructions write)",
|
|
34
|
+
author: "(none)",
|
|
35
|
+
style: "(none)",
|
|
36
|
+
effort: "(the app's own: the player's to choose)",
|
|
37
|
+
voices: "auto (a subagent at key moments, as you choose, where the app has them)",
|
|
38
|
+
"master-rolls": "behind the screen (unset: roll hides your rolls for foes and NPCs)",
|
|
39
|
+
"between-sessions": "stops (unset: no game time passes between sessions)",
|
|
40
|
+
};
|
|
41
|
+
if (settings[name] === undefined && Object.hasOwn(own, name)) {
|
|
42
|
+
return own[name];
|
|
43
|
+
}
|
|
44
|
+
return name === "coins" ? coinsShown(root, context) : name === "system" ? systemShown(root, settings.system, context) : settings[name];
|
|
45
|
+
}
|
|
46
|
+
/** An engine's setting as config shows it where the game offers only some of its values (DAT-16): the one it plays alone, or missing with those it offers. */
|
|
47
|
+
export function offeredShown(root, context, name, shown) {
|
|
48
|
+
const offered = offeredValues(root, context, name);
|
|
49
|
+
if (offered === undefined) {
|
|
50
|
+
return shown;
|
|
51
|
+
}
|
|
52
|
+
if (isFixedSetting(root, context, name)) {
|
|
53
|
+
return `${offered[0]} (the only one this game plays: no choice)`;
|
|
54
|
+
}
|
|
55
|
+
return playedEngineSetting(root, context, name) === undefined ? `(missing; ${offered.join(", ")})` : shown;
|
|
56
|
+
}
|
|
57
|
+
/** A setting of the system as config shows it: its value with what it means, or missing with every value and what it means (DAT-10). */
|
|
58
|
+
export function systemShownValue(root, context, setting) {
|
|
59
|
+
const value = playedSettingValue(root, context, setting);
|
|
60
|
+
const chosen = setting.values.find((candidate) => candidate.value === value);
|
|
61
|
+
return chosen === undefined ? `(missing; ${setting.values.map((candidate) => `${candidate.value}: ${candidate.means}`).join("; ")})` : `${chosen.value}: ${chosen.means}`;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* The system as config shows it (D-173): what it is, the version of its rules it is played with (VER-1), and the package that brings it with its version, or the
|
|
65
|
+
* engine for one it ships without a package; missing or not installed, with those that are (D-167).
|
|
66
|
+
*/
|
|
67
|
+
function systemShown(root, system, context) {
|
|
68
|
+
const installed = `installed: ${readableSystems(context.systemFolders).map((installedSystem) => installedSystem.name).join(", ") || "none"}`;
|
|
69
|
+
if (system === undefined) {
|
|
70
|
+
return `(missing; ${installed})`;
|
|
71
|
+
}
|
|
72
|
+
const found = findSystem(context.systemFolders, system, readTextSetting(root, rulesetSetting));
|
|
73
|
+
if (found === undefined) {
|
|
74
|
+
return `${system} (not installed; ${installed})`;
|
|
75
|
+
}
|
|
76
|
+
const own = systemPackage(found.folder);
|
|
77
|
+
const shipped = isInside(engineSystemsFolder, found.folder);
|
|
78
|
+
const from = own !== undefined ? ` (${own.package} ${own.version})` : shipped ? ` (rpg-engine ${getVersion()})` : "";
|
|
79
|
+
return `${found.name}, ${found.title}${playedRules(root, context, found)}${from}`;
|
|
80
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare const styleSettingNames: string[];
|
|
2
|
+
export declare const betweenSessionsWays: readonly ["stops", "1d per 7d", "1d per 1d"];
|
|
3
|
+
/** The settings the player changes on the dashboard (D-341): how the game plays for them; the master's own, as house rules, coins and precedents, stay in the chat. */
|
|
4
|
+
export declare const playerSettingNames: readonly ["difficulty", "custom-difficulty", "lethality", "saves", "rigor", "custom-rigor", "between-sessions", "mentor", "learned", "prose", "story", "author", "style", "dice", "master-rolls", "units", "voices", "pictures", "effort", "lines", "veils", "orders", "language"];
|
|
5
|
+
export declare const playerWords: Record<(typeof playerSettingNames)[number], PlayerWords>;
|
|
6
|
+
/**
|
|
7
|
+
* What a setting of the player's is to them, its values and what each means; what the master does when an item is added to a list or taken off it, or a text
|
|
8
|
+
* cleared; the value shown while it is unset, the core's own; the longest text of the player's own words, or of each item of a list.
|
|
9
|
+
*/
|
|
10
|
+
export interface PlayerWords {
|
|
11
|
+
about: string;
|
|
12
|
+
means?: Record<string, string>;
|
|
13
|
+
values?: readonly string[];
|
|
14
|
+
added?: string;
|
|
15
|
+
takenOff?: string;
|
|
16
|
+
cleared?: string;
|
|
17
|
+
unset?: string;
|
|
18
|
+
most?: number;
|
|
19
|
+
}
|
|
20
|
+
export declare const setupWords: Record<string, {
|
|
21
|
+
about: string;
|
|
22
|
+
values?: readonly string[];
|
|
23
|
+
means?: Record<string, string>;
|
|
24
|
+
labels?: Record<string, string>;
|
|
25
|
+
}>;
|
|
26
|
+
/** What a setting of the player's is to them and to the master, by its name; undefined for one of the game system. */
|
|
27
|
+
export declare function wordsOf(name: string): (typeof playerWords)[keyof typeof playerWords] | undefined;
|