[Asset/Render Parity] 超大护身符 (Grand Charm) 地面掉落图标误配为毁灭小护身符 (flpmss),应修正为 flpchm3 #452
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#452
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?
1. 问题描述 (Bug Description)
在当前游戏中,当玩家将超大护身符 (Grand Charm / code:
cm3,如各类职业技能板、普通超大护身符、基德的运气等) 从背包丢弃到地面,或怪物击杀掉落时:flpmss,9x4 px) 的地面素材,而非超大护身符的长条形地面积木符文石。这导致地面上的超大护身符视觉比例严重失真(只有 9x4 像素,比 1x1 物品还小),且外观与小护身符混淆,严重违背暗黑 2 原版掉落外观。
2. 原版 Diablo II v1.13c 核心机制规范 (Ground Truth Invariants)
依据官方 MPQ 数据表 (
Misc.txt/UniqueItems.txt) 与 DC6 精灵资产:小型护身符 (Small Charm, code:
cm1, 1x1):flippyfile) 为flpchm1(13x5 px);anni) 在UniqueItems.txt中指定flippyfile = flpmss(使用灵魂石地面贴图)。大型护身符 (Large Charm, code:
cm2, 1x2):flippyfile) 为flpchm2(13x6 px);torch) 指定flippyfile = flptrch。超大型护身符 (Grand Charm, code:
cm3, 1x3):flippyfile) 必须为flpchm3(21x6 px 的长条形符文石);gheeds) 依据UniqueItems.txt同样使用标准超大护身符地面贴图flpchm3,绝不能使用flpmss!3. 缺陷代码定位与根因分析 (Root Cause Analysis)
scripts/pack-ui.ts中硬编码映射错误:在
scripts/pack-ui.ts第 739–745 行:生成的元数据
src/ui/baked-ui-meta.ts固化了该错误:第 2589–2591 行及第 3297 行:
而
src/ui/baked-ui-meta.ts的flippyRects中实际上完整包含了正规的flpchm1,flpchm2,flpchm3贴图(第 7677–7694 行),但由于codeToFlippyFile映射被篡改,resolveGroundItemSpriteRect取到了flpmss。4. 修复方案 (Proposed Implementation)
scripts/pack-ui.ts:将护身符的
codeToFlippyFile恢复为 1.13c 真实规范:src/ui/baked-ui-meta.ts中的codeToFlippyFile对应键值。src/ui/inventory.ts的resolveGroundItemSpriteRect中补全护身符显式防回退逻辑:在查表前增加针对
cm1,cm2,cm3及其中文名称(超大护身符、超大型护身符、grand charm)的断言与定向解析,确保任何途径生成的超大护身符都能百分之百精准命中flpchm3。5. 验收标准 (Acceptance Criteria)
flpchm3)。flpchm1(13x5 px),毁灭小护身符保留flpmss(9x4 px)。flpchm2(13x6 px),地狱火炬保留flptrch。npm run typecheck,npm test) 100% 绿色通过。