nonebot-plugin-dnddicer 0.1.0__tar.gz
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.
- nonebot_plugin_dnddicer-0.1.0/.gitattributes +19 -0
- nonebot_plugin_dnddicer-0.1.0/.github/workflows/release.yml +42 -0
- nonebot_plugin_dnddicer-0.1.0/.github/workflows/test.yml +22 -0
- nonebot_plugin_dnddicer-0.1.0/.gitignore +41 -0
- nonebot_plugin_dnddicer-0.1.0/.python-version +1 -0
- nonebot_plugin_dnddicer-0.1.0/LICENSE +21 -0
- nonebot_plugin_dnddicer-0.1.0/PKG-INFO +177 -0
- nonebot_plugin_dnddicer-0.1.0/README.md +147 -0
- nonebot_plugin_dnddicer-0.1.0/docs/guide/attributes.md +52 -0
- nonebot_plugin_dnddicer-0.1.0/docs/guide/battle.md +113 -0
- nonebot_plugin_dnddicer-0.1.0/docs/guide/character-card.md +161 -0
- nonebot_plugin_dnddicer-0.1.0/docs/guide/faq.md +87 -0
- nonebot_plugin_dnddicer-0.1.0/docs/guide/hp-rest.md +160 -0
- nonebot_plugin_dnddicer-0.1.0/docs/guide/initiative.md +101 -0
- nonebot_plugin_dnddicer-0.1.0/docs/guide/quickstart.md +119 -0
- nonebot_plugin_dnddicer-0.1.0/docs/guide/roll-syntax.md +179 -0
- nonebot_plugin_dnddicer-0.1.0/docs/index.md +89 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/__init__.py +72 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/character/__init__.py +25 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/character/constants.py +89 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/character/models.py +229 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/character/services.py +510 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/commands/__init__.py +36 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/commands/base.py +253 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/commands/battle.py +323 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/commands/bot.py +69 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/commands/character.py +281 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/commands/dnd.py +106 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/commands/group_config.py +56 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/commands/help.py +62 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/commands/hp.py +318 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/commands/initiative.py +522 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/commands/roll.py +156 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/commands/roll_parse_args.py +206 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/commands/text.py +214 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/config.py +57 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/data/__init__.py +29 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/data/characters.py +99 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/data/group_config.py +75 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/data/initiative.py +78 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/data/schema.py +71 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/data/service_state.py +84 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/engine/__init__.py +27 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/engine/roll/__init__.py +18 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/engine/roll/_string_utils.py +33 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/engine/roll/ast_engine/__init__.py +69 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/engine/roll/ast_engine/adapter.py +375 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/engine/roll/ast_engine/ast_nodes.py +297 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/engine/roll/ast_engine/errors.py +112 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/engine/roll/ast_engine/evaluator.py +498 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/engine/roll/ast_engine/limits.py +164 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/engine/roll/ast_engine/parser.py +358 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/engine/roll/ast_engine/preprocessor.py +91 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/engine/roll/ast_engine/trace.py +405 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/engine/roll/default_dice.py +136 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/engine/roll/karma_runtime.py +40 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/engine/roll/result.py +131 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/engine/roll/roll_config.py +14 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/engine/roll/roll_const.py +14 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/engine/roll/roll_utils.py +161 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/engine/roll/sequence_runtime.py +63 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/initiative/__init__.py +7 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/initiative/models.py +114 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/platform/__init__.py +5 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/platform/onebot_v11.py +89 -0
- nonebot_plugin_dnddicer-0.1.0/nonebot_plugin_dnddicer/version.py +4 -0
- nonebot_plugin_dnddicer-0.1.0/pyproject.toml +98 -0
- nonebot_plugin_dnddicer-0.1.0/tests/conftest.py +59 -0
- nonebot_plugin_dnddicer-0.1.0/tests/engine/test_ast_error_semantics.py +259 -0
- nonebot_plugin_dnddicer-0.1.0/tests/engine/test_ast_evaluator.py +226 -0
- nonebot_plugin_dnddicer-0.1.0/tests/engine/test_ast_integration.py +303 -0
- nonebot_plugin_dnddicer-0.1.0/tests/engine/test_ast_parser.py +455 -0
- nonebot_plugin_dnddicer-0.1.0/tests/engine/test_ast_trace_errors_limits.py +362 -0
- nonebot_plugin_dnddicer-0.1.0/tests/engine/test_default_ast_path.py +138 -0
- nonebot_plugin_dnddicer-0.1.0/tests/fake_event.py +67 -0
- nonebot_plugin_dnddicer-0.1.0/tests/test_battle_command.py +283 -0
- nonebot_plugin_dnddicer-0.1.0/tests/test_bot_command.py +243 -0
- nonebot_plugin_dnddicer-0.1.0/tests/test_character_command.py +229 -0
- nonebot_plugin_dnddicer-0.1.0/tests/test_character_services.py +157 -0
- nonebot_plugin_dnddicer-0.1.0/tests/test_command_starts.py +119 -0
- nonebot_plugin_dnddicer-0.1.0/tests/test_data_schema.py +145 -0
- nonebot_plugin_dnddicer-0.1.0/tests/test_dnd_command.py +245 -0
- nonebot_plugin_dnddicer-0.1.0/tests/test_dset_command.py +102 -0
- nonebot_plugin_dnddicer-0.1.0/tests/test_error_fallback.py +80 -0
- nonebot_plugin_dnddicer-0.1.0/tests/test_help_command.py +88 -0
- nonebot_plugin_dnddicer-0.1.0/tests/test_hp_command.py +636 -0
- nonebot_plugin_dnddicer-0.1.0/tests/test_initiative_command.py +484 -0
- nonebot_plugin_dnddicer-0.1.0/tests/test_plugin.py +74 -0
- nonebot_plugin_dnddicer-0.1.0/tests/test_roll_command.py +250 -0
- nonebot_plugin_dnddicer-0.1.0/uv.lock +1517 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# 统一文本行尾为 LF(跨平台协作;ruff/uv 生态均按 LF 处理)
|
|
2
|
+
* text=auto
|
|
3
|
+
|
|
4
|
+
*.py text eol=lf
|
|
5
|
+
*.pyi text eol=lf
|
|
6
|
+
*.md text eol=lf
|
|
7
|
+
*.toml text eol=lf
|
|
8
|
+
*.yml text eol=lf
|
|
9
|
+
*.yaml text eol=lf
|
|
10
|
+
*.json text eol=lf
|
|
11
|
+
*.txt text eol=lf
|
|
12
|
+
*.lock text eol=lf
|
|
13
|
+
*.gitignore text eol=lf
|
|
14
|
+
*.gitattributes text eol=lf
|
|
15
|
+
|
|
16
|
+
# 二进制文件不转换
|
|
17
|
+
*.png binary
|
|
18
|
+
*.jpg binary
|
|
19
|
+
*.ico binary
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# 推 v* tag → 全量测试 → 构建并发布 PyPI(Trusted Publishing)+ 创建 GitHub Release
|
|
2
|
+
name: release
|
|
3
|
+
|
|
4
|
+
on:
|
|
5
|
+
push:
|
|
6
|
+
tags:
|
|
7
|
+
- "v*"
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
strategy:
|
|
13
|
+
fail-fast: false
|
|
14
|
+
matrix:
|
|
15
|
+
python-version: ["3.11", "3.12", "3.13"]
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
- uses: astral-sh/setup-uv@v6
|
|
19
|
+
with:
|
|
20
|
+
python-version: ${{ matrix.python-version }}
|
|
21
|
+
- name: 全量测试
|
|
22
|
+
run: uv run pytest
|
|
23
|
+
|
|
24
|
+
release:
|
|
25
|
+
needs: test
|
|
26
|
+
runs-on: ubuntu-latest
|
|
27
|
+
permissions:
|
|
28
|
+
# 建 GitHub Release
|
|
29
|
+
contents: write
|
|
30
|
+
# PyPI Trusted Publishing(OIDC),无需存储 token
|
|
31
|
+
id-token: write
|
|
32
|
+
steps:
|
|
33
|
+
- uses: actions/checkout@v4
|
|
34
|
+
- uses: astral-sh/setup-uv@v6
|
|
35
|
+
- name: 构建 sdist + wheel
|
|
36
|
+
run: uv build
|
|
37
|
+
- name: 发布到 PyPI
|
|
38
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
39
|
+
- name: 创建 GitHub Release
|
|
40
|
+
uses: softprops/action-gh-release@v2
|
|
41
|
+
with:
|
|
42
|
+
generate_release_notes: true
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# push / PR 全量测试(NoneFlow 商店加载检查同思路的本地回归)
|
|
2
|
+
name: test
|
|
3
|
+
|
|
4
|
+
on:
|
|
5
|
+
push:
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
test:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
strategy:
|
|
12
|
+
fail-fast: false
|
|
13
|
+
matrix:
|
|
14
|
+
python-version: ["3.11", "3.12", "3.13"]
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
- uses: astral-sh/setup-uv@v6
|
|
18
|
+
with:
|
|
19
|
+
python-version: ${{ matrix.python-version }}
|
|
20
|
+
# uv sync 默认包含 [dependency-groups].dev,pytest/nonebug 随附
|
|
21
|
+
- name: 全量测试
|
|
22
|
+
run: uv run pytest
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# ---- Python 通用 ----
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.egg-info/
|
|
6
|
+
.eggs/
|
|
7
|
+
build/
|
|
8
|
+
dist/
|
|
9
|
+
wheels/
|
|
10
|
+
.pytest_cache/
|
|
11
|
+
.ruff_cache/
|
|
12
|
+
.coverage
|
|
13
|
+
htmlcov/
|
|
14
|
+
junit.xml
|
|
15
|
+
|
|
16
|
+
# ---- 虚拟环境 ----
|
|
17
|
+
.venv/
|
|
18
|
+
venv/
|
|
19
|
+
env/
|
|
20
|
+
|
|
21
|
+
# ---- localstore 数据目录(仅仓库根:开发/测试期由 tests/conftest 落于此;
|
|
22
|
+
# 生产环境由宿主 LOCALSTORE_DATA_DIR 指定;不可用裸 data/ 以免误伤插件包内 data 目录)----
|
|
23
|
+
/data/
|
|
24
|
+
|
|
25
|
+
# ---- 环境与密钥 ----
|
|
26
|
+
.env
|
|
27
|
+
.env.*.local
|
|
28
|
+
!.env.example
|
|
29
|
+
|
|
30
|
+
# ---- 本地参考资料----
|
|
31
|
+
.ref/
|
|
32
|
+
|
|
33
|
+
# ---- 项目内部文档----
|
|
34
|
+
AGENTS.md
|
|
35
|
+
doc/
|
|
36
|
+
|
|
37
|
+
# ---- 编辑器/系统 ----
|
|
38
|
+
.vscode/
|
|
39
|
+
.idea/
|
|
40
|
+
.DS_Store
|
|
41
|
+
Thumbs.db
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.11
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 DNDDicer contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: nonebot-plugin-dnddicer
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: 专精 DND5e/5r 跑团的 NoneBot2 骰娘插件(屠龙骰):掷骰表达式、角色卡与检定、属性生成、HP 管理、先攻列表、战斗轮等,命令手感对齐 nonebot-dicepp
|
|
5
|
+
Project-URL: Homepage, https://github.com/H-Elden/nonebot-plugin-dnddicer
|
|
6
|
+
Project-URL: Issues, https://github.com/H-Elden/nonebot-plugin-dnddicer/issues
|
|
7
|
+
Project-URL: Repository, https://github.com/H-Elden/nonebot-plugin-dnddicer.git
|
|
8
|
+
Author: Elden
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: dice,dnd,dnd5e,nonebot,nonebot2,trpg,跑团,骰娘
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Topic :: Games/Entertainment :: Role-Playing
|
|
19
|
+
Requires-Python: >=3.11
|
|
20
|
+
Requires-Dist: lark<2.0.0,>=1.1.0
|
|
21
|
+
Requires-Dist: nonebot-adapter-onebot<3.0.0,>=2.4.6
|
|
22
|
+
Requires-Dist: nonebot-plugin-localstore<1.0.0,>=0.7.4
|
|
23
|
+
Requires-Dist: nonebot2<3.0.0,>=2.5.0
|
|
24
|
+
Provides-Extra: dev
|
|
25
|
+
Requires-Dist: nonebot2[fastapi]<3.0.0,>=2.5.0; extra == 'dev'
|
|
26
|
+
Requires-Dist: nonebug<1.0.0,>=0.4.4; extra == 'dev'
|
|
27
|
+
Requires-Dist: pytest-asyncio<1.0.0,>=0.25.0; extra == 'dev'
|
|
28
|
+
Requires-Dist: pytest<9.0.0,>=8.3.0; extra == 'dev'
|
|
29
|
+
Description-Content-Type: text/markdown
|
|
30
|
+
|
|
31
|
+
# 屠龙骰(DNDDicer / nonebot-plugin-dnddicer)
|
|
32
|
+
|
|
33
|
+
> 专精 **DND5e / DND5r** 跑团的 [NoneBot2](https://nonebot.dev/) 骰娘插件(OneBot V11 适配器),
|
|
34
|
+
> 命令手感对齐 [nonebot-dicepp](https://github.com/pear-studio/nonebot-dicepp)(梨骰)。
|
|
35
|
+
>
|
|
36
|
+
> 当前版本:**v0.1.0**(第一期功能完整可用)· 完整使用手册见 **📖 [使用文档](./docs/index.md)**
|
|
37
|
+
|
|
38
|
+
## ✨ 简介
|
|
39
|
+
|
|
40
|
+
DNDDicer 的目标是填补「NoneBot 商店中缺少 **DND5e/5r 专业 + 现代维护 + 插件形态** 骰娘」的空位:
|
|
41
|
+
以 DicePP 掷骰引擎与命令手感为基准,做独立的、零配置可加载的 NoneBot 插件,供任何已有
|
|
42
|
+
机器人从商店安装即用。
|
|
43
|
+
|
|
44
|
+
- **掷骰引擎**:移植 nonebot-dicepp 的 AST 表达式引擎(Lark 文法),支持 `2d20kh1`、
|
|
45
|
+
优势/劣势、爆炸骰、连掷、暗骰等 DicePP 完整语法面;
|
|
46
|
+
- **跑团全流程**:掷骰 → `.dnd` 属性生成 → 角色卡与检定/豁免/攻击点命令 → HP 管理
|
|
47
|
+
(伤害掷骰、抗性/易伤、AOE 多目标结算、长休)→ 先攻列表与战斗轮;
|
|
48
|
+
- **规则范围**:仅 DND5e/5r——专精 DND 定位,不做 COC/d100 体系与 `.mode` 模式切换;
|
|
49
|
+
- **商店合规**:零配置可加载、本地存储走 `nonebot-plugin-localstore`、元数据完整、全程异步。
|
|
50
|
+
|
|
51
|
+
## 📖 使用文档
|
|
52
|
+
|
|
53
|
+
详细用法、输入/输出示例与常见问题见仓库 `docs/` 使用文档:
|
|
54
|
+
|
|
55
|
+
- [命令总表与快速开始](./docs/index.md) · [群管理与 FAQ](./docs/guide/faq.md)
|
|
56
|
+
- [掷骰语法](./docs/guide/roll-syntax.md) · [角色卡与检定](./docs/guide/character-card.md)
|
|
57
|
+
- [属性生成](./docs/guide/attributes.md) · [HP 管理](./docs/guide/hp-rest.md)
|
|
58
|
+
- [先攻列表](./docs/guide/initiative.md) · [战斗轮](./docs/guide/battle.md)
|
|
59
|
+
|
|
60
|
+
## 📦 安装
|
|
61
|
+
|
|
62
|
+
通过 NB-CLI(推荐,与商店安装方式一致):
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
nb plugin install nonebot-plugin-dnddicer
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
或通过包管理器安装后,在 `pyproject.toml` 的 `[tool.nonebot]` 中声明加载:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
pip install nonebot-plugin-dnddicer
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
```toml
|
|
75
|
+
[tool.nonebot]
|
|
76
|
+
plugins = ["nonebot_plugin_dnddicer"]
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
> 依赖:Python ≥ 3.11,NoneBot2 ≥ 2.5.0,OneBot V11 适配器(`nb plugin install` 会自动安装依赖)。
|
|
80
|
+
|
|
81
|
+
## ⚙️ 配置
|
|
82
|
+
|
|
83
|
+
插件**零配置即可加载运行**,以下配置项全部可选(在 `.env` / 环境变量中设置):
|
|
84
|
+
|
|
85
|
+
| 配置项 | 类型 | 默认值 | 说明 |
|
|
86
|
+
| --- | --- | --- | --- |
|
|
87
|
+
| `dnddicer_command_priority` | `int` | `10` | 命令事件响应器基础优先级(越小越优先),与其他插件冲突时按需调整 |
|
|
88
|
+
| `dnddicer_default_face` | `int` | `20` | 全局默认骰面(DND 惯例 d20;已配置 `.dset` 的群以群配置为准,此项作兜底) |
|
|
89
|
+
| `dnddicer_enabled` | `bool` | `true` | 功能总开关,`false` 时只加载骨架、不注册命令 |
|
|
90
|
+
| `dnddicer_use_host_command_starts` | `bool` | `false` | 是否兼容宿主 `COMMAND_START` 起始符(NoneBot 默认 `/`,开启后 `/.help` 等亦可触发)。默认只匹配 `.` / `。`,避免 `/help`、`/bot` 等常见单词命令与其他插件同时命中(冲突) |
|
|
91
|
+
|
|
92
|
+
## 🎲 用法
|
|
93
|
+
|
|
94
|
+
> 命令以 `.`(或全角 `。`)开头,中英文别名对齐 DicePP;命令起始符默认仅 `.` / `。`,
|
|
95
|
+
> 如需用宿主斜杠 `/` 等起始符触发(如 `/.help`),请设置配置项 `dnddicer_use_host_command_starts=true`。
|
|
96
|
+
> **群聊服务默认关闭(白名单)**:需群主/管理员发送 `.bot on` 开启本群服务;`.bot off`
|
|
97
|
+
> 关闭后本群不再响应命令(`.bot` 本身不受影响)。群聊中使用 `.bot` 需先 @ 本机器人;
|
|
98
|
+
> 私聊不受服务开关限制,可直接使用全部功能。
|
|
99
|
+
|
|
100
|
+
### 🎲 掷骰(群聊 / 私聊)
|
|
101
|
+
|
|
102
|
+
| 命令 | 说明 |
|
|
103
|
+
| --- | --- |
|
|
104
|
+
| `.r [N#][hs][表达式] [原因]` | 掷骰表达式(`#` 连掷 1~10、`h` 暗骰、`s` 只显数值;仅 d20 有大成功/大失败播报) |
|
|
105
|
+
| `.rh [表达式] [原因]` | 暗骰(群内提示、结果私聊) |
|
|
106
|
+
|
|
107
|
+
### 📋 角色卡与检定(群聊)
|
|
108
|
+
|
|
109
|
+
| 命令 | 说明 |
|
|
110
|
+
| --- | --- |
|
|
111
|
+
| `.角色卡模板` / `.角色卡记录 <模板>` | 查看示例卡 / 记录或覆盖角色卡(`$…$` 分段模板) |
|
|
112
|
+
| `.角色卡` / `.角色卡清除` / `.状态` | 查看 / 删除角色卡 / 查看 HP 与生命骰摘要 |
|
|
113
|
+
| `.力量检定` / `.察觉检定+1` 等 | 属性/技能/先攻检定点命令,自动代入调整值/熟练/加值(`2#` 连掷、`+d4` 等可追加) |
|
|
114
|
+
| `.体质豁免` / `.敏捷攻击优势` 等 | 豁免/攻击点命令(原名直配,优势/劣势后缀) |
|
|
115
|
+
| `.先攻检定` | 掷先攻并自动写入本群先攻列表 |
|
|
116
|
+
|
|
117
|
+
### 🎯 属性生成(群聊 / 私聊)
|
|
118
|
+
|
|
119
|
+
| 命令 | 说明 |
|
|
120
|
+
| --- | --- |
|
|
121
|
+
| `.dnd [次数] [原因]` | 4D6K3 掷点生成六项属性(附合计与降序,自行分配给六属性) |
|
|
122
|
+
|
|
123
|
+
### ❤️ HP 与长休(群聊)
|
|
124
|
+
|
|
125
|
+
| 命令 | 说明 |
|
|
126
|
+
| --- | --- |
|
|
127
|
+
| `.hp [对象] 20/30 (5)` | 设置自己/队友 HP(含临时 HP) |
|
|
128
|
+
| `.hp [对象] -2d6+3` 等 | 伤害/治疗(支持掷骰表达式;目标后加 `抗性`/`易伤` 后缀可减半/加倍,分号分隔多目标同发结算) |
|
|
129
|
+
| `.hp` / `.hp list` / `.hp del` | 查看自己 / 本群列表 / 删除 |
|
|
130
|
+
| `.长休` | 长休结算(回满 HP、清临时 HP、回复一半生命骰) |
|
|
131
|
+
|
|
132
|
+
### ⚔️ 先攻与战斗轮(群聊)
|
|
133
|
+
|
|
134
|
+
| 命令 | 说明 |
|
|
135
|
+
| --- | --- |
|
|
136
|
+
| `.ri[修正] [名称/…]` | 掷先攻入表(`.ri20 地精` 固定值、`3#` 批量、`.先攻` 别名) |
|
|
137
|
+
| `.init` | 查看先攻列表(`del`/`clr`/`first`/`swap` 子指令) |
|
|
138
|
+
| `.br` | 新建战斗轮(清空先攻表) |
|
|
139
|
+
| `.回合` / `.轮次` | 查看/跳转当前回合与轮次(`.回合+2` 连续推进,轮到玩家自动 @ 提醒) |
|
|
140
|
+
| `.ed` | 结束当前回合并自动推进(`.结束` 别名) |
|
|
141
|
+
|
|
142
|
+
### ⚙️ 群管理(群聊)
|
|
143
|
+
|
|
144
|
+
| 命令 | 说明 |
|
|
145
|
+
| --- | --- |
|
|
146
|
+
| `.dset [表达式]` | 设置/查看群默认骰面(群主/管理员) |
|
|
147
|
+
| `.bot [on/off]` | 插件信息查询 / 本群服务开关(群主/管理员,需 @) |
|
|
148
|
+
| `.帮助` / `.help [命令]` | 命令总览 / 指定命令详细用法(如 `.help r`) |
|
|
149
|
+
|
|
150
|
+
> 一期范围外功能会**显式提示而非静默**:`.r exp` 期望值采样、`.r a/n` 特殊判定;
|
|
151
|
+
> 牌堆/随机表与规则查询(T2)、法术位/死亡豁免/BUFF 表(T3 候选)见下方路线。
|
|
152
|
+
|
|
153
|
+
## 📄 版本与路线
|
|
154
|
+
|
|
155
|
+
1. ✅ **v0.1.0**(第一期 = T0 + T1 + 战斗轮简化版 + `.bot` 服务开关):掷骰引擎移植、`.r/.rh`、
|
|
156
|
+
帮助、群配置(`.dset`)、角色卡与检定/豁免/攻击、`.dnd` 属性生成、HP 管理与长休
|
|
157
|
+
(含抗性/易伤与 AOE 伤害掷骰)、先攻列表、战斗轮——全部落地,全量测试通过;
|
|
158
|
+
2. ⏳ **第二期 T2**:牌堆/随机表、规则查询;
|
|
159
|
+
3. ⏳(可选)**T3 增强期**:法术位管理(`.ss/.cast`)、死亡豁免闭环(`.ds`)、BUFF/临时加值表(`.buff`)等。
|
|
160
|
+
|
|
161
|
+
## 📦 本地开发
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
# uv 方式(推荐;或使用 pip 安装 .[dev])
|
|
165
|
+
uv sync --group dev
|
|
166
|
+
uv run pytest
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
测试基于 [nonebug](https://github.com/nonebot/nonebug) 做 NoneBot 加载冒烟与全命令行为回归(与 NoneFlow 商店自动加载检查同思路)。
|
|
170
|
+
|
|
171
|
+
## 🤝 许可与致谢
|
|
172
|
+
|
|
173
|
+
- 本项目(业务层与工程骨架)以 **MIT License** 发布,见 [LICENSE](./LICENSE)。
|
|
174
|
+
- **掷骰引擎与命令语法移植自 [nonebot-dicepp](https://github.com/pear-studio/nonebot-dicepp)**
|
|
175
|
+
(Copyright (c) 2022 pear-studio,MIT License):相关文件头保留上游版权声明与 MIT 许可全文,来源按 MIT 要求在 LICENSE 中注明。
|
|
176
|
+
- 规则查询类资料内容**不随插件分发**(版权归原权利方/译者),需要时由使用者自行提供。
|
|
177
|
+
- 本项目与 nonebot-dicepp 无隶属关系,为独立命名的衍生/移植作品。
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
# 屠龙骰(DNDDicer / nonebot-plugin-dnddicer)
|
|
2
|
+
|
|
3
|
+
> 专精 **DND5e / DND5r** 跑团的 [NoneBot2](https://nonebot.dev/) 骰娘插件(OneBot V11 适配器),
|
|
4
|
+
> 命令手感对齐 [nonebot-dicepp](https://github.com/pear-studio/nonebot-dicepp)(梨骰)。
|
|
5
|
+
>
|
|
6
|
+
> 当前版本:**v0.1.0**(第一期功能完整可用)· 完整使用手册见 **📖 [使用文档](./docs/index.md)**
|
|
7
|
+
|
|
8
|
+
## ✨ 简介
|
|
9
|
+
|
|
10
|
+
DNDDicer 的目标是填补「NoneBot 商店中缺少 **DND5e/5r 专业 + 现代维护 + 插件形态** 骰娘」的空位:
|
|
11
|
+
以 DicePP 掷骰引擎与命令手感为基准,做独立的、零配置可加载的 NoneBot 插件,供任何已有
|
|
12
|
+
机器人从商店安装即用。
|
|
13
|
+
|
|
14
|
+
- **掷骰引擎**:移植 nonebot-dicepp 的 AST 表达式引擎(Lark 文法),支持 `2d20kh1`、
|
|
15
|
+
优势/劣势、爆炸骰、连掷、暗骰等 DicePP 完整语法面;
|
|
16
|
+
- **跑团全流程**:掷骰 → `.dnd` 属性生成 → 角色卡与检定/豁免/攻击点命令 → HP 管理
|
|
17
|
+
(伤害掷骰、抗性/易伤、AOE 多目标结算、长休)→ 先攻列表与战斗轮;
|
|
18
|
+
- **规则范围**:仅 DND5e/5r——专精 DND 定位,不做 COC/d100 体系与 `.mode` 模式切换;
|
|
19
|
+
- **商店合规**:零配置可加载、本地存储走 `nonebot-plugin-localstore`、元数据完整、全程异步。
|
|
20
|
+
|
|
21
|
+
## 📖 使用文档
|
|
22
|
+
|
|
23
|
+
详细用法、输入/输出示例与常见问题见仓库 `docs/` 使用文档:
|
|
24
|
+
|
|
25
|
+
- [命令总表与快速开始](./docs/index.md) · [群管理与 FAQ](./docs/guide/faq.md)
|
|
26
|
+
- [掷骰语法](./docs/guide/roll-syntax.md) · [角色卡与检定](./docs/guide/character-card.md)
|
|
27
|
+
- [属性生成](./docs/guide/attributes.md) · [HP 管理](./docs/guide/hp-rest.md)
|
|
28
|
+
- [先攻列表](./docs/guide/initiative.md) · [战斗轮](./docs/guide/battle.md)
|
|
29
|
+
|
|
30
|
+
## 📦 安装
|
|
31
|
+
|
|
32
|
+
通过 NB-CLI(推荐,与商店安装方式一致):
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
nb plugin install nonebot-plugin-dnddicer
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
或通过包管理器安装后,在 `pyproject.toml` 的 `[tool.nonebot]` 中声明加载:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
pip install nonebot-plugin-dnddicer
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
```toml
|
|
45
|
+
[tool.nonebot]
|
|
46
|
+
plugins = ["nonebot_plugin_dnddicer"]
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
> 依赖:Python ≥ 3.11,NoneBot2 ≥ 2.5.0,OneBot V11 适配器(`nb plugin install` 会自动安装依赖)。
|
|
50
|
+
|
|
51
|
+
## ⚙️ 配置
|
|
52
|
+
|
|
53
|
+
插件**零配置即可加载运行**,以下配置项全部可选(在 `.env` / 环境变量中设置):
|
|
54
|
+
|
|
55
|
+
| 配置项 | 类型 | 默认值 | 说明 |
|
|
56
|
+
| --- | --- | --- | --- |
|
|
57
|
+
| `dnddicer_command_priority` | `int` | `10` | 命令事件响应器基础优先级(越小越优先),与其他插件冲突时按需调整 |
|
|
58
|
+
| `dnddicer_default_face` | `int` | `20` | 全局默认骰面(DND 惯例 d20;已配置 `.dset` 的群以群配置为准,此项作兜底) |
|
|
59
|
+
| `dnddicer_enabled` | `bool` | `true` | 功能总开关,`false` 时只加载骨架、不注册命令 |
|
|
60
|
+
| `dnddicer_use_host_command_starts` | `bool` | `false` | 是否兼容宿主 `COMMAND_START` 起始符(NoneBot 默认 `/`,开启后 `/.help` 等亦可触发)。默认只匹配 `.` / `。`,避免 `/help`、`/bot` 等常见单词命令与其他插件同时命中(冲突) |
|
|
61
|
+
|
|
62
|
+
## 🎲 用法
|
|
63
|
+
|
|
64
|
+
> 命令以 `.`(或全角 `。`)开头,中英文别名对齐 DicePP;命令起始符默认仅 `.` / `。`,
|
|
65
|
+
> 如需用宿主斜杠 `/` 等起始符触发(如 `/.help`),请设置配置项 `dnddicer_use_host_command_starts=true`。
|
|
66
|
+
> **群聊服务默认关闭(白名单)**:需群主/管理员发送 `.bot on` 开启本群服务;`.bot off`
|
|
67
|
+
> 关闭后本群不再响应命令(`.bot` 本身不受影响)。群聊中使用 `.bot` 需先 @ 本机器人;
|
|
68
|
+
> 私聊不受服务开关限制,可直接使用全部功能。
|
|
69
|
+
|
|
70
|
+
### 🎲 掷骰(群聊 / 私聊)
|
|
71
|
+
|
|
72
|
+
| 命令 | 说明 |
|
|
73
|
+
| --- | --- |
|
|
74
|
+
| `.r [N#][hs][表达式] [原因]` | 掷骰表达式(`#` 连掷 1~10、`h` 暗骰、`s` 只显数值;仅 d20 有大成功/大失败播报) |
|
|
75
|
+
| `.rh [表达式] [原因]` | 暗骰(群内提示、结果私聊) |
|
|
76
|
+
|
|
77
|
+
### 📋 角色卡与检定(群聊)
|
|
78
|
+
|
|
79
|
+
| 命令 | 说明 |
|
|
80
|
+
| --- | --- |
|
|
81
|
+
| `.角色卡模板` / `.角色卡记录 <模板>` | 查看示例卡 / 记录或覆盖角色卡(`$…$` 分段模板) |
|
|
82
|
+
| `.角色卡` / `.角色卡清除` / `.状态` | 查看 / 删除角色卡 / 查看 HP 与生命骰摘要 |
|
|
83
|
+
| `.力量检定` / `.察觉检定+1` 等 | 属性/技能/先攻检定点命令,自动代入调整值/熟练/加值(`2#` 连掷、`+d4` 等可追加) |
|
|
84
|
+
| `.体质豁免` / `.敏捷攻击优势` 等 | 豁免/攻击点命令(原名直配,优势/劣势后缀) |
|
|
85
|
+
| `.先攻检定` | 掷先攻并自动写入本群先攻列表 |
|
|
86
|
+
|
|
87
|
+
### 🎯 属性生成(群聊 / 私聊)
|
|
88
|
+
|
|
89
|
+
| 命令 | 说明 |
|
|
90
|
+
| --- | --- |
|
|
91
|
+
| `.dnd [次数] [原因]` | 4D6K3 掷点生成六项属性(附合计与降序,自行分配给六属性) |
|
|
92
|
+
|
|
93
|
+
### ❤️ HP 与长休(群聊)
|
|
94
|
+
|
|
95
|
+
| 命令 | 说明 |
|
|
96
|
+
| --- | --- |
|
|
97
|
+
| `.hp [对象] 20/30 (5)` | 设置自己/队友 HP(含临时 HP) |
|
|
98
|
+
| `.hp [对象] -2d6+3` 等 | 伤害/治疗(支持掷骰表达式;目标后加 `抗性`/`易伤` 后缀可减半/加倍,分号分隔多目标同发结算) |
|
|
99
|
+
| `.hp` / `.hp list` / `.hp del` | 查看自己 / 本群列表 / 删除 |
|
|
100
|
+
| `.长休` | 长休结算(回满 HP、清临时 HP、回复一半生命骰) |
|
|
101
|
+
|
|
102
|
+
### ⚔️ 先攻与战斗轮(群聊)
|
|
103
|
+
|
|
104
|
+
| 命令 | 说明 |
|
|
105
|
+
| --- | --- |
|
|
106
|
+
| `.ri[修正] [名称/…]` | 掷先攻入表(`.ri20 地精` 固定值、`3#` 批量、`.先攻` 别名) |
|
|
107
|
+
| `.init` | 查看先攻列表(`del`/`clr`/`first`/`swap` 子指令) |
|
|
108
|
+
| `.br` | 新建战斗轮(清空先攻表) |
|
|
109
|
+
| `.回合` / `.轮次` | 查看/跳转当前回合与轮次(`.回合+2` 连续推进,轮到玩家自动 @ 提醒) |
|
|
110
|
+
| `.ed` | 结束当前回合并自动推进(`.结束` 别名) |
|
|
111
|
+
|
|
112
|
+
### ⚙️ 群管理(群聊)
|
|
113
|
+
|
|
114
|
+
| 命令 | 说明 |
|
|
115
|
+
| --- | --- |
|
|
116
|
+
| `.dset [表达式]` | 设置/查看群默认骰面(群主/管理员) |
|
|
117
|
+
| `.bot [on/off]` | 插件信息查询 / 本群服务开关(群主/管理员,需 @) |
|
|
118
|
+
| `.帮助` / `.help [命令]` | 命令总览 / 指定命令详细用法(如 `.help r`) |
|
|
119
|
+
|
|
120
|
+
> 一期范围外功能会**显式提示而非静默**:`.r exp` 期望值采样、`.r a/n` 特殊判定;
|
|
121
|
+
> 牌堆/随机表与规则查询(T2)、法术位/死亡豁免/BUFF 表(T3 候选)见下方路线。
|
|
122
|
+
|
|
123
|
+
## 📄 版本与路线
|
|
124
|
+
|
|
125
|
+
1. ✅ **v0.1.0**(第一期 = T0 + T1 + 战斗轮简化版 + `.bot` 服务开关):掷骰引擎移植、`.r/.rh`、
|
|
126
|
+
帮助、群配置(`.dset`)、角色卡与检定/豁免/攻击、`.dnd` 属性生成、HP 管理与长休
|
|
127
|
+
(含抗性/易伤与 AOE 伤害掷骰)、先攻列表、战斗轮——全部落地,全量测试通过;
|
|
128
|
+
2. ⏳ **第二期 T2**:牌堆/随机表、规则查询;
|
|
129
|
+
3. ⏳(可选)**T3 增强期**:法术位管理(`.ss/.cast`)、死亡豁免闭环(`.ds`)、BUFF/临时加值表(`.buff`)等。
|
|
130
|
+
|
|
131
|
+
## 📦 本地开发
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
# uv 方式(推荐;或使用 pip 安装 .[dev])
|
|
135
|
+
uv sync --group dev
|
|
136
|
+
uv run pytest
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
测试基于 [nonebug](https://github.com/nonebot/nonebug) 做 NoneBot 加载冒烟与全命令行为回归(与 NoneFlow 商店自动加载检查同思路)。
|
|
140
|
+
|
|
141
|
+
## 🤝 许可与致谢
|
|
142
|
+
|
|
143
|
+
- 本项目(业务层与工程骨架)以 **MIT License** 发布,见 [LICENSE](./LICENSE)。
|
|
144
|
+
- **掷骰引擎与命令语法移植自 [nonebot-dicepp](https://github.com/pear-studio/nonebot-dicepp)**
|
|
145
|
+
(Copyright (c) 2022 pear-studio,MIT License):相关文件头保留上游版权声明与 MIT 许可全文,来源按 MIT 要求在 LICENSE 中注明。
|
|
146
|
+
- 规则查询类资料内容**不随插件分发**(版权归原权利方/译者),需要时由使用者自行提供。
|
|
147
|
+
- 本项目与 nonebot-dicepp 无隶属关系,为独立命名的衍生/移植作品。
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# 属性生成(.dnd)
|
|
2
|
+
|
|
3
|
+
`.dnd` 按 DND5e 标准掷点法 **4D6K3** 生成一套六项属性:每项掷 4 个 D6、去掉最低的一个、剩余 3 个求和。**掷出的 6 个数值不绑定属性名**——由你自行分配给力量/敏捷/体质/智力/感知/魅力后,用 `.角色卡记录` 建卡。
|
|
4
|
+
|
|
5
|
+
## 用法
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
.dnd [次数] [原因]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
| 参数 | 说明 |
|
|
12
|
+
| --- | --- |
|
|
13
|
+
| 次数 | 可选,默认 1、上限 10(越界/非数字回退 1)。`.` 与命令名后可直接接数字(`.dnd2` 与 `.dnd 2` 等价) |
|
|
14
|
+
| 原因 | 可选,跟在次数之后(截断 50 字符),显示在结果标题中 |
|
|
15
|
+
|
|
16
|
+
群聊与私聊均可使用。
|
|
17
|
+
|
|
18
|
+
## 示例
|
|
19
|
+
|
|
20
|
+
```text
|
|
21
|
+
你发送:.dnd
|
|
22
|
+
骰娘回复:艾琳 DND人物作成:
|
|
23
|
+
83 : [18, 17, 14, 13, 12, 9]
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
输出读法:`83` 是六项合计;`[18, 17, …]` 是六项数值的**降序**列表。
|
|
27
|
+
示例中第一项 18 来自掷出 `6,6,6,1`(去掉 1 后 6+6+6);每项属性都是这样独立掷出。
|
|
28
|
+
|
|
29
|
+
多组与原因:
|
|
30
|
+
|
|
31
|
+
```text
|
|
32
|
+
你发送:.dnd 2 为了勇者
|
|
33
|
+
骰娘回复:艾琳 DND人物作成——为了勇者:
|
|
34
|
+
108 : [18, 18, 18, 18, 18, 18]
|
|
35
|
+
108 : [18, 18, 18, 18, 18, 18]
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
> 注:标准购点(27 点)暂无先例(DicePP/海豹骰均无),本期未提供;
|
|
39
|
+
> 如需购点建卡,可直接用 `.角色卡记录` 填写你购点得到的数值。
|
|
40
|
+
|
|
41
|
+
## 建卡衔接
|
|
42
|
+
|
|
43
|
+
拿到数值后,按顺序分配给六属性并建卡:
|
|
44
|
+
|
|
45
|
+
```text
|
|
46
|
+
你发送:.角色卡记录 $姓名$ 艾琳
|
|
47
|
+
$等级$ 1
|
|
48
|
+
$属性$ 18/14/13/12/9/17 ← 依次为 力量/敏捷/体质/智力/感知/魅力
|
|
49
|
+
骰娘回复:角色卡已设置
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
角色卡与检定点命令见 [角色卡与检定](./character-card.md)。
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# 战斗轮(.br / .ed / .回合 / .轮次)
|
|
2
|
+
|
|
3
|
+
战斗轮不是独立系统,而是**先攻表的"进行中状态机"**:`.br` 开局后,先攻列表
|
|
4
|
+
变成回合队列,`.ed`(结束回合)自动推进到下一行动者,一轮走完自动进位。
|
|
5
|
+
所有命令**仅限群聊**、作用于**本群**先攻表。
|
|
6
|
+
|
|
7
|
+
## 命令一览
|
|
8
|
+
|
|
9
|
+
| 命令 | 作用 |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| `.br` / `.战斗轮` | 新建战斗轮:清空本群先攻表与轮次指针,重新开局 |
|
|
12
|
+
| `.回合` / `.轮次` | 查看当前轮与回合 |
|
|
13
|
+
| `.回合 +1 / -1 / =2 / 2` | 回合前进/后退/直接跳转(越界自动进位轮次) |
|
|
14
|
+
| `.回合 名字` | 按名字跳转到该行动者的回合(支持模糊) |
|
|
15
|
+
| `.轮次 +1 / -1 / =3` | 调整轮次 |
|
|
16
|
+
| `.ed` / `.结束` | 结束当前回合:播报 + 自动推进下一位;轮到玩家时输出 @ 提醒 |
|
|
17
|
+
|
|
18
|
+
> 回合流转只需记住三条:玩家结束自己的回合用 `.ed`;DM 想连续推进多位直接发
|
|
19
|
+
> `.回合+2`;想直接到某人的回合发 `.回合 名字`——没有也不需要额外的推进命令。
|
|
20
|
+
|
|
21
|
+
## 开局顺序(重要)
|
|
22
|
+
|
|
23
|
+
**先 `.br` 开局,再掷先攻入表**——`.br` 会**清空**本群先攻表(无论旧的还是刚掷的),若先掷先攻再 `.br`,先攻会被清掉。
|
|
24
|
+
|
|
25
|
+
> `.br` 与 `.init clr` 的作用**完全等价**(都清空先攻表与轮次指针),区别只在播报文案:
|
|
26
|
+
> `.br` 播「已创建新战斗轮。清除先攻表、当前回合。」(面向开局),
|
|
27
|
+
> `.init clr` 播「已清除先攻列表」(面向清表)。
|
|
28
|
+
> 战斗开局用 `.br`,战斗中清表用 `.init clr` 即可。
|
|
29
|
+
|
|
30
|
+
## 完整时序示例
|
|
31
|
+
|
|
32
|
+
**① 开局**——DM 发 `.br`,然后全员掷先攻(详见 [先攻列表](./initiative.md)):
|
|
33
|
+
|
|
34
|
+
```text
|
|
35
|
+
你发送:.br
|
|
36
|
+
骰娘回复:已创建新战斗轮。清除先攻表、当前回合。
|
|
37
|
+
|
|
38
|
+
你发送:.ri ← 掷先攻入表(也可以用 .先攻检定 联动)
|
|
39
|
+
骰娘回复:艾琳的先攻值是 1D20=[15]=15
|
|
40
|
+
|
|
41
|
+
你发送:.ri20 地精
|
|
42
|
+
骰娘回复:地精的先攻值是 20
|
|
43
|
+
|
|
44
|
+
你发送:.ri 兽人
|
|
45
|
+
骰娘回复:兽人的先攻值是 1D20=[18]=18
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
**② 查看列表**(自动进入第 1 轮第 1 回合,先攻最高者行动):
|
|
49
|
+
|
|
50
|
+
```text
|
|
51
|
+
你发送:.init
|
|
52
|
+
骰娘回复:先攻列表如下:
|
|
53
|
+
当前是第1轮,地精的回合
|
|
54
|
+
1.地精 先攻:20
|
|
55
|
+
2.兽人 先攻:18
|
|
56
|
+
3.艾琳 先攻:15
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
**③ 查看当前回合**:
|
|
60
|
+
|
|
61
|
+
```text
|
|
62
|
+
你发送:.回合
|
|
63
|
+
骰娘回复:现在是第1轮第1回合,地精的回合。
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**④ 结束回合自动推进**(`.ed`):走完一轮自动进入下一轮并播报:
|
|
67
|
+
|
|
68
|
+
```text
|
|
69
|
+
你发送:.ed
|
|
70
|
+
骰娘回复:地精的回合结束了。
|
|
71
|
+
现在是兽人的回合。
|
|
72
|
+
|
|
73
|
+
你发送:.ed
|
|
74
|
+
骰娘回复:兽人的回合结束了。
|
|
75
|
+
现在是艾琳的回合。请玩家 @艾琳 开始行动。 ← 轮到绑定 QQ 的玩家时输出 @ 提醒
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**⑤ 手动调整回合/轮次**(DM 修正与连续推进):
|
|
79
|
+
|
|
80
|
+
```text
|
|
81
|
+
你发送:.回合-1 ← 回到上一行动者(艾琳 → 兽人)
|
|
82
|
+
骰娘回复:现在是兽人的回合。
|
|
83
|
+
|
|
84
|
+
你发送:.回合 地精 ← 按名字跳转(精确→模糊)
|
|
85
|
+
骰娘回复:现在是地精的回合。
|
|
86
|
+
|
|
87
|
+
你发送:.回合+2 ← 一次推进多位(地精是第 1 回合,+2 → 第 3 回合艾琳)
|
|
88
|
+
骰娘回复:现在是艾琳的回合。请玩家 @艾琳 开始行动。
|
|
89
|
+
|
|
90
|
+
你发送:.回合+1 ← 艾琳是第 3 回合(本轮最后一位),+1 溢出自动进位轮次
|
|
91
|
+
骰娘回复:新的一轮,现在是第2轮。
|
|
92
|
+
现在是地精的回合。
|
|
93
|
+
|
|
94
|
+
你发送:.轮次+1 ← 轮次从第 2 轮前进到第 3 轮
|
|
95
|
+
骰娘回复:现在变成第3轮了。
|
|
96
|
+
现在是地精的回合。
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
**⑥ 结束战斗**(无需专门命令):不再推进即可;下次 `.br` 重新开局。
|
|
100
|
+
|
|
101
|
+
## 常见提示
|
|
102
|
+
|
|
103
|
+
| 场景 | 回复 |
|
|
104
|
+
| --- | --- |
|
|
105
|
+
| 先攻表为空时操作战斗轮 | `目前先攻列表为空,故不存在回合与轮次。` |
|
|
106
|
+
| `.回合 名字` 无匹配 / 多匹配 | `没有找到这个回合。` / `找到复数回合,请换一个关键词。` |
|
|
107
|
+
| `.回合=9`(超出总人数) / `.回合=0` | `这个数字太大了。` / `这个数字太小了。` |
|
|
108
|
+
| `.回合+abc`(非数字) | `这不是数字。` |
|
|
109
|
+
|
|
110
|
+
## 一期范围说明
|
|
111
|
+
|
|
112
|
+
- **BUFF 计时表不做**(本轮中自动到期的 BUFF 由 DM 手动管理);
|
|
113
|
+
- NPC 先攻条目不关联临时 HP;实体显示入表时快照的名称(离线可用)。
|