Files
bl/logic/service/pet/pet.go
昔念 f76587f952 feat(pet): 实现精灵融合功能并优化相关逻辑
新增精灵融合接口及处理逻辑,支持主副精灵融合生成新精灵,并消耗金币与材料。
同时调整了战斗技能选择流程、修复地图热度统计安全问题以及完善宠物删除机制。

- 添加 `PetFusion` 控制器方法实现融合核心逻辑
- 新增 `C2S_PetFusion` 和 `PetFusionInfo` 结构体用于通信
- 修正战斗中技能随机选取后立即返回的问题
- 修复太空站进入/离开时对地图热度的并发访问风险
-
2025-11-26 01:33:48 +08:00

97 lines
4.0 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 pet
import (
"blazing/logic/service/common"
"blazing/modules/blazing/model"
)
type InInfo struct {
Head common.TomeeHeader `cmd:"2301" struc:"skip"`
CatchTime uint32
}
type OutInfo struct {
model.PetInfo
}
// PetReleaseOutboundInfo 宠物释放出站消息
type PetReleaseOutboundInfo struct {
HomeEnergy uint32 `json:"home_energy" fieldDescription:"暂定0" autoCodec:"true" uint:"true"`
FirstPetTime uint32 `json:"first_pet_time" fieldDescription:"精灵生成时间" autoCodec:"true" uint:"true"`
Flag uint32
PetInfo model.PetInfo `json:"pet_info" fieldDescription:"精灵信息" autoCodec:"true"`
}
// 放入背包或者加入仓库
type PetReleaseInboundInfo struct {
Head common.TomeeHeader `cmd:"2304" struc:"skip"`
CatchTime uint32 `json:"catch_time" fieldDescription:"精灵生成时间" autoCodec:"true" uint:"true"`
Flag uint32 `json:"flag" fieldDescription:"0为放入仓库1为放入背包" autoCodec:"true" uint:"true"`
}
type PetShowInboundInfo struct {
Head common.TomeeHeader `cmd:"2305" struc:"skip"`
CatchTime uint32 `codec:"catchTime" inboundMessageType:"Pet_Show"`
Flag uint32 `codec:"flag"`
}
type PetShowOutboundInfo struct {
UserID uint32 `codec:"UserID" description:"米米号"`
CatchTime uint32 `codec:"CatchTime" description:"精灵获得的时间"`
ID uint32 `codec:"PetID" description:"精灵编号"`
Flag uint32 `codec:"flag" description:"1为显示 0为收回"`
Dv uint32 `codec:"dv" description:"个体"`
Shiny uint32 `codec:"shiny" description:"闪光状态标识"`
SkinID uint32 `codec:"skinID" description:"皮肤ID"`
Reserved1 [3]uint32
}
type PetOneCureInboundInfo struct {
Head common.TomeeHeader `cmd:"2310" struc:"skip"`
CatchTime uint32 `json:"catchTime" fieldDescription:"精灵捕捉时间" uint:"true"`
} // PetOneCureOutboundInfo 宠物单个治疗出站消息
type PetOneCureOutboundInfo struct {
CatchTime uint32 `json:"catchTime" fieldDescription:"精灵捕捉时间" uint:"true"`
}
type PET_ROWEI struct {
Head common.TomeeHeader `cmd:"2321" struc:"skip"`
ID uint32
CatchTime uint32 `json:"catchTime" fieldDescription:"精灵捕捉时间" uint:"true"`
}
type PET_RETRIEVE struct {
Head common.TomeeHeader `cmd:"2322" struc:"skip"`
//ID uint32
CatchTime uint32 `json:"catchTime" fieldDescription:"精灵捕捉时间" uint:"true"`
}
// PetDefaultInboundInfo
// 实现了InboundMessage接口
type PetDefaultInboundInfo struct {
Head common.TomeeHeader `cmd:"2308" struc:"skip"`
CatchTime uint32 `json:"catchTime" fieldDescription:"精灵捕捉时间" uint:"true" autoCodec:"true" inboundMessageType:"Pet_Default"`
}
// PetDefaultOutboundInfo
// 实现了OutboundMessage接口
type PetDefaultOutboundInfo struct {
IsDefault uint32 `json:"isDefault" fieldDescription:"0: 首发设置失败1: 首发设置成功" uint:"true" autoCodec:"true" outboundMessageType:"Pet_Default"`
}
// C2S_IS_COLLECT 前端(Client)→后端(Server):精灵收集任务状态查询请求包
type C2S_IS_COLLECT struct {
Head common.TomeeHeader `cmd:"2313" struc:"skip"`
Type uint32 `json:"type" msgpack:"type"` // 收集类型301=太空站10胜1=精灵收集计划一期第一种2=精灵收集计划一期第二种
}
// S2C_IS_COLLECT 后端(Server)→前端(Client):精灵收集任务状态查询回包
// 补充说明:
// 1. 此包同时适用于「精灵收集计划」和「太空站10胜送主宠」场景
// 2. isCom=0未领取才可调用 PRIZE_OF_PETKING(2317) 协议领取精灵
// 3. isCom=1已完成/已领取)时,代表奖励已领取,无需再调用领取协议
type S2C_IS_COLLECT struct {
ID uint32 `json:"id" msgpack:"id"` // 收集类型301=太空站10胜1=精灵收集计划一期第一种2=精灵收集计划一期第二种
IsCom uint32 `json:"isCom" msgpack:"isCom"` // 是否完成/是否已领取0=未完成/未领取1=已完成/已领取
}