Files
ttrpg-tools/src/doc-entries/journal-roll.md
T
hypercross 40b6fbe157 feat(ui): replace unicode icons with solid-icons
Swap emoji and unicode glyphs for Tabler components so icons inherit
currentColor and font-size and render consistently across platforms.

- add src/components/doc-icons.ts to resolve doc-entry frontmatter icon
  keys to components; frontmatter now stores semantic keys
- replace the align-*.png assets with TbOutlineAlign* icons
- render RevealManager action SVGs as components instead of injected
  innerHTML strings
- carry completion icons via an optional CompletionItem.icon field
2026-09-13 14:01:03 +08:00

1.3 KiB

tag, icon, title
tag icon title
journal-roll roll 掷骰与火花表命令

在 Journal 中掷骰或随机抽取火花表内容。优先匹配火花表,否则作为骰子表达式处理。

语法: /roll 骰子表达式 | 火花表键名

概述

/roll 命令用于掷骰或随机抽取火花表,并将结果同步到所有客户端。

  • 如果参数匹配已定义的火花表 slug,则抽取并发布对应火花表的结果。
  • 否则,作为骰子表达式求值并发布掷骰结果。

示例

掷骰

/roll d20
/roll 3d6
/roll 2d8kh1
/roll 1d20+5
/roll 4d6k3

火花表

/roll npc
/roll encounter
/roll loot

支持的骰子表达式

表达式 说明
d20 单个 20 面骰
3d6 3 个 6 面骰求和
2d8kh1 2 个 8 面骰保留最高 1 个
1d20+5 1 个 20 面骰加 5
4d6k3 4 个 6 面骰保留最高 3 个

火花表定义

火花表在 markdown 文档中通过 :spark[CSV路径] 标记声明,系统扫描文档时自动发现。CSV 文件的第一列表头为骰子公式(如 d6、d20),后续列为数据列。

抽取时根据骰子公式投掷,查找对应行并将各列数据作为火花表结果发布。

权限

  • GM:可使用
  • 玩家:不可使用
  • 观察者:不可使用