feat(pet): 实现精灵融合功能并优化相关逻辑
新增精灵融合接口及处理逻辑,支持主副精灵融合生成新精灵,并消耗金币与材料。 同时调整了战斗技能选择流程、修复地图热度统计安全问题以及完善宠物删除机制。 - 添加 `PetFusion` 控制器方法实现融合核心逻辑 - 新增 `C2S_PetFusion` 和 `PetFusionInfo` 结构体用于通信 - 修正战斗中技能随机选取后立即返回的问题 - 修复太空站进入/离开时对地图热度的并发访问风险 -
This commit is contained in:
@@ -50,6 +50,15 @@ func (f *baseplayer) FindPet(CatchTime uint32) (int, *model.PetInfo, bool) {
|
||||
return item.CatchTime == CatchTime
|
||||
})
|
||||
}
|
||||
func (f *Player) Pet_del(CatchTime uint32) {
|
||||
|
||||
index, _, ok := f.FindPet(CatchTime)
|
||||
if ok {
|
||||
f.Info.PetList = append(f.Info.PetList[:index], f.Info.PetList[index+1:]...)
|
||||
}
|
||||
|
||||
f.Service.Pet.Pet_del(CatchTime)
|
||||
}
|
||||
|
||||
// // 计算整数的二进制1的个数(Integer.bitCount)
|
||||
// func bitsCount(n int) int {
|
||||
|
||||
Reference in New Issue
Block a user