```
feat(fight): 调整战斗逻辑与精灵切换机制 - 优化精灵切换时的效果处理,增加切换事件支持 - 修复战斗中超时逻辑和技能CD计算问题 - 增强状态效果在精灵上下场时的清理机制 - 修改伤害计算逻辑以提高准确性 - 更新战斗池初始化参数提升并发性能 此外,同步更新了宠物放生字段命名及逻辑处理方式,并调整网络通信中的限流策略。 ```
This commit is contained in:
@@ -40,7 +40,7 @@ func (h Controller) PlayerFightBoss(data *fight.ChallengeBossInboundInfo, c *pla
|
||||
-1,
|
||||
0, //野怪没特性
|
||||
0,
|
||||
2)
|
||||
50)
|
||||
moinfo.Nick = xmlres.PetMAP[int(mo.ID)].DefName
|
||||
moinfo.PetList = append(moinfo.PetList, *mo)
|
||||
} else {
|
||||
@@ -104,9 +104,6 @@ func (h Controller) OnPlayerFightNpcMonster(data *fight.FightNpcMonsterInboundIn
|
||||
int(refpet.Shiny),
|
||||
int(refpet.Lv))
|
||||
|
||||
if c.FightC != nil {
|
||||
return nil, errorcode.ErrorCodes.ErrOnlineOver6HoursCannotFight
|
||||
}
|
||||
moinfo := &model.PlayerInfo{}
|
||||
moinfo.Nick = xmlres.PetMAP[int(mo.ID)].DefName
|
||||
moinfo.PetList = append(moinfo.PetList, *mo)
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
|
||||
@@ -14,11 +14,11 @@ func (h Controller) Walk(data *maps.WalkInInfo, c *player.Player) (result *maps.
|
||||
}
|
||||
|
||||
result.UserID = data.Head.UserID
|
||||
c.Info.Pos = data.Point
|
||||
|
||||
//glog.Debug(context.Background(), err1)
|
||||
if !c.Info.Pos.BothLessThan50(data.Point) { //距离超过50才广播
|
||||
data.Broadcast(c.Info.MapID, *result) //走路的广播
|
||||
}
|
||||
|
||||
c.Info.Pos = data.Point
|
||||
return nil, -1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user