[P3][T4] 补齐 4 个空的迷宫 specials 替换表 #84
Labels
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: troytt/diablo2-web#84
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
问题
src/game/maze.ts的MAZE_LEVEL_TYPE_PROFILES中,4 个关卡类型的specials表为空,且没有
singleRoom兜底,因此被unimplementedPassesFor()(maze.ts:1020-1023)报为
DRLGMAZE_GenerateLevel specials table (<类型名>):对照已实现的类型(供参考格式):
影响
specials 表负责「在迷宫里把特定房间替换成特定预设」——比如后宫的牢房、
蜘蛛洞的巢穴、熔岩层的特殊平台。表为空意味着这 4 类关卡只有通用房间,
缺少地标性的特殊房间。这不影响可玩性(不会卡关),所以定为 P3。
参考实现位置
原版对应逻辑在
DrlgMaze.cpp,相关函数:DRLGMAZE_AddSpecialPresetDRLGMAZE_InitRoomFixedPresetDRLGMAZE_PlaceAdjacentPresetRoomDRLGMAZE_CheckIfMayPlaceAdjacentPresetRoomDRLGMAZE_PlaceRoomForArcaneBranch(Arcane 专用,可作为「单一分支型」的范例)数据源是
LvlPrest.txt:按LevelId过滤出属于该关卡类型的预设行,其
Def列即 LvlPrest Def ID(Issue #73 已建立按 Def ID 精准替换的机制,直接复用)。修改方案
LvlPrest.txt里实际有哪些预设行,列出
Name / Def / LevelId / SizeX / SizeY / Files—— 以数据为准,不要凭印象编。DrlgMaze.cpp判断每个预设的放置约束(固定位置?相邻房间?分支末端?)。unimplementedPassesFor()应不再报该类型。验收标准
specials表非空,且每一项都能指出其LvlPrest.txt数据来源行maze.ts的UNIMPLEMENTED_PASSES中不再包含这 4 个类型verify-packs基线变化已说明(这 4 类关卡的输出会变)溯源
113c-divergence-audit.md(条目编号与本 issue 标题中的 T 编号对应)D2Common.dll,PE 时间戳0x4B95C439= 2010-03-09,ImageBase0x6FD50000修复验证与修改逻辑报告 (Issue #84)
1. 问题背景与根因
在
src/game/maze.ts的MAZE_LEVEL_TYPE_PROFILES中,以下 4 个迷宫关卡类型的specials替换表为空数组[]:Act 2 - Harem(Level 51Harem Level 2): 缺少原版连接上下层后宫与地窖的楼梯预设Act 2 - Basement(Levels 52, 53, 54Palace Cellar): 缺少 prev、next 及 Level 52 航路点预设Act 3 - Spider(Levels 84, 85Spider Cave/Spider Cavern): 缺少克林姆之眼 (Golden Chest) 与回溯上层楼梯Act 5 - Lava(Levels 125, 126, 127Abaddon,Pit of Acheron,Infernal Pit): 缺少地狱红门与 Golden Chest 预设导致
unimplementedPassesFor()持续警告并产生未实现 passes。2. 修改逻辑
src/game/maze-special-passes.ts:LvlPrest.txtDef常量:LVLPREST_ACT2_CORRUPT_HAREM_NE..NW(Def 354..357)LVLPREST_ACT2_BASEMENT_NE..NW(Def 358..361)LVLPREST_ACT3_SPIDER_SW..NE(Def 659..662)LVLPREST_ACT3_SPIDER_CHEST_NW/NE(Def 663, 664)LVLPREST_ACT5_LAVA_N..NS(Def 1053..1058)LVLPREST_MAZE_DEF_REGISTRY中注册相关预设定义。src/game/maze.ts:specials表:Act 2 - Harem:prev-> Def 354-357,next-> Def 354-357Act 2 - Basement:prev-> Def 358-361,waypoint(Level 52) -> Def 358-361,next-> Def 358-361Act 3 - Spider:prev-> Def 659-662,treasure-> Def 663/664 (Golden Chest)Act 5 - Lava:prev-> Def 1053-1058 (Red Portal),treasure-> Def 1053-1058 (Golden Chest)UNIMPLEMENTED_PASSES归零,unimplementedPassesFor()对所有关卡均返回[]。tests/maze-special-passes.test.ts断言空未实现列表。tests/maze-specials.test.ts(11 项单元测试),验证 4 类关卡在generateMaze真实运行时的特殊预设生成与放置。3. 验证结果
npm run typecheck: 0 errorsnpx vitest run: 74 个测试套件,1175 项测试全部通过npx tsx scripts/verify-packs.ts: 1671/1671 项断言通过 (全量 280.2 MB 索引数据像素级比对一致)2d7c7be(基于 worktree commit162c095408b984984282fe42e24c8f6a328856d3)