docs: add battle system, conditional routing, key moments, and creators guide docs

This commit is contained in:
2026-06-14 16:42:16 +08:00
parent 02a82e9801
commit c75db2886f
5 changed files with 255 additions and 4 deletions

View File

@@ -0,0 +1,36 @@
# 条件路由
## 概述
P25 新增。`nextScene` 从单一场景 ID 扩展为**条件路由数组**。
第一个满足 `conditions` 的场景自动跳转,末尾无条件项作为默认兜底。
## 基本用法
```json
{
"id": "combat_router",
"keyMoment": false,
"nextScene": [
{ "conditions": [{ "variable": "enemy_hp", "op": "<=", "value": 0 }], "targetScene": "victory" },
{ "conditions": [{ "variable": "player_hp", "op": "<=", "value": 0 }], "targetScene": "defeat" },
{ "targetScene": "combat" }
]
}
```
**解读:** 敌人 HP ≤ 0 → 胜利 / 自己 HP ≤ 0 → 战败 / 否则 → 回到战斗场景循环。
## 配合 QTE 使用
```
QTE 成功 → effects: enemy_hp -= 25
→ successScene = "combat_router"
├── enemy_hp <= 0 → victory 场景
├── player_hp <= 0 → defeat 场景
└── 否则 → 回到 QTE 场景(循环)
```
## 向后兼容
旧的 `"nextScene": "alone_ending"` 写法**完全不受影响**。引擎自动区分字符串和数组。