feat(portal): 实装回城之书/卷轴、1.13c 城镇传送门坐标与双向传送 (#394) #488

Merged
troytt merged 1 commits from feat/issue-394-town-portal into main 2026-09-26 15:11:58 +00:00
Owner

Closes #394

变更内容 (Diablo II v1.13c Ground Truth)

  1. 全 5 幕 9 个城镇预设 DS1 传送门精确坐标 (src/game/portal.ts):提取 Levels.txt + LvlPrest.txt 各幕城镇 DS1 中 Type-2 Object #33 (Objects.txt ID 59 Town Portal) 的精确 Tile 并在中心子格 (tile * 5 + 3) 开启传送门;扩展 TownPortalSlot.mouthInLevel(levelId) 与 enterFrom(levelId) 实现双向生命周期(野外进城保持开启,城内返野自动关闭,对齐 ObjMode.cpp:3245)。
  2. 回城之书 (tbk) / 回城卷轴 (tsc) 背包交互与充能 (src/ui/inventory.ts, src/ui/hud-manager.ts, src/game/class-starter-profiles.ts):实装书本 quantity (初始 20/20)、悬浮数量与操作提示、左键卷轴放入书本充能、右键背包内 tbk/tsc 施展回城传送门(城镇内拒绝施展且不扣次数)。
  3. 原版传送门 DCC 动画烘焙与场景渲染交互 (scripts/pack-overlays.ts, src/scene/act-scene.ts):提取并烘焙 tptrlitophth.dcc / tphdlitophth.dcc (OP 15 帧开启) 与 tptrlitonhth.dcc / tphdlitonhth.dcc (ON 15 帧循环),支持蓝光照明 (Light=19, RGB=(64,110,255))、头顶目的地标签 (传送门 -> <目标区域>)、近距离左键点击或心灵传动 (Skill 43) 双向传送。
  4. 验证:新增 tests/town-portal.test.ts 单元测试(6/6 通过)并通过无头 Chrome CDP 全流程端到端验证。
Closes #394 ### 变更内容 (Diablo II v1.13c Ground Truth) 1. **全 5 幕 9 个城镇预设 DS1 传送门精确坐标 (`src/game/portal.ts`)**:提取 `Levels.txt` + `LvlPrest.txt` 各幕城镇 DS1 中 Type-2 Object #33 (`Objects.txt` ID 59 `Town Portal`) 的精确 Tile 并在中心子格 (`tile * 5 + 3`) 开启传送门;扩展 `TownPortalSlot.mouthInLevel(levelId)` 与 `enterFrom(levelId)` 实现双向生命周期(野外进城保持开启,城内返野自动关闭,对齐 `ObjMode.cpp:3245`)。 2. **回城之书 (`tbk`) / 回城卷轴 (`tsc`) 背包交互与充能 (`src/ui/inventory.ts`, `src/ui/hud-manager.ts`, `src/game/class-starter-profiles.ts`)**:实装书本 `quantity` (初始 20/20)、悬浮数量与操作提示、左键卷轴放入书本充能、右键背包内 `tbk`/`tsc` 施展回城传送门(城镇内拒绝施展且不扣次数)。 3. **原版传送门 DCC 动画烘焙与场景渲染交互 (`scripts/pack-overlays.ts`, `src/scene/act-scene.ts`)**:提取并烘焙 `tptrlitophth.dcc` / `tphdlitophth.dcc` (OP 15 帧开启) 与 `tptrlitonhth.dcc` / `tphdlitonhth.dcc` (ON 15 帧循环),支持蓝光照明 (`Light=19`, `RGB=(64,110,255)`)、头顶目的地标签 (`传送门 -> <目标区域>`)、近距离左键点击或心灵传动 (`Skill 43`) 双向传送。 4. **验证**:新增 `tests/town-portal.test.ts` 单元测试(6/6 通过)并通过无头 Chrome CDP 全流程端到端验证。
troytt added 1 commit 2026-09-26 14:59:56 +00:00
2fe9138fb1 feat(portal): implement v1.13c Town Portal tome/scroll, DS1 town positions & two-way travel (#394)
- Resolve exact Diablo II v1.13c DS1 Type-2 Object #33 (Objects.txt ID 59) Town Portal sub-tiles across all 9 town presets (Acts 1-5) in src/game/portal.ts
- Implement TownPortalSlot.mouthInLevel(levelId) and enterFrom(levelId) per ObjMode.cpp:3245 (wilderness -> town keeps portal open; town -> wilderness closes portal)
- Add 20-charge quantity tracking for Tome of Town Portal (tbk) and Tome of Identify (ibk), right-click casting for tbk/tsc in inventory, and scroll-to-tome refill
- Bake authentic TP DCC sprite atlases (tptrlitophth, tphdlitophth, tptrlitonhth, tphdlitonhth) into public/overlays/town_portal_*
- Render Town Portal entity with OP/ON DCC animation, dynamic blue light (Light=19, RGB 64/110/255), overhead destination label, and proximity walk-to-interact in src/scene/act-scene.ts
- Add unit and parity tests in tests/town-portal.test.ts

Closes #394
troytt force-pushed feat/issue-394-town-portal from 2fe9138fb1 to 7295dc8b3e 2026-09-26 15:11:21 +00:00 Compare
troytt merged commit e29d743f38 into main 2026-09-26 15:11:58 +00:00
troytt deleted branch feat/issue-394-town-portal 2026-09-26 15:11:58 +00:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: troytt/diablo2-web#488
No description provided.