-
Notifications
You must be signed in to change notification settings - Fork 783
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix 15 card booster generation #13206
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -145,6 +145,7 @@ public static ExpansionSetComparator getComparator() { | |
protected boolean hasAlternateBoosterPrintings = true; // not counting basic lands; e.g. Fallen Empires true, but Tenth Edition false | ||
|
||
protected int maxCardNumberInBooster; // used to omit cards with collector numbers beyond the regular cards in a set for boosters | ||
protected int maxCardNumberBasePrint; // used to omit limit boosters to only contain cards with a base printing | ||
|
||
protected final EnumMap<Rarity, List<CardInfo>> savedCards = new EnumMap<>(Rarity.class); | ||
protected final EnumMap<Rarity, List<CardInfo>> savedSpecialCards = new EnumMap<>(Rarity.class); | ||
|
@@ -220,9 +221,15 @@ public List<Card> 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 (this.Booster.size() > 15 && this.Booster.get(0).getRarity() == Rarity.LAND) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's what I get for rushing to submit just before the tournament started - fixed now. As for your first question, the only one I know of is CLB, but there could be others. For CLB, the last four cards (that this protects from being eliminated) are Background, Legendary, Rare, and Foil (which could be any rarity). So the uncommons are at risk. (Edit - changed code so now the uncommons are protected also.) (According to lethe, 2X2 comes in 16card boosters, with Cryptic Spires being the 16th card. So that is another potential one to trigger this in the future.) I had considered a slightly more complicated approach of multistep processing.
|
||
theBooster.remove(0); | ||
} | ||
while (theBooster.size() > 15) { | ||
theBooster.remove(RandomUtil.nextInt(theBooster.size() - 4)); | ||
} | ||
|
||
return theBooster; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are you adding this? what does it have to do with your change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops thought I had taken that one out. Was part of something else.