Files
bl/logic/service/fight/cmd.go
xinian 78a68148ce
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed
chore: update fight logic and effect implementations
2026-04-05 02:25:44 +08:00

175 lines
6.1 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/common"
_ "blazing/logic/service/fight/boss"
_ "blazing/logic/service/fight/effect"
)
// 野怪对战包
type FightNpcMonsterInboundInfo struct {
Head common.TomeeHeader `cmd:"2408" struc:"skip"`
// Number 地图刷新怪物结构体对应的序号1-9的位置序号
Number uint32 `fieldDesc:"地图刷新怪物结构体对应的序号 1 - 9 的位置序号" `
}
type ChallengeBossInboundInfo struct {
Head common.TomeeHeader `cmd:"2411" struc:"skip"`
BossId uint32 `json:"bossId"`
}
type NullOutboundInfo struct {
}
type S2C_ChoiceLevelRequestInfo struct {
CurFightLevel uint32 `json:"curFightLevel"` // 当前战斗层数
BossLen uint32 `struc:"sizeof=BossID"`
BossID []uint32 `json:"bossId"` // 下一层的精灵id数组
}
// 准备战斗包
type ReadyToFightInboundInfo struct {
Head common.TomeeHeader `cmd:"2404" struc:"skip"`
}
// 战斗逃跑
type EscapeFightInboundInfo struct {
Head common.TomeeHeader `cmd:"2410" struc:"skip"`
}
// 精灵王
type StartPetWarInboundInfo struct {
Head common.TomeeHeader `cmd:"2431" struc:"skip"`
}
type StartTwarInboundInfo struct {
Head common.TomeeHeader `cmd:"2429|2415|2425" struc:"skip"`
}
type ARENA_SET_OWENR struct {
Head common.TomeeHeader `cmd:"2417" struc:"skip"`
}
type ARENA_FIGHT_OWENR struct {
Head common.TomeeHeader `cmd:"2418" struc:"skip"`
}
type ARENA_GET_INFO struct {
Head common.TomeeHeader `cmd:"2419" struc:"skip"`
}
type ARENA_UPFIGHT struct {
Head common.TomeeHeader `cmd:"2420" struc:"skip"`
}
type ARENA_OWENR_ACCE struct {
Head common.TomeeHeader `cmd:"2422" struc:"skip"`
}
// 表示"宠物王加入"的入站消息数据
type PetKingJoinInboundInfo struct {
Head common.TomeeHeader `cmd:"2413" struc:"skip"`
Type uint32 // 战斗类型5=单精灵6=多精灵11=精灵大师赛
FightType uint32 // 仅当Type为11时有效
}
// HandleFightInviteInboundInfo 处理战斗邀请的入站消息
type HandleFightInviteInboundInfo struct {
Head common.TomeeHeader `cmd:"2403" struc:"skip"`
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
}
type InviteToFightInboundInfo struct {
Head common.TomeeHeader `cmd:"2401" struc:"skip"`
UserID uint32
// Mode 战斗类型 1 = 1v1 2 = 6v6
Mode uint32
}
type InviteFightCancelInboundInfo struct {
Head common.TomeeHeader `cmd:"2402" struc:"skip"`
}
// 2502的回复包 PVP邀请消息
type NoteHandleFightInviteOutboundInfo struct {
UserID uint32
Nickname string `struc:"[16]byte"` // 固定长度16字节
Result uint32 // 0=拒绝 1=同意 2=在线超6小时 3=无出战精灵 4=不在线
}
type UseSkillInInfo struct {
Head common.TomeeHeader `cmd:"2405" struc:"skip"`
// 技能id
SkillId uint32
}
// UseSkillAtInboundInfo 组队/多战位技能使用包(新增)。
// 目标关系与前端 AtkType 语义对齐:
// 0=对方 1=自己 2=队友AtkType: 0=所有人 1=仅己方 2=仅对方 3=仅自己。
type UseSkillAtInboundInfo struct {
Head common.TomeeHeader `cmd:"7505" struc:"skip"`
SkillId uint32 `json:"skillId"`
// 出手方槽位(我方)
ActorIndex uint8 `json:"actorIndex"`
// 目标槽位(按 TargetRelation 所属阵营解释)
TargetIndex uint8 `json:"targetIndex"`
// 0=对方 1=自己 2=队友
TargetRelation uint8 `json:"targetRelation"`
// 前端技能目标类型(可选兜底),同 GBTL AtkType 定义
AtkType uint8 `json:"atkType"`
}
type ChangePetInboundInfo struct {
Head common.TomeeHeader `cmd:"2407" struc:"skip"`
// CatchTime 捕捉时间
CatchTime uint32 `json:"catchTime"`
}
type CatchMonsterInboundInfo struct {
Head common.TomeeHeader `cmd:"2409" struc:"skip"`
// CapsuleId 胶囊id
CapsuleId uint32 `json:"capsuleId" fieldDescription:"胶囊id" uint:"true"`
}
type LoadPercentInboundInfo struct {
Head common.TomeeHeader `cmd:"2441" struc:"skip"`
Percent uint32 `fieldDescription:"加载百分比"`
}
// UsePetItemInboundInfo 对应Java的UsePetItemInboundInfo实现InboundMessage接口
type UsePetItemInboundInfo struct {
Head common.TomeeHeader `cmd:"2406" struc:"skip"`
// 字段首字母大写以导出对应Java的可访问性配合@Data的getter/setter
CatchTime uint32 `description:"精灵捕获时间" codec:"catchTime"`
ItemId uint32 `description:"使用的物品ID" codec:"itemId"` // 结构体标签模拟@FieldDescription和@AutoCodec注解
Reversed1 uint32 `description:"填充字段 0" codec:"reversed1"` // reversed1对应原Java的填充字段
}
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"` // 消息内容包含utf-8空字符('\x00')作为结束符
}
type C2S_FRESH_CHOICE_FIGHT_LEVEL struct {
Head common.TomeeHeader `cmd:"2428|2414" struc:"skip"`
Level uint `json:"level"` // 若使用JSON序列化添加tag若用protobuf可替换为对应的tag
}
type C2S_OPEN_DARKPORTAL struct {
Head common.TomeeHeader `cmd:"2424" struc:"skip"`
Level uint32 `json:"level"` // 若使用JSON序列化添加tag若用protobuf可替换为对应的tag
}
type S2C_OPEN_DARKPORTAL struct {
CurBossID uint32 `json:"curBossID"`
}
type S2C_FreshChoiceLevelRequestInfo struct {
// CurFightLevel 当前战斗层数(对应前端 curFightLevel 字段)
CurFightLevel uint32 `json:"curFightLevel"` // JSON序列化tag保证字段名与前端一致
BossIdLen uint32 `struc:"sizeof=BossId"`
// BossId 当前层数的精灵ID数组对应前端 bossId 字段C# List<uint> 对应Go []uint切片
BossId []uint32 `json:"bossId"`
}
type FRESH_LEAVE_FIGHT_LEVEL struct {
Head common.TomeeHeader `cmd:"2430|2416|2426" struc:"skip"`
}