feat(fight): 优化擂台战斗逻辑与状态管理

- 修改了擂台主人设置逻辑,引入 `Set` 方法统一处理玩家信息更新
- 增加对擂主是否可战斗的判断,防止无效挑战
- 调整连胜计算和广播机制,确保数据一致性
- 修复擂台挑战失败时的状态回滚问题
- 引入错误码替代硬编码返回值,提高代码可读性与维护性
- 统一访问擂台玩家的方式,移除冗余字段
This commit is contained in:
2025-11-28 00:16:51 +08:00
parent 0ab1a85d17
commit f90581e0f6
13 changed files with 90 additions and 54 deletions

View File

@@ -254,7 +254,7 @@ func (f *FightC) handleItemAction(a *action.UseItemAction) {
CatchTime: uint32(f.Opp.CurrentPet.Info.CatchTime),
PetId: uint32(f.Opp.CurrentPet.ID),
}))
//f.Reason = info.BattleOverReason.PlayerCatch
//f.Reason = info.BattleOverReason.PlayerCaptureSuccess
//f.WinnerId = 0 //捕捉成功不算胜利
f.closefight = true