fix(fight): 修复战斗中属性变化与暴击判定逻辑

- 调整能力提升计算时机,确保命中后再恢复原始属性
- 暴击判断前置,仅在命中时计算暴击翻倍及破防逻辑
- 优化回合结束效果清除逻辑,增加状态存活判断

refactor(controller): 重构擂台相关接口返回结构体类型

- 将 ARENA_SET_OWENR、ARENA_FIGHT_OWENR 等函数的返回值统一改为
  NullOutboundInfo,并移除冗余字段返回
- 广播逻辑调整,统一使用 Broadcast
This commit is contained in:
2025-11-20 05:57:29 +08:00
parent c0b09c92c4
commit 53d6db7e17
37 changed files with 555 additions and 151 deletions

View File

@@ -2,6 +2,7 @@ package controller
import (
"blazing/common/socket/errorcode"
"sync/atomic"
"blazing/logic/service/maphot"
"blazing/logic/service/maps"
@@ -34,24 +35,25 @@ func (h Controller) MapHot(data *maphot.InInfo, c *player.Player) (result *mapho
return
}
func (h *Controller) MapLeave(data *maps.LeaveMapInboundInfo, c *player.Player) (result *info.LeaveMapOutboundInfo, err errorcode.ErrorCode) { //这个时候player应该是空的
//result = &maps.LeaveMapOutboundInfo{UserID: c.GetUserID()}
c.Canmon = false
c.Changemap = true //可以刷怪
//data.Broadcast(c.Info.MapID, info.LeaveMapOutboundInfo{UserID: c.Info.UserID}) //同步广播
atomic.StoreUint32(&c.Canmon, 0)
//data.Broadcast(c.Info.MapID, info.LeaveMapOutboundInfo{UserID: c.Info.UserID}) //同步广播
result = &info.LeaveMapOutboundInfo{
UserID: c.Info.UserID,
}
defer c.GetSpace().LeaveMap(c) //玩家离开地图
// 如果有正在运行的刷怪协程,发送停止信号
//c.Info.MapID = 0 // 重置当前地图
return &info.LeaveMapOutboundInfo{UserID: c.Info.UserID}, 0
return
}
func (h *Controller) MapList(data *maps.ListMapPlayerInboundInfo, c *player.Player) (result *info.ListMapPlayerOutboundInfo, err errorcode.ErrorCode) { //这个时候player应该是空的
result = &info.ListMapPlayerOutboundInfo{
Player: c.GetSpace().GetInfo(),
}
atomic.StoreUint32(&c.Canmon, 2)
c.Canmon = true //可以刷怪
return
}