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)