feat(boss-fight): 添加boss id验证并修复捕捉机制 - 在玩家挑战boss时添加boss ids
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user