[P0][T01] 加载 ItemTypes.txt:类型树、Equiv 继承链、TreasureClass 与 Rarity 列 #89
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#89
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?
问题
loadActTables现在只加载 11 张地图 / 怪物表,物品表一张都没有。ItemTypes.txt必须最先做,因为它是两件事的共同底座:TreasureClass=1的类型会派生出armo3/weap3这类虚拟掉落节点金标准数据
98 行(有 Code 的)× 37 列。原始 104 行里要剔除:2 行
None(索引 0/1)、3 行Not Used(索引 14/17/23)、1 行Expansion(索引 58)。完整列头:
真实样例:
⭐
TreasureClass=1的全部 5 行(auto-TC 的种子)bowweapmelearmoabow全表就只有这 5 行,T-12 的输入就是它们。
实现要求
loadActTables里加载data\global\excel\ItemTypes.txt。Code → ItemTypeRow索引。isA(typeCode, ancestorCode)要能沿Equiv1/Equiv2一路向上(例如shie → shld,mele → weap)。这个函数后面被词缀匹配和 auto-TC 反复调用,必须做记忆化。Equiv1/Equiv2、TreasureClass、Rarity、MaxSock1/25/40、Magic/Rare/Normal/Charm/Gem、StaffMods、Body/BodyLoc1/BodyLoc2、Beltable、Class。MaxSock1|25|40是按 ilvl 分三段的插槽上限(1-24 / 25-39 / 40+),供 T-18 使用。陷阱
验收标准
TreasureClass=1的行恰好 5 个,Code 为bow/weap/mele/armo/abowisA('shie','shld') === true、isA('mele','weap') === true、isA('wand','rod') === truenpm run typecheck0 errornpx vitest run全绿npx tsx scripts/verify-items.ts新增断言通过溯源
data\global\excel\下的ItemTypes.txt(本机/usr/local/google/home/taodao/d2-data,挂载序 d2data → d2exp → Patch_D2,Patch_D2 优先)已完成并通过 real MPQ 验证(98行有效类型,5个 auto-TC 种子,Equiv 继承链),合并入 main (commit
5e5d897)。