修改抽卡逻辑

back_recharge
lvxinran 2021-01-28 17:05:37 +08:00
parent 50824acdd9
commit 1b2e00e478
1 changed files with 7 additions and 13 deletions

View File

@ -552,20 +552,14 @@ public class HeroLogic{
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
}
sLotteryRewardConfig = randomHeroByPoolId(onConfig.getpool_id(), 1, user.getPlayerInfoManager().getLevel());
if(mustSet.size() > 1){
//如果同时触发多个 把所有的计数清零
for(int mustId:mustSet){
randomPoolByType.get(mergePool).put(mustId,0);
for (int key : randomPoolByType.get(mergePool).keySet()) {
if(maxId >= key){
randomPoolByType.get(mergePool).put(key, 0);
}else{
int curValue = randomPoolByType.get(mergePool).getOrDefault(key, 0);
randomPoolByType.get(mergePool).put(key, curValue + 1);
}
}else{
//如果只触发一个仍把其他的计数加1
for (int key : randomPoolByType.get(mergePool).keySet()) {
if(maxId != key){
int curValue = randomPoolByType.get(mergePool).getOrDefault(key, 0);
randomPoolByType.get(mergePool).put(key, curValue + 1);
}
}
randomPoolByType.get(mergePool).put(maxId,0);
}
}
heroManager.updateRandomPoolByType(mergePool,randomPoolByType.get(mergePool));