rpg-engine 0.15.0 → 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/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 +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 +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 +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} +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} +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 +3 -0
- package/dist/commands/show.js +28 -9
- package/dist/commands/status.d.ts +2 -1
- package/dist/commands/status.js +28 -22
- 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 +1 -0
- package/dist/commands/write/write.js +32 -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/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 +5 -3
- package/dist/dashboard/guide/cs.md +5 -3
- package/dist/dashboard/guide/da.md +5 -3
- package/dist/dashboard/guide/de.md +5 -3
- package/dist/dashboard/guide/el.md +5 -3
- package/dist/dashboard/guide/en.md +2 -0
- package/dist/dashboard/guide/es.md +4 -2
- package/dist/dashboard/guide/fi.md +5 -3
- package/dist/dashboard/guide/fr.md +4 -2
- package/dist/dashboard/guide/he.md +4 -2
- package/dist/dashboard/guide/hi.md +6 -4
- package/dist/dashboard/guide/hu.md +4 -2
- package/dist/dashboard/guide/is.md +5 -3
- package/dist/dashboard/guide/it.md +3 -1
- package/dist/dashboard/guide/ja.md +7 -5
- package/dist/dashboard/guide/ko.md +6 -4
- package/dist/dashboard/guide/nb.md +4 -2
- package/dist/dashboard/guide/nl.md +5 -3
- package/dist/dashboard/guide/pl.md +4 -2
- package/dist/dashboard/guide/pt.md +4 -2
- package/dist/dashboard/guide/ro.md +5 -3
- package/dist/dashboard/guide/ru.md +5 -3
- package/dist/dashboard/guide/sv.md +5 -3
- package/dist/dashboard/guide/tr.md +6 -4
- package/dist/dashboard/guide/uk.md +4 -2
- package/dist/dashboard/guide/zh.md +5 -3
- package/dist/dashboard/help/help.js +3 -3
- package/dist/dashboard/i18n/ar.json +4 -0
- package/dist/dashboard/i18n/cs.json +4 -0
- package/dist/dashboard/i18n/da.json +4 -0
- package/dist/dashboard/i18n/de.json +4 -0
- package/dist/dashboard/i18n/el.json +4 -0
- package/dist/dashboard/i18n/es.json +4 -0
- package/dist/dashboard/i18n/fi.json +4 -0
- package/dist/dashboard/i18n/fr.json +4 -0
- package/dist/dashboard/i18n/he.json +4 -0
- package/dist/dashboard/i18n/hi.json +4 -0
- package/dist/dashboard/i18n/hu.json +4 -0
- package/dist/dashboard/i18n/is.json +4 -0
- package/dist/dashboard/i18n/it.json +4 -0
- package/dist/dashboard/i18n/ja.json +5 -1
- package/dist/dashboard/i18n/ko.json +4 -0
- package/dist/dashboard/i18n/nb.json +4 -0
- package/dist/dashboard/i18n/nl.json +4 -0
- package/dist/dashboard/i18n/pl.json +4 -0
- package/dist/dashboard/i18n/pt.json +4 -0
- package/dist/dashboard/i18n/ro.json +4 -0
- package/dist/dashboard/i18n/ru.json +4 -0
- package/dist/dashboard/i18n/sv.json +4 -0
- package/dist/dashboard/i18n/tr.json +4 -0
- package/dist/dashboard/i18n/uk.json +4 -0
- package/dist/dashboard/i18n/zh.json +4 -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} +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} +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} +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} +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 +74 -3
- 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/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 +9 -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/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,291 @@
|
|
|
1
|
+
// What the game system works out from the fields of a page (D-199, FOR-3–FOR-8): its computed fields, each with the values it came from, and the limits of// its counters. The formulas are the system's data; this is where they meet the pages and the counters.
|
|
2
|
+
import { contributingReads, diceFields, fieldsRead, listItems, numberOf, workOut } from "../../../core/formula.js";
|
|
3
|
+
import { comparableText } from "../../../core/text.js";
|
|
4
|
+
import { formatCounter, readCounter } from "../../../counters/index.js";
|
|
5
|
+
import { declaredKind, pagesWithName } from "../../../pages/index.js";
|
|
6
|
+
import { formulaIndex, formulaScope, itemFormula, itemValues } from "./formula-scope.js";
|
|
7
|
+
import { progressionValue } from "./progression.js";
|
|
8
|
+
import { isSystemCounter, isUse, itemList, keyOf } from "./system-fields.js";
|
|
9
|
+
import { signedText, workedParts } from "./worked-text.js";
|
|
10
|
+
/**
|
|
11
|
+
* The computed fields of the game system that have a value with these fields (FOR-4), in the order the system gives them; `explained`, each with only the
|
|
12
|
+
* values that changed it (FOR-8).
|
|
13
|
+
*/
|
|
14
|
+
export function workedFields(world, fields, explained = false) {
|
|
15
|
+
const scope = formulaScope(world, fields);
|
|
16
|
+
const computed = (world.system?.formulas?.computed ?? []).flatMap(([field, formula]) => {
|
|
17
|
+
const worked = scope.computed(field);
|
|
18
|
+
return worked?.value === undefined ? [] : [{ field, value: worked.value, reads: explained ? contributingReads(formula, scope, worked) : worked.reads }];
|
|
19
|
+
});
|
|
20
|
+
return [...computed, ...givenFields(world, scope, explained)];
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The fields with what the game system works out over them: each computed field that has a value takes it, over what the page writes (FOR-4); a counter
|
|
24
|
+
* takes the maximum the system works out, and a current above it reads as the maximum (FOR-6). With `sheeted`, the uses it does not write read full (DAT-9).
|
|
25
|
+
*/
|
|
26
|
+
export function withWorkedOut(world, fields, sheeted) {
|
|
27
|
+
const formulas = world.system?.formulas;
|
|
28
|
+
if (formulas === undefined) {
|
|
29
|
+
return fields;
|
|
30
|
+
}
|
|
31
|
+
const result = { ...fields };
|
|
32
|
+
const scope = formulaScope(world, fields);
|
|
33
|
+
const progression = scope.progression();
|
|
34
|
+
// What the classes give, then what the formulas work out over it (PRO-2, FOR-3); a column named as a counter is that counter's maximum (DAT-9).
|
|
35
|
+
for (const worked of givenFields(world, scope)) {
|
|
36
|
+
result[keyOf(result, worked.field) ?? worked.field] = progressionValue(progression, worked.field) ?? worked.value;
|
|
37
|
+
}
|
|
38
|
+
for (const [field] of formulas.computed) {
|
|
39
|
+
const worked = scope.computed(field);
|
|
40
|
+
if (worked?.value !== undefined) {
|
|
41
|
+
result[keyOf(result, field) ?? field] = worked.value;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
for (const field of Object.keys(formulas.counters)) {
|
|
45
|
+
const key = keyOf(result, field);
|
|
46
|
+
const counter = key === undefined ? undefined : readCounter(result[key]);
|
|
47
|
+
const { max } = limitsIn(scope, formulas.counters[field], field);
|
|
48
|
+
if (key !== undefined && counter !== undefined && max !== undefined) {
|
|
49
|
+
result[key] = formatCounter({ value: Math.min(counter.value, max), max });
|
|
50
|
+
}
|
|
51
|
+
// A use the page does not write is full, for who keeps the sheet (DAT-9, D-225).
|
|
52
|
+
if (sheeted && key === undefined && max !== undefined && max > 0 && isUse(world, field)) {
|
|
53
|
+
result[field] = formatCounter({ value: max, max });
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return result;
|
|
57
|
+
}
|
|
58
|
+
/** The uses the system gives a page with these fields that it does not write, each with its maximum (DAT-9): what write puts, full, on who keeps the sheet. */
|
|
59
|
+
export function missingUses(world, fields) {
|
|
60
|
+
return Object.keys(world.system?.formulas?.counters ?? {}).flatMap((field) => {
|
|
61
|
+
const { max } = keyOf(fields, field) === undefined && isUse(world, field) ? counterLimits(world, fields, field) : {};
|
|
62
|
+
return max === undefined || max <= 0 ? [] : [{ field, max }];
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* How much of a counter comes back with these occasions (DAT-9): the sum of what its refill gives for each, where max is the counter's maximum; undefined when
|
|
67
|
+
* it names none of them.
|
|
68
|
+
*/
|
|
69
|
+
export function refillAmount(world, fields, field, occasions, max) {
|
|
70
|
+
const refill = Object.entries(world.system?.formulas?.counters ?? {}).find(([name]) => comparableText(name) === comparableText(field))?.[1].refill;
|
|
71
|
+
const named = Object.entries(refill ?? {}).filter(([occasion]) => occasions.some((other) => comparableText(other) === comparableText(occasion)));
|
|
72
|
+
if (named.length === 0) {
|
|
73
|
+
return undefined;
|
|
74
|
+
}
|
|
75
|
+
const scope = formulaScope(world, fields);
|
|
76
|
+
const withMax = { ...scope, field: (name) => (comparableText(name) === "max" ? max : scope.field(name)) };
|
|
77
|
+
return named.reduce((total, [, formula]) => total + Math.max(0, Math.floor(workOut(formula, withMax).value ?? 0)), 0);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Each item of a list with what the formulas of its page give, field by field, in the order of the list, for a sheet that shows them item by item, as the
|
|
81
|
+
* attacks of the weapons a character has equipped (PRO-5).
|
|
82
|
+
*/
|
|
83
|
+
export function itemLines(world, fields, list, names, explained = false) {
|
|
84
|
+
const scope = formulaScope(world, fields);
|
|
85
|
+
const items = listItems(scope.field(list)).map((item) => item.name);
|
|
86
|
+
const byField = names.map((field) => ({ field, values: itemValues(world, scope, field, explained) }));
|
|
87
|
+
return items.flatMap((item) => {
|
|
88
|
+
const values = byField.flatMap(({ field, values }) => values.filter((value) => value.name === item).map((value) => ({ field, value: value.value, reads: value.reads })));
|
|
89
|
+
return values.length === 0 ? [] : [{ item, values }];
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
/** The minimum and maximum the game system works out for a counter with these fields, where they have a whole value (FOR-6). */
|
|
93
|
+
export function counterLimits(world, fields, field) {
|
|
94
|
+
const limits = Object.entries(world.system?.formulas?.counters ?? {}).find(([name]) => comparableText(name) === comparableText(field.trim()))?.[1];
|
|
95
|
+
if (limits === undefined) {
|
|
96
|
+
return {};
|
|
97
|
+
}
|
|
98
|
+
return limitsIn(formulaScope(world, fields), limits, field);
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* The game system's computed field with this name, in any case, and the fields it comes from, when its formula has a value with these fields (FOR-7):
|
|
102
|
+
* where it has none, as on a creature without a level, the field is written like any other.
|
|
103
|
+
*/
|
|
104
|
+
export function computedField(world, field, fields) {
|
|
105
|
+
const entry = world.system?.formulas?.computed.find(([name]) => comparableText(name) === comparableText(field.trim()));
|
|
106
|
+
const scope = formulaScope(world, fields);
|
|
107
|
+
const value = entry === undefined ? undefined : scope.computed(entry[0])?.value;
|
|
108
|
+
if (entry === undefined || value === undefined) {
|
|
109
|
+
return progressedField(world, scope, field);
|
|
110
|
+
}
|
|
111
|
+
// Of several formulas, the one that gave the value says what it comes from (D-210).
|
|
112
|
+
const used = entry[1].kind === "first" ? (entry[1].options.find((option) => workOut(option, scope).value !== undefined) ?? entry[1]) : entry[1];
|
|
113
|
+
return { name: entry[0], value, from: writtenSources(world, used, scope), direct: fieldsRead(used) };
|
|
114
|
+
}
|
|
115
|
+
/** The written fields the maximum of a counter comes from with these fields, as hp-base, level and con for hp (FOR-6); none when the system works out no maximum. */
|
|
116
|
+
export function maximumSources(world, field, fields) {
|
|
117
|
+
const max = Object.entries(world.system?.formulas?.counters ?? {}).find(([name]) => comparableText(name) === comparableText(field.trim()))?.[1].max;
|
|
118
|
+
return max === undefined ? [] : writtenSources(world, max, formulaScope(world, fields));
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* How the maximum the game system works out for a counter is made, "38, from hp-base 28, level 11, con-mod +1", and the written field to raise it with, as at a
|
|
122
|
+
* new level (FOR-6, D-226); undefined where the system works out none.
|
|
123
|
+
*/
|
|
124
|
+
export function maximumHint(world, fields, field) {
|
|
125
|
+
const worked = workedMaximum(world, fields, field);
|
|
126
|
+
if (worked === undefined) {
|
|
127
|
+
return undefined;
|
|
128
|
+
}
|
|
129
|
+
const parts = workedParts(world, worked.reads);
|
|
130
|
+
// A maximum of 0 says the character lacks what gives it: no field raises it.
|
|
131
|
+
const [raise] = worked.value === 0 ? [] : maximumSources(world, field, fields).filter((name) => declaredKind(world, name) !== "list");
|
|
132
|
+
return { made: `${worked.value}${parts === "" ? "" : `, from ${parts}`}`, ...(raise === undefined ? {} : { raise }) };
|
|
133
|
+
}
|
|
134
|
+
/** Why a computed field is not written or changed, and what to change instead: the fields it comes from, or an effect on a bonus among them (FOR-7). */
|
|
135
|
+
export function computedMessage(world, computed, page) {
|
|
136
|
+
const bonuses = directBonuses(world, computed);
|
|
137
|
+
const instead = bonuses.length === 0 ? "change one of those" : `change one of those, or give ${bonuses.join(" or ")} with an effect${aloneNote(world, computed.name, bonuses)}`;
|
|
138
|
+
return `${computed.name} on ${page} is ${signedText(world, computed.name, computed.value)}, worked out by the system ${world.system?.name ?? ""} from ${computed.from.join(", ")}: ${instead}`;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* "; bonus-skills also changes the other fields that read it…": of these bonuses, those other computed fields read too, as bonus-skills for every skill, which
|
|
142
|
+
* are no bonus to one alone (playtest 14); nothing when none is.
|
|
143
|
+
*/
|
|
144
|
+
export function aloneNote(world, field, bonuses) {
|
|
145
|
+
const readers = (bonus) => (world.system?.formulas?.computed ?? []).filter(([, formula]) => fieldsRead(formula).some((name) => comparableText(name) === comparableText(bonus))).length;
|
|
146
|
+
const shared = bonuses.filter((bonus) => readers(bonus) > 1);
|
|
147
|
+
const one = shared.length === 1;
|
|
148
|
+
return shared.length === 0 ? "" : `; ${shared.join(" and ")} also ${one ? "changes" : "change"} the other fields that read ${one ? "it" : "them"}, so for ${field} alone add the number to its roll`;
|
|
149
|
+
}
|
|
150
|
+
/** The bonus fields an effect gives to change a computed field that its formula reads itself, as bonus-skills for insight, not bonus-proficiency through proficiency. */
|
|
151
|
+
export function directBonuses(world, computed) {
|
|
152
|
+
return effectBonuses(world, computed.from).filter((field) => computed.direct?.some((name) => comparableText(name) === comparableText(field)) === true);
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* The first item of its list whose page gives a field, with the fields of its own that its formula reads, as a shield's bonus (PRO-5): a page of the campaign,
|
|
156
|
+
* which an effect can change, not one of the system, as the unarmed strike (D-235).
|
|
157
|
+
*/
|
|
158
|
+
export function itemSource(world, fields, field) {
|
|
159
|
+
const list = itemList(world, field);
|
|
160
|
+
const scope = formulaScope(world, fields);
|
|
161
|
+
for (const item of list === undefined ? [] : listItems(scope.field(list))) {
|
|
162
|
+
const page = scope.page(item.name);
|
|
163
|
+
const given = itemFormula(page, field);
|
|
164
|
+
if (list !== undefined && page !== undefined && given?.formula !== undefined && pagesWithName(world, item.name).length > 0) {
|
|
165
|
+
return { item: item.name, list, own: fieldsRead(given.formula).filter((name) => keyOf(page, name) !== undefined) };
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return undefined;
|
|
169
|
+
}
|
|
170
|
+
/** The maximum the game system works out for a counter with these fields, with only the values that changed it (FOR-6, FOR-8); undefined where it has none. */
|
|
171
|
+
export function workedMaximum(world, fields, field) {
|
|
172
|
+
const entry = Object.entries(world.system?.formulas?.counters ?? {}).find(([name]) => comparableText(name) === comparableText(field.trim()));
|
|
173
|
+
const formula = entry?.[1].max;
|
|
174
|
+
const scope = formulaScope(world, fields);
|
|
175
|
+
if (entry === undefined) {
|
|
176
|
+
return undefined;
|
|
177
|
+
}
|
|
178
|
+
// Without a formula, the maximum a class's row gives, from the classes it comes from (DAT-9).
|
|
179
|
+
if (formula === undefined) {
|
|
180
|
+
const row = scope.progression()?.values.find((value) => comparableText(value.field) === comparableText(entry[0]));
|
|
181
|
+
const max = numberOf(row?.value);
|
|
182
|
+
return row === undefined || max === undefined ? undefined : { field: entry[0], value: max, reads: row.from.map((from) => ({ list: scope.progression()?.lists[0] ?? "", item: from.name, value: from.level })) };
|
|
183
|
+
}
|
|
184
|
+
const worked = workOut(formula, scope);
|
|
185
|
+
return worked.value === undefined ? undefined : { field: entry[0], value: atLeastZero(worked.value), reads: contributingReads(formula, scope, worked) };
|
|
186
|
+
}
|
|
187
|
+
/** What the lists of a page give as computed fields: what its classes give (PRO-2, PRO-3), then what the formulas of its items' pages work out (PRO-5). */
|
|
188
|
+
export function givenFields(world, scope, explained = false) {
|
|
189
|
+
return [...progressionFields(world, scope), ...itemFields(world, scope, explained)];
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* The fields the classes give as computed fields, each with the items it comes from (PRO-2, FOR-8): the values of their rows, then the features. A column named
|
|
193
|
+
* as a counter of the system is not one: it is that counter's maximum (DAT-9).
|
|
194
|
+
*/
|
|
195
|
+
function progressionFields(world, scope) {
|
|
196
|
+
const progression = scope.progression();
|
|
197
|
+
if (progression === undefined) {
|
|
198
|
+
return [];
|
|
199
|
+
}
|
|
200
|
+
const values = progression.values.filter((value) => !isSystemCounter(world, value.field)).map((value) => ({
|
|
201
|
+
field: value.field,
|
|
202
|
+
value: value.value,
|
|
203
|
+
reads: value.from.map((from) => ({ list: progression.lists[0], item: from.name, value: from.level })),
|
|
204
|
+
}));
|
|
205
|
+
const features = progression.features.length + progression.written.length === 0 ? [] : [{
|
|
206
|
+
field: progression.featuresField,
|
|
207
|
+
value: [...progression.features.map((feature) => feature.name), ...progression.written].join(", "),
|
|
208
|
+
reads: progression.from.map((from) => ({ list: from.list, item: from.name, value: from.level ?? 1 })),
|
|
209
|
+
}];
|
|
210
|
+
return [...values, ...features];
|
|
211
|
+
}
|
|
212
|
+
/** The fields the formulas of the items' pages give, one value for each item, for every list the system names (PRO-5). */
|
|
213
|
+
function itemFields(world, scope, explained) {
|
|
214
|
+
return Object.values(world.system?.itemFormulas ?? {}).flat().flatMap((field) => {
|
|
215
|
+
const worked = scope.each(field, explained);
|
|
216
|
+
// A bonus an item gives as nothing, as the speed a heavy armor takes from who has its Strength, says nothing (FOR-8).
|
|
217
|
+
return worked === undefined || (worked.value === 0 && declaredKind(world, field) === "bonus") ? [] : [worked];
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
/** A field the classes give, as a computed field that cannot be written, with the lists it comes from (PRO-2, FOR-7); undefined for any other field. */
|
|
221
|
+
export function progressedField(world, scope, field) {
|
|
222
|
+
const found = givenFields(world, scope).find((worked) => comparableText(worked.field) === comparableText(field.trim()));
|
|
223
|
+
const list = found === undefined ? undefined : itemList(world, found.field);
|
|
224
|
+
// The features are written too, beside those the rows give (PRO-3).
|
|
225
|
+
if (found === undefined || comparableText(found.field) === comparableText(scope.progression()?.featuresField ?? "")) {
|
|
226
|
+
return undefined;
|
|
227
|
+
}
|
|
228
|
+
// A formula of the items' pages comes from what it reads, as the bonus an item gives, and from its list (PRO-5); the rows, from the lists alone.
|
|
229
|
+
if (list !== undefined) {
|
|
230
|
+
const read = listItems(scope.field(list)).flatMap((item) => {
|
|
231
|
+
const page = scope.page(item.name);
|
|
232
|
+
const given = itemFormula(page, found.field);
|
|
233
|
+
// What the item holds itself, as a weapon's bonus, comes from it, not from who lists it.
|
|
234
|
+
// Only the dice a field gives count, as a monk's martial-arts: one no one has is no source.
|
|
235
|
+
const dice = (given === undefined ? [] : diceFields(given)).filter((name) => scope.field(name) !== undefined).flatMap((name) => writtenSources(world, { kind: "field", name }, scope));
|
|
236
|
+
const formula = given?.formula === undefined ? [] : writtenSources(world, given.formula, scope);
|
|
237
|
+
return [...formula, ...dice].filter((name) => page === undefined || keyOf(page, name) === undefined);
|
|
238
|
+
});
|
|
239
|
+
return { name: found.field, value: found.value, from: [...new Set([...read, list])] };
|
|
240
|
+
}
|
|
241
|
+
return { name: found.field, value: found.value, from: scope.progression()?.lists ?? [] };
|
|
242
|
+
}
|
|
243
|
+
/** The limits of a counter worked out in a scope, where they have a whole value (FOR-6); without a max formula, the column of a class's row (DAT-9). */
|
|
244
|
+
function limitsIn(scope, limits, field) {
|
|
245
|
+
const whole = (worked) => (worked?.value !== undefined && Number.isSafeInteger(worked.value) ? worked.value : undefined);
|
|
246
|
+
const min = whole(limits.min === undefined ? undefined : workOut(limits.min, scope));
|
|
247
|
+
const row = limits.max === undefined ? numberOf(progressionValue(scope.progression(), field)) : undefined;
|
|
248
|
+
const max = limits.max === undefined ? (row !== undefined && Number.isSafeInteger(row) ? row : undefined) : whole(workOut(limits.max, scope));
|
|
249
|
+
return { ...(min === undefined ? {} : { min }), ...(max === undefined ? {} : { max: atLeastZero(max) }) };
|
|
250
|
+
}
|
|
251
|
+
/** A maximum worked out below 0, as 1 + cha-mod with Charisma 7, is 0: a counter is never written with a maximum below 0 (FOR-6). */
|
|
252
|
+
function atLeastZero(max) {
|
|
253
|
+
return Math.max(0, max);
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* The written fields a formula comes from, through the computed fields it reads that have a value: what can be changed, as wis for passive-perception, and
|
|
257
|
+
* level where the page writes it, having no classes (FOR-7).
|
|
258
|
+
*/
|
|
259
|
+
function writtenSources(world, formula, scope, seen = new Set()) {
|
|
260
|
+
const formulas = world.system?.formulas;
|
|
261
|
+
const index = formulas === undefined ? undefined : formulaIndex(formulas);
|
|
262
|
+
const sources = fieldsRead(formula).flatMap((name) => {
|
|
263
|
+
const entry = index?.computed.get(comparableText(name));
|
|
264
|
+
// What the classes give comes from the lists that name them (PRO-3); what the items' pages give, from their list, as armor-class from equipped (PRO-5).
|
|
265
|
+
// Whether the classes or the items give it, without asking where they come from, which may read this field again.
|
|
266
|
+
if (entry === undefined && givenFields(world, scope).some((worked) => comparableText(worked.field) === comparableText(name))) {
|
|
267
|
+
const list = itemList(world, name);
|
|
268
|
+
return list === undefined ? (scope.progression()?.lists ?? [name]) : [list];
|
|
269
|
+
}
|
|
270
|
+
// What the engine gives a formula, as the campaign's rigor or a character's load, is no field anyone writes (FOR-2).
|
|
271
|
+
if (["rigor", "effects", "load", "load-limit"].includes(comparableText(name))) {
|
|
272
|
+
return [];
|
|
273
|
+
}
|
|
274
|
+
if (entry === undefined || scope.computed(name)?.value === undefined) {
|
|
275
|
+
return [name];
|
|
276
|
+
}
|
|
277
|
+
if (seen.has(comparableText(name))) {
|
|
278
|
+
return [];
|
|
279
|
+
}
|
|
280
|
+
seen.add(comparableText(name));
|
|
281
|
+
return writtenSources(world, entry[1], scope, seen);
|
|
282
|
+
});
|
|
283
|
+
return sources.filter((name, position) => sources.findIndex((other) => comparableText(other) === comparableText(name)) === position);
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* The bonus fields among those a computed field comes from, which an effect on the page gives to change it, as bonus-ac for ac (FOR-5); not those the items of a
|
|
287
|
+
* list give, as a shield's armor-class-bonus, which change on the item (PRO-5).
|
|
288
|
+
*/
|
|
289
|
+
function effectBonuses(world, from) {
|
|
290
|
+
return from.filter((field) => declaredKind(world, field) === "bonus" && itemList(world, field) === undefined);
|
|
291
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { FormulaRead } from "../../../core/formula.ts";
|
|
2
|
+
import { type World } from "../../../pages/index.ts";
|
|
3
|
+
/** A computed field that has a value, and the values it came from (FOR-8); a field the rows of the classes give may hold text, such as martial-arts 1d6 (PRO-2). */
|
|
4
|
+
export interface WorkedField {
|
|
5
|
+
field: string;
|
|
6
|
+
value: number | string;
|
|
7
|
+
reads: FormulaRead[];
|
|
8
|
+
}
|
|
9
|
+
/** A value of a field as the outputs show it: with its sign when the system declares the field a modifier or a bonus (FOR-8). */
|
|
10
|
+
export declare function signedText(world: World, field: string, value: number | string): string;
|
|
11
|
+
/** "insight +5: wis-mod +3, proficiency +2, Insight in skill-proficiencies": a computed field and what it came from, leaving out what adds nothing (FOR-8). */
|
|
12
|
+
export declare function workedLine(world: World, worked: WorkedField): string;
|
|
13
|
+
/** "wis-mod +3, proficiency +2, Insight in skill-proficiencies": the values a result came from, leaving out what adds nothing (FOR-8). */
|
|
14
|
+
export declare function workedParts(world: World, reads: FormulaRead[]): string;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { declaredKind, weightUnit } from "../../../pages/index.js";
|
|
2
|
+
import { formatDuration } from "../../../time/index.js";
|
|
3
|
+
/** A value of a field as the outputs show it: with its sign when the system declares the field a modifier or a bonus (FOR-8). */
|
|
4
|
+
export function signedText(world, field, value) {
|
|
5
|
+
const kind = declaredKind(world, field);
|
|
6
|
+
// A length in the system's unit, at most one decimal: 12.5 ft (SPD-1).
|
|
7
|
+
if (typeof value === "number" && kind === "length") {
|
|
8
|
+
return `${Math.round(value * 10) / 10}${world.system?.lengthUnit === undefined ? "" : ` ${world.system.lengthUnit}`}`;
|
|
9
|
+
}
|
|
10
|
+
// A weight in the unit the system's items are weighed in: 420 lb.
|
|
11
|
+
if (typeof value === "number" && kind === "weight") {
|
|
12
|
+
const unit = world.system?.load === undefined ? undefined : weightUnit(world, world.system.load.field);
|
|
13
|
+
return `${Math.round(value * 10) / 10}${unit === undefined ? "" : ` ${unit}`}`;
|
|
14
|
+
}
|
|
15
|
+
// A duration in minutes as the engine writes them, half a minute in seconds: 3m, 30s.
|
|
16
|
+
if (typeof value === "number" && kind === "duration") {
|
|
17
|
+
return value > 0 && value < 1 ? `${Math.round(value * 60)}s` : formatDuration(Math.round(value));
|
|
18
|
+
}
|
|
19
|
+
return typeof value === "number" && (kind === "modifier" || kind === "bonus") && value >= 0 ? `+${value}` : String(value);
|
|
20
|
+
}
|
|
21
|
+
/** "insight +5: wis-mod +3, proficiency +2, Insight in skill-proficiencies": a computed field and what it came from, leaving out what adds nothing (FOR-8). */
|
|
22
|
+
export function workedLine(world, worked) {
|
|
23
|
+
const parts = workedParts(world, worked.reads);
|
|
24
|
+
return `${worked.field} ${signedText(world, worked.field, worked.value)}${parts === "" ? "" : `: ${parts}`}`;
|
|
25
|
+
}
|
|
26
|
+
/** "wis-mod +3, proficiency +2, Insight in skill-proficiencies": the values a result came from, leaving out what adds nothing (FOR-8). */
|
|
27
|
+
export function workedParts(world, reads) {
|
|
28
|
+
const parts = reads.flatMap((read) => {
|
|
29
|
+
if ("table" in read) {
|
|
30
|
+
// A key the explanation does not already give, as text: "ranks dangerous: 8".
|
|
31
|
+
const keyed = reads.some((other) => "field" in other && "key" in other && other.key === true);
|
|
32
|
+
return [keyed ? `${read.table} ${read.value}` : `${read.table} ${read.key}: ${read.value}`];
|
|
33
|
+
}
|
|
34
|
+
// The dice a roll took from a field, as a monk's martial-arts 1d6 (D-235).
|
|
35
|
+
if ("dice" in read) {
|
|
36
|
+
return [`${read.field} ${read.dice}`];
|
|
37
|
+
}
|
|
38
|
+
if ("field" in read) {
|
|
39
|
+
// A bonus of 0 and a factor of 1 change nothing (FOR-5).
|
|
40
|
+
const kind = declaredKind(world, read.field);
|
|
41
|
+
return (read.value === 0 && kind === "bonus") || (read.value === 1 && kind === "factor") ? [] : [`${read.field} ${signedText(world, read.field, read.value)}`];
|
|
42
|
+
}
|
|
43
|
+
if ("item" in read) {
|
|
44
|
+
return read.value === 0 ? [] : [read.value === 1 && !/\d/.test(read.item) ? `${read.item} in ${read.list}` : `${read.item} ${read.value} in ${read.list}`];
|
|
45
|
+
}
|
|
46
|
+
// The total of a list says nothing more beside one of its items, "Cleric 3 in classes", nor when it is 0; how many items a list has is no part of a value.
|
|
47
|
+
if (read.count === true || read.value === 0 || reads.some((other) => "item" in other && other.list === read.list && other.value !== 0)) {
|
|
48
|
+
return [];
|
|
49
|
+
}
|
|
50
|
+
return [`${read.value} in ${read.list}${read.where === undefined ? "" : `, ${read.where}`}`];
|
|
51
|
+
});
|
|
52
|
+
// "Perception in skills" says nothing more beside "Perception 3 in skills".
|
|
53
|
+
const named = (part) => parts.some((other) => other !== part && other.startsWith(part.replace(/ in [^ ]+$/, " ")) && other.endsWith(part.slice(part.lastIndexOf(" in "))));
|
|
54
|
+
return parts.filter((part, index) => parts.indexOf(part) === index && !named(part)).join(", ");
|
|
55
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Context } from "
|
|
2
|
-
import { type World } from "
|
|
3
|
-
import { type GameDate } from "
|
|
1
|
+
import type { Context } from "../../../core/context.ts";
|
|
2
|
+
import { type World } from "../../../pages/index.ts";
|
|
3
|
+
import { type GameDate } from "../../../time/index.ts";
|
|
4
4
|
import { type DatedEvent } from "./events.ts";
|
|
5
5
|
/** What time passing did, as outputs tell it. */
|
|
6
6
|
export interface TimePassed {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
// Time passing in the story (TIM-5, TIM-6, EFF-8, EVT-8), as advance and travel do it: up to the first planned event that comes due, with what ends and what comes.
|
|
2
|
-
import { changeState } from "
|
|
3
|
-
import { appendLogEntry } from "
|
|
4
|
-
import { isEmptyField, locate, playerCharacters } from "
|
|
5
|
-
import { addDuration, formatCalendarDay, formatGameDate, minutesBetween } from "
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
2
|
+
import { changeState } from "../../../campaign/index.js";
|
|
3
|
+
import { appendLogEntry } from "../../../core/log.js";
|
|
4
|
+
import { isEmptyField, locate, playerCharacters } from "../../../pages/index.js";
|
|
5
|
+
import { addDuration, formatCalendarDay, formatGameDate, minutesBetween } from "../../../time/index.js";
|
|
6
|
+
import { situationPart } from "../campaign/parts.js";
|
|
7
|
+
import { campaignSystem, campaignWorld } from "../campaign/world.js";
|
|
8
|
+
import { diaryDueLine } from "../characters/thoughts.js";
|
|
9
|
+
import { shortList, skippedPagesNote } from "../notes.js";
|
|
10
|
+
import { surroundings, surroundingsText } from "../places/environment.js";
|
|
11
|
+
import { endedByDate, endEffects } from "../scene/effects.js";
|
|
12
|
+
import { readOpenScene } from "../scene/scene.js";
|
|
8
13
|
import { clocksToMove, dueAdvice, dueEvents, dueText, isDated, plannedEvents, plannedText } from "./events.js";
|
|
9
|
-
import { shortList, skippedPagesNote } from "./notes.js";
|
|
10
|
-
import { situationPart } from "./parts.js";
|
|
11
|
-
import { readOpenScene } from "./scene.js";
|
|
12
|
-
import { diaryDueLine } from "./thoughts.js";
|
|
13
14
|
import { calendarDayOf, newDatedLogEntry } from "./time.js";
|
|
14
15
|
import { dailyUpkeep } from "./upkeep.js";
|
|
15
|
-
import { campaignSystem, campaignWorld } from "./world.js";
|
|
16
16
|
// An hour or more passing usually ends a scene: then advance reminds that one is still open.
|
|
17
17
|
const sceneReminderMinutes = 60;
|
|
18
18
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Context } from "
|
|
2
|
-
import { type Page, type World } from "
|
|
3
|
-
import type { GameSystem, Recipe } from "
|
|
1
|
+
import type { Context } from "../../../core/context.ts";
|
|
2
|
+
import { type Page, type World } from "../../../pages/index.ts";
|
|
3
|
+
import type { GameSystem, Recipe } from "../../../systems/index.ts";
|
|
4
4
|
/** Dice spent: the line that says it, with the rules they touched; the faces, what each die adds and what they gave, and the id of the roll's line in the log. */
|
|
5
5
|
export interface DiceSpent {
|
|
6
6
|
text: string;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { appendLogEntry } from "
|
|
2
|
-
import { comparableText, valueNamed } from "
|
|
3
|
-
import { formatCounter, readCounter } from "
|
|
4
|
-
import { rollDice } from "
|
|
5
|
-
import { concernsPlayer, findPage, isPartyMember, withPage, writePage } from "
|
|
6
|
-
import {
|
|
7
|
-
import { saveEffects } from "
|
|
8
|
-
import { behindTheScreen, screenNote, sealHiddenRoll } from "
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
1
|
+
import { appendLogEntry } from "../../../core/log.js";
|
|
2
|
+
import { comparableText, valueNamed } from "../../../core/text.js";
|
|
3
|
+
import { formatCounter, readCounter } from "../../../counters/index.js";
|
|
4
|
+
import { rollDice } from "../../../dice/index.js";
|
|
5
|
+
import { concernsPlayer, findPage, isPartyMember, withPage, writePage } from "../../../pages/index.js";
|
|
6
|
+
import { allSaid, packagesCounterChanged } from "../packages/hooks.js";
|
|
7
|
+
import { saveEffects } from "../scene/effects.js";
|
|
8
|
+
import { behindTheScreen, screenNote, sealHiddenRoll } from "../scene/master-rolls.js";
|
|
9
|
+
import { effectGiving, effectiveFields, effectsOf, withValue } from "../sheet/effect-layer.js";
|
|
10
|
+
import { formulaValue } from "../sheet/formula-scope.js";
|
|
11
|
+
import { thresholdNotes } from "../sheet/thresholds.js";
|
|
11
12
|
import { newDatedLogEntry } from "./time.js";
|
|
12
|
-
import { formulaValue } from "./worked-out.js";
|
|
13
13
|
/**
|
|
14
14
|
* Spends dice of a counter named after its die, as stamina-d6, in a recipe that lets one (D-449): each die rolled with what the recipe adds, at least 0, the
|
|
15
15
|
* total given to its counter up to the maximum, the dice taken from theirs, each on the effect that gives it, if one does (EFF-7); the line that says it, with the
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { Context } from "
|
|
2
|
-
import type { Problem } from "
|
|
3
|
-
import { type Page, type PageType, type World } from "
|
|
4
|
-
import { type GameDate } from "
|
|
5
|
-
import { type TriggerFacts } from "
|
|
1
|
+
import type { Context } from "../../../core/context.ts";
|
|
2
|
+
import type { Problem } from "../../../core/problem.ts";
|
|
3
|
+
import { type Page, type PageType, type World } from "../../../pages/index.ts";
|
|
4
|
+
import { type GameDate } from "../../../time/index.ts";
|
|
5
|
+
import { type TriggerFacts } from "../../../triggers/index.ts";
|
|
6
6
|
/** A planned event of the world, with its game date when the engine can read one. */
|
|
7
7
|
export interface PlannedEvent {
|
|
8
8
|
page: Page;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { appendLogEntry } from "
|
|
2
|
-
import { comparableText } from "
|
|
3
|
-
import { formatCounter, readCounter } from "
|
|
4
|
-
import { backlinks, containerFieldOf, isCountedItem, isEmptyField, isInParty, linksIn, locate, newPageFields, pagesWithName, pageWithPath, parsePageReference, standardValues, systemLabel, systemPageNamed, withPage, writePage, } from "
|
|
5
|
-
import { formatDuration, formatGameDate, minutesBetween, readGameDate } from "
|
|
6
|
-
import { formatTrigger, readTriggers, triggerHolds } from "
|
|
7
|
-
import {
|
|
1
|
+
import { appendLogEntry } from "../../../core/log.js";
|
|
2
|
+
import { comparableText } from "../../../core/text.js";
|
|
3
|
+
import { formatCounter, readCounter } from "../../../counters/index.js";
|
|
4
|
+
import { backlinks, containerFieldOf, isCountedItem, isEmptyField, isInParty, linksIn, locate, newPageFields, pagesWithName, pageWithPath, parsePageReference, standardValues, systemLabel, systemPageNamed, withPage, writePage, } from "../../../pages/index.js";
|
|
5
|
+
import { formatDuration, formatGameDate, minutesBetween, readGameDate } from "../../../time/index.js";
|
|
6
|
+
import { formatTrigger, readTriggers, triggerHolds } from "../../../triggers/index.js";
|
|
7
|
+
import { textList } from "../characters/knowledge.js";
|
|
8
|
+
import { shortList } from "../notes.js";
|
|
8
9
|
import { newDatedLogEntry } from "./time.js";
|
|
9
10
|
/** The planned events: those with a game date first, in order of date, then those without one. */
|
|
10
11
|
export function plannedEvents(world) {
|
|
@@ -192,7 +193,7 @@ export function conditionNotes(world, when) {
|
|
|
192
193
|
if (system !== undefined) {
|
|
193
194
|
return systemConditionText(system);
|
|
194
195
|
}
|
|
195
|
-
const aliased = world.pages.find((page) =>
|
|
196
|
+
const aliased = world.pages.find((page) => textList(page.fields.aliases).some((alias) => comparableText(alias) === comparableText(name)));
|
|
196
197
|
const hint = aliased === undefined ? "" : ` ${aliased.name} has ${name} among its aliases: write [[${aliased.name}]].`;
|
|
197
198
|
return `[[${name}]] is not a page yet: the condition on it cannot hold until a page has that name.${hint}`;
|
|
198
199
|
});
|
|
@@ -206,7 +207,7 @@ export function eventProblems(world) {
|
|
|
206
207
|
const date = plannedEventDateProblem(page.type, page.fields) === undefined ? undefined : `${page.name} is planned, but its date ${JSON.stringify(page.fields.date)} is not a game date.`;
|
|
207
208
|
// A clock or conditions of the wrong kind of value are reported once, with the standard fields.
|
|
208
209
|
const clock = typeof page.fields.clock === "string" || typeof page.fields.clock === "number" ? clockProblem(page.fields.clock) : undefined;
|
|
209
|
-
const when =
|
|
210
|
+
const when = textList(page.fields.when).length === (Array.isArray(page.fields.when) ? page.fields.when.length : 1) ? whenProblem(world, page.fields.when) : undefined;
|
|
210
211
|
return [
|
|
211
212
|
...problem(date, `write ${page.name}, set date to a game date such as day 1, 23:00, or status to happened if it already took place`),
|
|
212
213
|
...problem(clock === undefined ? undefined : `${page.name}: ${clock}`, `write ${page.name}, set clock to current/max, such as 0/4, or unset it`),
|
|
@@ -316,10 +317,6 @@ function isOpenStory(page) {
|
|
|
316
317
|
function storyText(page, now) {
|
|
317
318
|
return page.type === "quest" ? `${page.name} (quest, ${statusOf(page) ?? ""})` : plannedText(plannedEventOf(page), now);
|
|
318
319
|
}
|
|
319
|
-
/** The texts a field holds: itself when it is text, the texts in it when it is a list. */
|
|
320
|
-
function textsOf(value) {
|
|
321
|
-
return Array.isArray(value) ? value.filter((item) => typeof item === "string") : typeof value === "string" ? [value] : [];
|
|
322
|
-
}
|
|
323
320
|
/** "Name (a, b)", or the name alone when there are no parts. */
|
|
324
321
|
function withParts(name, parts) {
|
|
325
322
|
const given = parts.filter((part) => part !== undefined);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Effect } from "
|
|
2
|
-
import { type Page, type World } from "
|
|
3
|
-
import type { GameSystem, Recipe } from "
|
|
1
|
+
import type { Effect } from "../../../effects/index.ts";
|
|
2
|
+
import { type Page, type World } from "../../../pages/index.ts";
|
|
3
|
+
import type { GameSystem, Recipe } from "../../../systems/index.ts";
|
|
4
4
|
/** The recipe of the game system with this name, with the system; refused, with those it has, when it has none. */
|
|
5
5
|
export declare function recipeNamed(system: GameSystem | undefined, name: string): {
|
|
6
6
|
system: GameSystem;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
// The recipes of a game system (D-185, DAT-4): which pages a rest goes to, the effects it ends, the fields it brings back, and what it leaves to the master.
|
|
2
|
-
import { comparableText } from "
|
|
3
|
-
import { readCounter } from "
|
|
4
|
-
import { isDeclaredUncounted, isInParty, locate, playerCharacters } from "
|
|
5
|
-
import { effectiveFields, effectsOf } from "
|
|
6
|
-
import { formulaValue
|
|
2
|
+
import { comparableText } from "../../../core/text.js";
|
|
3
|
+
import { readCounter } from "../../../counters/index.js";
|
|
4
|
+
import { isDeclaredUncounted, isInParty, locate, playerCharacters } from "../../../pages/index.js";
|
|
5
|
+
import { effectiveFields, effectsOf } from "../sheet/effect-layer.js";
|
|
6
|
+
import { formulaValue } from "../sheet/formula-scope.js";
|
|
7
|
+
import { refillAmount } from "../sheet/worked-out.js";
|
|
7
8
|
/** The recipe of the game system with this name, with the system; refused, with those it has, when it has none. */
|
|
8
9
|
export function recipeNamed(system, name) {
|
|
9
10
|
const recipe = system?.recipes.find((candidate) => comparableText(candidate.name) === comparableText(name.trim()));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Context } from "
|
|
2
|
-
import { type LogEntry } from "
|
|
3
|
-
import type { Problem } from "
|
|
4
|
-
import { type Calendar, type CalendarDay, type CalendarStart, type GameDate } from "
|
|
1
|
+
import type { Context } from "../../../core/context.ts";
|
|
2
|
+
import { type LogEntry } from "../../../core/log.ts";
|
|
3
|
+
import type { Problem } from "../../../core/problem.ts";
|
|
4
|
+
import { type Calendar, type CalendarDay, type CalendarStart, type GameDate } from "../../../time/index.ts";
|
|
5
5
|
/** The campaign's calendar and the day of it that is day 1, if the story starts on one (TIM-8); what does not read is a problem, never a stop. */
|
|
6
6
|
export interface CampaignCalendar {
|
|
7
7
|
calendar: Calendar;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// The game time as several commands use it: the present date from state.yaml, the log lines stamped with it, and the calendar that shows it.
|
|
2
2
|
import { resolve } from "node:path";
|
|
3
|
-
import { campaignFileName, readOneSetting, readState, readTextSetting } from "
|
|
4
|
-
import { newLogEntry, readLog } from "
|
|
5
|
-
import { files } from "
|
|
6
|
-
import { isEmptyField } from "
|
|
7
|
-
import { calendarDay, formatCalendarDay, formatDuration, formatGameDate, lastGameDay, minutesBetween, readBetweenSessions, readCalendar, readCalendarStart, readGameDate, realCalendar, } from "
|
|
8
|
-
import { campaignExtensions, extensionSources } from "
|
|
3
|
+
import { campaignFileName, readOneSetting, readState, readTextSetting } from "../../../campaign/index.js";
|
|
4
|
+
import { newLogEntry, readLog } from "../../../core/log.js";
|
|
5
|
+
import { files } from "../../../core/store.js";
|
|
6
|
+
import { isEmptyField } from "../../../pages/index.js";
|
|
7
|
+
import { calendarDay, formatCalendarDay, formatDuration, formatGameDate, lastGameDay, minutesBetween, readBetweenSessions, readCalendar, readCalendarStart, readGameDate, realCalendar, } from "../../../time/index.js";
|
|
8
|
+
import { campaignExtensions, extensionSources } from "../packages/extensions.js";
|
|
9
9
|
// The setting of the game time between sessions (D-133).
|
|
10
10
|
const betweenSessionsSetting = "between-sessions";
|
|
11
11
|
/** The present of the game: its date, or the problem that keeps state.yaml from giving one; neither before the game has a date. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Context } from "
|
|
2
|
-
import { type Page, type World } from "
|
|
3
|
-
import type { GameSystem } from "
|
|
1
|
+
import type { Context } from "../../../core/context.ts";
|
|
2
|
+
import { type Page, type World } from "../../../pages/index.ts";
|
|
3
|
+
import type { GameSystem } from "../../../systems/index.ts";
|
|
4
4
|
/** The upkeep of each midnight passed (UPK-1–UPK-3), for the party members who keep a sheet, under the rigor «rules» or «simulation»; the lines that say it. */
|
|
5
5
|
export declare function dailyUpkeep(root: string, context: Context, system: GameSystem | undefined, days: number): string[];
|
|
6
6
|
/**
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { parseFormula } from "
|
|
2
|
-
import { appendLogEntry } from "
|
|
3
|
-
import { comparableText, valueNamed, withArticle } from "
|
|
4
|
-
import { formatCounter, readCounter } from "
|
|
5
|
-
import { formatAmount, payCoins, readAmount, totalOf } from "
|
|
6
|
-
import { baseChain, heldStacksOfKind, kindNamed, locate, writePage } from "
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
1
|
+
import { parseFormula } from "../../../core/formula.js";
|
|
2
|
+
import { appendLogEntry } from "../../../core/log.js";
|
|
3
|
+
import { comparableText, valueNamed, withArticle } from "../../../core/text.js";
|
|
4
|
+
import { formatCounter, readCounter } from "../../../counters/index.js";
|
|
5
|
+
import { formatAmount, payCoins, readAmount, totalOf } from "../../../money/index.js";
|
|
6
|
+
import { baseChain, heldStacksOfKind, kindNamed, locate, writePage } from "../../../pages/index.js";
|
|
7
|
+
import { campaignCoins } from "../campaign/money.js";
|
|
8
|
+
import { playedRigor } from "../campaign/offers.js";
|
|
9
|
+
import { firstInChat } from "../campaign/parts.js";
|
|
10
|
+
import { campaignWorld } from "../campaign/world.js";
|
|
11
|
+
import { effectiveFields } from "../sheet/effect-layer.js";
|
|
12
|
+
import { formulaValue } from "../sheet/formula-scope.js";
|
|
13
|
+
import { writeStacks } from "../sheet/stacks.js";
|
|
14
|
+
import { hasSheet } from "../sheet/system-fields.js";
|
|
11
15
|
import { partyPages } from "./recipes.js";
|
|
12
|
-
import { writeStacks } from "./stacks.js";
|
|
13
16
|
import { newDatedLogEntry } from "./time.js";
|
|
14
|
-
import { formulaValue, hasSheet } from "./worked-out.js";
|
|
15
|
-
import { campaignWorld } from "./world.js";
|
|
16
17
|
// Where a day's meals come from the lifestyle, not from what one carries: a place of these kinds, or one inside it (UPK-1).
|
|
17
18
|
const settlementKinds = ["city", "town", "village", "inn"];
|
|
18
19
|
/** The upkeep of each midnight passed (UPK-1–UPK-3), for the party members who keep a sheet, under the rigor «rules» or «simulation»; the lines that say it. */
|