[P0][T02] 加载 ItemStatCost.txt + Properties.txt:属性层与属性函数 #90
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#90
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?
问题
词缀、暗金、套装、符文之语、宝石全部通过
Properties.code引用属性,再由Properties.statN落到ItemStatCost.Stat。不先把这两张表做出来,T-06 / T-09 / T-10 / T-16 / T-18 全都没有落点。同时
ItemStatCost的Save Bits/Save Add是.d2s序列化的必需品(见 T-17)。金标准数据
ItemStatCost.txt —— 359 行 × 53 列(无分隔行)
真实样例:
关键列:
StatProperties.statN引用的主键ID.d2s属性列表里存的就是它(9 bit)Save Bits+Save AddAdd平移成无符号Save Param Bitsop/op param/op base/op stat1..3descpriority/descfunc/descvaldescstrpos/descstrneg/descstr2ModStr1a),供 T-20dgrp*maxstat/Encode/keepzero/itemspecific/damagerelatedProperties.txt —— 268 行 × 36 列(1 行
Expansion)code是整个词缀系统的中枢,被这些地方引用:MagicPrefix/MagicSuffix/AutoMagic的mod1-3codeUniqueItems的prop1-12SetItems的prop1-9/aprop1a-5bSets的PCode*/FCode*Runes的T1Code1-7Gems的*Mod1-3CodefuncN是赋值函数号:1 = 直接赋min..max随机值,14 = 插槽数,15/16/17 = 技能触发,19 = charged 等。实现要求
Stat → row、code → row)。resolveProperty(code) → { stats: [{ stat, func, val, set }] },一个 property 最多展开 7 个 stat。*开头的列是注释列(*done*desc*param*min*max*notes*eol),游戏不读,解析时跳过。Save Bits/Save Add/Save Param Bits暴露给 T-17 的序列化层。descstrpos等 tbl key 先存字符串,T-20 再解析。陷阱
验收标准
Stat → ID映射建立Expansion)Properties.statN都能在ItemStatCost.Stat里找到(悬空引用数为 0,若非 0 需列出并说明)Save Bits/Save Add可被 T-17 的序列化层读取npm run typecheck0 errornpx vitest run全绿npx tsx scripts/verify-items.ts新增断言通过溯源
data\global\excel\下的ItemStatCost.txt/Properties.txt(本机/usr/local/google/home/taodao/d2-data,挂载序 d2data → d2exp → Patch_D2,Patch_D2 优先)已完成并通过 1.13c MPQ 真实表验证(ItemStatCost 359 行 / Properties 268 行,属性函数与序列化位宽),合并入 main (commit
fb79151)。