feat(fight): 新增使用宠物物品功能 - 在Controller中新增UsePetItemInboundInfo方法,用于处理宠物物品使用请求 - 在FightI接口中添加UseItem方法定义,支持传入捕获时间和物品ID - 修改UseItemAction结构体,增加CacthTime字段以记录宠物捕获时间 - 新增UsePetItemInboundInfo结构体,定义宠物物品使用的消息格式 - 在FightC中实现UseItem方法,将使用物品的动作发送到actionChan ```
22 lines
557 B
Go
22 lines
557 B
Go
package common
|
|
|
|
import (
|
|
"blazing/logic/service/fight/info"
|
|
"math/rand"
|
|
)
|
|
|
|
type FightI interface {
|
|
Over(c PlayerI, id info.EnumBattleOverReason) //逃跑
|
|
UseSkill(c PlayerI, id int32) //使用技能
|
|
GetCurrPET(c PlayerI) *info.BattlePetEntity //当前精灵
|
|
Ownerid() uint32
|
|
ReadyFight(c PlayerI) //是否准备战斗
|
|
ChangePet(c PlayerI, id uint32)
|
|
Capture(c PlayerI, id uint32)
|
|
GetRand() *rand.Rand
|
|
LoadPercent(c PlayerI, percent int32)
|
|
UseItem(c PlayerI, cacthid, itemid uint32)
|
|
CanEscape() bool
|
|
IsFirst(c PlayerI) bool
|
|
}
|