feat(fight): 实现精灵切换功能并优化战斗逻辑

- 新增 ChangePet 方法实现精灵切换
- 优化战斗循环逻辑,支持精灵切换
- 修复一些战斗相关的 bug
- 优化代码结构,提高可维护性
This commit is contained in:
2025-09-07 00:23:28 +08:00
parent 6376d94487
commit 9d2de92dd6
12 changed files with 193 additions and 48 deletions

View File

@@ -83,3 +83,10 @@ func (h Controller) Escape(data *fight.EscapeFightInboundInfo, c *service.Player
c.FightC.Escape(c)
return nil, 0
}
// 切换精灵
func (h Controller) ChangePet(data *fight.ChangePetInboundInfo, c *service.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) {
c.FightC.ChangePet(c, int32(data.CatchTime))
return nil, 0
}