From dee5278f52c77c214b77dad0433948283539167b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=94=E5=BF=B5?= <12574910+72wo@users.noreply.github.com> Date: Thu, 26 Feb 2026 00:05:43 +0800 Subject: [PATCH] =?UTF-8?q?```=20feat(boss-fight):=20=E6=B7=BB=E5=8A=A0bos?= =?UTF-8?q?s=20id=E9=AA=8C=E8=AF=81=E5=B9=B6=E4=BF=AE=E5=A4=8D=E6=8D=95?= =?UTF-8?q?=E6=8D=89=E6=9C=BA=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在玩家挑战boss时添加boss ids --- logic/controller/fight_boss野怪和地图怪.go | 11 +++++++++-- logic/service/player/Monster.go | 11 +++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/logic/controller/fight_boss野怪和地图怪.go b/logic/controller/fight_boss野怪和地图怪.go index 0d8da503c..4d65678af 100644 --- a/logic/controller/fight_boss野怪和地图怪.go +++ b/logic/controller/fight_boss野怪和地图怪.go @@ -34,6 +34,9 @@ func (Controller) PlayerFightBoss(data1 *fight.ChallengeBossInboundInfo, p *play return nil, errorcode.ErrorCodes.ErrPokemonNotExists } + if len(mdata.BossIds) == 0 { + return nil, errorcode.ErrorCodes.ErrPokemonNotExists + } bosinfo := service.NewBossService().Get(mdata.BossIds[0]) if bosinfo == nil { return nil, errorcode.ErrorCodes.ErrPokemonNotExists @@ -85,9 +88,13 @@ func (Controller) PlayerFightBoss(data1 *fight.ChallengeBossInboundInfo, p *play ai := player.NewAI_player(monsterInfo) ai.CanCapture = bosinfo[0].IsCapture - if xmlres.PetMAP[int(monster.ID)].CatchRate == 0 { - ai.CanCapture = 0 + if bosinfo[0].IsCapture != 0 { + ai.CanCapture = xmlres.PetMAP[int(monster.ID)].CatchRate + if xmlres.PetMAP[int(monster.ID)].CatchRate == 0 { + ai.CanCapture = 0 + } } + ai.Prop[0] = 2 fight.NewFight(p, ai, func(foi info.FightOverInfo) { if mdata.WinBonusID != 0 { diff --git a/logic/service/player/Monster.go b/logic/service/player/Monster.go index 5720e0dd9..893b97339 100644 --- a/logic/service/player/Monster.go +++ b/logic/service/player/Monster.go @@ -66,10 +66,17 @@ func (p *Player) GenMonster() { if p.Data[i].ID != 0 { p.Data[i].Lv = uint32(grand.N(v.MinLevel, v.MaxLevel)) - p.Data[i].IsCapture = v.IsCapture //实现捕捉限制 - if handleNPCFightSpecial(p.Data[i].ID) == 0 { + + if v.IsCapture != 0 { + if handleNPCFightSpecial(p.Data[i].ID) == 0 { + p.Data[i].IsCapture = 0 + } else { + p.Data[i].IsCapture = handleNPCFightSpecial(p.Data[i].ID) //施加捕捉率 + } + } else { p.Data[i].IsCapture = 0 } + if len(v.RefreshID) == 1 { //说明这里只固定刷一个,概率变尼尔尼奥,不是稀有精灵 nieo, _, _ := p.Roll(1, 25)