- 在 `fight_boss.go` 中为 Boss 的每只宠物增加了 CatchTime 字段以区分不同精灵, 并修复了技能特效参数解析的问题。 - 新增多个魂印(NewSeIdx)实现,包括: * 无限 PP、伤害倍率控制、命中屏蔽、属性克制、暴击率调整等。 - 调整了部分已有 NewSeIdx 文件中的方法调用方式,统一使用 `ID().GetCatchTime()` 来判断精灵是否在场。 - 修改了 EffectIDCombiner 的字段访问方式,改为通过 Get/Set 方法操作。 - 优化战斗逻辑,在 NPC 战斗中加入 AI 自动出招机制。
127 lines
4.3 KiB
Go
127 lines
4.3 KiB
Go
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 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 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=精灵大师赛 (对应Java的@UInt long type)
|
||
FightType uint32 // 仅当Type为11时有效 (对应Java的@UInt long fightType)
|
||
}
|
||
|
||
// 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
|
||
}
|
||
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"` // @UInt long 对应Go的uint32(无符号64位)
|
||
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"` // @UInt long reserve,无符号长整数
|
||
MessageLen uint32 `struc:"sizeof=Message"`
|
||
Message string `json:"message" fieldDescription:"消息内容, 结束符为utf-8的数字0"` // 消息内容,包含utf-8空字符('\x00')作为结束符
|
||
}
|