From e03dad7a8c8b6b103ae11367405bee2eab2c7a20 Mon Sep 17 00:00:00 2001 From: Evan Kranzler <theelk801@gmail.com> Date: Sun, 28 Mar 2021 19:06:36 -0400 Subject: [PATCH] [STX] added STA to booster generation --- .../mage/sets/StrixhavenMysticalArchive.java | 1 + .../mage/sets/StrixhavenSchoolOfMages.java | 23 ++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/sets/StrixhavenMysticalArchive.java b/Mage.Sets/src/mage/sets/StrixhavenMysticalArchive.java index d73f891334..f7058980a3 100644 --- a/Mage.Sets/src/mage/sets/StrixhavenMysticalArchive.java +++ b/Mage.Sets/src/mage/sets/StrixhavenMysticalArchive.java @@ -19,6 +19,7 @@ public final class StrixhavenMysticalArchive extends ExpansionSet { super("Strixhaven Mystical Archive", "STA", ExpansionSet.buildDate(2021, 4, 23), SetType.SUPPLEMENTAL); this.hasBoosters = false; this.hasBasicLands = false; + this.maxCardNumberInBooster = 63; cards.add(new SetCardInfo("Abundant Harvest", 111, Rarity.RARE, mage.cards.a.AbundantHarvest.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Abundant Harvest", 48, Rarity.RARE, mage.cards.a.AbundantHarvest.class, NON_FULL_USE_VARIOUS)); diff --git a/Mage.Sets/src/mage/sets/StrixhavenSchoolOfMages.java b/Mage.Sets/src/mage/sets/StrixhavenSchoolOfMages.java index a3800be614..9bc85994cb 100644 --- a/Mage.Sets/src/mage/sets/StrixhavenSchoolOfMages.java +++ b/Mage.Sets/src/mage/sets/StrixhavenSchoolOfMages.java @@ -1,8 +1,12 @@ package mage.sets; +import mage.cards.Card; import mage.cards.ExpansionSet; import mage.constants.Rarity; import mage.constants.SetType; +import mage.util.RandomUtil; + +import java.util.List; /** * @author TheElk801 @@ -21,7 +25,7 @@ public final class StrixhavenSchoolOfMages extends ExpansionSet { this.hasBoosters = true; this.hasBasicLands = true; this.numBoosterLands = 1; - this.numBoosterCommon = 10; + this.numBoosterCommon = 9; this.numBoosterUncommon = 3; this.numBoosterRare = 1; this.ratioBoosterMythic = 7.4; @@ -75,4 +79,21 @@ public final class StrixhavenSchoolOfMages extends ExpansionSet { cards.add(new SetCardInfo("Witherbloom Apprentice", 247, Rarity.UNCOMMON, mage.cards.w.WitherbloomApprentice.class)); cards.add(new SetCardInfo("Witherbloom Command", 248, Rarity.RARE, mage.cards.w.WitherbloomCommand.class)); } + + @Override + public List<Card> tryBooster() { + // Boosters have one card from STA, odds are 2/3 for uncommon, 4/15 for rare, 1/15 for mythic + List<Card> booster = super.tryBooster(); + final Rarity rarity; + int i = RandomUtil.nextInt(15); + if (i == 14) { + rarity = Rarity.MYTHIC; + } else if (i >= 10) { + rarity = Rarity.RARE; + } else { + rarity = Rarity.UNCOMMON; + } + addToBooster(booster, StrixhavenMysticalArchive.getInstance().getCardsByRarity(rarity)); + return booster; + } }