diff --git a/modules/hero/api_drawCard.go b/modules/hero/api_drawCard.go index da78ac276..a91e2fecb 100644 --- a/modules/hero/api_drawCard.go +++ b/modules/hero/api_drawCard.go @@ -98,7 +98,7 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq strPool = append(strPool, v) //找到了 continue } - + Is5Star := false starWeight := []int32{drawConf.Star3w, drawConf.Star4w, drawConf.Star5w} // 随机获取三星 if drawConf.Permission != -1 && heroRecord.Baodi5[req.DrawType] > 0 { // 橙权递增 starWeight[2] += this.module.configure.GetHeroDrawWeightConfigById(drawConf.Permission, heroRecord.Baodi5[req.DrawType]) @@ -115,6 +115,7 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq star5Count++ heroRecord.Baodi5[req.DrawType] = 0 strPool = append(strPool, drawConf.P5pool) + Is5Star = true } } else { if starIndex == 0 { @@ -127,10 +128,11 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq star5Count++ heroRecord.Baodi5[req.DrawType] = 0 strPool = append(strPool, drawConf.N5pool) + Is5Star = true } } // 判断是否必出5星 - if heroRecord.Baodi5[req.DrawType] >= drawConf.Baidi5 { + if heroRecord.Baodi5[req.DrawType] >= drawConf.Baidi5 && !Is5Star { heroRecord.Baodi5[req.DrawType] = 0 star5Count++ if IsBaodiPool { @@ -138,6 +140,7 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq } else { strPool[len(strPool)-1] = drawConf.N5pool } + Is5Star = true continue } // 判断是否必出4星 @@ -169,6 +172,7 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq } } } + //抽出5星英雄后A次抽奖内不会再抽到5星英雄(普通卡池+阵营卡池) } } // 通过卡池获得最终的英雄 diff --git a/modules/smithy/api_trade.go b/modules/smithy/api_trade.go index e27f6a6e9..f8a8329c2 100644 --- a/modules/smithy/api_trade.go +++ b/modules/smithy/api_trade.go @@ -32,14 +32,13 @@ func (this *apiComp) Sell(session comm.IUserSession, req *pb.SmithySellReq) (err if errors.As(err, &customErr) { code := customErr.Code errdata = &pb.ErrorData{ - Code: code, - Title: code.ToString(), + Code: code, + Title: code.ToString(), } } else { errdata = &pb.ErrorData{ - Code: pb.ErrorCode_DBError, - Title: pb.ErrorCode_DBError.ToString(), - Message: err.Error(), + Code: pb.ErrorCode_DBError, + Title: pb.ErrorCode_DBError.ToString(), } return }