Files
bl/logic/service/fight/cmd.go
昔念 9d2de92dd6 feat(fight): 实现精灵切换功能并优化战斗逻辑
- 新增 ChangePet 方法实现精灵切换
- 优化战斗循环逻辑,支持精灵切换
- 修复一些战斗相关的 bug
- 优化代码结构,提高可维护性
2025-09-07 00:23:28 +08:00

56 lines
1.7 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package fight
import (
"blazing/logic/service"
_ "blazing/logic/service/fight/battle/effect"
)
// 野怪对战包
type FightNpcMonsterInboundInfo struct {
Head service.TomeeHeader `cmd:"2408" struc:"[0]pad"`
// Number 地图刷新怪物结构体对应的序号1-9的位置序号
// @UInt long类型使用uint32保持无符号特性
Number uint32 `fieldDesc:"地图刷新怪物结构体对应的序号 1 - 9 的位置序号" `
}
type NullOutboundInfo struct {
}
// 准备战斗包
type ReadyToFightInboundInfo struct {
Head service.TomeeHeader `cmd:"2404" struc:"[0]pad"`
}
// 战斗逃跑
type EscapeFightInboundInfo struct {
Head service.TomeeHeader `cmd:"2410" struc:"[0]pad"`
}
// HandleFightInviteInboundInfo 处理战斗邀请的入站消息
// 回空包就行
type HandleFightInviteInboundInfo struct {
Head service.TomeeHeader `cmd:"2403" struc:"[0]pad"`
UserID uint32 `json:"userId" codec:"userId,uint"` // 邀请我对战人的userid
Flag uint32 `json:"flag" codec:"flag,uint"` // 1为同意对战 0为取消对战
Mode uint32 `json:"mode" codec:"mode,uint"` // 战斗类型 1 = 1v1 2 = 6v6
}
// 2502的回复包 PVP邀请消息
type NoteHandleFightInviteOutboundInfo struct {
UserID uint32
Nickname string `struc:"[16]byte"` // 固定长度16字节
Result uint32 // 0=拒绝 1=同意 2=在线超6小时 3=无出战精灵 4=不在线
}
// 实现入站消息接口Go中通过方法集隐式实现
type UseSkillInboundInfo struct {
Head service.TomeeHeader `cmd:"2405" struc:"[0]pad"`
// 技能id
SkillId uint32
}
type ChangePetInboundInfo struct {
Head service.TomeeHeader `cmd:"2407" struc:"[0]pad"`
// CatchTime 捕捉时间
CatchTime uint32 `json:"catchTime"`
}