public List<Card> create15CardBooster() { // Forces 15 card booster packs. // if the packs are too small, it adds commons to fill it out. // if the packs are too big, it removes the first cards. // since it adds lands then commons before uncommons // and rares this should be the least disruptive. List<Card> theBooster = this.createBooster(); if (15 > theBooster.size()) { List<CardInfo> commons = getCardsByRarity(Rarity.COMMON); while (15 > theBooster.size() && !commons.isEmpty()) { addToBooster(theBooster, commons); if (commons.isEmpty()) { commons = getCardsByRarity(Rarity.COMMON); } } } while (theBooster.size() > 15) { theBooster.remove(0); } return theBooster; }
if (RandomUtil.nextInt(15) < 10) { if (!specialCommon.isEmpty()) { addToBooster(booster, specialCommon); } else { i--; addToBooster(booster, specialUncommon); } else { i--; addToBooster(booster, specialRare); } else { i--; if (!specialBonus.isEmpty()) { if (RandomUtil.nextInt(3) < 2) { addToBooster(booster, specialMythic); continue; addToBooster(booster, specialMythic); continue; addToBooster(booster, specialBonus);
for (int i = 0; i < numBoosterLands; i++) { if (ratioBoosterSpecialLand > 0 && RandomUtil.nextInt(ratioBoosterSpecialLand) < ratioBoosterSpecialLandNumerator && specialLands != null) { addToBooster(booster, specialLands); } else { addToBooster(booster, basicLands); addToBooster(booster, commons); addToBooster(booster, uncommons); for (int i = 0; i < numBoosterRare; i++) { if (ratioBoosterMythic > 0 && RandomUtil.nextInt(ratioBoosterMythic) == 0) { addToBooster(booster, mythics); } else { addToBooster(booster, rares);
for (int i = 0; i < numBoosterUncommon; i++) { while (true) { addToBooster(booster, uncommons); int check = addMissingPartner(booster, partnerAllowed, numBoosterUncommon - 1, i); if (check == 1) { addToBooster(booster, commons); if (ratioBoosterMythic > 0 && RandomUtil.nextInt(ratioBoosterMythic) == 0) { while (true) { addToBooster(booster, mythics); int check = addMissingPartner(booster, partnerAllowed, -1, 1); if (check == 1) { addToBooster(booster, rares); int check = addMissingPartner(booster, partnerAllowed, -1, 1); if (check == 1) {
public void addDoubleFace(List<Card> booster) { for (int i = 0; i < numBoosterDoubleFaced; i++) { CardCriteria criteria = new CardCriteria(); criteria.setCodes(this.code).doubleFaced(true); if (RandomUtil.nextInt(15) < 10) { criteria.rarities(Rarity.COMMON); } else if (RandomUtil.nextInt(5) < 4) { criteria.rarities(Rarity.UNCOMMON); } else if (RandomUtil.nextInt(8) < 7) { criteria.rarities(Rarity.RARE); } else { criteria.rarities(Rarity.MYTHIC); } List<CardInfo> doubleFacedCards = CardRepository.instance.findCards(criteria); addToBooster(booster, doubleFacedCards); } }