抽卡清计数修改

back_recharge
lvxinran 2021-04-20 14:04:01 +08:00
parent 935740a46e
commit 1a1a112734
2 changed files with 12 additions and 12 deletions

View File

@ -517,7 +517,7 @@ public class HeroLogic{
}
SLotteryRewardConfig sLotteryRewardConfig;
//是否有必出
int currStarId = 0;
int[] currStarId;//需要清除的计数id
if(mustSet.isEmpty()){
sLotteryRewardConfig = randomHeroByPoolId(getPooId(sLotterySetting), 1, user.getPlayerInfoManager().getLevel());
// if(randomPoolByType.get(mergePool)!=null) {
@ -550,25 +550,25 @@ public class HeroLogic{
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
}
sLotteryRewardConfig = randomHeroByPoolId(onConfig.getpool_id(), 1, user.getPlayerInfoManager().getLevel());
currStarId = maxId;
currStarId = new int[]{maxId};
}
if(randomPoolByType.get(mergePool)!=null) {
for (int key : randomPoolByType.get(mergePool).keySet()) {
//如果生效次数是0可重置
List<SLotterySpecialConfig> lotteryListByDifferentType = SLotterySpecialConfig.getLotteryListByDifferentType(key);
if (currStarId >= key && lotteryListByDifferentType != null && lotteryListByDifferentType.iterator().hasNext() && lotteryListByDifferentType.iterator().next().getMin_num() == 0) {
randomPoolByType.get(mergePool).put(key, 0);
} else {
int curValue = randomPoolByType.get(mergePool).getOrDefault(key, 0);
randomPoolByType.get(mergePool).put(key, curValue + 1);
for(int starId:currStarId){
if (starId >= key && lotteryListByDifferentType != null && lotteryListByDifferentType.iterator().hasNext() && lotteryListByDifferentType.iterator().next().getMin_num() == 0) {
randomPoolByType.get(mergePool).put(key, 0);
} else {
int curValue = randomPoolByType.get(mergePool).getOrDefault(key, 0);
randomPoolByType.get(mergePool).put(key, curValue + 1);
}
}
}
}
heroManager.updateRandomPoolByType(mergePool,randomPoolByType.get(mergePool));
int result = sLotteryRewardConfig.getId();
return result;
return sLotteryRewardConfig.getId();
}
private int getSpecialPoolByRandcount(SLotterySetting sLotterySetting, int randCount,int poolCount) {

View File

@ -23,7 +23,7 @@ public class SLotteryRewardConfig implements BaseConfig {
private int[] openRules;
private int star;
private int[] star;
private static Map<Integer, List<SLotteryRewardConfig>> sLotteryRewardConfigsByPoolId;
private static Map<Integer, Integer> sLotteryRewardWeightByPoolId;
@ -85,7 +85,7 @@ public class SLotteryRewardConfig implements BaseConfig {
return openRules;
}
public int getStar() {
public int[] getStar() {
return star;
}
}