[P1][T21] 重写 scripts/verify-items.ts:全量真实表列映射断言 + TC 树不变量 #109
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#109
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?
问题
母 issue 的验收项明确要求「新增
scripts/verify-items.ts:全量物品表列映射断言」。现在这个文件已经存在(193 行),但一行 MPQ 都没读 —— 全部用手写的 4 行内联假表:
等于从零开始。
实现要求
重写为读真实 MPQ,断言下列不变量。所有期望值都是本机 1.13c 实测所得。
数据规模
Expansion)spawnable=1TreasureClass=1的 ItemTypesbowweapmelearmoabow)weap/armo/bow各 29 +mele13)enabled=1385complete=178、server=123TC 树不变量
NoDrop + ΣProb > 0Magic品质因子列的 231 个非空值全部等于 1024(防止数据源被换掉)定点概率验算
Act 1 H2H A单人空掉落率 =100/160= 62.5%Cow (H)单人空掉落率 = 62.5%Act 1 H2H A的完整展开与手算概率树一致:Act 5 (H) Equip B的注释列自洽:SumItems=36= 本层 ΣProb,TotalProb=1566 = 36+1530,DropChance=0.9770 = 1530/1566列映射交叉核对
cap:level=1 minac=3 maxac=5 reqstr=0 durability=12 gemsockets=2 ubercode=xap ultracode=uapWeapons.txt索引 18 的空列名不污染任何字段Armor.txt重复的mindam/maxdam取到的是正确那一组Properties.statN→ItemStatCost.Stat悬空数为 0modNcode→Properties.code悬空数为 0itype/etype→ItemTypes.Code悬空数为 0本地化覆盖
cap→帽子RNG(Q1 选 B)
state64 = lo * 0x6AC690C5 + hi的前 N 个输出与手算序列逐位相等Rand(seed, 1024)走 AND 分支、Rand(seed, 1000)走取模分支模拟器 vs 解析概率
陷阱
验收标准
npm run typecheck0 errornpx vitest run全绿npx tsx scripts/verify-items.ts新增断言通过溯源
data\global\excel\下的全部 17 张物品表(本机/usr/local/google/home/taodao/d2-data,挂载序 d2data → d2exp → Patch_D2,Patch_D2 优先)已重写 scripts/verify-items.ts:断言 659 基础物品、1378 词缀、98 类型、852+100 TC、385 暗金、127 套装、78 符文之语、68 宝石、218 悬空引用解析、TC 树深度<=64无环、固定点概率、中文 UTF-8 与 100万次蒙特卡洛 99% 置信区间收敛,合并入 main (commit
93874f4)。