Files
bl/logic/controller/inbound_fight.go
昔念 0051ac0be8
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
```
feat(fight): 添加旧组队协议支持并优化战斗系统

- 实现了旧组队协议相关功能,包括GroupReadyFightFinish、GroupUseSkill、
  GroupUseItem、GroupChangePet和GroupEscape方法
- 新增组队战斗相关的入站信息结构体定义
- 实现了组队BOSS战斗逻辑,添加groupBossSlotLimit常量
- 重构宠物技能设置逻辑,调整金币消耗时机
- 优化战斗循环逻辑,添加对无行动槽位的处理
- 改进AI行动逻辑,增加多位置目标选择
2026-04-08 01:28:55 +08:00

191 lines
6.2 KiB
Go

package controller
import "blazing/logic/service/common"
// FightNpcMonsterInboundInfo 定义请求或响应数据结构。
type FightNpcMonsterInboundInfo struct {
Head common.TomeeHeader `cmd:"2408" struc:"skip"`
Number uint32 `fieldDesc:"地图刷新怪物结构体对应的序号 1 - 9 的位置序号" `
}
// ChallengeBossInboundInfo 定义请求或响应数据结构。
type ChallengeBossInboundInfo struct {
Head common.TomeeHeader `cmd:"2411" struc:"skip"`
BossId uint32 `json:"bossId"`
}
// ReadyToFightInboundInfo 定义请求或响应数据结构。
type ReadyToFightInboundInfo struct {
Head common.TomeeHeader `cmd:"2404" struc:"skip"`
}
// GroupReadyFightFinishInboundInfo 旧组队协议准备完成。
type GroupReadyFightFinishInboundInfo struct {
Head common.TomeeHeader `cmd:"7556" struc:"skip"`
}
type GroupUseSkillInboundInfo struct {
Head common.TomeeHeader `cmd:"7558" struc:"skip"`
ActorIndex uint8
TargetSide uint8
TargetPos uint8
SkillId uint32
}
type GroupUseItemInboundInfo struct {
Head common.TomeeHeader `cmd:"7562" struc:"skip"`
ActorIndex uint8
ItemId uint32
}
type GroupChangePetInboundInfo struct {
Head common.TomeeHeader `cmd:"7563" struc:"skip"`
ActorIndex uint8
CatchTime uint32
}
type GroupEscapeInboundInfo struct {
Head common.TomeeHeader `cmd:"7565" struc:"skip"`
ActorIndex uint8
}
// EscapeFightInboundInfo 定义请求或响应数据结构。
type EscapeFightInboundInfo struct {
Head common.TomeeHeader `cmd:"2410" struc:"skip"`
}
// StartPetWarInboundInfo 定义请求或响应数据结构。
type StartPetWarInboundInfo struct {
Head common.TomeeHeader `cmd:"2431" struc:"skip"`
}
// StartTwarInboundInfo 定义请求或响应数据结构。
type StartTwarInboundInfo struct {
Head common.TomeeHeader `cmd:"2429|2415|2425" struc:"skip"`
}
// ARENA_GET_INFO 定义请求或响应数据结构。
type ARENA_GET_INFO struct {
Head common.TomeeHeader `cmd:"2419" struc:"skip"`
}
// ARENA_UPFIGHT 定义请求或响应数据结构。
type ARENA_UPFIGHT struct {
Head common.TomeeHeader `cmd:"2420" struc:"skip"`
}
// ARENA_OWENR_ACCE 定义请求或响应数据结构。
type ARENA_OWENR_ACCE struct {
Head common.TomeeHeader `cmd:"2422" struc:"skip"`
}
// PetKingJoinInboundInfo 定义请求或响应数据结构。
type PetKingJoinInboundInfo struct {
Head common.TomeeHeader `cmd:"2413" struc:"skip"`
Type uint32
FightType uint32
}
// PeakQueueCancelInboundInfo 定义请求或响应数据结构。
type PeakQueueCancelInboundInfo struct {
Head common.TomeeHeader `cmd:"2459" struc:"skip"`
}
// PeakBanPickSubmitInboundInfo 定义请求或响应数据结构。
type PeakBanPickSubmitInboundInfo struct {
Head common.TomeeHeader `cmd:"2460" struc:"skip"`
SelectedCatchTimesLen uint32 `struc:"sizeof=SelectedCatchTimes"`
SelectedCatchTimes []uint32 `json:"selectedCatchTimes"`
BanCatchTimesLen uint32 `struc:"sizeof=BanCatchTimes"`
BanCatchTimes []uint32 `json:"banCatchTimes"`
}
// HandleFightInviteInboundInfo 定义请求或响应数据结构。
type HandleFightInviteInboundInfo struct {
Head common.TomeeHeader `cmd:"2403" struc:"skip"`
UserID uint32 `json:"userId" codec:"userId,uint"`
Flag uint32 `json:"flag" codec:"flag,uint"`
Mode uint32 `json:"mode" codec:"mode,uint"`
}
// InviteToFightInboundInfo 定义请求或响应数据结构。
type InviteToFightInboundInfo struct {
Head common.TomeeHeader `cmd:"2401" struc:"skip"`
UserID uint32
Mode uint32
}
// InviteFightCancelInboundInfo 定义请求或响应数据结构。
type InviteFightCancelInboundInfo struct {
Head common.TomeeHeader `cmd:"2402" struc:"skip"`
}
// UseSkillInInfo 定义请求或响应数据结构。
type UseSkillInInfo struct {
Head common.TomeeHeader `cmd:"2405" struc:"skip"`
SkillId uint32
}
// UseSkillAtInboundInfo 定义请求或响应数据结构。
type UseSkillAtInboundInfo struct {
Head common.TomeeHeader `cmd:"7505" struc:"skip"`
SkillId uint32 `json:"skillId"`
ActorIndex uint8 `json:"actorIndex"`
TargetIndex uint8 `json:"targetIndex"`
TargetRelation uint8 `json:"targetRelation"`
AtkType uint8 `json:"atkType"`
}
// ChangePetInboundInfo 定义请求或响应数据结构。
type ChangePetInboundInfo struct {
Head common.TomeeHeader `cmd:"2407" struc:"skip"`
CatchTime uint32 `json:"catchTime"`
}
// CatchMonsterInboundInfo 定义请求或响应数据结构。
type CatchMonsterInboundInfo struct {
Head common.TomeeHeader `cmd:"2409" struc:"skip"`
CapsuleId uint32 `json:"capsuleId" fieldDescription:"胶囊id" uint:"true"`
}
// LoadPercentInboundInfo 定义请求或响应数据结构。
type LoadPercentInboundInfo struct {
Head common.TomeeHeader `cmd:"2441" struc:"skip"`
Percent uint32 `fieldDescription:"加载百分比"`
}
// UsePetItemInboundInfo 定义请求或响应数据结构。
type UsePetItemInboundInfo struct {
Head common.TomeeHeader `cmd:"2406" struc:"skip"`
CatchTime uint32 `description:"精灵捕获时间" codec:"catchTime"`
ItemId uint32 `description:"使用的物品ID" codec:"itemId"`
Reversed1 uint32 `description:"填充字段 0" codec:"reversed1"`
}
// ChatInfo 定义请求或响应数据结构。
type ChatInfo struct {
Head common.TomeeHeader `cmd:"50002" struc:"skip"`
Reserve uint32 `json:"reserve" fieldDescription:"填充 默认值为0" uint:"true"`
MessageLen uint32 `struc:"sizeof=Message"`
Message string `json:"message" fieldDescription:"消息内容, 结束符为utf-8的数字0"`
}
// C2S_FRESH_CHOICE_FIGHT_LEVEL 定义请求或响应数据结构。
type C2S_FRESH_CHOICE_FIGHT_LEVEL struct {
Head common.TomeeHeader `cmd:"2428|2414" struc:"skip"`
Level uint `json:"level"`
}
// C2S_OPEN_DARKPORTAL 定义请求或响应数据结构。
type C2S_OPEN_DARKPORTAL struct {
Head common.TomeeHeader `cmd:"2424" struc:"skip"`
Level uint32 `json:"level"`
}
// FRESH_LEAVE_FIGHT_LEVEL 定义请求或响应数据结构。
type FRESH_LEAVE_FIGHT_LEVEL struct {
Head common.TomeeHeader `cmd:"2430|2416|2426" struc:"skip"`
}