Files
SoundGame/docs/design/05-rpg-chapter1.md
T
2026-10-01 23:26:47 +08:00

309 lines
15 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 05a · 《剑与声》第一章施工稿(26 号对齐)
> **给开发者的实现要点摘要**
> 1. 场景图 JSON、遭遇战表、数值、存档字段、BGM/sfx 清单 **以本文为准**(与 05 号总设计冲突时,数据以本文、交互以 26 号+05 号 §0)。
> 2. 战斗仍是定时器驱动的 10 状态机。**格挡 = 前摇窗口内再单击**(或朝来招方向滑)。禁止要求新手双击。
> 3. 探索:左右滑切选项、单击确认、上滑状态。`doubleTapWindow: 0`。
> 4. 第一章 8 场景、5 场明雷、商店/宝箱/支线获取不变。
> 5. 语音仍只引用 [05-rpg-ch1-voice-ids.md](05-rpg-ch1-voice-ids.md) 表内 id;须停用「双击格挡」教学句或改录为「点一下挡住」(改词在实现时登记,本文不改 voice-ids 文件)。
---
## 0. 设计单(第一章范围)
一句话、三状态、手势、矩阵、失败表、首 3 分钟、台词类别、断点复述:**见 [05-rpg.md](05-rpg.md) §0**。本章等待点补:
| id | 场景 | 期待 | `_short` |
|---|---|---|---|
| `village_opt` | village | 左右/单击 | 「滑一下。」 |
| `path_go` | path | 前进 | 「单击。」 |
| `fork_pick` | fork | 左右选路 | 「左右滑。」 |
| `stream_teach` | stream | 教学战四步 | 见 11 号 |
| `gate_pick` | gate | 强攻/绕行 | 「左右滑。」 |
Floor:探索 `YOUR_TURN`(amb 常驻可作床);战斗选指令 `YOUR_TURN`(`turn_player`);前摇 `ACTION`;演出 `BUSY`/`SPEAKING`。
---
## 1. 第一章场景图(数据表,直接转 JSON)
```js
const CH1 = {
start: 'village',
scenes: {
village: { name: '雾口村', amb: 'amb_village', options: ['go_path', 'shop', 'rest', 'status'] },
path: { name: '林间小路', amb: 'amb_path', options: ['go_fork', 'investigate', 'back'] },
fork: { name: '岔路口', amb: 'amb_fork', options: ['go_chest', 'go_stream', 'back'] },
chest: { name: '枯树洞', amb: 'amb_chest', options: ['open_chest', 'back'] },
stream: { name: '溪流', amb: 'amb_stream', options: ['drink', 'go_hunter', 'back'],
encounter: 'enc_teach_wolf' },
hunter: { name: '猎人小屋', amb: 'amb_hunter', options: ['talk_hunter', 'go_deepwood', 'back'] },
deepwood: { name: '密林深处', amb: 'amb_deepwood', options: ['go_gate', 'back'],
encounter: 'enc_bandits' },
gate: { name: '黑风寨门前', amb: 'amb_gate', options: ['assault', 'sneak', 'back'] },
boss1: { name: '聚义厅', amb: 'amb_hall', options: [],
encounter: 'enc_boss1' },
},
};
```
选项语义(不变):
| 选项 id | 播报语音 | 行为 |
|---|---|---|
| `go_*` | `opt_go_<场景>` | 切换场景(脚步 + 新场景 desc) |
| `back` | `opt_back` | 回上一场景 |
| `shop` | `opt_shop` | 商店子菜单 |
| `rest` | `opt_rest` | HP/MP 回满,`sys_rest`;仅 village |
| `status` | `opt_status` | 与上滑相同 |
| `investigate` | `opt_investigate` | 一次性 +15 金(`chest_path`) |
| `go_chest` | `opt_go_chest` | 岔路左 |
| `open_chest` | `opt_open_chest` | 金疮药×2(`chest_fork`) |
| `drink` | `opt_drink` | HP 回满 |
| `talk_hunter` | `opt_talk_hunter` | 药×1 + 九折 `shop_discount` |
| `assault` | `opt_assault` | `enc_elite` → 胜后 boss1 |
| `sneak` | `opt_sneak` | `enc_sneak` → 进 boss1 且 HP/MP 回满 |
---
## 2. 遭遇战表(不变)
| 遭遇 id | 敌人 | 触发 | 特殊 |
|---|---|---|---|
| `enc_teach_wolf` | 教学野狼 ×1 | stream 首次 | HP 锁底 1;四步教学(格挡=窗口单击) |
| `enc_wolf` | 野狼 ×1 | 教学后再入 50% | 可逃 |
| `enc_bandits` | 山贼 ×2 | deepwood 首次 | 不可逃;间不回血 |
| `enc_elite` | 寨丁头目 ×1 | assault | 不可逃 |
| `enc_sneak` | 山贼 + 毒蛛 | sneak | 不可逃;胜后回满 |
| `enc_boss1` | 黑风寨主 | boss1 | 不可逃;半血二阶段 |
---
## 3. 战斗状态机(格挡输入改写)
状态:`B_START → (回合循环) → VICTORY | DEFEAT | FLED`
| 状态 | 进入时副作用 | 出口转换 |
|---|---|---|
| `B_START` | `btl_start_<enemy>`;回合=1 | 第一章 → `PLAYER_SELECT`(蛊师类先攻除外) |
| `PLAYER_SELECT` | `sfx/turn_player`;Floor=`YOUR_TURN`;播当前指令名;左右滑循环 攻击→技能→防御→道具;单击执行;上滑战场状态;下滑逃跑 | 单击 → `PLAYER_EXECUTE`;下滑 → `FLEE_CHECK` |
| `PLAYER_EXECUTE` | 攻击=伤害公式;技能=atk×2 耗 mp3(不足 `btl_nomp` 留在 SELECT);防御=halfDamage;道具=金疮药 40%maxHp(无药 `btl_noitem`)。内容音 = `silent-ok` | → `CHECK_ENEMY_DEAD` |
| `CHECK_ENEMY_DEAD` | 敌 HP≤0:`btl_enemy_die`;连战拉下一只回 `B_START`(不重置玩家) | 无下一只 → `VICTORY`;否则 `ENEMY_TELEGRAPH` |
| `ENEMY_TELEGRAPH` | Floor=`ACTION`。有声:`tel_<enemy>` 1.0s(保护档见 11 号)。无声:`danger` earcon(系统合成,必出声)。窗口内:**单击 = 格挡**;**朝来招方向滑 = 格挡**。成功:`sfx/parry`,标记 true。反向滑 / 上滑 / 下滑:`invalid`,留在窗口。连点 400ms 内第二下 `busy` | 窗口结束或已格挡 → `ENEMY_RESOLVE` |
| `ENEMY_RESOLVE` | `dmg×0.3` 格挡 / `×0.5` 防御 / 全值。受击 `hurt`+回执;格挡成功不播 hurt。降档才播 `st_hp_*` | HP≤0 → `DEFEAT`;否则 → `PLAYER_SELECT` |
| `FLEE_CHECK` | 见 11 号成功率 | `FLED` 或回 SELECT;失败则 `ENEMY_TELEGRAPH`(可格挡) |
| `VICTORY` | `btl_win` + 分档掉落 + 升级 | 探索态,写存档 |
| `DEFEAT` | `btl_lose` + 归因 → village 重生(等级金币装备 flags 保留,本章非 Boss 遭遇重置) | village,写存档 |
半血钩子:HP 首次 ≤50% 于结算前插播 `btl_half_<enemy>`。
来招方向约定(滑动格挡,不单独教学):
| 敌人 | 声像 / 约定方向 |
|---|---|
| 野狼、教学狼 | 中央;滑动任意左右也认,或只认单击 |
| 山贼 / 头目 | 前摇脚步声像侧 |
| 毒蛛 | 高频,中央;认单击 |
| 无声 | 无方向;**只认单击**(滑=`invalid`+「点一下。」) |
---
## 4. 数值表(原样保留)
### 4.1 玩家
```
maxHp = 20 + 8*(lv-1)
atk = 5 + 2*(lv-1) + 武器atk
def = 护甲def
mp = 3 + lv
expToNext = lv * 20
dmg = max(1, round((atk攻 - def守) * (0.85~1.15)))
```
### 4.2 敌人
| 敌人 | 章 | HP | ATK | DEF | EXP | 金币 | 前摇 sfx | 前摇特征 | 半血句 |
|---|---|---|---|---|---|---|---|---|---|
| 教学野狼 | 1 | 6 | 3 | 0 | 5 | 0 | `tel_wolf` | 扑击低吼 | 无 |
| 野狼 | 1 | 10 | 4 | 0 | 8 | 5 | `tel_wolf` | 低吼 | 无 |
| 山贼 | 1 | 16 | 6 | 1 | 12 | 12 | `tel_bandit` | 脚步+拔刀 | `btl_half_bandit` |
| 毒蛛 | 1 | 12 | 7 | 0 | 12 | 8 | `tel_spider` | 高频肢节 | 无 |
| 寨丁头目 | 1 | 24 | 8 | 2 | 20 | 25 | `tel_elite` | 重甲 | `btl_half_elite` |
| **Boss 黑风寨主** | 1 | 45 | 10 | 2 | 50 | 100 | `tel_boss1` | 双刀两声 | 二阶段 ATK→12 |
| 沼泽鳄 | 2 | 30 | 11 | 2 | 22 | 18 | `tel_croc` | 水花+低吼 | 无 |
| 蛊师 | 2 | 22 | 12 | 1 | 26 | 30 | `tel_shaman` | 吟唱(先攻) | 有 |
| 剑傀 | 3 | 38 | 14 | 3 | 40 | 45 | `tel_puppet` | 机括 | 无 |
| 影卫 | 3 | 30 | 16 | 2 | 45 | 50 | 无(danger earcon) | 寂静 | 有 |
| **Boss 腐沼祭主** | 2 | 70 | 14 | 3 | 90 | 200 | `tel_boss2` | 哼鸣 | 二阶段 2 毒蛛 |
| **Boss 白无瞳** | 3 | 110 | 18 | 5 | 150 | 500 | 三阶段无声+earcon | 寂静 | 三次转换 |
经验校验原文成立:打完第一章约 lv3。
### 4.3 装备获取(不变)
| 物品 | 效果 | 获取 |
|---|---|---|
| 铁剑 | atk+3 | 商店 100(九折 90) |
| 皮甲 | def+2 | 商店 80(九折 72) |
| 金疮药 | 40% maxHp | 30 金;宝箱×2;猎人×1;上限 5 |
| 青钢剑 | atk+6 | 二章 300 |
| 铁鳞甲 | def+4 | 二章 250 |
| 听风剑 | atk+9,窗口 1.0→1.3s | 三章 600 |
### 4.4 商店
`shop_open` → 左右滑:铁剑/皮甲/金疮药/离开 → **单击购买**(不再双击)。钱不够 `shop_poor`;已购 `shop_owned`。成功 `sfx/coin` + 回执。写存档。
---
## 5. 探索态手势(施工口径)
- 左右滑=切选项(报名)=`silent-ok` 或 `ok`
- 单击=确认
- 上滑= `st_lv_*` → `st_hp_*` → `st_gold_*` → `st_weapon_*` → `st_armor_*`(可打断)
- 下滑=菜单(阶段 2):继续 / 保存回大厅 / 返回;破坏性二次确认
- 双击新手当单击(不重听整段描述;描述可用单击跳句后的帮助短句)
血量档:>70% / 30–70% / <30% 原句 id 保留。
教学战逐步旁白(替旧「双击格挡」):
| 步 | 意图 | 玩家 |
|---|---|---|
| T0 | 左右滑听指令名 | 滑 ≥2 |
| T1 | 攻击单击 | 出剑一次 |
| T2 | 前摇内**单击**格挡 | 成功或受击都通过 |
| T3 | 选防御单击 | 演示减伤 |
| T4 | 自由击杀 | 敌亡 |
完整参数见 [11-rpg-battle-rebalance.md](11-rpg-battle-rebalance.md)。
---
## 6. 存档 JSON(精确定义,保留)
`PUT /api/progress { game: 'rpg', data: ... }`:
```json
{
"schema": 1,
"updatedAt": "2026-08-29T12:00:00Z",
"summary": "第一章·溪流 · Lv3 · 金币120",
"chapter": 1,
"scene": "stream",
"player": {
"lv": 3, "exp": 45,
"hp": 28, "maxHp": 36, "mp": 6,
"gold": 120,
"weapon": "iron_sword",
"armor": "leather",
"potions": 2
},
"flags": {
"tutorial_battle_done": false,
"chest_path": false,
"chest_fork": false,
"hunter_quest": false,
"shop_discount": false,
"enc_bandits_done": false,
"enc_elite_done": false,
"enc_sneak_done": false,
"boss1_done": false
},
"chapters": { "1": "open", "2": "locked", "3": "locked" },
"stats": { "kills": 0, "deaths": 0, "parries": 0, "playSec": 0, "battlesWon": 0 }
}
```
| 字段 | 默认 | 说明 |
|---|---|---|
| `schema` | 1 | 不匹配可重开,stats 保留 |
| `summary` | `"新的旅程"` | `第X章·场景名 · LvN · 金币M` |
| `chapter`/`scene` | 1 / `village` | 落点 |
| `player.*` | lv1 exp0 hp20 maxHp20 mp4 gold50 weapon null armor null potions 1 | 开局 50 金 |
| `weapon`/`armor` | null | `iron_sword`/`steel_sword`/`wind_sword`;`leather`/`iron_scale` |
| `flags.*` | false | 一次性 |
| `chapters` | 见上 | locked/open/cleared |
| `stats.*` | 0 | 只增不减;`battlesWon` 供保护档 |
保存:场景切换、战斗结算、商店、菜单保存。localStorage `soundgame.progress.rpg` 与服务器双写。有档:`sys_continue_ask` 单击继续、右滑新游戏。
---
## 7. 资产需求清单(保留 prompt)
### 7.1 BGM(与 10 号对齐)
| id | 用途 | Mureka prompt 草稿 |
|---|---|---|
| `bgm/explore` | 探索宏观 | Atmospheric Chinese wuxia ambient, bamboo forest mist, sparse guzheng plucks over low drone, slow tempo 60 bpm, mysterious but calm, no vocals, seamless loop |
| `bgm/battle` | 普通战斗 | Tense wuxia battle music, driving taiko drums 100 bpm, sharp erhu stabs, urgent but not chaotic, no vocals, seamless loop |
| `bgm/boss` | Boss | Epic dark wuxia boss theme, heavy taiko 120 bpm, dissonant strings, dramatic tension, no vocals, seamless loop |
| `bgm/village` | 村庄 | Warm peaceful Chinese village ambiance music, soft dizi flute melody, gentle plucked strings, cozy 70 bpm, no vocals, seamless loop |
| `bgm/ending` | 章结算 | Melancholic wuxia emotional theme, solo erhu over soft pads, bittersweet, slow, no vocals, seamless loop |
amb_* 走 **sfx 层 loop**(addendum),`bgm=0` 时 amb 仍在。village 在 bgm=0 时用 `amb_village`。
### 7.2 SFX(35;SA3 = Stable Audio 3,SYN = 程序合成)
| 类别 | id | 方式 | prompt / 说明 |
|---|---|---|---|
| 敌方前摇 | `tel_wolf` | SA3 | wolf growl then lunge, short, dry, close mic |
| | `tel_bandit` | SA3 | footsteps on dirt then sword unsheathing shing, 1 second |
| | `tel_spider` | SA3 | insect legs skittering, high frequency chitin clicks, eerie, 1 second |
| | `tel_elite` | SA3 | heavy armor plates clanking, menacing, 1 second |
| | `tel_boss1` | SA3 | two metal blades striking each other twice, dramatic ring |
| | `tel_croc` | SA3 | water splash with low reptile growl |
| | `tel_shaman` | SA3 | low guttural chant humming, ritualistic, dark |
| | `tel_puppet` | SA3 | wooden mechanism clicks and winding gears |
| 战斗 | `atk_swing` | SA3 | sword whoosh through air, fast, clean |
| | `atk_hit` | SA3 | sword hitting flesh, dull impact, not gory |
| | `parry` | SA3 | metal parry clang, bright ring, short |
| | `skill_slash` | SA3 | powerful sword slash with air rip, dramatic |
| | `hurt` | SYN | 低频闷击(避免与 atk_hit 混淆) |
| | `enemy_die` | SA3 | body falling to ground with weapon clatter |
| | `potion` | SA3 | drinking liquid gulps, glass bottle |
| | `flee` | SYN | 渐远脚步 |
| | `turn_player` | SYN | 上行双音剑鸣,≤0.4s(11 号) |
| | `victory` | SA3 | triumphant short brass fanfare, 3 rising notes, wuxia style, under 1.5 seconds |
| 探索/系统 | `step` | SYN | 单步脚步 |
| | `coin` | SYN | 硬币叮当 |
| | `chest` | SA3 | old wooden chest creaking open |
| | `drink_water` | SA3 | scooping and drinking stream water |
| | `rest` | SA3 | settling down by campfire, fabric rustle |
| | `levelup` | SYN | 上行钟声琶音 |
| | `door_heavy` | SA3 | heavy wooden gate slowly opening, deep creak |
| | `ui_deny` | — | **不做**(回执走引擎) |
| 场景环境 | `amb_village` | SA3 | night village ambience, campfire crackle, distant chatter, crickets, loop |
| | `amb_path` | SA3 | forest path ambience, wind through leaves, birds distant, loop |
| | `amb_fork` | SA3 | forest crossroads ambience, wind split feel, crows, loop |
| | `amb_chest` | SA3 | hollow tree hole ambience, drips, muffled wind, loop |
| | `amb_stream` | SA3 | flowing stream over rocks, gentle water, loop |
| | `amb_hunter` | SA3 | wood cabin ambience, firewood crackle, knife sharpening occasionally, loop |
| | `amb_deepwood` | SA3 | deep forest ambience, insects, distant wolf howl, ominous, loop |
| | `amb_gate` | SA3 | bandit camp outside gate ambience, torches burning, rowdy distant voices, loop |
| | `amb_hall` | SA3 | large hall ambience, fire brazier, echoing space, tense, loop |
无声敌人(影卫 / 白无瞳三阶段)不占 sfx:窗口用引擎 `danger` earcon + 回执。amb 走 sfx 层 loop。计数仍约 35 件内容音 + 2 个战斗状态音。
---
## 8. 与台词表
开发只许引用 05-rpg-ch1-voice-ids.md。教学格挡句若仍写「双击」,运行时改播等价「点一下挡住」或停用旧 id 待重录——**不在本次改 voice-ids 文件**。
---
## 9. 废止(本章范围内)
| 废止 | 改为 |
|---|---|
| `ENEMY_TELEGRAPH` 双击格挡 | 单击;同向滑可选 |
| 探索双击重听 | 新手当单击;阶段 3 再重听当前描述 |
| 商店双击购买 | 单击购买 |
| 无声窗口仅震动 | danger earcon + 回执 |
| amb 与 explore BGM 抢同一层导致互删 | BGM 宏观 + amb 走 sfx loop(addendum) |
JSON、数值、获取节点、flags、summary 格式:**未改**。