连续自动战斗 自动使用体力药剂

This commit is contained in:
meixiongfeng 2023-06-08 11:39:39 +08:00
parent 2f34d17669
commit 3fe6c89068
2 changed files with 27 additions and 32 deletions

View File

@ -80,22 +80,19 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.HuntingChallen
"ps": hunting.Ps, "ps": hunting.Ps,
}) })
} }
// if errdata = this.module.CheckRes(session, cfgData.PsConsume); errdata != nil { if errdata = this.module.CheckRes(session, cfgData.PsConsume); errdata != nil {
// if req.AutoBuy { // 不够的时候看是否能自动购买 if req.AutoBuy { // 不够的时候看是否能自动购买
// var count int32 resSell := this.module.ModuleTools.GetGlobalConf().PsItem
// for _, v := range cfgData.PsConsume { if errdata = this.module.CheckRes(session, []*cfg.Gameatn{resSell}); errdata != nil {
// if v.N > 0 { return
// count += v.N }
// } m := make(map[string]int32, 0)
// } m[resSell.T] = resSell.N
// if errdata = this.module.ModuleItems.BuyUnifiedTicket(session, count); errdata != nil { this.module.ModuleItems.SellItem(session, m, true)
// return } else {
// } return
// } else { }
// code = pb.ErrorCode_VikingMaxChallengeCount }
// return
// }
// }
value, ok := hunting.Boss[req.BossType] value, ok := hunting.Boss[req.BossType]
if !ok { // 类型校验 if !ok { // 类型校验

View File

@ -69,22 +69,20 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.VikingChalleng
}) })
} }
// if errdata = this.module.CheckRes(session, cfgData.PsConsume); errdata != nil { if errdata = this.module.CheckRes(session, cfgData.PsConsume); errdata != nil {
// if req.AutoBuy { // 不够的时候自动使用 if req.AutoBuy { // 不够的时候自动使用
// var count int32 resSell := this.module.ModuleTools.GetGlobalConf().PsItem
// for _, v := range cfgData.PsConsume { if errdata = this.module.CheckRes(session, []*cfg.Gameatn{resSell}); errdata != nil {
// if v.N > 0 { return
// count += v.N }
// } m := make(map[string]int32, 0)
// } m[resSell.T] = resSell.N
// if errdata = this.module.ModuleItems.BuyUnifiedTicket(session, count); errdata != nil { this.module.ModuleItems.SellItem(session, m, true)
// return
// } } else { // 体力不够
// } else { return
// code = pb.ErrorCode_VikingMaxChallengeCount }
// return }
// }
// }
if req.Difficulty == 1 && viking.Boss[req.BossId] == 0 { // 当前难度第一次打 if req.Difficulty == 1 && viking.Boss[req.BossId] == 0 { // 当前难度第一次打
viking.Boss[req.BossId] = 1 viking.Boss[req.BossId] = 1