[MH2] Implemented Break the Ice

This commit is contained in:
Evan Kranzler 2021-06-01 20:25:05 -04:00
parent 1326c635f9
commit 3206ce77b4
2 changed files with 67 additions and 0 deletions

View file

@ -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<Permanent> {
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));
}
}

View file

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