抽出5星英雄后A次抽奖内不会再抽到5星英雄(普通卡池+阵营卡池)

This commit is contained in:
meixiongfeng 2022-11-21 16:29:00 +08:00
parent edf63e2f0f
commit 024609c29b

View File

@ -108,6 +108,7 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq
} }
} }
} else { // 所有阵营抽卡都走这里 } else { // 所有阵营抽卡都走这里
drawCount += req.DrawCount
if req.DrawCount == 1 { if req.DrawCount == 1 {
switch req.DrawType { switch req.DrawType {
case 1: case 1:
@ -197,6 +198,12 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq
if v, ok := _data[int32(star)]; ok { if v, ok := _data[int32(star)]; ok {
if int32(len(v)) > randomIndex { if int32(len(v)) > randomIndex {
if star == 5 { // 抽出5星英雄后A次抽奖内不会再抽到5星英雄普通卡池+阵营卡池)
curDrawCount := drawCount - req.DrawCount
newID := this.module.ContinuousRestriction(session.GetUserId(), v[randomIndex].Id, curDrawCount+int32(index), strPool[index])
szCards = append(szCards, newID)
continue
}
szCards = append(szCards, v[randomIndex].Id) szCards = append(szCards, v[randomIndex].Id)
} }
} }
@ -215,6 +222,7 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq
return return
} }
for _, heroId := range szCards { for _, heroId := range szCards {
_mapAddHero[heroId]++ _mapAddHero[heroId]++
} }
code = this.module.CreateRepeatHeros(session, _mapAddHero, true) code = this.module.CreateRepeatHeros(session, _mapAddHero, true)