[P1][D11] 死亡动画帧门控:掉落延迟到死亡动画结束帧触发 #420

Closed
opened 2026-09-24 03:25:58 +00:00 by troytt · 1 comment
Owner

现状

src/game/combat.ts:730-733 在 monster.hp <= 0 的同一帧就发出 kill 事件,
src/game/engine.ts:846 紧接着同帧执行掉落。视觉上物品在怪物尚未开始播放死亡动画时就已经洒了一地。

1.13c 真实行为

掉落挂在死亡动画的终帧(AnimData.d2 中 DT/DD 序列的结束)上,
与尸体定格、flippy 弹出、掉落音效在时间轴上对齐。

验收标准

  • 引入掉落延迟队列:kill 事件只登记待掉落,真正生成在 animator 的死亡序列终帧解析。
  • 死亡动画被打断/怪物被尸爆等移除时,仍必须按原版规则完成掉落(不可吞掉)。
  • RNG 时序不受延迟影响:掉落结果在 kill 帧即用怪物 seed 决定,仅呈现延后,保证与 D18 锁步一致。
  • vitest:断言掉落实体出现的 tick 等于死亡动画终帧 tick,且相同 seed 下物品结果与同帧掉落完全相同。
## 现状 `src/game/combat.ts:730-733` 在 `monster.hp <= 0` 的同一帧就发出 `kill` 事件, `src/game/engine.ts:846` 紧接着同帧执行掉落。视觉上物品在怪物尚未开始播放死亡动画时就已经洒了一地。 ## 1.13c 真实行为 掉落挂在死亡动画的终帧(`AnimData.d2` 中 `DT`/`DD` 序列的结束)上, 与尸体定格、`flippy` 弹出、掉落音效在时间轴上对齐。 ## 验收标准 - [ ] 引入掉落延迟队列:kill 事件只登记待掉落,真正生成在 `animator` 的死亡序列终帧解析。 - [ ] 死亡动画被打断/怪物被尸爆等移除时,仍必须按原版规则完成掉落(不可吞掉)。 - [ ] RNG 时序不受延迟影响:掉落结果在 kill 帧即用怪物 seed 决定,仅**呈现**延后,保证与 D18 锁步一致。 - [ ] vitest:断言掉落实体出现的 tick 等于死亡动画终帧 tick,且相同 seed 下物品结果与同帧掉落完全相同。
troytt added this to the [M18] 打怪掉落物品:怪物死亡掉落全链路 1.13c 还原 milestone 2026-09-24 03:25:58 +00:00
Author
Owner

Resolution Summary (Issue #420 — Commit 9022579)

  • Gated monster drop dispatch on death animation completion (DT -> DD transition) via queueMonsterDrop and triggerMonsterDrop in src/game/engine.ts and src/scene/act-scene.ts.\n- Verified in tests/death-animation-drop-gating.test.ts.

  • Verification: npx tsc --noEmit (0 errors), full Vitest drop/combat/item/E2E parity suites (100% pass), and scripts/verify-m5.ts / scripts/verify-net.ts (0 problems).

### Resolution Summary (Issue #420 — Commit `9022579`) - Gated monster drop dispatch on death animation completion (`DT` -> `DD` transition) via `queueMonsterDrop` and `triggerMonsterDrop` in `src/game/engine.ts` and `src/scene/act-scene.ts`.\n- Verified in `tests/death-animation-drop-gating.test.ts`. - **Verification**: `npx tsc --noEmit` (0 errors), full Vitest drop/combat/item/E2E parity suites (100% pass), and `scripts/verify-m5.ts` / `scripts/verify-net.ts` (0 problems).
Sign in to join this conversation.
No Label
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#420
No description provided.