抽卡修改
parent
a2cd81dc37
commit
46a12c155c
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue