```
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

feat(fight_boss): 修复Boss挑战功能中的参数传递和效果处理逻辑

- 修复PlayerFightBoss方法中参数名错误(data -> data1)
- 修正BossId获取路径,使用正确的参数引用
- 重构特效处理逻辑,从循环解析改为批量获取
- 添加宠物闪光效果初始化支持

fix(fight_塔): 修复试炼塔相关战斗逻辑错误

- 修正Boss获取逻辑,从单个对象改为数组切片访问
- 调整塔级Boss获取接口
This commit is contained in:
昔念
2026-02-25 21:16:36 +08:00
parent 6af88365c2
commit a3244549f3
6 changed files with 42 additions and 48 deletions

View File

@@ -21,7 +21,7 @@ import (
// data: 包含挑战Boss信息的输入数据
// player: 当前玩家对象
// 返回: 战斗结果和错误码
func (Controller) PlayerFightBoss(data *fight.ChallengeBossInboundInfo, p *player.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) {
func (Controller) PlayerFightBoss(data1 *fight.ChallengeBossInboundInfo, p *player.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) {
r := p.CanFight()
if p.CanFight() != 0 {
return nil, r
@@ -29,7 +29,7 @@ func (Controller) PlayerFightBoss(data *fight.ChallengeBossInboundInfo, p *playe
var monster *model.PetInfo
monsterInfo := &model.PlayerInfo{}
mdata := service.NewMapNodeService().GetDataNode(p.Info.MapID, data.BossId)
mdata := service.NewMapNodeService().GetDataNode(p.Info.MapID, data1.BossId)
if mdata == nil {
return nil, errorcode.ErrorCodes.ErrPokemonNotExists
}
@@ -56,24 +56,20 @@ func (Controller) PlayerFightBoss(data *fight.ChallengeBossInboundInfo, p *playe
monster.MaxHp = uint32(bm.Hp)
}
for _, v := range bm.Effect {
idx := gconv.Uint16(v)
effects := service.NewEffectService().Args(bm.Effect)
if idx == 0 {
continue
}
EID, args := service.NewEffectService().Args(uint32(idx))
for _, v := range effects {
monster.EffectInfo = append(monster.EffectInfo, model.PetEffectInfo{
Idx: idx,
EID: gconv.Uint16(EID),
Args: gconv.Ints(args),
Idx: uint16(v.SeIdx),
EID: gconv.Uint16(v.Eid),
Args: gconv.Ints(v.Args),
})
}
monsterInfo.PetList = append(monsterInfo.PetList, *monster)
}
if bosinfo[0].IsCapture == 1 {
monsterInfo.PetList[0].ShinyInfo = make([]data.GlowFilter, 0)
if grand.Meet(1, 500) {
monsterInfo.PetList[0].RandomByWeightShiny()
}