refactor(fight): 重构战斗模块代码
- 优化了 FightC 结构体,将 Info 字段改为指针类型 - 添加了 EffectNode 类型的 Type 方法,用于获取效果类型 - 修改了 BattlePetEntity 中的 Attribute 结构,移除了未使用的枚举类型 - 删除了 info.go 文件中未使用的结构体定义 - 在 effect_1.go 中更新了 Effect1 类的 PostDamage 方法,待重写实现
This commit is contained in:
60
logic/service/fight/cmd.go
Normal file
60
logic/service/fight/cmd.go
Normal file
@@ -0,0 +1,60 @@
|
||||
package fight
|
||||
|
||||
import (
|
||||
"blazing/logic/service"
|
||||
)
|
||||
|
||||
// 野怪对战包
|
||||
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"`
|
||||
}
|
||||
|
||||
// FightOverInfo 战斗结束信息结构体 2506
|
||||
type FightOverInfo struct {
|
||||
Reason uint32 // 固定值0
|
||||
WinnerId uint32 // 胜者的米米号 野怪为0
|
||||
TwoTimes uint32 // 双倍经验剩余次数
|
||||
ThreeTimes uint32 // 三倍经验剩余次数
|
||||
AutoFightTimes uint32 // 自动战斗剩余次数
|
||||
EnergyTimes uint32 // 能量吸收器剩余次数
|
||||
LearnTimes uint32 // 双倍学习器剩余次数
|
||||
}
|
||||
|
||||
// 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
|
||||
}
|
||||
Reference in New Issue
Block a user