rpg-engine 0.10.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/adventures/placement.js +4 -0
- package/dist/campaign/find-campaign.js +18 -0
- package/dist/campaign/host-files.js +8 -6
- package/dist/campaign/index.d.ts +1 -1
- package/dist/campaign/index.js +1 -1
- package/dist/campaign/settings.d.ts +2 -0
- package/dist/campaign/settings.js +12 -5
- package/dist/commands/advance.js +1 -1
- package/dist/commands/ask.js +1 -1
- package/dist/commands/config.js +21 -32
- package/dist/commands/import/import.js +1 -1
- package/dist/commands/instructions.js +1 -1
- package/dist/commands/mode.js +1 -1
- package/dist/commands/mood.js +2 -3
- package/dist/commands/move.js +1 -1
- package/dist/commands/package.js +2 -2
- package/dist/commands/reveal.js +1 -1
- package/dist/commands/roll/roll.js +6 -12
- package/dist/commands/rules.js +0 -1
- package/dist/commands/scene.js +6 -8
- package/dist/commands/shared/adventures.js +1 -1
- package/dist/commands/shared/images.js +3 -1
- package/dist/commands/shared/knowledge.d.ts +8 -0
- package/dist/commands/shared/knowledge.js +41 -18
- package/dist/commands/shared/mode.d.ts +7 -4
- package/dist/commands/shared/mode.js +28 -15
- package/dist/commands/shared/packages/code.js +13 -2
- package/dist/commands/shared/page-words.d.ts +2 -0
- package/dist/commands/shared/page-words.js +13 -0
- package/dist/commands/shared/sheet.d.ts +3 -2
- package/dist/commands/shared/sheet.js +8 -5
- package/dist/commands/show.js +1 -1
- package/dist/commands/status.js +9 -5
- package/dist/commands/view/place.js +9 -3
- package/dist/commands/write/write.js +4 -3
- package/dist/core/archive-paths.js +1 -1
- package/dist/core/package-api.d.ts +1 -1
- package/dist/core/package-declarations.d.ts +3 -3
- package/dist/core/package-declarations.js +3 -3
- package/dist/core/store.d.ts +4 -0
- package/dist/core/store.js +20 -1
- package/dist/dashboard/app.js +8 -8
- package/dist/dashboard/asked.js +2 -2
- package/dist/dashboard/dice/throw.js +2 -1
- package/dist/dashboard/dice/tray.js +1 -1
- package/dist/dashboard/guide/ar.md +13 -13
- package/dist/dashboard/guide/cs.md +11 -11
- package/dist/dashboard/guide/da.md +12 -12
- package/dist/dashboard/guide/de.md +11 -11
- package/dist/dashboard/guide/el.md +13 -13
- package/dist/dashboard/guide/en.md +2 -2
- package/dist/dashboard/guide/es.md +12 -12
- package/dist/dashboard/guide/fi.md +15 -15
- package/dist/dashboard/guide/fr.md +11 -11
- package/dist/dashboard/guide/he.md +10 -10
- package/dist/dashboard/guide/hi.md +15 -15
- package/dist/dashboard/guide/hu.md +12 -12
- package/dist/dashboard/guide/is.md +10 -10
- package/dist/dashboard/guide/it.md +3 -3
- package/dist/dashboard/guide/ja.md +11 -11
- package/dist/dashboard/guide/ko.md +14 -14
- package/dist/dashboard/guide/nb.md +12 -12
- package/dist/dashboard/guide/nl.md +13 -13
- package/dist/dashboard/guide/pl.md +12 -12
- package/dist/dashboard/guide/pt.md +9 -9
- package/dist/dashboard/guide/ro.md +12 -12
- package/dist/dashboard/guide/ru.md +11 -11
- package/dist/dashboard/guide/sv.md +11 -11
- package/dist/dashboard/guide/tr.md +14 -14
- package/dist/dashboard/guide/uk.md +11 -11
- package/dist/dashboard/guide/zh.md +13 -13
- package/dist/dashboard/i18n/ar.json +1 -0
- package/dist/dashboard/i18n/cs.json +1 -0
- package/dist/dashboard/i18n/da.json +1 -0
- package/dist/dashboard/i18n/de.json +1 -0
- package/dist/dashboard/i18n/el.json +1 -0
- package/dist/dashboard/i18n/es.json +1 -0
- package/dist/dashboard/i18n/fi.json +1 -0
- package/dist/dashboard/i18n/fr.json +1 -0
- package/dist/dashboard/i18n/he.json +1 -0
- package/dist/dashboard/i18n/hi.json +1 -0
- package/dist/dashboard/i18n/hu.json +1 -0
- package/dist/dashboard/i18n/is.json +1 -0
- package/dist/dashboard/i18n/it.json +1 -0
- package/dist/dashboard/i18n/ja.json +1 -0
- package/dist/dashboard/i18n/ko.json +1 -0
- package/dist/dashboard/i18n/nb.json +1 -0
- package/dist/dashboard/i18n/nl.json +1 -0
- package/dist/dashboard/i18n/pl.json +1 -0
- package/dist/dashboard/i18n/pt.json +1 -0
- package/dist/dashboard/i18n/ro.json +1 -0
- package/dist/dashboard/i18n/ru.json +1 -0
- package/dist/dashboard/i18n/sv.json +1 -0
- package/dist/dashboard/i18n/tr.json +1 -0
- package/dist/dashboard/i18n/uk.json +1 -0
- package/dist/dashboard/i18n/zh.json +1 -0
- package/dist/dashboard/journal.js +1 -1
- package/dist/dashboard/packages/packages.js +5 -5
- package/dist/dashboard/packages/widgets.js +1 -1
- package/dist/dashboard/settings.js +2 -2
- package/dist/dashboard/setup.js +1 -1
- package/dist/dashboard/world/lore.js +1 -1
- package/dist/dashboard/world/world.js +1 -1
- package/dist/dice/index.d.ts +1 -1
- package/dist/dice/oracle.d.ts +5 -3
- package/dist/dice/oracle.js +7 -6
- package/dist/helpers/codex.js +1 -1
- package/dist/packages/npm.js +13 -2
- package/dist/pages/index.d.ts +1 -1
- package/dist/pages/index.js +1 -1
- package/dist/pages/markdown.d.ts +2 -0
- package/dist/pages/markdown.js +21 -0
- package/dist/pages/world.js +4 -0
- package/dist/server/dashboard/files.js +3 -3
- package/dist/server/dashboard/index.js +8 -4
- package/dist/server/mcp.d.ts +3 -1
- package/dist/server/mcp.js +20 -5
- package/dist/systems/game-system.d.ts +2 -0
- package/dist/systems/game-system.js +2 -0
- package/instructions/adventure.md +1 -1
- package/instructions/combat.md +1 -1
- package/instructions/core.md +2 -2
- package/instructions/import.md +1 -0
- package/instructions/session-zero.md +1 -1
- package/instructions/session.md +1 -1
- package/instructions/setup.md +1 -1
- package/package.json +10 -10
- package/systems/free/instructions/outcomes-rolled.md +1 -1
- package/systems/free/instructions/outcomes-tossed.md +1 -1
- package/systems/free/instructions/play.md +1 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Translated from en.md, part by part, by npm run translate: c38df721 53ff5eaa 9f1774ef 4c5cd093 019e9516 8e136927
|
|
1
|
+
<!-- Translated from en.md, part by part, by npm run translate: c38df721 53ff5eaa 9f1774ef 4c5cd093 019e9516 8e136927 95c609b6 423af5fa 17577253 4c3ea82e 2731ea0e 59c1a762. Change the English, then run it again. -->
|
|
2
2
|
# RPG Engine: повний посібник
|
|
3
3
|
|
|
4
4
|
**RPG Engine** дає змогу грати в настільну рольову гру, де **майстром є ШІ**. Ти спілкуєшся з майстром у **чаті**, а RPG Engine працює за лаштунками: він **пам'ятає світ**, **кидає кубики** і **веде облік**. Поруч із чатом у браузері відкрита сторінка, **панель керування**, де є твій аркуш персонажа, кубики, мапи та журнал.
|
|
@@ -218,25 +218,25 @@ RPG Engine може створювати зображення місць, до
|
|
|
218
218
|
|
|
219
219
|
### 5.1 Що таке ігрова система
|
|
220
220
|
|
|
221
|
-
Це дані однієї гри:
|
|
221
|
+
Це дані однієї гри: аркуш персонажа, числа, істоти, предмети, закляття й текст правил. Кожна кампанія грає в одну систему. RPG Engine підраховує дані аркуша, а також те, що витрачається й відновлюється. Як працює та чи інша здатність, майстер читає в правилах і вирішує сам, як за столом.
|
|
222
222
|
|
|
223
223
|
### 5.2 П'ята редакція
|
|
224
224
|
|
|
225
|
-
Раси, класи, підкласи, передісторія та риса з SRD 5.1; 319 заклять, зброя, обладунки, магічні предмети й монстри; розділи правил, які майстер читає за точним текстом; повний аркуш персонажа з усіма
|
|
225
|
+
Раси, класи, підкласи, передісторія та риса з SRD 5.1; 319 заклять, зброя, обладунки, магічні предмети й монстри; розділи правил, які майстер читає за точним текстом; повний аркуш персонажа з усіма підрахунками.
|
|
226
226
|
|
|
227
|
-
Це окремий пакет: майстер пропонує його, коли ти налаштовуєш кампанію, і встановлює.
|
|
227
|
+
Це окремий пакет: майстер пропонує його, коли ти налаштовуєш кампанію, і встановлює. Якщо кампанія грає за цими правилами, пакет встановлюється сам, коли кампанію вперше відкривають на комп'ютері без нього. Майстер повідомить тебе про це.
|
|
228
228
|
|
|
229
|
-
|
|
229
|
+
Можна також грати за матеріалами, яких немає в SRD, з книги, що в тебе є: майстер записує їх як сторінки твоєї кампанії, і RPG Engine сприймає їх як свої. RPG Engine постачається лише з відкритим вмістом, але те, що знає майстер, нічим не обмежене.
|
|
230
230
|
|
|
231
|
-
Твої власні посібники можуть стати твоєю бібліотекою: скажи майстру, де вони лежать, *[Мої посібники лежать у D:\Books\5e.]*, або додай їхню теку в Packages › Library і один раз
|
|
231
|
+
Твої власні посібники можуть стати твоєю бібліотекою: скажи майстру, де вони лежать, *[Мої посібники лежать у D:\Books\5e.]*, або додай їхню теку в розділі Packages › Library і один раз підтверди у вікні, яке покаже комп'ютер. RPG Engine читає їх на цьому комп'ютері; кожна кампанія використовує теки, які ти там увімкнеш(-ла). Коли майстер вирішує питання правил, він шукає в них після SRD і вказує книгу та сторінку. Найкраще читаються текстові файли або PDF із виділюваним текстом. Відсканований PDF читається з картинок сторінок, лише у Windows, за кілька хвилин і з певною кількістю помилок. RPG Engine ніколи не змінює твої посібники, нікуди не надсилає їхній текст і не копіює його в кампанію.
|
|
232
232
|
|
|
233
233
|
### 5.3 Домашні правила та твої власні доповнення
|
|
234
234
|
|
|
235
|
-
Попроси майстра: *[Домашнє правило: натуральна 1
|
|
235
|
+
Попроси майстра: *[Домашнє правило: натуральна 1 під час атаки означає, що зброя випадає з рук.]* Майстер збереже це як домовленість за столом або запише сторінку чи число аркуша персонажа, якщо це потрібно. Уже готові домашні правила можна додати як текстові файли в теку `rules` кампанії.
|
|
236
236
|
|
|
237
237
|
### 5.4 Додавання або імпорт власної ігрової системи
|
|
238
238
|
|
|
239
|
-
Ігрова система — це пакет: майстер встановлює його з npm,
|
|
239
|
+
Ігрова система — це пакет: майстер встановлює його з npm, теки або файлу. Пакет не від нас він встановлює лише з твоєї згоди, у формі твого агента або у вікні комп'ютера. Створення такого пакета — робота для розробника, вона описана в документах RPG Engine на GitHub. Перетворити свою книгу на ігрову систему поки що неможливо ([Незабаром](#9-coming-later)).
|
|
240
240
|
|
|
241
241
|
---
|
|
242
242
|
|
|
@@ -264,11 +264,11 @@ RPG Engine може створювати зображення місць, до
|
|
|
264
264
|
|
|
265
265
|
## 8. Для допитливих: тека кампанії <!-- icon: list -->
|
|
266
266
|
|
|
267
|
-
Відкривати її не
|
|
267
|
+
Відкривати її тобі ніколи не потрібно, а ще в ній зберігаються секрети твоєї кампанії. У ній є `campaign.yaml` (твої налаштування), `state.yaml` (поточний стан гри), `world/` (по одній сторінці markdown для кожного персонажа, місця, завдання та решти), `rules/` (твої домашні правила), `images/`, `log.jsonl` (кожна зміна), `.saves/`, `.player/` (твої нотатки) і невеликі файли, що кажуть ШІ-агентам, де RPG Engine. Сторінки мають формат Obsidian. Якщо ти змінюєш сторінку вручну, майстер дізнається про це в наступній відповіді.
|
|
268
268
|
|
|
269
|
-
RPG Engine
|
|
269
|
+
RPG Engine працює лише в цій теці: читає й записує гру тільки тут і ніколи не чіпає інших твоїх файлів; теки з твоїми посібниками він тільки читає. Поза нею він зберігає лише власні теки з даними (переклади панелі, текст, прочитаний із твоїх посібників, а також Codex або Claude Code, якщо дозволиш їх встановити) і тимчасові теки, поки малюється картинка. Усе інше, що агент захоче зробити на твоєму комп'ютері, він спершу спитає в тебе. Ігрова система чи розширення — це код, як і будь-який пакет npm: пакет не від нас запускається на твоєму комп'ютері з твоїми правами, а RPG Engine встановлює його лише з твоєї згоди, у формі твого агента або у вікні комп'ютера. Погоджуйся лише на пакети, чиїм авторам довіряєш.
|
|
270
270
|
|
|
271
|
-
Кожну
|
|
271
|
+
Кожну команду, яку використовує майстер, можна запустити і в теці кампанії: `rpg --help` покаже їх список. Багато з них виводять секрети кампанії.
|
|
272
272
|
|
|
273
273
|
---
|
|
274
274
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Translated from en.md, part by part, by npm run translate: c38df721 53ff5eaa 9f1774ef 4c5cd093 019e9516 8e136927
|
|
1
|
+
<!-- Translated from en.md, part by part, by npm run translate: c38df721 53ff5eaa 9f1774ef 4c5cd093 019e9516 8e136927 95c609b6 423af5fa 17577253 4c3ea82e 2731ea0e 59c1a762. Change the English, then run it again. -->
|
|
2
2
|
# RPG Engine:完整指南
|
|
3
3
|
|
|
4
4
|
**RPG Engine** 让你和一位 **AI 主持人**一起玩桌面角色扮演游戏。你在**聊天**里和主持人交谈;RPG Engine 在幕后工作:它**记住世界**,**掷骰子**,**记账**。聊天旁边,你在浏览器里开着一个页面,也就是**仪表盘**,上面有你的角色卡、骰子、地图和日志。
|
|
@@ -214,29 +214,29 @@ RPG Engine 可以按**图片**设置,为你到达的地点、接下的任务
|
|
|
214
214
|
|
|
215
215
|
---
|
|
216
216
|
|
|
217
|
-
## 5.
|
|
217
|
+
## 5. 游戏系统与房规 <!-- icon: dice -->
|
|
218
218
|
|
|
219
219
|
### 5.1 什么是游戏系统
|
|
220
220
|
|
|
221
|
-
|
|
221
|
+
一款游戏的全部数据:角色卡、数值、生物、物品、法术和规则文本。每个战役只玩一种系统。RPG Engine 负责计算角色卡,以及消耗和恢复的资源;某项能力具体如何生效,由主持人查阅规则后裁定,就像在牌桌上一样。
|
|
222
222
|
|
|
223
223
|
### 5.2 第五版
|
|
224
224
|
|
|
225
|
-
包含 SRD 5.1
|
|
225
|
+
包含 SRD 5.1 的种族、职业、子职业、一个背景和一个专长;319 个法术,以及武器、护甲、魔法物品和怪物;还有规则章节,主持人会按原文查阅;以及完整的、已算好的角色卡。
|
|
226
226
|
|
|
227
|
-
|
|
227
|
+
它是一个独立的包:你设置战役时,主持人会提议使用它,并为你安装。玩这套系统的战役,第一次在没有安装它的电脑上打开时,会自动安装,主持人也会告诉你。
|
|
228
228
|
|
|
229
|
-
|
|
229
|
+
SRD 里没有的内容,你也可以玩,只要来自你自己拥有的书:主持人会把它写成你战役的页面,RPG Engine 将它们视为自己的内容。RPG Engine 只附带开放内容;主持人所知道的则不受此限。
|
|
230
230
|
|
|
231
|
-
|
|
231
|
+
你自己的手册可以成为你的资料库:告诉主持人它们在哪里,*[我的手册在 D:\Books\5e。]*,或者在 Packages › Library 中添加它们所在的文件夹,并在电脑弹出的窗口里点一次“是”。RPG Engine 会在这台电脑上读取它们;每个战役使用你在那里打开的文件夹,主持人在裁定规则时会在 SRD 之后搜索这些手册,并注明书名和页码。纯文本,或文字可以选中的 PDF,读取效果最好;扫描版 PDF 则是根据页面图片来识别的,只支持 Windows,需要几分钟,也会有少量错误。RPG Engine 绝不会修改你的手册,绝不会把手册文字发送到任何地方,也绝不会把它复制进战役。
|
|
232
232
|
|
|
233
|
-
### 5.3
|
|
233
|
+
### 5.3 房规与你自己的补充
|
|
234
234
|
|
|
235
|
-
|
|
235
|
+
对主持人说:*[房规:攻击掷出自然 1 时,武器会脱手。]* 主持人会把它记为牌桌上的约定;需要时,也会写成一个页面,或角色卡上的一个数值。已经写好的房规,可以作为文本文件放进战役的 `rules` 文件夹。
|
|
236
236
|
|
|
237
237
|
### 5.4 添加或导入你自己的游戏系统
|
|
238
238
|
|
|
239
|
-
游戏系统是一个包:主持人可以从 npm
|
|
239
|
+
游戏系统是一个包:主持人可以从 npm、文件夹或文件安装。不是我们提供的包,只有在你同意后才会安装,你可以在 AI 助手的表单或电脑的窗口中确认。制作游戏系统是开发者的工作,详见 RPG Engine 在 GitHub 上的文档。把你的书变成游戏系统,目前还不支持([后续推出](#9-coming-later))。
|
|
240
240
|
|
|
241
241
|
---
|
|
242
242
|
|
|
@@ -264,11 +264,11 @@ RPG Engine 可以按**图片**设置,为你到达的地点、接下的任务
|
|
|
264
264
|
|
|
265
265
|
## 8. 好奇者专区:战役文件夹 <!-- icon: list -->
|
|
266
266
|
|
|
267
|
-
|
|
267
|
+
你完全不需要打开它,而且里面存着你战役的秘密。其中有 `campaign.yaml`(你的设置)、`state.yaml`(游戏进行到哪里)、`world/`(每个角色、地点、任务等各占一页 markdown)、`rules/`(你的房规)、`images/`、`log.jsonl`(每一次改动)、`.saves/`、`.player/`(你的笔记),以及告诉 AI 助手 RPG Engine 在哪里的几个小文件。页面采用 Obsidian 的格式。如果你手动修改了某个页面,主持人会在下一次回答时得知。
|
|
268
268
|
|
|
269
|
-
RPG Engine
|
|
269
|
+
RPG Engine 只在这个文件夹内活动:它只在这里读写游戏,绝不会碰你的其他文件;你的手册所在的文件夹,它只读取。在这个文件夹之外,它只保留自己的数据文件夹(仪表盘的翻译、它从你的手册中读出的文字,以及你允许安装的 Codex 或 Claude Code),还有绘制图片时用到的临时文件夹。你的 AI 助手若想在电脑上做别的事,都会先征求你的同意。游戏系统或扩展就是代码,和所有 npm 包一样:不是我们提供的包,会以你的权限在你的电脑上运行,RPG Engine 只有在你同意后才会安装,你可以在 AI 助手的表单或电脑的窗口中确认。只对你信任其作者的包说“是”。
|
|
270
270
|
|
|
271
|
-
|
|
271
|
+
主持人用到的每一条命令,也都可以在战役文件夹里运行:`rpg --help` 会列出它们。许多命令会打印出战役的秘密。
|
|
272
272
|
|
|
273
273
|
---
|
|
274
274
|
|
|
@@ -946,6 +946,7 @@
|
|
|
946
946
|
"The story starts on day {day}": "تبدأ القصة في اليوم {day}",
|
|
947
947
|
"The story starts on day {day}, {time}": "تبدأ القصة في اليوم {day}، {time}",
|
|
948
948
|
"The story starts with the first scene.": "تبدأ القصة بالمشهد الأول.",
|
|
949
|
+
"The text above lies behind the master's screen, forbidden to the players' eyes.": "النص أعلاه خلف حاجز مدير اللعبة، ومحظور على أعين اللاعبين.",
|
|
949
950
|
"The title of the note {title}": "عنوان الملاحظة {title}",
|
|
950
951
|
"the top bar": "الشريط العلوي",
|
|
951
952
|
"the units of the story": "وحدات القياس في القصة",
|
|
@@ -946,6 +946,7 @@
|
|
|
946
946
|
"The story starts on day {day}": "Příběh začíná dne {day}",
|
|
947
947
|
"The story starts on day {day}, {time}": "Příběh začíná dne {day}, {time}",
|
|
948
948
|
"The story starts with the first scene.": "Příběh začíná první scénou.",
|
|
949
|
+
"The text above lies behind the master's screen, forbidden to the players' eyes.": "Text výše je schovaný za zástěnou Pána jeskyně a hráčům je zakázáno ho vidět.",
|
|
949
950
|
"The title of the note {title}": "Název poznámky {title}",
|
|
950
951
|
"the top bar": "horní lišta",
|
|
951
952
|
"the units of the story": "jednotky v příběhu",
|
|
@@ -946,6 +946,7 @@
|
|
|
946
946
|
"The story starts on day {day}": "Historien begynder på dag {day}",
|
|
947
947
|
"The story starts on day {day}, {time}": "Historien begynder på dag {day}, {time}",
|
|
948
948
|
"The story starts with the first scene.": "Historien starter med den første scene.",
|
|
949
|
+
"The text above lies behind the master's screen, forbidden to the players' eyes.": "Teksten ovenfor ligger bag spillederens skærm og er forbudt for spillernes øjne.",
|
|
949
950
|
"The title of the note {title}": "Titlen på noten {title}",
|
|
950
951
|
"the top bar": "den øverste bjælke",
|
|
951
952
|
"the units of the story": "historiens måleenheder",
|
|
@@ -946,6 +946,7 @@
|
|
|
946
946
|
"The story starts on day {day}": "Die Geschichte beginnt an Tag {day}",
|
|
947
947
|
"The story starts on day {day}, {time}": "Die Geschichte beginnt an Tag {day}, {time}",
|
|
948
948
|
"The story starts with the first scene.": "Die Geschichte beginnt mit der ersten Szene.",
|
|
949
|
+
"The text above lies behind the master's screen, forbidden to the players' eyes.": "Der Text oben liegt hinter dem Schirm der Spielleitung und ist für die Augen der Spielenden tabu.",
|
|
949
950
|
"The title of the note {title}": "Titel der Notiz {title}",
|
|
950
951
|
"the top bar": "die obere Leiste",
|
|
951
952
|
"the units of the story": "die Maßeinheiten der Geschichte",
|
|
@@ -946,6 +946,7 @@
|
|
|
946
946
|
"The story starts on day {day}": "Η ιστορία ξεκινά την ημέρα {day}",
|
|
947
947
|
"The story starts on day {day}, {time}": "Η ιστορία ξεκινά την ημέρα {day}, {time}",
|
|
948
948
|
"The story starts with the first scene.": "Η ιστορία ξεκινά με την πρώτη σκηνή.",
|
|
949
|
+
"The text above lies behind the master's screen, forbidden to the players' eyes.": "Το κείμενο παραπάνω βρίσκεται πίσω από το παραβάν του αφηγητή, απαγορευμένο για τα μάτια των παικτών.",
|
|
949
950
|
"The title of the note {title}": "Ο τίτλος της σημείωσης {title}",
|
|
950
951
|
"the top bar": "η πάνω γραμμή",
|
|
951
952
|
"the units of the story": "οι μονάδες μέτρησης της ιστορίας",
|
|
@@ -946,6 +946,7 @@
|
|
|
946
946
|
"The story starts on day {day}": "La historia comienza el día {day}",
|
|
947
947
|
"The story starts on day {day}, {time}": "La historia comienza el día {day}, {time}",
|
|
948
948
|
"The story starts with the first scene.": "La historia empieza con la primera escena.",
|
|
949
|
+
"The text above lies behind the master's screen, forbidden to the players' eyes.": "El texto de arriba está detrás de la pantalla del máster, vetado a la vista de los jugadores.",
|
|
949
950
|
"The title of the note {title}": "El título de la nota {title}",
|
|
950
951
|
"the top bar": "la barra superior",
|
|
951
952
|
"the units of the story": "las unidades de medida de la historia",
|
|
@@ -946,6 +946,7 @@
|
|
|
946
946
|
"The story starts on day {day}": "Tarina alkaa päivänä {day}",
|
|
947
947
|
"The story starts on day {day}, {time}": "Tarina alkaa päivänä {day}, {time}",
|
|
948
948
|
"The story starts with the first scene.": "Tarina alkaa ensimmäisestä kohtauksesta.",
|
|
949
|
+
"The text above lies behind the master's screen, forbidden to the players' eyes.": "Yllä oleva teksti on pelinjohtajan suojan takana, pelaajien silmiltä kiellettynä.",
|
|
949
950
|
"The title of the note {title}": "Muistiinpanon {title} otsikko",
|
|
950
951
|
"the top bar": "yläpalkki",
|
|
951
952
|
"the units of the story": "tarinan mittayksiköt",
|
|
@@ -946,6 +946,7 @@
|
|
|
946
946
|
"The story starts on day {day}": "L'histoire commence au jour {day}",
|
|
947
947
|
"The story starts on day {day}, {time}": "L'histoire commence au jour {day}, {time}",
|
|
948
948
|
"The story starts with the first scene.": "L'histoire commence avec la première scène.",
|
|
949
|
+
"The text above lies behind the master's screen, forbidden to the players' eyes.": "Le texte ci-dessus se trouve derrière l'écran du MJ, interdit aux regards des joueurs.",
|
|
949
950
|
"The title of the note {title}": "Le titre de la note {title}",
|
|
950
951
|
"the top bar": "la barre du haut",
|
|
951
952
|
"the units of the story": "les unités de l'histoire",
|
|
@@ -946,6 +946,7 @@
|
|
|
946
946
|
"The story starts on day {day}": "הסיפור מתחיל ביום {day}",
|
|
947
947
|
"The story starts on day {day}, {time}": "הסיפור מתחיל ביום {day}, {time}",
|
|
948
948
|
"The story starts with the first scene.": "הסיפור מתחיל בסצנה הראשונה.",
|
|
949
|
+
"The text above lies behind the master's screen, forbidden to the players' eyes.": "הטקסט שלמעלה נמצא מאחורי מסך המנחה, אסור לעיני השחקנים.",
|
|
949
950
|
"The title of the note {title}": "כותרת הפתק {title}",
|
|
950
951
|
"the top bar": "הסרגל העליון",
|
|
951
952
|
"the units of the story": "יחידות המידה של הסיפור",
|
|
@@ -946,6 +946,7 @@
|
|
|
946
946
|
"The story starts on day {day}": "कहानी दिन {day} से शुरू होती है",
|
|
947
947
|
"The story starts on day {day}, {time}": "कहानी दिन {day}, {time} से शुरू होती है",
|
|
948
948
|
"The story starts with the first scene.": "कहानी पहले दृश्य से शुरू होती है।",
|
|
949
|
+
"The text above lies behind the master's screen, forbidden to the players' eyes.": "ऊपर का टेक्स्ट गेम मास्टर की स्क्रीन के पीछे है, खिलाड़ियों की नज़र से छिपा हुआ।",
|
|
949
950
|
"The title of the note {title}": "नोट {title} का शीर्षक",
|
|
950
951
|
"the top bar": "ऊपरी बार",
|
|
951
952
|
"the units of the story": "कहानी की माप-इकाइयाँ",
|
|
@@ -946,6 +946,7 @@
|
|
|
946
946
|
"The story starts on day {day}": "A történet a(z) {day}. napon kezdődik",
|
|
947
947
|
"The story starts on day {day}, {time}": "A történet a(z) {day}. napon kezdődik, {time}",
|
|
948
948
|
"The story starts with the first scene.": "A történet az első jelenettel indul.",
|
|
949
|
+
"The text above lies behind the master's screen, forbidden to the players' eyes.": "A fenti szöveg a mesélő paravánja mögött található, a játékosok elől elzárva.",
|
|
949
950
|
"The title of the note {title}": "A(z) „{title}” jegyzet címe",
|
|
950
951
|
"the top bar": "a felső sáv",
|
|
951
952
|
"the units of the story": "a történet mértékegységei",
|
|
@@ -946,6 +946,7 @@
|
|
|
946
946
|
"The story starts on day {day}": "Sagan hefst á degi {day}",
|
|
947
947
|
"The story starts on day {day}, {time}": "Sagan hefst á degi {day}, {time}",
|
|
948
948
|
"The story starts with the first scene.": "Sagan byrjar með fyrsta atriðinu.",
|
|
949
|
+
"The text above lies behind the master's screen, forbidden to the players' eyes.": "Textinn hér að ofan er á bak við skjá sögumannsins og bannaður augum leikmanna.",
|
|
949
950
|
"The title of the note {title}": "Titill minnisblaðsins {title}",
|
|
950
951
|
"the top bar": "efri stikan",
|
|
951
952
|
"the units of the story": "mælieiningar sögunnar",
|
|
@@ -946,6 +946,7 @@
|
|
|
946
946
|
"The story starts on day {day}": "La storia comincia il giorno {day}",
|
|
947
947
|
"The story starts on day {day}, {time}": "La storia comincia il giorno {day}, {time}",
|
|
948
948
|
"The story starts with the first scene.": "La storia comincia con la prima scena.",
|
|
949
|
+
"The text above lies behind the master's screen, forbidden to the players' eyes.": "Il testo qui sopra sta dietro lo schermo del master, proibito agli occhi dei giocatori.",
|
|
949
950
|
"The title of the note {title}": "Il titolo della nota {title}",
|
|
950
951
|
"the top bar": "la barra in alto",
|
|
951
952
|
"the units of the story": "le unità di misura della storia",
|
|
@@ -946,6 +946,7 @@
|
|
|
946
946
|
"The story starts on day {day}": "物語は{day}日目から始まります",
|
|
947
947
|
"The story starts on day {day}, {time}": "物語は{day}日目の{time}から始まります",
|
|
948
948
|
"The story starts with the first scene.": "ストーリーは最初のシーンから始まります。",
|
|
949
|
+
"The text above lies behind the master's screen, forbidden to the players' eyes.": "上の文章はGMスクリーンの裏側にあり、プレイヤーには見せられません。",
|
|
949
950
|
"The title of the note {title}": "メモ「{title}」のタイトル",
|
|
950
951
|
"the top bar": "上部バー",
|
|
951
952
|
"the units of the story": "物語で使う単位",
|
|
@@ -946,6 +946,7 @@
|
|
|
946
946
|
"The story starts on day {day}": "이야기는 {day}일에 시작돼요",
|
|
947
947
|
"The story starts on day {day}, {time}": "이야기는 {day}일 {time}에 시작돼요",
|
|
948
948
|
"The story starts with the first scene.": "이야기는 첫 장면과 함께 시작돼요.",
|
|
949
|
+
"The text above lies behind the master's screen, forbidden to the players' eyes.": "위 내용은 GM 스크린 뒤에 있는 내용이라 플레이어에게는 보이지 않아요.",
|
|
949
950
|
"The title of the note {title}": "메모 {title}의 제목",
|
|
950
951
|
"the top bar": "상단 바",
|
|
951
952
|
"the units of the story": "이야기의 단위",
|
|
@@ -946,6 +946,7 @@
|
|
|
946
946
|
"The story starts on day {day}": "Historien begynner på dag {day}",
|
|
947
947
|
"The story starts on day {day}, {time}": "Historien begynner på dag {day}, {time}",
|
|
948
948
|
"The story starts with the first scene.": "Historien begynner med den første scenen.",
|
|
949
|
+
"The text above lies behind the master's screen, forbidden to the players' eyes.": "Teksten ovenfor ligger bak spillederens skjerm, skjult for spillernes øyne.",
|
|
949
950
|
"The title of the note {title}": "Tittelen på notatet {title}",
|
|
950
951
|
"the top bar": "toppfeltet",
|
|
951
952
|
"the units of the story": "enhetene i historien",
|
|
@@ -946,6 +946,7 @@
|
|
|
946
946
|
"The story starts on day {day}": "Het verhaal begint op dag {day}",
|
|
947
947
|
"The story starts on day {day}, {time}": "Het verhaal begint op dag {day}, {time}",
|
|
948
948
|
"The story starts with the first scene.": "Het verhaal begint met de eerste scène.",
|
|
949
|
+
"The text above lies behind the master's screen, forbidden to the players' eyes.": "De tekst hierboven ligt achter het scherm van de spelleider, verboden voor de ogen van de spelers.",
|
|
949
950
|
"The title of the note {title}": "De titel van de notitie {title}",
|
|
950
951
|
"the top bar": "de bovenbalk",
|
|
951
952
|
"the units of the story": "de eenheden van het verhaal",
|
|
@@ -946,6 +946,7 @@
|
|
|
946
946
|
"The story starts on day {day}": "Historia zaczyna się w dniu {day}",
|
|
947
947
|
"The story starts on day {day}, {time}": "Historia zaczyna się w dniu {day}, {time}",
|
|
948
948
|
"The story starts with the first scene.": "Historia zaczyna się od pierwszej sceny.",
|
|
949
|
+
"The text above lies behind the master's screen, forbidden to the players' eyes.": "Tekst powyżej znajduje się za ekranem Mistrza Gry i jest ukryty przed oczami graczy.",
|
|
949
950
|
"The title of the note {title}": "Tytuł notatki {title}",
|
|
950
951
|
"the top bar": "górny pasek",
|
|
951
952
|
"the units of the story": "jednostki miar w fabule",
|
|
@@ -946,6 +946,7 @@
|
|
|
946
946
|
"The story starts on day {day}": "A história começa no dia {day}",
|
|
947
947
|
"The story starts on day {day}, {time}": "A história começa no dia {day}, {time}",
|
|
948
948
|
"The story starts with the first scene.": "A história começa com a primeira cena.",
|
|
949
|
+
"The text above lies behind the master's screen, forbidden to the players' eyes.": "O texto acima está atrás da tela do mestre, proibido aos olhos de quem joga.",
|
|
949
950
|
"The title of the note {title}": "O título da nota {title}",
|
|
950
951
|
"the top bar": "a barra superior",
|
|
951
952
|
"the units of the story": "as unidades de medida da história",
|
|
@@ -946,6 +946,7 @@
|
|
|
946
946
|
"The story starts on day {day}": "Povestea începe în ziua {day}",
|
|
947
947
|
"The story starts on day {day}, {time}": "Povestea începe în ziua {day}, {time}",
|
|
948
948
|
"The story starts with the first scene.": "Povestea începe cu prima scenă.",
|
|
949
|
+
"The text above lies behind the master's screen, forbidden to the players' eyes.": "Textul de mai sus se află în spatele paravanului maestrului de joc, ascuns privirilor jucătorilor.",
|
|
949
950
|
"The title of the note {title}": "Titlul notiței {title}",
|
|
950
951
|
"the top bar": "bara de sus",
|
|
951
952
|
"the units of the story": "unitățile de măsură ale poveștii",
|
|
@@ -946,6 +946,7 @@
|
|
|
946
946
|
"The story starts on day {day}": "История начинается в день {day}",
|
|
947
947
|
"The story starts on day {day}, {time}": "История начинается в день {day}, {time}",
|
|
948
948
|
"The story starts with the first scene.": "История начнётся с первой сцены.",
|
|
949
|
+
"The text above lies behind the master's screen, forbidden to the players' eyes.": "Текст выше скрыт за ширмой мастера — игрокам смотреть запрещено.",
|
|
949
950
|
"The title of the note {title}": "Название заметки {title}",
|
|
950
951
|
"the top bar": "верхняя панель",
|
|
951
952
|
"the units of the story": "единицы измерения в истории",
|
|
@@ -946,6 +946,7 @@
|
|
|
946
946
|
"The story starts on day {day}": "Berättelsen börjar dag {day}",
|
|
947
947
|
"The story starts on day {day}, {time}": "Berättelsen börjar dag {day}, {time}",
|
|
948
948
|
"The story starts with the first scene.": "Berättelsen börjar med den första scenen.",
|
|
949
|
+
"The text above lies behind the master's screen, forbidden to the players' eyes.": "Texten ovan ligger bakom spelledarens skärm, förbjuden för spelarnas ögon.",
|
|
949
950
|
"The title of the note {title}": "Titeln på anteckningen {title}",
|
|
950
951
|
"the top bar": "översta fältet",
|
|
951
952
|
"the units of the story": "berättelsens måttenheter",
|
|
@@ -946,6 +946,7 @@
|
|
|
946
946
|
"The story starts on day {day}": "Hikâye {day}. günde başlıyor",
|
|
947
947
|
"The story starts on day {day}, {time}": "Hikâye {day}. gün, {time} saatinde başlıyor",
|
|
948
948
|
"The story starts with the first scene.": "Hikâye ilk sahneyle başlar.",
|
|
949
|
+
"The text above lies behind the master's screen, forbidden to the players' eyes.": "Yukarıdaki metin oyun yöneticisinin ekranının arkasında duruyor; oyuncuların görmesi yasak.",
|
|
949
950
|
"The title of the note {title}": "{title} notunun başlığı",
|
|
950
951
|
"the top bar": "üst çubuk",
|
|
951
952
|
"the units of the story": "hikâyenin ölçü birimleri",
|
|
@@ -946,6 +946,7 @@
|
|
|
946
946
|
"The story starts on day {day}": "Історія починається в день {day}",
|
|
947
947
|
"The story starts on day {day}, {time}": "Історія починається в день {day}, {time}",
|
|
948
948
|
"The story starts with the first scene.": "Історія починається з першої сцени.",
|
|
949
|
+
"The text above lies behind the master's screen, forbidden to the players' eyes.": "Текст вище лежить за ширмою майстра, заборонений для очей гравців.",
|
|
949
950
|
"The title of the note {title}": "Заголовок нотатки {title}",
|
|
950
951
|
"the top bar": "верхня панель",
|
|
951
952
|
"the units of the story": "одиниці виміру в історії",
|
|
@@ -946,6 +946,7 @@
|
|
|
946
946
|
"The story starts on day {day}": "故事始于第{day}天",
|
|
947
947
|
"The story starts on day {day}, {time}": "故事始于第{day}天{time}",
|
|
948
948
|
"The story starts with the first scene.": "故事从第一个场景开始。",
|
|
949
|
+
"The text above lies behind the master's screen, forbidden to the players' eyes.": "以上文字位于主持人的屏风之后,玩家不得窥视。",
|
|
949
950
|
"The title of the note {title}": "笔记“{title}”的标题",
|
|
950
951
|
"the top bar": "顶栏",
|
|
951
952
|
"the units of the story": "故事使用的单位",
|
|
@@ -69,7 +69,7 @@ export function FollowedQuests({ version, campaign, beside = false }) {
|
|
|
69
69
|
export function QuestEndings({ version, campaign, beside = false }) {
|
|
70
70
|
const journal = useJournal(version);
|
|
71
71
|
const [followed] = useFollowed(campaign, journal.read?.quests);
|
|
72
|
-
const before = useRef();
|
|
72
|
+
const before = useRef(undefined);
|
|
73
73
|
const [endings, setEndings] = useState([]);
|
|
74
74
|
const [told, setTold] = useState("");
|
|
75
75
|
useEffect(() => {
|
|
@@ -58,11 +58,11 @@ export function PackagesPage({ version, tab }) {
|
|
|
58
58
|
const [asking, setAsking] = useState();
|
|
59
59
|
const reads = useRef(0);
|
|
60
60
|
const catalogReads = useRef(0);
|
|
61
|
-
const before = useRef();
|
|
61
|
+
const before = useRef(undefined);
|
|
62
62
|
const mine = useRef(0);
|
|
63
63
|
// The rows here before the last addition: those not among them are new.
|
|
64
|
-
const known = useRef();
|
|
65
|
-
const seeing = useRef();
|
|
64
|
+
const known = useRef(undefined);
|
|
65
|
+
const seeing = useRef(undefined);
|
|
66
66
|
const shownTab = tab === "add" || tab === "library" ? tab : "installed";
|
|
67
67
|
const [library, setLibrary] = useState();
|
|
68
68
|
const [libraryProblem, setLibraryProblem] = useState();
|
|
@@ -314,7 +314,7 @@ function breakablePath(path) {
|
|
|
314
314
|
function LibraryField({ state, onAdd }) {
|
|
315
315
|
const [path, setPath] = useState("");
|
|
316
316
|
const [empty, setEmpty] = useState(false);
|
|
317
|
-
const sent = useRef();
|
|
317
|
+
const sent = useRef(undefined);
|
|
318
318
|
useEffect(() => {
|
|
319
319
|
if (state.said?.problem === false && sent.current === path) {
|
|
320
320
|
setPath("");
|
|
@@ -356,7 +356,7 @@ function AddField({ state, onAdd, onFile }) {
|
|
|
356
356
|
const [source, setSource] = useState("");
|
|
357
357
|
const [empty, setEmpty] = useState(false);
|
|
358
358
|
const picker = useRef(null);
|
|
359
|
-
const sent = useRef();
|
|
359
|
+
const sent = useRef(undefined);
|
|
360
360
|
// Added: the field is ready for the next one.
|
|
361
361
|
useEffect(() => {
|
|
362
362
|
if (state.said?.problem === false && sent.current === source) {
|
|
@@ -211,7 +211,7 @@ function Marks({ track, place, change }) {
|
|
|
211
211
|
}
|
|
212
212
|
/** A figure of an extension, given what it drew before once what it draws changes, for it to move from one to the other. */
|
|
213
213
|
export function Figure({ owner, name, part }) {
|
|
214
|
-
const looks = useRef();
|
|
214
|
+
const looks = useRef(undefined);
|
|
215
215
|
const said = JSON.stringify([part, owner.data]);
|
|
216
216
|
// The data it drew before, once what it draws changes: in a card of a roll that is once the dice land, as the card changes only then.
|
|
217
217
|
if (looks.current?.said !== said) {
|
|
@@ -80,7 +80,7 @@ function offBy(setting, settings) {
|
|
|
80
80
|
function SettingRow({ setting, off, several = false, onChange }) {
|
|
81
81
|
// The value just picked shows at once, until the setting is read again.
|
|
82
82
|
const [picked, setPicked] = useState();
|
|
83
|
-
const resting = useRef();
|
|
83
|
+
const resting = useRef(undefined);
|
|
84
84
|
const said = useSaid();
|
|
85
85
|
const value = picked ?? setting.value;
|
|
86
86
|
const id = `setting-${idOf(setting.name)}`;
|
|
@@ -168,7 +168,7 @@ function choiceLabel(setting, choice, capital = true) {
|
|
|
168
168
|
/** What a change said, in its row: saved for a few seconds, what went wrong until the next change. */
|
|
169
169
|
function useSaid() {
|
|
170
170
|
const [now, setNow] = useState();
|
|
171
|
-
const timer = useRef();
|
|
171
|
+
const timer = useRef(undefined);
|
|
172
172
|
useEffect(() => () => clearTimeout(timer.current), []);
|
|
173
173
|
const show = (problem) => {
|
|
174
174
|
clearTimeout(timer.current);
|
package/dist/dashboard/setup.js
CHANGED
|
@@ -60,7 +60,7 @@ export function SetupView({ setup }) {
|
|
|
60
60
|
*/
|
|
61
61
|
function Question({ question, count, left, focus, onBack, onNext, onLeave, onProblem }) {
|
|
62
62
|
const [picked, setPicked] = useState();
|
|
63
|
-
const resting = useRef();
|
|
63
|
+
const resting = useRef(undefined);
|
|
64
64
|
const heading = useRef(null);
|
|
65
65
|
const value = picked ?? question.value;
|
|
66
66
|
const title = question.question === undefined ? settingLabel(question.name) : t(question.question);
|
|
@@ -92,7 +92,7 @@ function documentLabel(document) {
|
|
|
92
92
|
*/
|
|
93
93
|
function Browse({ open, explicit, back, backLabel, children }) {
|
|
94
94
|
const box = useRef(null);
|
|
95
|
-
const last = useRef();
|
|
95
|
+
const last = useRef(undefined);
|
|
96
96
|
useEffect(() => {
|
|
97
97
|
if (explicit) {
|
|
98
98
|
last.current = open;
|
|
@@ -144,7 +144,7 @@ function MapCard({ map, full, part, layout, lead, chosen, focus, onChoose, onGo,
|
|
|
144
144
|
return { ways: wayShapes({ ...full, places, roads }), spots: places.filter((place) => place.x !== undefined && place.y !== undefined && place.radius === undefined) };
|
|
145
145
|
}, [part, full]);
|
|
146
146
|
const pointers = useRef(new Map());
|
|
147
|
-
const drag = useRef();
|
|
147
|
+
const drag = useRef(undefined);
|
|
148
148
|
const narrow = size !== undefined && size.width < 600;
|
|
149
149
|
// The map's size, as the window changes it.
|
|
150
150
|
useEffect(() => {
|
package/dist/dice/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { type CoinSide, coinSides, type CoinToss, mostCoins, tossCoins } from "./coins.ts";
|
|
2
2
|
export { DiceError, diceProblem, parseNotation } from "./notation.ts";
|
|
3
|
-
export { askOracle, type OracleAnswer, oracleResult } from "./oracle.ts";
|
|
3
|
+
export { askOracle, type OracleAnswer, oracleResult, type OracleYes } from "./oracle.ts";
|
|
4
4
|
export { createProof, fingerprint, sha256 } from "./proof.ts";
|
|
5
5
|
export { type DiceRoll, type FaceSource, rollDice, type ThrownDie } from "./roll-dice.ts";
|
|
6
6
|
export { type RandomTable, readRandomTable, rollOnTable, type TableRoll, type TableRow } from "./tables.ts";
|
package/dist/dice/oracle.d.ts
CHANGED
|
@@ -10,10 +10,12 @@ export interface OracleAnswer {
|
|
|
10
10
|
extreme: boolean;
|
|
11
11
|
text: string;
|
|
12
12
|
}
|
|
13
|
+
/** Where a d100 says yes: low, up to the odds; high, above 100 less the odds, as Ironsworn's oracle. */
|
|
14
|
+
export type OracleYes = "low" | "high";
|
|
13
15
|
/** Asks the oracle with the odds named, in any case, with hyphens for spaces too; refused, with the five odds, for any other. */
|
|
14
|
-
export declare function askOracle(odds: string, source: FaceSource): OracleAnswer;
|
|
15
|
-
/** Yes when the d100 is no higher than the chance; extreme on a double, 11 to 99 and 100 as 00. */
|
|
16
|
-
export declare function oracleResult(chance: number, rolled: number): {
|
|
16
|
+
export declare function askOracle(odds: string, source: FaceSource, yesOn?: OracleYes): OracleAnswer;
|
|
17
|
+
/** Yes when the d100 is no higher than the chance, or above 100 less the chance when yes is high; extreme on a double, 11 to 99 and 100 as 00. */
|
|
18
|
+
export declare function oracleResult(chance: number, rolled: number, yesOn?: OracleYes): {
|
|
17
19
|
yes: boolean;
|
|
18
20
|
extreme: boolean;
|
|
19
21
|
};
|
package/dist/dice/oracle.js
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
// A yes/no oracle: a d100 against the odds, yes when it is no higher; a double (11, 22, … 00)
|
|
1
|
+
// A yes/no oracle: a d100 against the odds, yes when it is no higher, or, in a game that reads it so, when it is above 100 less the odds; a double (11, 22, … 00)
|
|
2
|
+
// makes the answer extreme.
|
|
2
3
|
import { DiceError } from "./notation.js";
|
|
3
4
|
import { rollDice } from "./roll-dice.js";
|
|
4
5
|
/** The odds an oracle is asked with, and the chance of a yes in a hundred. */
|
|
5
6
|
export const oracleOdds = { "almost certain": 90, likely: 75, "50/50": 50, unlikely: 25, "small chance": 10 };
|
|
6
7
|
/** Asks the oracle with the odds named, in any case, with hyphens for spaces too; refused, with the five odds, for any other. */
|
|
7
|
-
export function askOracle(odds, source) {
|
|
8
|
+
export function askOracle(odds, source, yesOn = "low") {
|
|
8
9
|
const name = odds.trim().toLowerCase().replace(/[-\s]+/g, " ");
|
|
9
10
|
const chance = Object.hasOwn(oracleOdds, name) ? oracleOdds[name] : undefined;
|
|
10
11
|
if (chance === undefined) {
|
|
11
12
|
throw new DiceError(`"${odds}" are no odds of the oracle: give one of ${Object.keys(oracleOdds).join(", ")}.`);
|
|
12
13
|
}
|
|
13
14
|
const roll = rollDice("d100", source);
|
|
14
|
-
const { yes, extreme } = oracleResult(chance, roll.total);
|
|
15
|
+
const { yes, extreme } = oracleResult(chance, roll.total, yesOn);
|
|
15
16
|
const answer = yes ? (extreme ? "Yes, and more: something beyond what was asked." : "Yes.") : extreme ? "No, and worse." : "No.";
|
|
16
17
|
const shown = `${name[0].toUpperCase()}${name.slice(1)} (${chance}%)`;
|
|
17
18
|
return { odds: name, chance, roll, yes, extreme, text: `${shown}: [d100 = ${roll.total}] ${answer}` };
|
|
18
19
|
}
|
|
19
|
-
/** Yes when the d100 is no higher than the chance; extreme on a double, 11 to 99 and 100 as 00. */
|
|
20
|
-
export function oracleResult(chance, rolled) {
|
|
21
|
-
return { yes: rolled <= chance, extreme: rolled === 100 || (rolled % 11 === 0 && rolled < 100) };
|
|
20
|
+
/** Yes when the d100 is no higher than the chance, or above 100 less the chance when yes is high; extreme on a double, 11 to 99 and 100 as 00. */
|
|
21
|
+
export function oracleResult(chance, rolled, yesOn = "low") {
|
|
22
|
+
return { yes: yesOn === "high" ? rolled > 100 - chance : rolled <= chance, extreme: rolled === 100 || (rolled % 11 === 0 && rolled < 100) };
|
|
22
23
|
}
|
package/dist/helpers/codex.js
CHANGED
|
@@ -130,7 +130,7 @@ function write(brief) {
|
|
|
130
130
|
function read(folder, brief, _writable, signal) {
|
|
131
131
|
const last = join(folder, ".last.txt");
|
|
132
132
|
// The folder is the working one, never in the line: the shell would read a title's $(…) or %…% (Matteo's review, D-489).
|
|
133
|
-
const line = `${codex} exec --ephemeral --skip-git-repo-check -s workspace-write -o .last.txt --ignore-user-config --ignore-rules -`;
|
|
133
|
+
const line = `${codex} exec --ephemeral --skip-git-repo-check -s workspace-write -c shell_environment_policy.inherit=core -o .last.txt --ignore-user-config --ignore-rules -`;
|
|
134
134
|
return new Promise((done) => {
|
|
135
135
|
const child = spawn(line, { shell: true, windowsHide: true, cwd: folder, env: helperEnvironment("codex"), stdio: ["pipe", "ignore", "pipe"] });
|
|
136
136
|
// Dropped while it runs: the helper stops with all it started.
|
package/dist/packages/npm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { spawn, spawnSync } from "node:child_process";
|
|
2
|
-
import { cpSync, existsSync, mkdirSync, readdirSync, readFileSync, renameSync, rmSync } from "node:fs";
|
|
2
|
+
import { cpSync, existsSync, lstatSync, mkdirSync, readdirSync, readFileSync, renameSync, rmSync } from "node:fs";
|
|
3
3
|
import { tmpdir } from "node:os";
|
|
4
4
|
import { isAbsolute, join, resolve } from "node:path";
|
|
5
5
|
import { ourScope } from "../core/consents.js";
|
|
@@ -298,7 +298,8 @@ async function installCopy(folder, spec, expected, run) {
|
|
|
298
298
|
}
|
|
299
299
|
else {
|
|
300
300
|
// What npm or git keep beside a package's own files is no part of it.
|
|
301
|
-
|
|
301
|
+
// A link would bring in what it points to, which is not what was asked about.
|
|
302
|
+
cpSync(resolve(spec), staged, { recursive: true, filter: (path) => !/[\\/](node_modules|\.git)([\\/]|$)/.test(path.slice(resolve(spec).length)) && plainEntry(path, spec) });
|
|
302
303
|
}
|
|
303
304
|
}
|
|
304
305
|
catch (error) {
|
|
@@ -418,3 +419,13 @@ function stopTree(pid) {
|
|
|
418
419
|
process.kill(pid, "SIGKILL");
|
|
419
420
|
}
|
|
420
421
|
}
|
|
422
|
+
/** True for a plain file or folder of the package folder `spec`; it throws for a link, which refuses the package whole, as a link in a .tgz does. */
|
|
423
|
+
function plainEntry(path, spec) {
|
|
424
|
+
if (lstatSync(path).isSymbolicLink() && resolve(path) === resolve(spec)) {
|
|
425
|
+
throw new Refusal(`${spec} is a link to another folder: give the folder it points to.`, "archive-link", { name: spec, entry: path });
|
|
426
|
+
}
|
|
427
|
+
if (lstatSync(path).isSymbolicLink()) {
|
|
428
|
+
throw new Refusal(`${spec} holds ${path}, which is a link to somewhere else: the package is refused whole. Replace the link with what it points to.`, "archive-link", { name: spec, entry: path });
|
|
429
|
+
}
|
|
430
|
+
return true;
|
|
431
|
+
}
|