diff --git a/Mage/src/main/java/mage/cards/ExpansionSet.java b/Mage/src/main/java/mage/cards/ExpansionSet.java index 3e7077f11a7e..b140f5701148 100644 --- a/Mage/src/main/java/mage/cards/ExpansionSet.java +++ b/Mage/src/main/java/mage/cards/ExpansionSet.java @@ -220,10 +220,28 @@ public List create15CardBooster() { } } - while (theBooster.size() > 15) { + // removing positional cards from collated boosters is going to mess with balancing and as-fan + // also for sets with common lands in the land slot, this may eliminate the majority of fixing from a pack + // instead removing a random card that is not in the last four (where rare and uncommons usually are - though some uncommons may be displayed by cards with special collation - eg DFC or bonus sheet). + if (theBooster.size() > 15 && theBooster.get(0).getRarity() == Rarity.LAND) { theBooster.remove(0); } - + int keepCards = 4; + ArrayList dontRemove = new ArrayList<>(Arrays.asList(Rarity.UNCOMMON, Rarity.RARE, Rarity.MYTHIC)); + int toRemove; + while (theBooster.size() > 15) { + if (theBooster.size() > keepCards) { + toRemove = RandomUtil.nextInt(theBooster.size() - keepCards); + if( dontRemove.contains( theBooster.get(toRemove).getRarity() )) { + keepCards = theBooster.size() - toRemove ; + } else { + theBooster.remove(toRemove); + } + } else { + theBooster.remove(0); + } + } + return theBooster; }