[动画] 本地玩家死亡后画成站立姿势:selfMode=12 在 PlrMode.txt 里是 KK #548

Open
opened 2026-10-02 07:13:27 +00:00 by troytt · 0 comments
Owner

现象

本地玩家死亡后,角色被画成站立姿势(NU 的最后一帧):既没有死亡动画(DT),也没有倒地的尸体(DD)。

(依据下面的代码路径分析。)

原因

期望(1.13c)

死亡时先播放一次 DT(mode 0),播完后停在 DD(mode 17)。

相关(目前看不出来)

unit-drawables.ts L491-L497 的 animMode 不区分单位类型:mode 7 / 4 → A1,10 → SC。但怪物 7 = SC、玩家 4 = GH、怪物 10 = S3。渲染器目前不读 animMode,所以暂时没有可见影响;处理 #544 时建议按 PlrMode / MonMode 分表一起修。见 #544 的评论:#544 (comment)

## 现象 本地玩家死亡后,角色被画成站立姿势(NU 的最后一帧):既没有死亡动画(DT),也没有倒地的尸体(DD)。 (依据下面的代码路径分析。) ## 原因 - [online-session.ts L1323-L1326](https://git.projectdiablo2.cn/troytt/diablo2-web/src/commit/8fcd2238cc70a054a2051845d247a3a3bc0024cd/src/client/session/online-session.ts#L1323-L1326):本地玩家死亡时 `selfMode = 12`,同时传 `isCorpse: isSelfDead`([L1354](https://git.projectdiablo2.cn/troytt/diablo2-web/src/commit/8fcd2238cc70a054a2051845d247a3a3bc0024cd/src/client/session/online-session.ts#L1354))。 - 12 是 **MonMode.txt** 的 DD([plr-mode.ts L101-L118](https://git.projectdiablo2.cn/troytt/diablo2-web/src/commit/8fcd2238cc70a054a2051845d247a3a3bc0024cd/src/common/units/plr-mode.ts#L101-L118))。按 **PlrMode.txt**([plr-mode.ts L70-L91](https://git.projectdiablo2.cn/troytt/diablo2-web/src/commit/8fcd2238cc70a054a2051845d247a3a3bc0024cd/src/common/units/plr-mode.ts#L70-L91)),玩家 mode 12 是 KK(Kick);死亡中是 DT (0),尸体是 DD (17)。 - 渲染器的玩家分支([`drawSceneUnitDrawable` L403-L435](https://git.projectdiablo2.cn/troytt/diablo2-web/src/commit/8fcd2238cc70a054a2051845d247a3a3bc0024cd/src/client/scene/world-renderer.ts#L403-L435))查 [`PLAYER_MODE_TO_CLIP`](https://git.projectdiablo2.cn/troytt/diablo2-web/src/commit/8fcd2238cc70a054a2051845d247a3a3bc0024cd/src/client/scene/world-renderer.ts#L178-L191),表里没有 12,于是回退到 `nu`(`ctx.playerMoving` 为真时是 `wl`,L417);随后又因为 `unit.isCorpse` 取最后一帧(L431-L432)。结果就是一具站着的尸体。 - 对比:怪物分支在 `isCorpse` 时会选 `dd`([L477-L483](https://git.projectdiablo2.cn/troytt/diablo2-web/src/commit/8fcd2238cc70a054a2051845d247a3a3bc0024cd/src/client/scene/world-renderer.ts#L477-L483)),玩家分支没有对应处理。 ## 期望(1.13c) 死亡时先播放一次 DT(mode 0),播完后停在 DD(mode 17)。 ## 相关(目前看不出来) [unit-drawables.ts L491-L497](https://git.projectdiablo2.cn/troytt/diablo2-web/src/commit/8fcd2238cc70a054a2051845d247a3a3bc0024cd/src/client/view/unit-drawables.ts#L491-L497) 的 `animMode` 不区分单位类型:mode 7 / 4 → `A1`,10 → `SC`。但怪物 7 = SC、玩家 4 = GH、怪物 10 = S3。渲染器目前不读 `animMode`,所以暂时没有可见影响;处理 #544 时建议按 PlrMode / MonMode 分表一起修。见 #544 的评论:https://git.projectdiablo2.cn/troytt/diablo2-web/issues/544#issuecomment-3447
Sign in to join this conversation.
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#548
No description provided.