From 3206ce77b448a57e6f01467dc710bd649e714ee0 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Tue, 1 Jun 2021 20:25:05 -0400 Subject: [PATCH] [MH2] Implemented Break the Ice --- Mage.Sets/src/mage/cards/b/BreakTheIce.java | 66 ++++++++++++++++++++ Mage.Sets/src/mage/sets/ModernHorizons2.java | 1 + 2 files changed, 67 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/b/BreakTheIce.java diff --git a/Mage.Sets/src/mage/cards/b/BreakTheIce.java b/Mage.Sets/src/mage/cards/b/BreakTheIce.java new file mode 100644 index 00000000000..172b63c99da --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BreakTheIce.java @@ -0,0 +1,66 @@ +package mage.cards.b; + +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DestroyAllEffect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.keyword.OverloadAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.ManaType; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.Predicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.TargetPermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class BreakTheIce extends CardImpl { + + private static final FilterPermanent filter + = new FilterLandPermanent("land that is snow or could produce {C}"); + + static { + filter.add(BreakTheIcePredicate.instance); + } + + public BreakTheIce(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{B}{B}"); + + // Destroy target land that is snow or could produce {C}. + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addTarget(new TargetPermanent(filter)); + + // Overload {4}{B}{B} + this.addAbility(new OverloadAbility(this, new DestroyAllEffect(filter), new ManaCostsImpl<>("{4}{B}{B}"))); + } + + private BreakTheIce(final BreakTheIce card) { + super(card); + } + + @Override + public BreakTheIce copy() { + return new BreakTheIce(this); + } +} + +enum BreakTheIcePredicate implements Predicate { + instance; + + @Override + public boolean apply(Permanent input, Game game) { + return input.isSnow() + || input + .getAbilities() + .getActivatedManaAbilities(Zone.BATTLEFIELD) + .stream() + .anyMatch(ability -> ability.getProducableManaTypes(game).contains(ManaType.COLORLESS)); + } +} diff --git a/Mage.Sets/src/mage/sets/ModernHorizons2.java b/Mage.Sets/src/mage/sets/ModernHorizons2.java index dbb383e3f05..d8471818fe6 100644 --- a/Mage.Sets/src/mage/sets/ModernHorizons2.java +++ b/Mage.Sets/src/mage/sets/ModernHorizons2.java @@ -48,6 +48,7 @@ public final class ModernHorizons2 extends ExpansionSet { cards.add(new SetCardInfo("Braids, Cabal Minion", 273, Rarity.RARE, mage.cards.b.BraidsCabalMinion.class)); cards.add(new SetCardInfo("Brainstone", 223, Rarity.UNCOMMON, mage.cards.b.Brainstone.class)); cards.add(new SetCardInfo("Break Ties", 8, Rarity.COMMON, mage.cards.b.BreakTies.class)); + cards.add(new SetCardInfo("Break the Ice", 77, Rarity.UNCOMMON, mage.cards.b.BreakTheIce.class)); cards.add(new SetCardInfo("Breya's Apprentice", 117, Rarity.RARE, mage.cards.b.BreyasApprentice.class)); cards.add(new SetCardInfo("Cabal Coffers", 301, Rarity.MYTHIC, mage.cards.c.CabalCoffers.class)); cards.add(new SetCardInfo("Calibrated Blast", 118, Rarity.RARE, mage.cards.c.CalibratedBlast.class));