feat(pet): 实现精灵融合功能并优化相关数据结构 - 新增精灵融合主服务和材料服务,支持根据主副精灵ID查询融合结果 - 调整融合接口参数结构,将物品字段统一为数组形式 - 修改融合材料模型字段类型,提升数据一致性 - 重构融合配置相关逻辑,移除旧融合配置模型及服务 - 增加特性随机选择逻辑,确保融合产物具备有效特性 - 添加材料合法性校验,防止非法材料参与融合 ```
43 lines
1.8 KiB
Go
43 lines
1.8 KiB
Go
package pet
|
||
|
||
import "blazing/logic/service/common"
|
||
|
||
type GetPetListInboundEmpty struct {
|
||
Head common.TomeeHeader `cmd:"2303" struc:"skip"`
|
||
}
|
||
type GetPetListFreeInboundEmpty struct {
|
||
Head common.TomeeHeader `cmd:"2320" struc:"skip"`
|
||
}
|
||
type GetPetListOutboundInfo struct {
|
||
ShortInfoListLen uint32 `struc:"int32,sizeof=ShortInfoList"`
|
||
ShortInfoList []PetShortInfo
|
||
}
|
||
|
||
// PetShortInfo 精灵简要信息结构体
|
||
type PetShortInfo struct {
|
||
ID uint32 // 精灵类型ID(
|
||
CatchTime uint32 // 精灵生成时间
|
||
Level uint32 // 精灵等级
|
||
SkinID uint32 // 精灵皮肤ID
|
||
Shiny uint32 // 精灵是否闪光(0=否,1=是)
|
||
}
|
||
|
||
// C2S_PetFusion 前端(Client)到后端(Server)的精灵融合请求包
|
||
type C2S_PetFusion struct {
|
||
Head common.TomeeHeader `cmd:"2351" struc:"skip"`
|
||
Mcatchtime uint32 `json:"mcatchtime" msgpack:"mcatchtime"` // 主精灵的时间戳
|
||
Auxcatchtime uint32 `json:"auxcatchtime" msgpack:"auxcatchtime"` // 副精灵的时间戳
|
||
Item1 [4]uint32 `json:"item1" msgpack:"item1"` // 物品序号1
|
||
|
||
GoldItem1 uint32 `json:"gold_item1" msgpack:"gold_item1"` // 0代表未放置 金豆物品1(C#:gold_item1)
|
||
GoldItem2 uint32 `json:"gold_item2" msgpack:"gold_item2"` // 0代表未放置 金豆物品2(C#:gold_item2)
|
||
}
|
||
|
||
// PetFusionInfo 精灵融合结果详情(后端回包嵌套结构体)
|
||
type PetFusionInfo struct {
|
||
ObtainTime uint32 `json:"obtainTime" msgpack:"obtainTime"` // 如果获得时间为0 则代表融合失败
|
||
SoulID uint32 `json:"soulID" msgpack:"soulID"` // 元神珠的id 融合失败为0
|
||
StarterCpTm uint32 `json:"starterCpTm" msgpack:"starterCpTm"` // 融合失败为0
|
||
CostItemFlag uint32 `json:"costItemFlag" msgpack:"costItemFlag"` // 是不是消耗掉了金豆道具 1代表消耗道具
|
||
}
|