抽卡修改

back_recharge
lvxinran 2019-12-21 10:19:18 +08:00
parent a2cd81dc37
commit 46a12c155c
2 changed files with 11 additions and 4 deletions

View File

@ -220,8 +220,15 @@ public class HeroLogic{
allowFree = user.getPlayerInfoManager().check(VipPrivilegeType.FREE_HERO_RANDOM, 1);
}
if(!allowFree){
int [][] costItems = new int[][]{sLotterySetting.getCostItem()};
boolean enoughCost = ItemUtil.itemCost(user, costItems,BIReason.RANDOM_HERO_CONSUME,type);
boolean enoughCost = false;
for (int[] cost:sLotterySetting.getCostItem()){
int [][] costItems = new int[][]{cost};
enoughCost = ItemUtil.itemCost(user, costItems,BIReason.RANDOM_HERO_CONSUME,type);
if(enoughCost){
break;
}
}
if(!enoughCost){
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
}

View File

@ -25,7 +25,7 @@ public class SLotterySetting implements BaseConfig {
private int[][] tenTimesMustGetItem;
private int[] costItem;
private int[][] costItem;
private int perCount;
@ -88,7 +88,7 @@ public class SLotterySetting implements BaseConfig {
return perCount;
}
public int[] getCostItem() {
public int[][] getCostItem() {
return costItem;
}