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.
Files changed (503) hide show
  1. package/dist/adventures/source.d.ts +3 -1
  2. package/dist/adventures/source.js +31 -1
  3. package/dist/campaign/find-campaign.js +8 -4
  4. package/dist/campaign/index.d.ts +1 -1
  5. package/dist/campaign/index.js +1 -1
  6. package/dist/campaign/settings.d.ts +6 -0
  7. package/dist/campaign/settings.js +22 -1
  8. package/dist/cli/cli.js +1 -1
  9. package/dist/cli/command-line.js +1 -1
  10. package/dist/commands/advance.d.ts +1 -1
  11. package/dist/commands/advance.js +6 -6
  12. package/dist/commands/ask.js +7 -7
  13. package/dist/commands/change/amounts.d.ts +32 -0
  14. package/dist/commands/change/amounts.js +150 -0
  15. package/dist/commands/change/change.d.ts +4 -54
  16. package/dist/commands/change/change.js +19 -749
  17. package/dist/commands/change/damage.d.ts +30 -0
  18. package/dist/commands/change/damage.js +73 -2
  19. package/dist/commands/change/dice.d.ts +34 -0
  20. package/dist/commands/change/dice.js +59 -0
  21. package/dist/commands/change/fields.d.ts +37 -0
  22. package/dist/commands/change/fields.js +156 -0
  23. package/dist/commands/change/holder.d.ts +48 -0
  24. package/dist/commands/change/holder.js +162 -0
  25. package/dist/commands/change/recipe-pace.js +1 -1
  26. package/dist/commands/change/recipe.d.ts +58 -0
  27. package/dist/commands/change/recipe.js +179 -0
  28. package/dist/commands/choices.js +3 -3
  29. package/dist/commands/config/config.d.ts +15 -0
  30. package/dist/commands/config/config.js +355 -0
  31. package/dist/commands/config/custom-levels.d.ts +7 -0
  32. package/dist/commands/config/custom-levels.js +32 -0
  33. package/dist/commands/{config.d.ts → config/dashboard.d.ts} +2 -24
  34. package/dist/commands/config/dashboard.js +171 -0
  35. package/dist/commands/config/entries.d.ts +17 -0
  36. package/dist/commands/config/entries.js +76 -0
  37. package/dist/commands/config/news.d.ts +7 -0
  38. package/dist/commands/config/news.js +88 -0
  39. package/dist/commands/config/shown.d.ts +9 -0
  40. package/dist/commands/config/shown.js +80 -0
  41. package/dist/commands/config/words.d.ts +27 -0
  42. package/dist/commands/config/words.js +204 -0
  43. package/dist/commands/effect.js +9 -9
  44. package/dist/commands/find.js +1 -1
  45. package/dist/commands/image.js +6 -6
  46. package/dist/commands/import/import.d.ts +0 -2
  47. package/dist/commands/import/import.js +68 -45
  48. package/dist/commands/import/run.js +1 -1
  49. package/dist/commands/index.js +3 -3
  50. package/dist/commands/init.js +2 -2
  51. package/dist/commands/install.js +1 -1
  52. package/dist/commands/instructions.js +6 -6
  53. package/dist/commands/mode.d.ts +2 -2
  54. package/dist/commands/mode.js +8 -8
  55. package/dist/commands/mood.js +4 -4
  56. package/dist/commands/move.js +10 -10
  57. package/dist/commands/package/consent.d.ts +11 -0
  58. package/dist/commands/package/consent.js +52 -0
  59. package/dist/commands/package/here.d.ts +51 -0
  60. package/dist/commands/package/here.js +128 -0
  61. package/dist/commands/package/install.d.ts +10 -0
  62. package/dist/commands/package/install.js +337 -0
  63. package/dist/commands/package/package.d.ts +18 -0
  64. package/dist/commands/package/package.js +270 -0
  65. package/dist/commands/package/result.d.ts +89 -0
  66. package/dist/commands/package/result.js +1 -0
  67. package/dist/commands/package/uninstall.d.ts +6 -0
  68. package/dist/commands/package/uninstall.js +70 -0
  69. package/dist/commands/rename.js +3 -3
  70. package/dist/commands/reveal.js +5 -5
  71. package/dist/commands/roll/roll.js +11 -9
  72. package/dist/commands/roll/tables.js +1 -1
  73. package/dist/commands/rules.d.ts +2 -2
  74. package/dist/commands/rules.js +3 -3
  75. package/dist/commands/save.d.ts +2 -2
  76. package/dist/commands/save.js +2 -2
  77. package/dist/commands/scene/close.d.ts +18 -0
  78. package/dist/commands/scene/close.js +179 -0
  79. package/dist/commands/scene/members.d.ts +14 -0
  80. package/dist/commands/scene/members.js +32 -0
  81. package/dist/commands/scene/open.d.ts +6 -0
  82. package/dist/commands/scene/open.js +298 -0
  83. package/dist/commands/scene/result.d.ts +98 -0
  84. package/dist/commands/scene/result.js +2 -0
  85. package/dist/commands/{scene.d.ts → scene/scene.d.ts} +10 -36
  86. package/dist/commands/scene/scene.js +210 -0
  87. package/dist/commands/scene/turns.d.ts +18 -0
  88. package/dist/commands/scene/turns.js +229 -0
  89. package/dist/commands/shared/books/adventure-layers.d.ts +89 -0
  90. package/dist/commands/shared/books/adventure-layers.js +201 -0
  91. package/dist/commands/shared/{adventures.d.ts → books/adventures.d.ts} +28 -9
  92. package/dist/commands/shared/{adventures.js → books/adventures.js} +77 -35
  93. package/dist/commands/shared/{library-reader.js → books/library-reader.js} +3 -3
  94. package/dist/commands/shared/{library.d.ts → books/library.d.ts} +2 -2
  95. package/dist/commands/shared/{library.js → books/library.js} +9 -9
  96. package/dist/commands/shared/{rules.d.ts → books/rules.d.ts} +2 -2
  97. package/dist/commands/shared/{rules.js → books/rules.js} +5 -5
  98. package/dist/commands/shared/{system-texts.d.ts → books/system-texts.d.ts} +2 -2
  99. package/dist/commands/shared/{system-texts.js → books/system-texts.js} +9 -8
  100. package/dist/commands/shared/{page-words.d.ts → books/words.d.ts} +2 -2
  101. package/dist/commands/shared/{page-words.js → books/words.js} +4 -4
  102. package/dist/commands/shared/{checks.d.ts → campaign/checks.d.ts} +3 -3
  103. package/dist/commands/shared/{checks.js → campaign/checks.js} +7 -7
  104. package/dist/commands/shared/{images.d.ts → campaign/images.d.ts} +3 -3
  105. package/dist/commands/shared/{images.js → campaign/images.js} +5 -5
  106. package/dist/commands/shared/{mode.d.ts → campaign/mode.d.ts} +4 -4
  107. package/dist/commands/shared/{mode.js → campaign/mode.js} +24 -13
  108. package/dist/commands/shared/{money.d.ts → campaign/money.d.ts} +3 -3
  109. package/dist/commands/shared/{money.js → campaign/money.js} +2 -2
  110. package/dist/commands/shared/{offers.d.ts → campaign/offers.d.ts} +3 -3
  111. package/dist/commands/shared/{offers.js → campaign/offers.js} +3 -3
  112. package/dist/commands/shared/{outside.d.ts → campaign/outside.d.ts} +3 -3
  113. package/dist/commands/shared/{outside.js → campaign/outside.js} +7 -7
  114. package/dist/commands/shared/{parts.d.ts → campaign/parts.d.ts} +3 -3
  115. package/dist/commands/shared/{parts.js → campaign/parts.js} +3 -3
  116. package/dist/commands/shared/{problems.d.ts → campaign/problems.d.ts} +3 -3
  117. package/dist/commands/shared/{problems.js → campaign/problems.js} +17 -17
  118. package/dist/commands/shared/{quests.d.ts → campaign/quests.d.ts} +4 -4
  119. package/dist/commands/shared/{quests.js → campaign/quests.js} +6 -6
  120. package/dist/commands/shared/{saves.d.ts → campaign/saves.d.ts} +4 -4
  121. package/dist/commands/shared/{saves.js → campaign/saves.js} +10 -10
  122. package/dist/commands/shared/{theme.d.ts → campaign/theme.d.ts} +3 -3
  123. package/dist/commands/shared/{theme.js → campaign/theme.js} +1 -1
  124. package/dist/commands/shared/{world.d.ts → campaign/world.d.ts} +5 -5
  125. package/dist/commands/shared/{world.js → campaign/world.js} +17 -14
  126. package/dist/commands/shared/{knowledge.d.ts → characters/knowledge.d.ts} +3 -3
  127. package/dist/commands/shared/{knowledge.js → characters/knowledge.js} +4 -4
  128. package/dist/commands/shared/{moods.d.ts → characters/moods.d.ts} +3 -3
  129. package/dist/commands/shared/{moods.js → characters/moods.js} +3 -3
  130. package/dist/commands/shared/characters/orders.d.ts +4 -0
  131. package/dist/commands/shared/characters/orders.js +10 -0
  132. package/dist/commands/shared/{thoughts.d.ts → characters/thoughts.d.ts} +9 -6
  133. package/dist/commands/shared/{thoughts.js → characters/thoughts.js} +17 -7
  134. package/dist/commands/shared/{voices.d.ts → characters/voices.d.ts} +1 -1
  135. package/dist/commands/shared/{voices.js → characters/voices.js} +2 -2
  136. package/dist/commands/shared/examples.js +2 -2
  137. package/dist/commands/shared/packages/catalog.js +2 -2
  138. package/dist/commands/shared/packages/code.d.ts +1 -1
  139. package/dist/commands/shared/packages/code.js +8 -8
  140. package/dist/commands/shared/packages/extensions.d.ts +1 -1
  141. package/dist/commands/shared/packages/extensions.js +1 -1
  142. package/dist/commands/shared/packages/hooks.d.ts +1 -1
  143. package/dist/commands/shared/packages/hooks.js +1 -1
  144. package/dist/commands/shared/packages/widgets.d.ts +3 -3
  145. package/dist/commands/shared/packages/widgets.js +3 -3
  146. package/dist/commands/shared/{environment.d.ts → places/environment.d.ts} +1 -1
  147. package/dist/commands/shared/{environment.js → places/environment.js} +4 -4
  148. package/dist/commands/shared/{grid-moves.d.ts → places/grid-moves.d.ts} +4 -4
  149. package/dist/commands/shared/{grid-moves.js → places/grid-moves.js} +8 -7
  150. package/dist/commands/shared/{grids.d.ts → places/grids.d.ts} +4 -4
  151. package/dist/commands/shared/{grids.js → places/grids.js} +6 -6
  152. package/dist/commands/shared/{journey.d.ts → places/journey.d.ts} +3 -3
  153. package/dist/commands/shared/{journey.js → places/journey.js} +6 -6
  154. package/dist/commands/shared/{moves.d.ts → places/moves.d.ts} +2 -2
  155. package/dist/commands/shared/{moves.js → places/moves.js} +4 -4
  156. package/dist/commands/shared/{positions.d.ts → places/positions.d.ts} +2 -2
  157. package/dist/commands/shared/{positions.js → places/positions.js} +4 -4
  158. package/dist/commands/shared/{roads.d.ts → places/roads.d.ts} +5 -5
  159. package/dist/commands/shared/{roads.js → places/roads.js} +6 -6
  160. package/dist/commands/shared/{effects.d.ts → scene/effects.d.ts} +7 -7
  161. package/dist/commands/shared/{effects.js → scene/effects.js} +10 -10
  162. package/dist/commands/shared/{loot.d.ts → scene/loot.d.ts} +2 -2
  163. package/dist/commands/shared/{loot.js → scene/loot.js} +3 -3
  164. package/dist/commands/shared/{master-rolls.d.ts → scene/master-rolls.d.ts} +2 -2
  165. package/dist/commands/shared/{master-rolls.js → scene/master-rolls.js} +5 -5
  166. package/dist/commands/shared/{reminders.d.ts → scene/reminders.d.ts} +4 -4
  167. package/dist/commands/shared/{reminders.js → scene/reminders.js} +4 -4
  168. package/dist/commands/shared/{scene.d.ts → scene/scene.d.ts} +3 -3
  169. package/dist/commands/shared/{scene.js → scene/scene.js} +10 -8
  170. package/dist/commands/shared/{bonds.d.ts → sheet/bonds.d.ts} +3 -3
  171. package/dist/commands/shared/{bonds.js → sheet/bonds.js} +2 -2
  172. package/dist/commands/shared/{page-counters.d.ts → sheet/counters.d.ts} +3 -3
  173. package/dist/commands/shared/{page-counters.js → sheet/counters.js} +5 -5
  174. package/dist/commands/shared/{effect-layer.d.ts → sheet/effect-layer.d.ts} +2 -2
  175. package/dist/commands/shared/{effect-layer.js → sheet/effect-layer.js} +9 -6
  176. package/dist/commands/shared/sheet/effect-values.d.ts +9 -0
  177. package/dist/commands/shared/sheet/effect-values.js +69 -0
  178. package/dist/commands/shared/{experience.d.ts → sheet/experience.d.ts} +3 -3
  179. package/dist/commands/shared/{experience.js → sheet/experience.js} +5 -5
  180. package/dist/commands/shared/sheet/formula-problems.d.ts +8 -0
  181. package/dist/commands/shared/sheet/formula-problems.js +140 -0
  182. package/dist/commands/shared/sheet/formula-scope.d.ts +32 -0
  183. package/dist/commands/shared/sheet/formula-scope.js +235 -0
  184. package/dist/commands/shared/{limits.d.ts → sheet/limits.d.ts} +3 -3
  185. package/dist/commands/shared/{limits.js → sheet/limits.js} +5 -4
  186. package/dist/commands/shared/{progression.d.ts → sheet/progression.d.ts} +2 -2
  187. package/dist/commands/shared/{progression.js → sheet/progression.js} +4 -4
  188. package/dist/commands/shared/{sheet.d.ts → sheet/sheet.d.ts} +7 -5
  189. package/dist/commands/shared/{sheet.js → sheet/sheet.js} +11 -7
  190. package/dist/commands/shared/{stacks.d.ts → sheet/stacks.d.ts} +2 -2
  191. package/dist/commands/shared/{stacks.js → sheet/stacks.js} +4 -4
  192. package/dist/commands/shared/sheet/system-fields.d.ts +21 -0
  193. package/dist/commands/shared/sheet/system-fields.js +45 -0
  194. package/dist/commands/shared/{thresholds.d.ts → sheet/thresholds.d.ts} +1 -1
  195. package/dist/commands/shared/{thresholds.js → sheet/thresholds.js} +4 -4
  196. package/dist/commands/shared/{turn-uses.d.ts → sheet/turn-uses.d.ts} +3 -3
  197. package/dist/commands/shared/{turn-uses.js → sheet/turn-uses.js} +4 -3
  198. package/dist/commands/shared/{worked-out.d.ts → sheet/worked-out.d.ts} +11 -46
  199. package/dist/commands/shared/sheet/worked-out.js +291 -0
  200. package/dist/commands/shared/sheet/worked-text.d.ts +14 -0
  201. package/dist/commands/shared/sheet/worked-text.js +55 -0
  202. package/dist/commands/shared/{advance.d.ts → time/advance.d.ts} +3 -3
  203. package/dist/commands/shared/{advance.js → time/advance.js} +11 -11
  204. package/dist/commands/shared/{dice-pool.d.ts → time/dice-pool.d.ts} +3 -3
  205. package/dist/commands/shared/{dice-pool.js → time/dice-pool.js} +11 -11
  206. package/dist/commands/shared/{events.d.ts → time/events.d.ts} +5 -5
  207. package/dist/commands/shared/{events.js → time/events.js} +10 -13
  208. package/dist/commands/shared/{recipes.d.ts → time/recipes.d.ts} +3 -3
  209. package/dist/commands/shared/{recipes.js → time/recipes.js} +6 -5
  210. package/dist/commands/shared/{time.d.ts → time/time.d.ts} +4 -4
  211. package/dist/commands/shared/{time.js → time/time.js} +6 -6
  212. package/dist/commands/shared/{upkeep.d.ts → time/upkeep.d.ts} +3 -3
  213. package/dist/commands/shared/{upkeep.js → time/upkeep.js} +14 -13
  214. package/dist/commands/show.d.ts +9 -0
  215. package/dist/commands/show.js +43 -10
  216. package/dist/commands/status.d.ts +2 -1
  217. package/dist/commands/status.js +28 -22
  218. package/dist/commands/thoughts.d.ts +1 -0
  219. package/dist/commands/thoughts.js +26 -18
  220. package/dist/commands/trade.js +8 -8
  221. package/dist/commands/translate.d.ts +1 -1
  222. package/dist/commands/translate.js +3 -3
  223. package/dist/commands/travel/open.d.ts +1 -1
  224. package/dist/commands/travel/open.js +2 -2
  225. package/dist/commands/travel/route.js +7 -6
  226. package/dist/commands/travel/travel.d.ts +1 -1
  227. package/dist/commands/travel/travel.js +8 -8
  228. package/dist/commands/validate.js +3 -3
  229. package/dist/commands/view/journal.d.ts +2 -2
  230. package/dist/commands/view/journal.js +2 -2
  231. package/dist/commands/view/layers.d.ts +34 -0
  232. package/dist/commands/view/layers.js +44 -0
  233. package/dist/commands/view/map.d.ts +1 -1
  234. package/dist/commands/view/map.js +6 -6
  235. package/dist/commands/view/memory.d.ts +16 -0
  236. package/dist/commands/view/memory.js +96 -0
  237. package/dist/commands/view/page.d.ts +32 -0
  238. package/dist/commands/view/page.js +166 -0
  239. package/dist/commands/view/place.d.ts +7 -2
  240. package/dist/commands/view/place.js +30 -12
  241. package/dist/commands/view/result.d.ts +252 -0
  242. package/dist/commands/view/result.js +1 -0
  243. package/dist/commands/view/saves.d.ts +6 -0
  244. package/dist/commands/view/saves.js +53 -0
  245. package/dist/commands/view/story.d.ts +32 -0
  246. package/dist/commands/view/story.js +227 -0
  247. package/dist/commands/view/view.d.ts +29 -292
  248. package/dist/commands/view/view.js +31 -536
  249. package/dist/commands/view/world.d.ts +1 -1
  250. package/dist/commands/view/world.js +3 -3
  251. package/dist/commands/write/checks.d.ts +42 -0
  252. package/dist/commands/write/checks.js +291 -0
  253. package/dist/commands/write/here.d.ts +1 -1
  254. package/dist/commands/write/here.js +5 -5
  255. package/dist/commands/write/inheritance.d.ts +40 -0
  256. package/dist/commands/write/inheritance.js +185 -0
  257. package/dist/commands/write/input.d.ts +29 -0
  258. package/dist/commands/write/input.js +124 -0
  259. package/dist/commands/write/layer.d.ts +44 -0
  260. package/dist/commands/write/layer.js +68 -0
  261. package/dist/commands/write/notes.d.ts +22 -0
  262. package/dist/commands/write/notes.js +76 -0
  263. package/dist/commands/write/progression.d.ts +27 -0
  264. package/dist/commands/write/progression.js +175 -0
  265. package/dist/commands/write/write.d.ts +2 -0
  266. package/dist/commands/write/write.js +36 -816
  267. package/dist/core/files.d.ts +2 -0
  268. package/dist/core/files.js +7 -0
  269. package/dist/core/{package-declarations.d.ts → packages/declarations.d.ts} +1 -1
  270. package/dist/core/{package-declarations.js → packages/declarations.js} +1 -1
  271. package/dist/core/session-store.js +3 -3
  272. package/dist/core/store.d.ts +2 -2
  273. package/dist/core/store.js +18 -4
  274. package/dist/core/text.d.ts +2 -0
  275. package/dist/core/text.js +4 -0
  276. package/dist/dashboard/acts/acts.js +1 -1
  277. package/dist/dashboard/acts/sending.js +110 -0
  278. package/dist/dashboard/acts/sheet.js +2 -2
  279. package/dist/dashboard/acts/strip.js +1 -1
  280. package/dist/dashboard/address.js +6 -0
  281. package/dist/dashboard/api.js +19 -1
  282. package/dist/dashboard/app.js +51 -171
  283. package/dist/dashboard/dice/roller.js +1 -1
  284. package/dist/dashboard/dice/sets.js +2 -2
  285. package/dist/dashboard/dice/stage.js +1 -1
  286. package/dist/dashboard/dice/tray.js +6 -6
  287. package/dist/dashboard/guide/ar.md +7 -3
  288. package/dist/dashboard/guide/cs.md +9 -5
  289. package/dist/dashboard/guide/da.md +9 -5
  290. package/dist/dashboard/guide/de.md +7 -3
  291. package/dist/dashboard/guide/el.md +9 -5
  292. package/dist/dashboard/guide/en.md +4 -0
  293. package/dist/dashboard/guide/es.md +8 -4
  294. package/dist/dashboard/guide/fi.md +9 -5
  295. package/dist/dashboard/guide/fr.md +8 -4
  296. package/dist/dashboard/guide/he.md +7 -3
  297. package/dist/dashboard/guide/hi.md +10 -6
  298. package/dist/dashboard/guide/hu.md +8 -4
  299. package/dist/dashboard/guide/is.md +9 -5
  300. package/dist/dashboard/guide/it.md +5 -1
  301. package/dist/dashboard/guide/ja.md +9 -5
  302. package/dist/dashboard/guide/ko.md +8 -4
  303. package/dist/dashboard/guide/nb.md +8 -4
  304. package/dist/dashboard/guide/nl.md +8 -4
  305. package/dist/dashboard/guide/pl.md +8 -4
  306. package/dist/dashboard/guide/pt.md +7 -3
  307. package/dist/dashboard/guide/ro.md +9 -5
  308. package/dist/dashboard/guide/ru.md +8 -4
  309. package/dist/dashboard/guide/sv.md +9 -5
  310. package/dist/dashboard/guide/tr.md +9 -5
  311. package/dist/dashboard/guide/uk.md +8 -4
  312. package/dist/dashboard/guide/zh.md +8 -4
  313. package/dist/dashboard/help/help.js +3 -3
  314. package/dist/dashboard/i18n/ar.json +29 -0
  315. package/dist/dashboard/i18n/cs.json +29 -0
  316. package/dist/dashboard/i18n/da.json +29 -0
  317. package/dist/dashboard/i18n/de.json +29 -0
  318. package/dist/dashboard/i18n/el.json +29 -0
  319. package/dist/dashboard/i18n/es.json +29 -0
  320. package/dist/dashboard/i18n/fi.json +29 -0
  321. package/dist/dashboard/i18n/fr.json +29 -0
  322. package/dist/dashboard/i18n/he.json +29 -0
  323. package/dist/dashboard/i18n/hi.json +29 -0
  324. package/dist/dashboard/i18n/hu.json +29 -0
  325. package/dist/dashboard/i18n/is.json +29 -0
  326. package/dist/dashboard/i18n/it.json +29 -0
  327. package/dist/dashboard/i18n/ja.json +30 -1
  328. package/dist/dashboard/i18n/ko.json +29 -0
  329. package/dist/dashboard/i18n/nb.json +29 -0
  330. package/dist/dashboard/i18n/nl.json +29 -0
  331. package/dist/dashboard/i18n/pl.json +29 -0
  332. package/dist/dashboard/i18n/pt.json +29 -0
  333. package/dist/dashboard/i18n/ro.json +29 -0
  334. package/dist/dashboard/i18n/ru.json +29 -0
  335. package/dist/dashboard/i18n/sv.json +29 -0
  336. package/dist/dashboard/i18n/tr.json +29 -0
  337. package/dist/dashboard/i18n/uk.json +29 -0
  338. package/dist/dashboard/i18n/zh.json +29 -0
  339. package/dist/dashboard/{journal.js → journal/journal.js} +16 -16
  340. package/dist/dashboard/{notes.js → journal/notes.js} +4 -4
  341. package/dist/dashboard/kit.js +3 -3
  342. package/dist/dashboard/packages/ask-card.js +3 -3
  343. package/dist/dashboard/packages/catalog.js +196 -0
  344. package/dist/dashboard/packages/changes.js +111 -0
  345. package/dist/dashboard/packages/engine.js +87 -0
  346. package/dist/dashboard/packages/installed.js +53 -0
  347. package/dist/dashboard/packages/library.js +97 -0
  348. package/dist/dashboard/packages/outcomes.js +45 -0
  349. package/dist/dashboard/packages/packages.js +27 -578
  350. package/dist/dashboard/packages/page-code.js +15 -2
  351. package/dist/dashboard/packages/{package-page.js → page.js} +12 -5
  352. package/dist/dashboard/packages/rows.js +84 -0
  353. package/dist/dashboard/packages/share.js +44 -0
  354. package/dist/dashboard/packages/widgets.js +3 -3
  355. package/dist/dashboard/{card.js → parts/card.js} +1 -1
  356. package/dist/dashboard/parts/changed.js +37 -0
  357. package/dist/dashboard/{faces.js → parts/faces.js} +5 -5
  358. package/dist/dashboard/{game-words.js → parts/game-words.js} +1 -1
  359. package/dist/dashboard/{icons.js → parts/icons.js} +1 -1
  360. package/dist/dashboard/{labels.js → parts/labels.js} +2 -1
  361. package/dist/dashboard/{map-symbols.js → parts/map-symbols.js} +1 -1
  362. package/dist/dashboard/{markdown.js → parts/markdown.js} +2 -2
  363. package/dist/dashboard/{mood.js → parts/mood.js} +1 -1
  364. package/dist/dashboard/{refusals.js → parts/refusals.js} +5 -1
  365. package/dist/dashboard/{status.js → parts/status.js} +4 -4
  366. package/dist/dashboard/{widgets.js → parts/widgets.js} +5 -3
  367. package/dist/dashboard/place/key.js +24 -0
  368. package/dist/dashboard/place/paper.js +67 -0
  369. package/dist/dashboard/place/{map-sheet.js → sheet.js} +2 -2
  370. package/dist/dashboard/place/things.js +129 -0
  371. package/dist/dashboard/place/tokens.js +93 -0
  372. package/dist/dashboard/place/view.js +124 -0
  373. package/dist/dashboard/{asked-dice.js → play/asked-dice.js} +3 -3
  374. package/dist/dashboard/{asked.js → play/asked.js} +10 -10
  375. package/dist/dashboard/{choices.js → play/choices.js} +11 -10
  376. package/dist/dashboard/{requested.js → play/requested.js} +1 -1
  377. package/dist/dashboard/{rolls.js → play/rolls.js} +9 -9
  378. package/dist/dashboard/{scene.js → play/scene.js} +14 -14
  379. package/dist/dashboard/{turns.js → play/turns.js} +12 -12
  380. package/dist/dashboard/{language-choice.js → settings/language-choice.js} +1 -1
  381. package/dist/dashboard/{languages.js → settings/languages.js} +1 -1
  382. package/dist/dashboard/{saves.js → settings/saves.js} +8 -8
  383. package/dist/dashboard/{settings.js → settings/settings.js} +17 -15
  384. package/dist/dashboard/{setup.js → settings/setup.js} +5 -5
  385. package/dist/dashboard/{party.js → sheet/party.js} +8 -8
  386. package/dist/dashboard/{person-panel.js → sheet/person-panel.js} +4 -4
  387. package/dist/dashboard/{sheet.js → sheet/sheet.js} +27 -24
  388. package/dist/dashboard/{story.js → sheet/story.js} +3 -3
  389. package/dist/dashboard/{columns.js → shell/columns.js} +1 -1
  390. package/dist/dashboard/{footer.js → shell/footer.js} +3 -3
  391. package/dist/dashboard/{master.js → shell/master.js} +2 -2
  392. package/dist/dashboard/{notices.js → shell/notices.js} +3 -3
  393. package/dist/dashboard/{pages.js → shell/pages.js} +5 -5
  394. package/dist/dashboard/shell/shown.js +38 -0
  395. package/dist/dashboard/{table.js → shell/table.js} +2 -2
  396. package/dist/dashboard/{tabs.js → shell/tabs.js} +2 -2
  397. package/dist/dashboard/{top.js → shell/top.js} +7 -7
  398. package/dist/dashboard/style.css +288 -4
  399. package/dist/dashboard/world/calendar.js +4 -4
  400. package/dist/dashboard/world/drawing.js +92 -0
  401. package/dist/dashboard/world/key.js +21 -0
  402. package/dist/dashboard/world/lore.js +10 -6
  403. package/dist/dashboard/world/map-card.js +186 -0
  404. package/dist/dashboard/world/place-card.js +39 -0
  405. package/dist/dashboard/world/places.js +29 -0
  406. package/dist/dashboard/world/world.js +9 -341
  407. package/dist/extensions/extension.d.ts +1 -1
  408. package/dist/extensions/extension.js +1 -1
  409. package/dist/images/images.js +12 -9
  410. package/dist/index.d.ts +1 -1
  411. package/dist/languages/index.d.ts +1 -1
  412. package/dist/languages/index.js +1 -1
  413. package/dist/packages/npm.js +1 -1
  414. package/dist/page.d.ts +2 -2
  415. package/dist/page.js +1 -1
  416. package/dist/pages/check.js +23 -1
  417. package/dist/pages/containers.d.ts +1 -1
  418. package/dist/pages/containers.js +1 -1
  419. package/dist/pages/index.d.ts +4 -2
  420. package/dist/pages/index.js +4 -2
  421. package/dist/pages/inheritance.d.ts +2 -2
  422. package/dist/pages/layers.d.ts +52 -0
  423. package/dist/pages/layers.js +105 -0
  424. package/dist/pages/markdown.d.ts +5 -1
  425. package/dist/pages/markdown.js +13 -1
  426. package/dist/pages/rename-page.js +1 -1
  427. package/dist/pages/stacks/writes.js +48 -22
  428. package/dist/pages/standard-fields.d.ts +1 -1
  429. package/dist/pages/system-pages.d.ts +5 -3
  430. package/dist/pages/system-pages.js +16 -7
  431. package/dist/pages/world.d.ts +8 -1
  432. package/dist/pages/world.js +16 -4
  433. package/dist/pages/write-layer.d.ts +23 -0
  434. package/dist/pages/write-layer.js +162 -0
  435. package/dist/pages/write-page.d.ts +2 -2
  436. package/dist/pages/write-page.js +2 -2
  437. package/dist/rules/index.d.ts +1 -1
  438. package/dist/rules/index.js +1 -1
  439. package/dist/rules/search.d.ts +1 -1
  440. package/dist/rules/shown.d.ts +1 -1
  441. package/dist/server/dashboard/choices.d.ts +2 -0
  442. package/dist/server/dashboard/choices.js +6 -4
  443. package/dist/server/dashboard/files.js +5 -5
  444. package/dist/server/dashboard/index.d.ts +2 -2
  445. package/dist/server/dashboard/index.js +7 -3
  446. package/dist/server/dashboard/news.js +4 -3
  447. package/dist/server/dashboard/player.js +1 -1
  448. package/dist/server/dashboard/writes.d.ts +7 -0
  449. package/dist/server/dashboard/writes.js +48 -7
  450. package/dist/server/mcp.js +28 -13
  451. package/dist/systems/campaign-data.d.ts +15 -0
  452. package/dist/systems/campaign-data.js +85 -0
  453. package/dist/systems/{system-code.d.ts → code.d.ts} +1 -1
  454. package/dist/systems/{system-code.js → code.js} +2 -2
  455. package/dist/systems/game-system.d.ts +7 -61
  456. package/dist/systems/game-system.js +1 -984
  457. package/dist/systems/index.d.ts +6 -3
  458. package/dist/systems/index.js +6 -3
  459. package/dist/systems/installed.d.ts +31 -0
  460. package/dist/systems/installed.js +89 -0
  461. package/dist/systems/maps.d.ts +3 -0
  462. package/dist/systems/maps.js +9 -0
  463. package/dist/systems/read.d.ts +3 -0
  464. package/dist/systems/read.js +471 -0
  465. package/dist/systems/schema.d.ts +289 -0
  466. package/dist/systems/schema.js +243 -0
  467. package/dist/systems/settings.d.ts +19 -0
  468. package/dist/systems/settings.js +78 -0
  469. package/dist/systems/versions.d.ts +12 -0
  470. package/dist/systems/versions.js +52 -0
  471. package/dist/testing/index.js +1 -1
  472. package/instructions/import.md +1 -1
  473. package/instructions/play.md +1 -1
  474. package/instructions/voices.md +1 -1
  475. package/package.json +1 -1
  476. package/dist/commands/config.js +0 -948
  477. package/dist/commands/package.d.ts +0 -143
  478. package/dist/commands/package.js +0 -785
  479. package/dist/commands/scene.js +0 -894
  480. package/dist/commands/shared/worked-out.js +0 -805
  481. package/dist/dashboard/place/map-view.js +0 -417
  482. /package/dist/commands/shared/{library-reader.d.ts → books/library-reader.d.ts} +0 -0
  483. /package/dist/core/{package-api.d.ts → packages/api.d.ts} +0 -0
  484. /package/dist/core/{package-api.js → packages/api.js} +0 -0
  485. /package/dist/dashboard/{coins.js → parts/coins.js} +0 -0
  486. /package/dist/dashboard/{glass.js → parts/glass.js} +0 -0
  487. /package/dist/dashboard/{layout.js → parts/layout.js} +0 -0
  488. /package/dist/dashboard/{mood-faces.js → parts/mood-faces.js} +0 -0
  489. /package/dist/dashboard/{free-rolls.js → play/free-rolls.js} +0 -0
  490. /package/dist/dashboard/{reactions.js → play/reactions.js} +0 -0
  491. /package/dist/dashboard/{prefs.js → shell/prefs.js} +0 -0
  492. /package/dist/dashboard/{system-style.js → shell/system-style.js} +0 -0
  493. /package/dist/dashboard/{theme.js → shell/theme.js} +0 -0
  494. /package/dist/languages/{language-pack.d.ts → pack.d.ts} +0 -0
  495. /package/dist/languages/{language-pack.js → pack.js} +0 -0
  496. /package/dist/pages/{page-file.d.ts → file.d.ts} +0 -0
  497. /package/dist/pages/{page-file.js → file.js} +0 -0
  498. /package/dist/pages/{page-types.d.ts → types.d.ts} +0 -0
  499. /package/dist/pages/{page-types.js → types.js} +0 -0
  500. /package/dist/rules/{rule-book.d.ts → book.d.ts} +0 -0
  501. /package/dist/rules/{rule-book.js → book.js} +0 -0
  502. /package/dist/systems/{system-folders.d.ts → folders.d.ts} +0 -0
  503. /package/dist/systems/{system-folders.js → folders.js} +0 -0
@@ -0,0 +1,201 @@
1
+ // The layers an adventure carries over the pages of the game system it needs (ADV-8, SYS-11): which of the campaign's an export takes, where an install puts them and
2
+ // which it leaves out, and which go with the adventure when it is taken out.
3
+ import { basename, join, relative, sep } from "node:path";
4
+ import { Refusal } from "../../../core/refusal.js";
5
+ import { files } from "../../../core/store.js";
6
+ import { comparableText, textPrint, valueText } from "../../../core/text.js";
7
+ import { introductionText, layerFolder, layerParts, layersFolderName, layerTakes, pageWithPath, readFields, splitPageFile, systemOriginal, worldFolderName } from "../../../pages/index.js";
8
+ import { followersOfWrite, logCounterChanges } from "../../write/inheritance.js";
9
+ import { campaignCoins } from "../campaign/money.js";
10
+ import { campaignWorld } from "../campaign/world.js";
11
+ import { checkNotCopied, readOpenScene } from "../scene/scene.js";
12
+ /** The layers a line of the log says an adventure brought, by their file, each with the print of its text. */
13
+ export function layerPrints(value) {
14
+ return value === null || typeof value !== "object" || Array.isArray(value) ? {} : Object.fromEntries(Object.entries(value).filter((entry) => typeof entry[1] === "string"));
15
+ }
16
+ /**
17
+ * The campaign's layers as they are now, for an export (ADV-8): each over a page of the system goes, at the page's path; one over no page, one that does not read or
18
+ * writes what a layer never changes, and one an installed adventure brought and no one changed since stay out, by name. `brought` are the layers of the adventures installed.
19
+ */
20
+ export function layersToExport(root, world, system, brought) {
21
+ const byLayer = new Map((world.system?.pages ?? []).flatMap((page) => (page.layer === undefined ? [] : [[page.layer.path, page]])));
22
+ const exported = { carried: {}, pages: [], sourced: [], leftOut: [] };
23
+ for (const [path, bytes] of layerFiles(root, system)) {
24
+ const file = `${layersFolderName}/${system}/${path}`;
25
+ const page = byLayer.get(file);
26
+ const name = page?.name ?? basename(path, ".md");
27
+ const layer = readOrProblem(file, bytes);
28
+ if (page === undefined || typeof layer === "string") {
29
+ exported.leftOut.push({ name, why: typeof layer === "string" ? "unread" : "no-page" });
30
+ }
31
+ else if ((page.layer?.ignored.length ?? 0) > 0) {
32
+ exported.leftOut.push({ name, why: "forbidden" });
33
+ }
34
+ else if (isBrought(brought, file, bytes)) {
35
+ exported.leftOut.push({ name, why: "adventure" });
36
+ }
37
+ else if (!givesNothing(layer)) {
38
+ exported.carried[`${layersFolderName}/${system}/${systemOriginal(page).path}`] = bytes;
39
+ exported.pages.push(...changedPages([page]));
40
+ // From the player's documents when the layer says so, or the page under it does.
41
+ exported.sourced.push(...(layer.fields.source !== undefined || systemOriginal(page).fields.source !== undefined ? [name] : []));
42
+ }
43
+ }
44
+ return exported;
45
+ }
46
+ /**
47
+ * Where each layer of an adventure goes (ADV-8): at its page's path in the campaign's layers. One over a page the campaign has its own layer on stays out, with what it
48
+ * would have given, unless the two are the same; one over no page of the rules the campaign plays stays out; one that does not read, or writes what a layer never
49
+ * changes, is a problem.
50
+ */
51
+ export function planLayers(root, world, adventure) {
52
+ const system = world.system?.name ?? adventure.manifest.needs.system ?? "";
53
+ const there = layerFiles(root, system);
54
+ const own = new Map([...there.keys()].map((path) => [comparableText(path), path]));
55
+ // As the world lays a layer over a page: by their paths, compared as names are.
56
+ const under = new Map((world.system?.pages ?? []).map((page) => [comparableText(page.path), page]));
57
+ const plan = { writes: [], prints: {}, changed: [], kept: [], stray: [], problems: [] };
58
+ const targets = new Set();
59
+ for (const path of Object.keys(adventure.layers).sort()) {
60
+ const bytes = adventure.layers[path];
61
+ const file = `${layersFolderName}/${system}/${path}`;
62
+ const layer = readOrProblem(file, bytes);
63
+ const page = under.get(comparableText(path));
64
+ if (typeof layer === "string") {
65
+ plan.problems.push(`its layer over ${page?.name ?? basename(path, ".md")} does not read: ${layer}`);
66
+ continue;
67
+ }
68
+ // A file that gives nothing is no layer, as write leaves none.
69
+ if (givesNothing(layer)) {
70
+ continue;
71
+ }
72
+ const forbidden = Object.entries(layer.fields).filter(([field, value]) => !layerTakes(page === undefined ? pageless : systemOriginal(page), field, value, world.system?.fields)).map(([field]) => field);
73
+ if (forbidden.length > 0) {
74
+ plan.problems.push(`its layer over ${page?.name ?? basename(path, ".md")} writes ${forbidden.join(", ")}`);
75
+ continue;
76
+ }
77
+ if (page === undefined) {
78
+ plan.stray.push(basename(path, ".md"));
79
+ continue;
80
+ }
81
+ const held = own.get(comparableText(path));
82
+ const target = `${layersFolderName}/${system}/${held ?? systemOriginal(page).path}`;
83
+ // Two files whose names differ only as names are compared, such as by an apostrophe.
84
+ if (targets.has(target)) {
85
+ plan.problems.push(`two of its layers lie over ${page.name}`);
86
+ continue;
87
+ }
88
+ targets.add(target);
89
+ // The same as the campaign's by its print, which is what taking the adventure out compares.
90
+ if (held !== undefined && printOf(there.get(held) ?? new Uint8Array()) !== printOf(bytes)) {
91
+ const fields = Object.fromEntries(Object.entries(layer.fields).map(([field, value]) => [field, valueText(value)]));
92
+ plan.kept.push({ page: page.name, fields, sections: layer.sections, introduction: layer.introduction });
93
+ continue;
94
+ }
95
+ plan.prints[target] = printOf(bytes);
96
+ if (held === undefined) {
97
+ plan.writes.push({ path: target, bytes });
98
+ plan.changed.push({ page, fields: Object.keys(layer.fields) });
99
+ }
100
+ }
101
+ return plan;
102
+ }
103
+ /**
104
+ * The layers that go with an adventure taken out (ADV-8): those still as it wrote them. One changed since, with write or by hand, stays the campaign's, by the name of
105
+ * its page; one already gone is skipped; one another adventure of the campaign brought the same stays with that one. `others` are the layers of the other adventures.
106
+ */
107
+ export function layersToRemove(root, world, brought, others) {
108
+ const byLayer = new Map((world.system?.pages ?? []).flatMap((page) => (page.layer === undefined ? [] : [[comparableText(page.layer.path), page]])));
109
+ const removal = { paths: [], changed: [], kept: [] };
110
+ for (const [file, print] of Object.entries(brought)) {
111
+ const bytes = files().bytes(join(root, ...file.split("/")));
112
+ const page = byLayer.get(comparableText(file));
113
+ if (bytes === undefined) {
114
+ continue;
115
+ }
116
+ if (printOf(bytes) !== print) {
117
+ removal.kept.push(page?.name ?? basename(file, ".md"));
118
+ }
119
+ else if (!isBrought(others, file, bytes)) {
120
+ removal.paths.push(file);
121
+ removal.changed.push(...(page === undefined ? [] : [page]));
122
+ }
123
+ }
124
+ return removal;
125
+ }
126
+ /**
127
+ * Refuses to bring an adventure in, or take it out, while the open scene holds copies of a page whose fields its layers change (INH-10), as write with layer does.
128
+ * Said without the page and its copies: the player reads it too, adding an adventure on the dashboard, and the remedy is the same.
129
+ */
130
+ export function checkLayersNotCopied(root, world, title, doing, pages) {
131
+ const open = readOpenScene(root);
132
+ for (const page of pages) {
133
+ try {
134
+ checkNotCopied(world, open, page);
135
+ }
136
+ catch (error) {
137
+ if (!(error instanceof Refusal) || error.code !== "copies-in-scene") {
138
+ throw error;
139
+ }
140
+ throw new Refusal(`${title} cannot be ${doing} now: its layers change a page of the game system that has copies in the open scene, which read from it what they do not change. `
141
+ + `Close the scene first, then give the same command again. Nothing changed.`, "adventure-copies", { name: title });
142
+ }
143
+ }
144
+ }
145
+ /**
146
+ * One public line for each counter of the player's party that changed with the pages of the system an adventure's layers came over, or went from (INH-11), as write
147
+ * with layer writes them. `before` is the world as it was, and `pages` those pages in it; a page that was not there then, as one the adventure brings, changed nothing.
148
+ */
149
+ export function logLayerCounters(root, context, before, pages) {
150
+ if (pages.length === 0) {
151
+ return;
152
+ }
153
+ const now = campaignWorld(root, context);
154
+ const followers = new Set(pages.flatMap((page) => {
155
+ const after = now.system?.pages.find((one) => one.path === page.path);
156
+ return after === undefined ? [] : followersOfWrite(now, page, after).pages;
157
+ }));
158
+ const changed = now.pages.filter((page) => followers.has(page)).flatMap((page) => {
159
+ const was = pageWithPath(before, page.path);
160
+ return was === undefined ? [] : [[was, page]];
161
+ });
162
+ logCounterChanges(root, context, before, now, changed, campaignCoins(root, context).coins);
163
+ }
164
+ /** The pages of the system as the master hears them changed: each by its name, with its type. */
165
+ export function changedPages(pages) {
166
+ return pages.map((page) => ({ page: page.name, ...(page.type === undefined ? {} : { type: page.type }) }));
167
+ }
168
+ // A page of no type with no fields, for a layer over no page: only what no layer ever changes is refused of it.
169
+ const pageless = { name: "", path: "", fields: {}, body: "" };
170
+ /** The campaign's layers over the pages of a game system as their files are now, in order, by their path from the system's layers' folder, such as world/creatures/Goblin.md. */
171
+ function layerFiles(root, system) {
172
+ const folder = layerFolder(root, system);
173
+ const found = files().files(join(folder, worldFolderName), (name) => /\.md$/i.test(name)).map((file) => [relative(folder, file).split(sep).join("/"), files().bytes(file) ?? new Uint8Array()]);
174
+ return new Map(found.sort(([first], [second]) => (first < second ? -1 : 1)));
175
+ }
176
+ /** What a layer's file gives; it throws, naming the file, when its frontmatter does not read. */
177
+ function readLayer(file, bytes) {
178
+ const text = splitPageFile(new TextDecoder().decode(bytes));
179
+ return { fields: readFields(text.frontmatter, file), sections: layerParts(text.body).filter((part) => part.content !== "").map((part) => part.name), introduction: introductionText(text.body) !== "" };
180
+ }
181
+ /** What a layer's file gives, or why it does not read. */
182
+ function readOrProblem(file, bytes) {
183
+ try {
184
+ return readLayer(file, bytes);
185
+ }
186
+ catch (error) {
187
+ return error instanceof Error ? error.message : String(error);
188
+ }
189
+ }
190
+ function givesNothing(layer) {
191
+ return Object.keys(layer.fields).length === 0 && layer.sections.length === 0 && !layer.introduction;
192
+ }
193
+ /** Whether one of these adventures brought the layer in this file as it is now: the same file, as names are compared, with the same print. */
194
+ function isBrought(brought, file, bytes) {
195
+ const print = printOf(bytes);
196
+ return brought.some((layers) => Object.entries(layers).some(([path, known]) => comparableText(path) === comparableText(file) && known === print));
197
+ }
198
+ /** The print of a layer's file, by which one changed since it was written is told. */
199
+ function printOf(bytes) {
200
+ return textPrint(new TextDecoder().decode(bytes));
201
+ }
@@ -1,6 +1,7 @@
1
- import { type AdventureFiles, type AdventureManifest } from "../../adventures/index.ts";
2
- import type { Context } from "../../core/context.ts";
3
- import { type LogEntry } from "../../core/log.ts";
1
+ import { type AdventureFiles, type AdventureManifest } from "../../../adventures/index.ts";
2
+ import type { Context } from "../../../core/context.ts";
3
+ import { type LogEntry } from "../../../core/log.ts";
4
+ import { type LayeredPage, type LayerLeftOut, type LayersInstalled } from "./adventure-layers.ts";
4
5
  /** An adventure the campaign has installed and not taken out (ADV-6). */
5
6
  export interface InstalledAdventure {
6
7
  title: string;
@@ -9,6 +10,8 @@ export interface InstalledAdventure {
9
10
  since?: string;
10
11
  /** The files it wrote, from the campaign's folder. */
11
12
  files: string[];
13
+ /** The layers it brought over the pages of the game system (ADV-8), by their file, each with the print of its text as it wrote it. */
14
+ layers: Record<string, string>;
12
15
  /** The days its dates were moved by. */
13
16
  shift: number;
14
17
  /** The line of the log that installed it. */
@@ -34,18 +37,30 @@ export interface AdventureInstalled {
34
37
  name: string;
35
38
  placed: boolean;
36
39
  };
40
+ /** What its layers over the pages of the game system did (ADV-8): the pages they change, and the layers left out. */
41
+ layers: LayersInstalled;
37
42
  }
38
- /** What an export wrote (ADV-7). */
43
+ /** What taking an adventure out did (ADV-6, ADV-8): the pages of the game system its layers change no more, and those whose layer, changed since, stays the campaign's. */
44
+ export interface AdventureRemoved {
45
+ title: string;
46
+ layers: LayeredPage[];
47
+ layersKept: string[];
48
+ }
49
+ /** What an export wrote (ADV-7, ADV-8). */
39
50
  export interface AdventureExported {
40
51
  file: string;
41
52
  from: string;
42
53
  pages: number;
54
+ /** The pages of the game system whose layers it carries, as the campaign has them now, each with its type. */
55
+ layers: LayeredPage[];
56
+ /** The player characters, the adventures installed, and the campaign's layers that stay out, each with why. */
43
57
  leftOut: {
44
58
  characters: string[];
45
59
  adventures: string[];
60
+ layers: LayerLeftOut[];
46
61
  };
47
62
  opening?: string;
48
- /** The pages written from the player's documents (source:), when no license was given: the zip keeps them to the player. */
63
+ /** The pages and layers written from the player's documents (source:), when no license was given: the zip keeps them to the player. */
49
64
  sourced?: string[];
50
65
  }
51
66
  /** Whether what was given to package install is an adventure: a .zip, a link, or a folder with adventure.yaml; a document says it is imported instead. */
@@ -56,13 +71,17 @@ export declare function readAdventureSpec(spec: string, context: Context): Promi
56
71
  export declare function installedAdventures(root: string): InstalledAdventure[];
57
72
  /** Installs an adventure in the campaign (ADV-2–ADV-5): checked whole, then written, or nothing at all; installed again, it finishes what stopped. */
58
73
  export declare function installAdventure(root: string, context: Context, adventure: AdventureFiles, from: string): AdventureInstalled;
59
- /** Takes an adventure out (ADV-6), with the files it wrote, while no line of the log after it names one of its pages; else it throws, saying it stays. */
60
- export declare function removeAdventure(root: string, context: Context, adventure: InstalledAdventure): void;
61
- /** The first line of the log after an adventure came in that names one of its pages (ADV-6): it can no longer be taken out; undefined while none does. */
74
+ /**
75
+ * Takes an adventure out (ADV-6), with the files it wrote and the layers still as it wrote them (ADV-8), while no line of the log after it names one of its pages;
76
+ * else it throws, saying it stays.
77
+ */
78
+ export declare function removeAdventure(root: string, context: Context, adventure: InstalledAdventure): AdventureRemoved;
79
+ /** The first line of the log after an adventure came in that names one of its pages (ADV-6), never of the system's its layers change: it can no longer be taken out; undefined while none does. */
62
80
  export declare function storyTouching(root: string, adventure: InstalledAdventure): LogEntry | undefined;
63
81
  /**
64
82
  * Exports the campaign's world as an adventure (ADV-7), as it was at its start: the save before session zero, else that of the start, else the world now while no
65
- * scene was ever opened; without the player characters and the adventures it installed. Written in exports/, by the campaign's name.
83
+ * scene was ever opened; without the player characters and the adventures it installed. Its layers over the game system go as they are now (ADV-8), whatever the
84
+ * save held. Written in exports/, by the campaign's name.
66
85
  */
67
86
  export declare function exportAdventure(root: string, context: Context, credits: {
68
87
  author?: string;
@@ -1,26 +1,29 @@
1
1
  // The adventures of a campaign (D-476, D-483): installed from a package whole or not at all, taken out while the story has not touched them, and exported as
2
- // they were at the start (ADV-1–ADV-7).
2
+ // they were at the start (ADV-1–ADV-7), with the campaign's layers over its game system as they are now (ADV-8).
3
3
  import { basename, join, relative, resolve, sep } from "node:path";
4
4
  import { parse, parseDocument, stringify, visit } from "yaml";
5
- import { adventureFolderName, adventureTarget, isAdventureFolder, largestAdventure, manifestLine, packAdventure, readAdventureFolder, readAdventureZip } from "../../adventures/index.js";
6
- import { houseRulesFolderName, readSettings } from "../../campaign/index.js";
7
- import { appendLogEntry, readLog } from "../../core/log.js";
8
- import { Refusal } from "../../core/refusal.js";
9
- import { files } from "../../core/store.js";
10
- import { comparableText, linkTargetName } from "../../core/text.js";
11
- import { isNewerVersion } from "../../core/version.js";
12
- import { shortName } from "../../extensions/index.js";
13
- import { findImage, imageFileName, largestImage } from "../../images/index.js";
14
- import { locate, pageNamed, pageNamedQuietly, readFields, splitPageFile, textsIn, worldFolderName } from "../../pages/index.js";
15
- import { readRuleBook, ruleSections } from "../../rules/index.js";
16
- import { unpackFiles } from "../../saves/index.js";
17
- import { formatGameDate, readGameDate } from "../../time/index.js";
18
- import { campaignMode } from "./mode.js";
19
- import { listedExtensions } from "./packages/extensions.js";
5
+ import { adventureFolderName, adventureTarget, isAdventureFolder, largestAdventure, manifestLine, packAdventure, readAdventureFolder, readAdventureZip } from "../../../adventures/index.js";
6
+ import { houseRulesFolderName, readSettings } from "../../../campaign/index.js";
7
+ import { appendLogEntry, readLog } from "../../../core/log.js";
8
+ import { Refusal } from "../../../core/refusal.js";
9
+ import { files } from "../../../core/store.js";
10
+ import { comparableText, linkTargetName } from "../../../core/text.js";
11
+ import { isNewerVersion } from "../../../core/version.js";
12
+ import { shortName } from "../../../extensions/index.js";
13
+ import { findImage, imageFileName, largestImage } from "../../../images/index.js";
14
+ import { locate, pageNamed, pageNamedQuietly, readFields, splitPageFile, textsIn, worldFolderName } from "../../../pages/index.js";
15
+ import { readRuleBook, ruleSections } from "../../../rules/index.js";
16
+ import { unpackFiles } from "../../../saves/index.js";
17
+ import { formatGameDate, readGameDate } from "../../../time/index.js";
18
+ import { campaignMode } from "../campaign/mode.js";
19
+ import { campaignSaves, exportsFolderName, resetSave, savesFolderName, savesWhy } from "../campaign/saves.js";
20
+ import { campaignSystem, campaignWorld } from "../campaign/world.js";
21
+ import { listedExtensions } from "../packages/extensions.js";
22
+ import { newDatedLogEntry, readPresent } from "../time/time.js";
23
+ import { changedPages, checkLayersNotCopied, layerPrints, layersToExport, layersToRemove, logLayerCounters, planLayers } from "./adventure-layers.js";
20
24
  import { houseRules, systemRuleBook } from "./rules.js";
21
- import { campaignSaves, exportsFolderName, resetSave, savesFolderName, savesWhy } from "./saves.js";
22
- import { newDatedLogEntry, readPresent } from "./time.js";
23
- import { campaignSystem, campaignWorld } from "./world.js";
25
+ // What the system's attribution adds when the adventure carries layers over its pages: an open licence asks to say that the material was changed (ADV-8).
26
+ const changesMade = "Changes were made: the files under layers/ modify pages the game system adapted from that material.";
24
27
  // The mark of an install under way, with its title and the days it moves dates by: while it is there, installing the same adventure finishes it (ADV-5).
25
28
  const installMarkName = ".adventure-install.yaml";
26
29
  // The documents a master imports, never a package: their pages are written by the master (D-483 (10)).
@@ -67,7 +70,11 @@ export function installAdventure(root, context, adventure, from) {
67
70
  version: there.version,
68
71
  });
69
72
  }
70
- return { ...describe(root, context, adventure, there.shift, [], []), already: true };
73
+ // An install that stopped after its line was written left only its mark behind.
74
+ if (comparableText(installMark(root)?.title ?? "") === comparableText(manifest.title)) {
75
+ files().remove(join(root, installMarkName));
76
+ }
77
+ return { ...describe(root, context, adventure, there.shift, [], []), already: true, layers: { changed: [], kept: [], stray: [] } };
71
78
  }
72
79
  const stopped = installMark(root);
73
80
  if (stopped !== undefined && comparableText(stopped.title) !== comparableText(manifest.title)) {
@@ -77,35 +84,61 @@ export function installAdventure(root, context, adventure, from) {
77
84
  }
78
85
  checkNeeds(root, context, manifest);
79
86
  const shift = stopped?.shift ?? Math.max(0, (readPresent(root).date?.day ?? 1) - 1);
87
+ const world = campaignWorld(root, context);
80
88
  const plan = planInstall(root, context, adventure, shift);
89
+ const layers = planLayers(root, world, adventure);
81
90
  if (plan.problems.length > 0) {
82
91
  const listed = plan.problems.slice(0, 10).join("; ");
83
92
  const more = plan.problems.length > 10 ? `; and ${plan.problems.length - 10} more` : "";
84
93
  throw new Refusal(`${manifest.title} cannot be installed: ${listed}${more}. Rename the adventure's pages in its folder, or the campaign's with rename if the player has not met them, `
85
94
  + "and install it again. Nothing changed.", "adventure-names", { name: manifest.title, names: `${listed}${more}` });
86
95
  }
96
+ if (layers.problems.length > 0) {
97
+ const listed = layers.problems.join("; ");
98
+ throw new Refusal(`${manifest.title} cannot be installed: ${listed}. A layer changes neither the name nor the type of a page of the game system, nor a field no page inherits, nor gives uses to an item `
99
+ + "counted in stacks, and a page has one layer: fix its layers, in its folder or its .zip, and install it again. Nothing changed.", "adventure-layers", { name: manifest.title, layers: listed });
100
+ }
101
+ // The copies read the fields a layer gives, never its text (INH-10).
102
+ checkLayersNotCopied(root, world, manifest.title, "installed", layers.changed.filter((one) => one.fields.length > 0).map((one) => one.page));
87
103
  const mark = join(root, installMarkName);
88
104
  files().write(mark, stringify({ title: manifest.title, shift, from }));
89
- for (const write of plan.writes) {
105
+ for (const write of [...plan.writes, ...layers.writes]) {
90
106
  files().writeBytes(join(root, ...write.path.split("/")), write.bytes);
91
107
  }
92
- appendLogEntry(root, newDatedLogEntry(root, context, "adventure-installed", "public", { title: manifest.title, version: manifest.version, from, shift, files: plan.paths }));
108
+ // Before the adventure's own line: a line after it is the story going on (ADV-6).
109
+ logLayerCounters(root, context, world, layers.changed.map((one) => one.page));
110
+ const brought = Object.keys(layers.prints).length === 0 ? {} : { layers: layers.prints };
111
+ appendLogEntry(root, newDatedLogEntry(root, context, "adventure-installed", "public", { title: manifest.title, version: manifest.version, from, shift, files: plan.paths, ...brought }));
93
112
  files().remove(mark);
94
- return { ...describe(root, context, adventure, shift, plan.shadows, plan.covers), already: false };
113
+ return {
114
+ ...describe(root, context, adventure, shift, plan.shadows, plan.covers),
115
+ already: false,
116
+ layers: { changed: changedPages(layers.changed.map((one) => one.page)), kept: layers.kept, stray: layers.stray },
117
+ };
95
118
  }
96
- /** Takes an adventure out (ADV-6), with the files it wrote, while no line of the log after it names one of its pages; else it throws, saying it stays. */
119
+ /**
120
+ * Takes an adventure out (ADV-6), with the files it wrote and the layers still as it wrote them (ADV-8), while no line of the log after it names one of its pages;
121
+ * else it throws, saying it stays.
122
+ */
97
123
  export function removeAdventure(root, context, adventure) {
98
124
  const touching = storyTouching(root, adventure);
99
125
  if (touching !== undefined) {
100
126
  throw new Refusal(`${adventure.title} is part of the story now: the log names its pages${touching.date === undefined ? "" : ` on ${touching.date}`}. It stays; nothing changed.`, "adventure-in-story", { name: adventure.title });
101
127
  }
128
+ const world = campaignWorld(root, context);
129
+ const others = installedAdventures(root).filter((one) => one.entry !== adventure.entry).map((one) => one.layers);
130
+ const layers = layersToRemove(root, world, adventure.layers, others);
131
+ // The copies read the fields a layer gives, never its text (INH-10).
132
+ checkLayersNotCopied(root, world, adventure.title, "taken out", layers.changed.filter((page) => (page.layer?.fields.length ?? 0) > 0));
102
133
  // A file already gone, by hand or by a remove that stopped, is no reason to stop.
103
- for (const path of adventure.files.map((one) => join(root, ...one.split("/"))).filter((one) => files().exists(one))) {
134
+ for (const path of [...adventure.files, ...layers.paths].map((one) => join(root, ...one.split("/"))).filter((one) => files().exists(one))) {
104
135
  files().remove(path);
105
136
  }
137
+ logLayerCounters(root, context, world, layers.changed);
106
138
  appendLogEntry(root, newDatedLogEntry(root, context, "adventure-removed", "public", { title: adventure.title }));
139
+ return { title: adventure.title, layers: changedPages(layers.changed), layersKept: layers.kept };
107
140
  }
108
- /** The first line of the log after an adventure came in that names one of its pages (ADV-6): it can no longer be taken out; undefined while none does. */
141
+ /** The first line of the log after an adventure came in that names one of its pages (ADV-6), never of the system's its layers change: it can no longer be taken out; undefined while none does. */
109
142
  export function storyTouching(root, adventure) {
110
143
  const log = readLog(root);
111
144
  const names = new Set(adventure.files.filter((path) => path.startsWith(`${worldFolderName}/`)).flatMap((path) => pageNames(root, path)).map(comparableText));
@@ -114,7 +147,8 @@ export function storyTouching(root, adventure) {
114
147
  }
115
148
  /**
116
149
  * Exports the campaign's world as an adventure (ADV-7), as it was at its start: the save before session zero, else that of the start, else the world now while no
117
- * scene was ever opened; without the player characters and the adventures it installed. Written in exports/, by the campaign's name.
150
+ * scene was ever opened; without the player characters and the adventures it installed. Its layers over the game system go as they are now (ADV-8), whatever the
151
+ * save held. Written in exports/, by the campaign's name.
118
152
  */
119
153
  export function exportAdventure(root, context, credits) {
120
154
  const { held, from } = startingFiles(root, context);
@@ -136,10 +170,16 @@ export function exportAdventure(root, context, credits) {
136
170
  const opening = pages.find((page) => !installed.has(page.path) && textsIn(page.fields.tags).some((tag) => comparableText(tag) === "opening"));
137
171
  const start = opening === undefined ? undefined : textsIn(opening.fields.start)[0]?.replace(/^\[\[|\]\]$/g, "");
138
172
  const system = campaignSystem(root, context);
139
- // The system is needed, with its credits, only where a page uses it (D-489 (6)); pages from the player's documents keep it to the player unless they say otherwise.
140
- const usesSystem = settings.system !== undefined && systemUsed(kept, campaignWorld(root, context), system?.fields ?? {});
141
- const sourced = pages.filter((page) => kept[page.path] !== undefined && page.fields.source !== undefined).map((page) => basename(page.path, ".md"));
173
+ const world = campaignWorld(root, context);
174
+ const none = { carried: {}, pages: [], sourced: [], leftOut: [] };
175
+ const layers = settings.system === undefined ? none : layersToExport(root, world, system?.name ?? settings.system, installedAdventures(root).map((adventure) => adventure.layers));
176
+ const layered = layers.pages.length > 0;
177
+ // The system is needed, with its credits, only where a page uses it (D-489 (6)), and always with layers over its pages (ADV-8); pages from the player's documents
178
+ // keep it to the player unless they say otherwise.
179
+ const usesSystem = settings.system !== undefined && (layered || systemUsed(kept, world, system?.fields ?? {}));
180
+ const sourced = [...pages.filter((page) => kept[page.path] !== undefined && page.fields.source !== undefined).map((page) => basename(page.path, ".md")), ...layers.sourced];
142
181
  const license = credits.license ?? (sourced.length > 0 ? "personal use only" : undefined);
182
+ const attribution = system?.attribution === undefined || !usesSystem ? undefined : layered ? `${system.attribution.trim()} ${changesMade}` : system.attribution;
143
183
  const manifest = {
144
184
  title: manifestLine(settings.name, "title"),
145
185
  about: manifestLine(settings.premise ?? settings.name, "about"),
@@ -147,20 +187,21 @@ export function exportAdventure(root, context, credits) {
147
187
  version: "1.0.0",
148
188
  ...(credits.author === undefined ? {} : { author: credits.author }),
149
189
  ...(license === undefined ? {} : { license }),
150
- ...(system?.attribution === undefined || !usesSystem ? {} : { attribution: system.attribution }),
190
+ ...(attribution === undefined ? {} : { attribution }),
151
191
  needs: { ...(usesSystem ? { system: settings.system } : {}), extensions: listedExtensions(root) },
152
192
  content: [],
153
193
  ...(start === undefined ? {} : { start }),
154
194
  ...(opening === undefined ? {} : { opening: basename(opening.path, ".md") }),
155
195
  };
156
196
  const file = join(root, exportsFolderName, `${settings.name.replace(/[\\/:*?"<>|\u0000-\u001f]/g, "").trim()}.adventure.zip`);
157
- files().writeBytes(file, packAdventure(manifest, kept));
197
+ files().writeBytes(file, packAdventure(manifest, { ...kept, ...layers.carried }));
158
198
  const adventures = adventuresOfLog(log).map((adventure) => adventure.title);
159
199
  return {
160
200
  file,
161
201
  from,
162
202
  pages: Object.keys(kept).filter((path) => path.startsWith(`${worldFolderName}/`)).length,
163
- leftOut: { characters: players.map((page) => basename(page.path, ".md")), adventures },
203
+ layers: layers.pages,
204
+ leftOut: { characters: players.map((page) => basename(page.path, ".md")), adventures, layers: layers.leftOut },
164
205
  ...(sourced.length > 0 && credits.license === undefined ? { sourced } : {}),
165
206
  ...(opening === undefined ? {} : { opening: basename(opening.path, ".md") }),
166
207
  };
@@ -184,8 +225,9 @@ function adventuresOfLog(log) {
184
225
  const data = entry.data;
185
226
  const title = String(data.title ?? "");
186
227
  if (entry.type === "adventure-installed") {
187
- const shift = Number(entry.data.shift ?? 0);
188
- found.push({ title, version: String(data.version ?? ""), ...(entry.date === undefined ? {} : { since: entry.date }), files: textsIn(data.files), shift, entry: entry.id });
228
+ const { shift, layers } = entry.data;
229
+ const since = entry.date === undefined ? {} : { since: entry.date };
230
+ found.push({ title, version: String(data.version ?? ""), ...since, files: textsIn(data.files), layers: layerPrints(layers), shift: Number(shift ?? 0), entry: entry.id });
189
231
  }
190
232
  else if (entry.type === "adventure-removed") {
191
233
  const removed = found.findIndex((one) => comparableText(one.title) === comparableText(title));
@@ -1,9 +1,9 @@
1
1
  // The reading of the player's books apart from the chat (D-491, LIB-3): rules and config start a process of its own, `rpg --read-library`, which reads each
2
2
  // book of this computer's library still to read, its PDF pages without readable text by the system's OCR, and writes its index; one at a time on a computer.
3
3
  import { spawn } from "node:child_process";
4
- import { defaultContext } from "../../core/context.js";
5
- import { readDocument, systemPageReader } from "../../documents/index.js";
6
- import { claimLibrary, dropUnlisted, libraryFolders, readLibrary, releaseLibrary } from "../../library/index.js";
4
+ import { defaultContext } from "../../../core/context.js";
5
+ import { readDocument, systemPageReader } from "../../../documents/index.js";
6
+ import { claimLibrary, dropUnlisted, libraryFolders, readLibrary, releaseLibrary } from "../../../library/index.js";
7
7
  import { libraryScope } from "./library.js";
8
8
  // The argument of the command line that reads the library, as cli.ts takes it: not a command, only what rules starts.
9
9
  const readLibraryArgument = "--read-library";
@@ -1,5 +1,5 @@
1
- import type { Context } from "../../core/context.ts";
2
- import { type LibraryScope, type LibraryState } from "../../library/index.ts";
1
+ import type { Context } from "../../../core/context.ts";
2
+ import { type LibraryScope, type LibraryState } from "../../../library/index.ts";
3
3
  /** What rules shows of the player's books (LIB-7). */
4
4
  export interface LibraryAnswer {
5
5
  /** The languages the books are in, by name, such as Italian. */
@@ -1,15 +1,15 @@
1
1
  // The player's library as the commands use it (D-491): the entries config adds, checked and allowed by the player; what config shows of each; and what rules
2
2
  // finds in the books, after the game system's rules.
3
3
  import { basename, dirname, isAbsolute, join, relative, resolve } from "node:path";
4
- import { campaignFileName, findCampaign, readListSetting, readTextSetting } from "../../campaign/index.js";
5
- import { Refusal } from "../../core/refusal.js";
6
- import { comparableText } from "../../core/text.js";
7
- import { documentAt, documentKinds } from "../../documents/index.js";
8
- import { dropUnlisted, foldersIn, isWithin, libraryFolders, libraryReader, libraryState, mostBooks, samePath, saveLibraryFolders } from "../../library/index.js";
9
- import { bookHeadings, findPages, hasAllWords, pageExcerpt, pageTitle } from "../../rules/index.js";
10
- import { layeredSystemWords, systemContentFolders } from "../../systems/index.js";
11
- import { YesRefused } from "../package.js";
12
- import { languageName } from "./world.js";
4
+ import { campaignFileName, findCampaign, readListSetting, readTextSetting } from "../../../campaign/index.js";
5
+ import { Refusal } from "../../../core/refusal.js";
6
+ import { comparableText } from "../../../core/text.js";
7
+ import { documentAt, documentKinds } from "../../../documents/index.js";
8
+ import { dropUnlisted, foldersIn, isWithin, libraryFolders, libraryReader, libraryState, mostBooks, samePath, saveLibraryFolders } from "../../../library/index.js";
9
+ import { bookHeadings, findPages, hasAllWords, pageExcerpt, pageTitle } from "../../../rules/index.js";
10
+ import { layeredSystemWords, systemContentFolders } from "../../../systems/index.js";
11
+ import { YesRefused } from "../../package/consent.js";
12
+ import { languageName } from "../campaign/world.js";
13
13
  /** What a library takes: the documents the engine reads, outside every campaign (LIB-2). */
14
14
  export const libraryScope = { kinds: documentKinds, skipFoldersWith: campaignFileName };
15
15
  // About how many words each excerpt shows: the first, the second, and the only one when the system has answered (LIB-7); the other pages named.
@@ -1,5 +1,5 @@
1
- import { type RuleSection } from "../../rules/index.ts";
2
- import { type GameSystem } from "../../systems/index.ts";
1
+ import { type RuleSection } from "../../../rules/index.ts";
2
+ import { type GameSystem } from "../../../systems/index.ts";
3
3
  /** The source of the campaign's own rules, in the campaign's rules folder. */
4
4
  export declare const houseRules = "house rules";
5
5
  /** What to do when a precedent and the book disagree (D-181). */
@@ -1,10 +1,10 @@
1
1
  // A rule by its title, as rules finds it (D-179, DAT-3, DAT-6): a house rule of the campaign first, else the game system's, with the table's precedents on it.
2
2
  import { join } from "node:path";
3
- import { houseRulesFolderName, readListSetting, readTextSetting } from "../../campaign/index.js";
4
- import { translationFolder } from "../../core/files.js";
5
- import { comparableText } from "../../core/text.js";
6
- import { isTitled, readRuleBook } from "../../rules/index.js";
7
- import { layeredSystemWords, systemContentFolders } from "../../systems/index.js";
3
+ import { houseRulesFolderName, readListSetting, readTextSetting } from "../../../campaign/index.js";
4
+ import { translationFolder } from "../../../core/files.js";
5
+ import { comparableText } from "../../../core/text.js";
6
+ import { isTitled, readRuleBook } from "../../../rules/index.js";
7
+ import { layeredSystemWords, systemContentFolders } from "../../../systems/index.js";
8
8
  /** The source of the campaign's own rules, in the campaign's rules folder. */
9
9
  export const houseRules = "house rules";
10
10
  /** What to do when a precedent and the book disagree (D-181). */
@@ -1,5 +1,5 @@
1
- import type { Context, SystemTexts } from "../../core/context.ts";
2
- import { type Page, type World } from "../../pages/index.ts";
1
+ import type { Context, SystemTexts } from "../../../core/context.ts";
2
+ import { type Page, type World } from "../../../pages/index.ts";
3
3
  /**
4
4
  * Asks for the game system's pages that these pages show the player in the campaign's language: themselves and their bases, and for a character the pages
5
5
  * its fields link, as its class, its spells and its items (D-539); nothing where the system has its own translation, or nothing translates.
@@ -3,13 +3,13 @@
3
3
  // translated again.
4
4
  import { join } from "node:path";
5
5
  import { stringify } from "yaml";
6
- import { translationFolder } from "../../core/files.js";
7
- import { codeAndBase } from "../../core/language.js";
8
- import { files } from "../../core/store.js";
9
- import { textPrint } from "../../core/text.js";
10
- import { baseChain, findPage, linksIn, versionTranslations } from "../../pages/index.js";
11
- import { answerOf, isGarbled, languageName } from "./page-words.js";
12
- import { campaignSystem, ownTranslationFolder } from "./world.js";
6
+ import { translationFolder } from "../../../core/files.js";
7
+ import { codeAndBase } from "../../../core/language.js";
8
+ import { files } from "../../../core/store.js";
9
+ import { textPrint } from "../../../core/text.js";
10
+ import { baseChain, findPage, linksIn, systemOriginal, versionTranslations } from "../../../pages/index.js";
11
+ import { campaignSystem, ownTranslationFolder } from "../campaign/world.js";
12
+ import { answerOf, isGarbled, languageName } from "./words.js";
13
13
  // How much of the system's text goes in one request, in characters, and at most how many pages.
14
14
  const batchLetters = 12_000;
15
15
  const batchPages = 12;
@@ -34,7 +34,8 @@ export function wantTexts(root, context, world, shown) {
34
34
  }
35
35
  const wanted = new Map();
36
36
  const add = (page) => {
37
- for (const one of page === undefined ? [] : [page, ...baseChain(world, page)]) {
37
+ // The system's own text, never the campaign's layer over it (SYS-11): the translation is of this computer, for every campaign.
38
+ for (const one of page === undefined ? [] : [page, ...baseChain(world, page)].map(systemOriginal)) {
38
39
  // A page of the version of the system's rules is the version's, with a translation of its own (VER-3).
39
40
  const version = found.version !== undefined && files().exists(join(found.version.folder, one.path)) ? found.version : undefined;
40
41
  const path = version === undefined ? one.path : join(versionTranslations(version.name), one.path);
@@ -1,5 +1,5 @@
1
- import type { Context } from "../../core/context.ts";
2
- import { type SystemWords } from "../../systems/index.ts";
1
+ import type { Context } from "../../../core/context.ts";
2
+ import { type SystemWords } from "../../../systems/index.ts";
3
3
  /** What the page has of a language: its phrases so far, whether they are being translated, whether this computer can, and how many it still lacks. */
4
4
  export interface PageWords {
5
5
  phrases: Record<string, string>;