Fix wrong extra cards in 10E boosters

This commit is contained in:
xenohedron 2023-06-11 23:07:27 -04:00
parent 43aa0be6eb
commit 7b2f6b3d46
2 changed files with 18 additions and 5 deletions

View file

@ -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));

View file

@ -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<CardInfo> cardInfos = CardRepository.instance.findCards(new CardCriteria()
.setCodes(needSets)
.variousArt(true)
.maxCardNumber(maxCardNumberInBooster) // ignore bonus/extra reprints
);
List<CardInfo> 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);