feat(fight): 新增使用宠物物品功能

- 在Controller中新增UsePetItemInboundInfo方法,用于处理宠物物品使用请求
- 在FightI接口中添加UseItem方法定义,支持传入捕获时间和物品ID
- 修改UseItemAction结构体,增加CacthTime字段以记录宠物捕获时间
- 新增UsePetItemInboundInfo结构体,定义宠物物品使用的消息格式
- 在FightC中实现UseItem方法,将使用物品的动作发送到actionChan
```
This commit is contained in:
2025-11-08 01:30:53 +08:00
parent cad3ad6913
commit a42bd76517
6 changed files with 36 additions and 1 deletions

View File

@@ -198,3 +198,11 @@ func (h Controller) LoadPercent(data *fight.LoadPercentInboundInfo, c *player.Pl
return nil, -1
}
func (h Controller) UsePetItemInboundInfo(data *fight.UsePetItemInboundInfo, c *player.Player) (result *info.UsePetItemOutboundInfo, err errorcode.ErrorCode) {
if c.FightC != nil {
c.FightC.UseItem(c, data.CatchTime, data.ItemId)
}
return nil, -1
}