feat(fight): 调整战斗逻辑与精灵切换机制

- 优化精灵切换时的效果处理,增加切换事件支持
- 修复战斗中超时逻辑和技能CD计算问题
- 增强状态效果在精灵上下场时的清理机制
- 修改伤害计算逻辑以提高准确性
- 更新战斗池初始化参数提升并发性能

此外,同步更新了宠物放生字段命名及逻辑处理方式,并调整网络通信中的限流策略。
```
This commit is contained in:
2025-11-13 02:43:00 +08:00
parent 45911dd23d
commit f281b949ba
24 changed files with 201 additions and 105 deletions

View File

@@ -74,7 +74,7 @@ func (h *Controller) PetRelease(
if v.CatchTime == uint32(data.CatchTime) {
c.Service.PetInfo_One_exec(data.CatchTime, func(t *model.PetEX) {
t.Data = v
t.InBag = 0
//t.InBag = 0
})
@@ -88,9 +88,18 @@ func (h *Controller) PetRelease(
case 1:
//todo 背包
c.Service.PetInfo_One_exec(data.CatchTime, func(t *model.PetEX) {
t.InBag = 1
c.Info.PetList = append(c.Info.PetList, t.Data)
result.PetInfo = t.Data
_, _, ok := utils.FindWithIndex(c.Info.PetList, func(item model.PetInfo) bool {
return item.CatchTime == uint32(data.CatchTime)
})
//如果背包没找到,再放入背包
if !ok && t.CatchTime != 0 {
//t.InBag = 1
c.Info.PetList = append(c.Info.PetList, t.Data)
result.PetInfo = t.Data
}
})