From 7b2f6b3d467ac5c10192f3a1be49328f6644e38f Mon Sep 17 00:00:00 2001 From: xenohedron Date: Sun, 11 Jun 2023 23:07:27 -0400 Subject: [PATCH] Fix wrong extra cards in 10E boosters --- Mage.Sets/src/mage/sets/TenthEdition.java | 1 + .../main/java/mage/cards/ExpansionSet.java | 22 ++++++++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/Mage.Sets/src/mage/sets/TenthEdition.java b/Mage.Sets/src/mage/sets/TenthEdition.java index faeffd5129f..5e6574c2aa6 100644 --- a/Mage.Sets/src/mage/sets/TenthEdition.java +++ b/Mage.Sets/src/mage/sets/TenthEdition.java @@ -23,6 +23,7 @@ public final class TenthEdition extends ExpansionSet { this.numBoosterUncommon = 3; this.numBoosterRare = 1; this.ratioBoosterMythic = 0; + this.hasAlternateBoosterPrintings = false; // Printings with * are foils without reminder text, not alt art for booster gen purpose cards.add(new SetCardInfo("Abundance", 249, Rarity.RARE, mage.cards.a.Abundance.class)); cards.add(new SetCardInfo("Academy Researchers", 63, Rarity.UNCOMMON, mage.cards.a.AcademyResearchers.class)); diff --git a/Mage/src/main/java/mage/cards/ExpansionSet.java b/Mage/src/main/java/mage/cards/ExpansionSet.java index e3d4d538641..d12e3f4edc9 100644 --- a/Mage/src/main/java/mage/cards/ExpansionSet.java +++ b/Mage/src/main/java/mage/cards/ExpansionSet.java @@ -8,6 +8,7 @@ import mage.collation.BoosterCollator; import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.SetType; +import mage.constants.SuperType; import mage.filter.FilterMana; import mage.util.CardUtil; import mage.util.RandomUtil; @@ -139,6 +140,7 @@ public abstract class ExpansionSet implements Serializable { protected boolean hasUnbalancedColors = false; protected boolean hasOnlyMulticolorCards = false; + 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 @@ -540,11 +542,21 @@ public abstract class ExpansionSet implements Serializable { // TODO: is it ok to put all parent's cards to booster instead lands only? needSets.add(this.parentSet.code); } - List cardInfos = CardRepository.instance.findCards(new CardCriteria() - .setCodes(needSets) - .variousArt(true) - .maxCardNumber(maxCardNumberInBooster) // ignore bonus/extra reprints - ); + List cardInfos; + if (hasAlternateBoosterPrintings) { + cardInfos = CardRepository.instance.findCards(new CardCriteria() + .setCodes(needSets) + .variousArt(true) + .maxCardNumber(maxCardNumberInBooster) // ignore bonus/extra reprints + ); + } else { + cardInfos = CardRepository.instance.findCards(new CardCriteria() + .setCodes(needSets) + .variousArt(true) + .maxCardNumber(maxCardNumberInBooster) // ignore bonus/extra reprints + .supertypes(SuperType.BASIC) // only basic lands with extra printings + ); + } cardInfos.forEach(card -> { this.savedReprints.putIfAbsent(card.getName(), new ArrayList<>()); this.savedReprints.get(card.getName()).add(card);