back_recharge
wangyuan 2019-05-13 17:59:22 +08:00
parent 41ec525158
commit e45fc9a2e8
3 changed files with 18 additions and 1 deletions

View File

@ -57,6 +57,7 @@ public class SDifferDemonsBoxSetting implements BaseConfig {
idBySeasonIdMapTmp.get(sDifferDemonsBoxSetting.getSeasonTimes()).add(sDifferDemonsBoxSetting.getId());
}
config = configTmp;
idBySeasonIdMap = idBySeasonIdMapTmp;
}

View File

@ -343,7 +343,7 @@ public class ActivityLogic {
}
secretBoxManager.setCount(secretBoxManager.getCount()+randCount);
CommonProto.Drop.Builder drop = ItemUtil.drop(user, randDrop);
CommonProto.Drop.Builder drop = ItemUtil.dropPer(user, randDrop);
int[] extraItem = sDifferDemonsBoxSetting.getExtraItem();
CommonProto.Drop.Builder extraDrop = ItemUtil.drop(user, new int[][]{extraItem});
PlayerInfoProto.SecretBoxRandomResponse build = PlayerInfoProto.SecretBoxRandomResponse.newBuilder().setDrop(drop).setExtrarReward(extraDrop).build();

View File

@ -36,6 +36,22 @@ public class ItemUtil {
addEquip(user,equipMap,dropBuilder);
return dropBuilder;
}
public static CommonProto.Drop.Builder dropPer(User user, int[][] itemArr) throws Exception {
CommonProto.Drop.Builder dropBuilder = CommonProto.Drop.newBuilder();
for(int [] item : itemArr){
Map<Integer, Integer> itemMap = new HashMap<>();
Map<Integer, Integer> cardMap = new HashMap<>();
Map<Integer,Integer> equipMap = new HashMap<>();
Map<Integer,Integer> randomMap = new HashMap<>();
selectItemArr(new int[][]{item},cardMap,itemMap,equipMap,randomMap);
useRandomItem(user,randomMap);
addItem(user,itemMap,dropBuilder);
addCard(user,cardMap,dropBuilder);
addEquip(user,equipMap,dropBuilder);
}
return dropBuilder;
}
//活动额外掉落
public static void activityDrop(User user,CommonProto.Drop.Builder dropBuilder ,int[] dropGroupIds, float dropRatio) throws Exception {
Map<Integer, Integer> itemMap = new HashMap<>();