37 lines
3.0 KiB
Go
37 lines
3.0 KiB
Go
package methods
|
||
|
||
// Native action-layer wire contracts, copied field-for-field from the donor build
|
||
// (7k-v0.4 Drmk.RpcTypes/Client4229938/Methods/GameScene/EnemyAiMethods.cs). The sizes were
|
||
// read out of the CURRENT GameAssembly there, so the field order and widths are not ours to
|
||
// guess: getting them wrong makes the client fail to parse the packet silently, which looks
|
||
// exactly like "the enemy ignored the command".
|
||
// TypeSerializer.ReadSkillParam 0x9F52880. SkillParam is a struct: no reference marker.
|
||
// DesignerPosList is nullable; with it null the payload serialises to 119 bytes.
|
||
// ReadBattleMoveTowardUnitData 0x9B8F0F0: 36 bytes. The action enum is a BYTE on the wire,
|
||
// not an Int32 — writing it as Int32 shifts every field after it and the client reads garbage.
|
||
// Finite native rotation, 21 bytes. Used because many authored NPC skills set
|
||
// NoRotation=true, so the cast itself would not turn the unit to face the player.
|
||
//
|
||
// ⛑⛑ 2026-10-01 实机:这套「服务端自己算角度」的做法会让敌人<b>转身朝向偏转</b>(跑到玩家
|
||
// 面前再转 90° 打空气)。根因不是角度单位(记忆 2026-09-21.md:1066 已确认 Facing/EulerAngles.y
|
||
// 是<b>度</b>),而是 <c>fromAngle</c> 用的是<b>服务端陈旧的估算朝向</b>:客户端在追击过程中
|
||
// 早就自己转过身了,服务端还记着上一次出招的值 ⇒ changeAngle 是凭空多出来的那一截。
|
||
// ⇒ 改用下面的 <c>EnemyAiFaceToTarget4229938</c>(把目标甩给客户端算)。
|
||
// 官方的「转向某个单位」包:SyncUnitSmoothFaceToTarget(ulong pid, ulong targetPid, float rotationSpeed)
|
||
// —— dump.cs:1900469 的抽象声明,methodId 68146316。
|
||
// 20 字节(u64 + u64 + f32)。转角由客户端用<b>真实朝向 + 目标真实坐标</b>算,服务端不再插手,
|
||
// 也就不会因为估算朝向过期而偏。2026-10-01 起是出招前转向的默认方式。
|
||
// C2S. Carries the pid and nothing else — no token, no success flag, so it is a diagnostic
|
||
// acknowledgement rather than proof of arrival.
|
||
// 2026-09-26 Wave 2(原生战斗管线复活):敌人战斗姿态两包,移植 7k-v0.5 同名 DTO
|
||
// (donor 7k-v0.5 GameScene/EnemyAiMethods.cs:7-12),消费方注释一并保留。
|
||
// 两个都是 inline (ulong, uint) = 定长 12B(u64 LE + u32 LE,无 marker)。
|
||
// SyncAgentChangeWeapon(ulong agentId, uint weaponId) -> native agent weapon swap.
|
||
// weaponId = 0 是「卸武器」(7K melee 模式对有空手技能的模板就是这么干的),不是无效值。
|
||
// SyncBattleAnimSet(ulong id, uint animSetTag) -> BaseUnit.ApplyBattleAnimSetTag.
|
||
// This is an AnimationSetConfig ID, NOT AgentConfig.BattleAnimType or an action ID.
|
||
// 空手 = 325(十二面空手)/ 327(通用胖子空手);远程 = 337/338/340;0 = 移除覆盖。
|
||
// SyncEnemyStopMove(68815634)。逐字取自捐赠端
|
||
// Drmk.RpcTypes/Client4229938/Methods/GameScene/EnemyAiMethods.cs:103-109
|
||
// (2026-10-02 牢房移植补齐;主线原先没有这一拍,旧 PolicePrison.cs 注释里记着"先跑两拍")。
|