diff --git a/Mage.Sets/src/mage/cards/b/BlotOutTheSky.java b/Mage.Sets/src/mage/cards/b/BlotOutTheSky.java new file mode 100644 index 00000000000..c303992fdc9 --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BlotOutTheSky.java @@ -0,0 +1,61 @@ +package mage.cards.b; + +import mage.abilities.Ability; +import mage.abilities.condition.Condition; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.dynamicvalue.common.ManacostVariableValue; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.DestroyAllEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterNonlandPermanent; +import mage.filter.predicate.Predicates; +import mage.game.Game; +import mage.game.permanent.token.SilverquillToken; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class BlotOutTheSky extends CardImpl { + + private static final FilterPermanent filter = new FilterNonlandPermanent(); + + static { + filter.add(Predicates.not(CardType.CREATURE.getPredicate())); + } + + public BlotOutTheSky(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{W}{B}"); + + // Create X tapped 2/1 white and black Inkling creature tokens with flying. If X is 6 or more, destroy all noncreature, nonland permanents. + this.getSpellAbility().addEffect(new CreateTokenEffect( + new SilverquillToken(), ManacostVariableValue.instance, true, false + )); + this.getSpellAbility().addEffect(new ConditionalOneShotEffect( + new DestroyAllEffect(filter), BlotOutTheSkyCondition.instance, + "If X is 6 or more, destroy all noncreature, nonland permanents" + )); + } + + private BlotOutTheSky(final BlotOutTheSky card) { + super(card); + } + + @Override + public BlotOutTheSky copy() { + return new BlotOutTheSky(this); + } +} + +enum BlotOutTheSkyCondition implements Condition { + instance; + + @Override + public boolean apply(Game game, Ability source) { + return source.getManaCostsToPay().getX() >= 6; + } +} diff --git a/Mage.Sets/src/mage/sets/StrixhavenSchoolOfMages.java b/Mage.Sets/src/mage/sets/StrixhavenSchoolOfMages.java index b128b47fc2b..8ad44f0888d 100644 --- a/Mage.Sets/src/mage/sets/StrixhavenSchoolOfMages.java +++ b/Mage.Sets/src/mage/sets/StrixhavenSchoolOfMages.java @@ -41,6 +41,7 @@ public final class StrixhavenSchoolOfMages extends ExpansionSet { cards.add(new SetCardInfo("Beaming Defiance", 9, Rarity.COMMON, mage.cards.b.BeamingDefiance.class)); cards.add(new SetCardInfo("Biomathematician", 164, Rarity.COMMON, mage.cards.b.Biomathematician.class)); cards.add(new SetCardInfo("Blade Historian", 165, Rarity.RARE, mage.cards.b.BladeHistorian.class)); + cards.add(new SetCardInfo("Blot Out the Sky", 167, Rarity.MYTHIC, mage.cards.b.BlotOutTheSky.class)); cards.add(new SetCardInfo("Body of Research", 168, Rarity.MYTHIC, mage.cards.b.BodyOfResearch.class)); cards.add(new SetCardInfo("Bury in Books", 39, Rarity.COMMON, mage.cards.b.BuryInBooks.class)); cards.add(new SetCardInfo("Campus Guide", 252, Rarity.COMMON, mage.cards.c.CampusGuide.class));