feat(fight): 添加捕捉宠物功能并优化物品系统

- 新增 Capture 函数处理捕捉宠物逻辑
- 修改 ChangePet 函数返回值
- 优化物品添加和查询逻辑
- 增加新消息类型 CatchMonsterOutboundInfo
- 调整战斗循环处理捕捉逻辑
待修复技能丢失问题
This commit is contained in:
2025-09-11 02:44:21 +08:00
parent 53df18c1e1
commit 0ca743a592
9 changed files with 123 additions and 20 deletions

View File

@@ -16,15 +16,24 @@ func (h *Controller) GetPetInfo(
data *pet.InInfo,
c *service.Player) (result *pet.OutInfo,
err errorcode.ErrorCode) { //这个时候player应该是空的
for _, pi := range c.Info.PetList {
if pi.CatchTime == data.CatchTime {
return &pet.OutInfo{
result = &pet.OutInfo{
PetInfo: pi,
}, 0
}
}
}
return result, errorcode.ErrorCodes.ErrNoPrerequisiteFacility
if result == nil {
result = &pet.OutInfo{
PetInfo: c.Service.GetPetInfo(data.CatchTime),
}
}
return result, 0
}
// 获取仓库列表