mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
Merge d559914205 into acc180d1d4
This commit is contained in:
commit
ee68ad1783
1 changed files with 20 additions and 2 deletions
|
|
@ -282,10 +282,28 @@ public abstract class ExpansionSet implements Serializable {
|
|||
}
|
||||
}
|
||||
|
||||
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<Rarity> 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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue