From a70b6000625b5a238b41c55e81065cd4ff0348e7 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Wed, 21 Jun 2023 17:21:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=BD=E5=8D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/hero/api_drawCardv2.go | 59 +++++++++------------------------- 1 file changed, 15 insertions(+), 44 deletions(-) diff --git a/modules/hero/api_drawCardv2.go b/modules/hero/api_drawCardv2.go index b3412a0e5..adc10190c 100644 --- a/modules/hero/api_drawCardv2.go +++ b/modules/hero/api_drawCardv2.go @@ -28,7 +28,6 @@ func (this *apiComp) DrawCardV2(session comm.IUserSession, req *pb.HeroDrawCardR star4Max int32 // 10连抽最大4星数量 star5Max int32 // 10连抽最大5星数量 cfgDraw *cfg.GameGlobalData - costAtn *cfg.Gameatn heroRecord *pb.DBHeroRecord pool string // 当前抽对应的卡池 atno []*pb.UserAtno // 最终获得的资源 @@ -82,9 +81,13 @@ func (this *apiComp) DrawCardV2(session comm.IUserSession, req *pb.HeroDrawCardR if req.DrawType == 0 { // 普通卡池抽卡 ////// 获取消耗 star if req.DrawCount == 1 { - costAtn = cfgDraw.BasePoolCost // 单抽消耗 + costRes = drawConf.ConsumeA // 单抽消耗 } else { - costAtn = cfgDraw.BasePool10cost // 十连消耗 + costRes = drawConf.ConsumeB // 十连消耗 + } + + if errdata = this.module.CheckRes(session, costRes); errdata != nil { // 消耗数量不足直接返回 + return } ///// 获取消耗 end for i := 1; i <= int(req.DrawCount); i++ { // 一张一张的抽 @@ -93,6 +96,7 @@ func (this *apiComp) DrawCardV2(session comm.IUserSession, req *pb.HeroDrawCardR strPool = append(strPool, v) //找到了 continue } + // 随机获取三星 } } else { @@ -101,15 +105,14 @@ func (this *apiComp) DrawCardV2(session comm.IUserSession, req *pb.HeroDrawCardR if req.DrawType == 0 { // 普通卡池抽卡 normalDraw = true // 获取普通抽卡池 - if req.DrawCount == 1 { - costAtn = cfgDraw.BasePoolCost - } else { - costAtn = cfgDraw.BasePool10cost - } - costRes = append(costRes, costAtn) - if errdata = this.module.CheckRes(session, costRes); errdata != nil { // 消耗数量不足直接返回 - return - } + // if req.DrawCount == 1 { + // costAtn = cfgDraw.BasePoolCost + // } else { + // costAtn = cfgDraw.BasePool10cost + // } + // if errdata = this.module.CheckRes(session, costRes); errdata != nil { // 消耗数量不足直接返回 + // return + // } for i := 0; i < int(req.DrawCount); i++ { drawCount += 1 @@ -250,47 +253,15 @@ func (this *apiComp) DrawCardV2(session comm.IUserSession, req *pb.HeroDrawCardR } else { // 所有阵营抽卡都走这里 drawCount += req.DrawCount if req.DrawCount == 1 { - switch req.DrawType { - case 1: - pool = cfgDraw.Camp1Pool1 - costAtn = cfgDraw.Camp1PoolCost - - case 2: - pool = cfgDraw.Camp2Pool1 - costAtn = cfgDraw.Camp2PoolCost - case 3: - pool = cfgDraw.Camp3Pool1 - costAtn = cfgDraw.Camp3PoolCost - case 4: - pool = cfgDraw.Camp4Pool1 - costAtn = cfgDraw.Camp4PoolCost - } strPool = append(strPool, pool) } else { - costAtn = cfgDraw.Camp1PoolCost - switch req.DrawType { - case 1: - pool = cfgDraw.Camp1Pool1 - costAtn = cfgDraw.Camp1Pool10cost - case 2: - pool = cfgDraw.Camp2Pool1 - costAtn = cfgDraw.Camp2Pool10cost - case 3: - pool = cfgDraw.Camp3Pool1 - costAtn = cfgDraw.Camp3Pool10cost - case 4: - pool = cfgDraw.Camp4Pool1 - costAtn = cfgDraw.Camp4Pool10cost - } for i := 0; i < int(req.DrawCount); i++ { strPool = append(strPool, pool) } } - costRes = append(costRes, costAtn) - //阵营消耗 if errdata = this.module.CheckRes(session, costRes); errdata != nil { // 消耗数量不足直接返回 return