[P0][D02] 内嵌 SuperUniques.txt 并解析三难度 TC 列,填充 superUniques #411

Closed
opened 2026-09-24 03:25:57 +00:00 by troytt · 1 comment
Owner

现状

  1. src/game/embedded-drop-tables.ts:109:superUniques: new Map(),canonical-drop-data.ts 无 RAW_SUPER_UNIQUES。
    实机中 src/game/engine.ts:860 的 dropTables.superUniques.has(event.superUniqueId) 恒为 false。
  2. 即便走 MPQ 路径(loadDropTables),src/game/drop-pipeline.ts:246 的 readSuperUniques()
    只读取了 normal 一个难度的 TC 列,engine.ts:861 直接取单例 .treasureClass。
    → Pindleskin、Nihlathak 等在 Hell 难度会拿到 Normal 难度的掉落表。
  3. src/game/drop-pipeline.ts:250-252 用 catch { /* keep map empty */ } 静默吞掉 SuperUniques.txt 缺失,
    违反项目「禁止静默失败」规则。

1.13c 真实行为

SuperUniques.txt 对 66 个超级独特怪各提供三列:TC / TC(N) / TC(H),
并带 MonSound / Mod1..3(词缀)/ EClass 等。掉落必须按当前游戏难度选列。
其随从(Minion)沿用宿主的 TreasureClass3 而非超级独特怪的 TC。

验收标准

  • 内嵌 RAW_SUPER_UNIQUES(Superunique / Name / Class / TC / TC(N) / TC(H) / MinGrp / MaxGrp / Mod1..3)。
  • readSuperUniques() 返回三难度 TC,SuperUnique 类型改为 { normal, nightmare, hell }。
  • engine.ts 按 this.opts.difficulty 取对应难度 TC。
  • 删除 drop-pipeline.ts:250-252 的静默 catch,缺表直接抛错。
  • vitest:Pindleskin 在 Hell 解析为 Act 5 Super Cx(H) 一类的 Hell TC,Normal 解析为 Normal TC,两者不相等。
  • vitest:超级独特怪随从使用宿主 TreasureClass3,不使用 SuperUniques TC。
## 现状 1. `src/game/embedded-drop-tables.ts:109`:`superUniques: new Map()`,`canonical-drop-data.ts` 无 `RAW_SUPER_UNIQUES`。 实机中 `src/game/engine.ts:860` 的 `dropTables.superUniques.has(event.superUniqueId)` 恒为 false。 2. 即便走 MPQ 路径(`loadDropTables`),`src/game/drop-pipeline.ts:246` 的 `readSuperUniques()` 只读取了 **normal 一个难度**的 TC 列,`engine.ts:861` 直接取单例 `.treasureClass`。 → Pindleskin、Nihlathak 等在 Hell 难度会拿到 Normal 难度的掉落表。 3. `src/game/drop-pipeline.ts:250-252` 用 `catch { /* keep map empty */ }` 静默吞掉 SuperUniques.txt 缺失, 违反项目「禁止静默失败」规则。 ## 1.13c 真实行为 `SuperUniques.txt` 对 66 个超级独特怪各提供三列:`TC` / `TC(N)` / `TC(H)`, 并带 `MonSound` / `Mod1..3`(词缀)/ `EClass` 等。掉落必须按**当前游戏难度**选列。 其随从(Minion)沿用宿主的 `TreasureClass3` 而非超级独特怪的 TC。 ## 验收标准 - [ ] 内嵌 `RAW_SUPER_UNIQUES`(`Superunique` / `Name` / `Class` / `TC` / `TC(N)` / `TC(H)` / `MinGrp` / `MaxGrp` / `Mod1..3`)。 - [ ] `readSuperUniques()` 返回三难度 TC,`SuperUnique` 类型改为 `{ normal, nightmare, hell }`。 - [ ] `engine.ts` 按 `this.opts.difficulty` 取对应难度 TC。 - [ ] 删除 `drop-pipeline.ts:250-252` 的静默 `catch`,缺表直接抛错。 - [ ] vitest:Pindleskin 在 Hell 解析为 `Act 5 Super Cx(H)` 一类的 Hell TC,Normal 解析为 Normal TC,两者不相等。 - [ ] vitest:超级独特怪随从使用宿主 `TreasureClass3`,不使用 SuperUniques TC。
troytt added this to the [M18] 打怪掉落物品:怪物死亡掉落全链路 1.13c 还原 milestone 2026-09-24 03:25:57 +00:00
Author
Owner

Resolution Summary (Issue #411)

  • SuperUniques Multi-Difficulty TC Embedded: Extracted 21 columns from 1.13c SuperUniques.txt (including TC, TC(N), TC(H)) and embedded in src/data/canonical-drop-data.ts as RAW_SUPERUNIQUES.
  • Runtime superUniques Hydration: src/game/embedded-drop-tables.ts hydrates all 66 valid super uniques with difficulty-aware TC resolution (getTreasureClass(difficulty)).
  • Eliminated Silent Catch in drop-pipeline.ts: Removed the silent catch in loadDropTables (src/game/drop-pipeline.ts:243-255); missing SuperUniques.txt now throws an explicit Error to fail fast.
  • Minion Drop Inheritance: Updated src/game/engine.ts:1010-1035 so that minions (monsterRank === minion) of SuperUniques inherit their host unique monster's TreasureClass3 instead of the SuperUnique boss TC.
  • Verification: tests/superunique-minion-drop.test.ts passes 3/3 tests verifying multi-difficulty TC resolution, minion inheritance of host TC3, and loud fail-fast on missing tables. tests/monster-treasure-class.test.ts passes 19/19 tests (100%).
### Resolution Summary (Issue #411) - **SuperUniques Multi-Difficulty TC Embedded**: Extracted 21 columns from 1.13c `SuperUniques.txt` (including `TC`, `TC(N)`, `TC(H)`) and embedded in `src/data/canonical-drop-data.ts` as `RAW_SUPERUNIQUES`. - **Runtime superUniques Hydration**: `src/game/embedded-drop-tables.ts` hydrates all 66 valid super uniques with difficulty-aware TC resolution (`getTreasureClass(difficulty)`). - **Eliminated Silent Catch in drop-pipeline.ts**: Removed the silent `catch` in `loadDropTables` (`src/game/drop-pipeline.ts:243-255`); missing `SuperUniques.txt` now throws an explicit `Error` to fail fast. - **Minion Drop Inheritance**: Updated `src/game/engine.ts:1010-1035` so that minions (`monsterRank === minion`) of SuperUniques inherit their host unique monster's `TreasureClass3` instead of the SuperUnique boss TC. - **Verification**: `tests/superunique-minion-drop.test.ts` passes 3/3 tests verifying multi-difficulty TC resolution, minion inheritance of host TC3, and loud fail-fast on missing tables. `tests/monster-treasure-class.test.ts` passes 19/19 tests (100%).
Sign in to join this conversation.
No Label
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: troytt/diablo2-web#411
No description provided.