From b1a79b8fa25a5311bb0a6898df734137d8962843 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Fri, 19 Aug 2022 23:54:46 -0400 Subject: [PATCH] [DMU] Implemented Cut Down --- Mage.Sets/src/mage/cards/c/CutDown.java | 53 ++++++++++++++++++++ Mage.Sets/src/mage/sets/DominariaUnited.java | 1 + 2 files changed, 54 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/c/CutDown.java diff --git a/Mage.Sets/src/mage/cards/c/CutDown.java b/Mage.Sets/src/mage/cards/c/CutDown.java new file mode 100644 index 0000000000..75d43410dd --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CutDown.java @@ -0,0 +1,53 @@ +package mage.cards.c; + +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterCreaturePermanent; +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 CutDown extends CardImpl { + + private static final FilterPermanent filter + = new FilterCreaturePermanent("creature with total power and toughness 5 or less"); + + static { + filter.add(CutDownPredicate.instance); + } + + public CutDown(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{B}"); + + // Destroy target creature with total power and toughness 5 or less. + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addTarget(new TargetPermanent(filter)); + } + + private CutDown(final CutDown card) { + super(card); + } + + @Override + public CutDown copy() { + return new CutDown(this); + } +} + +enum CutDownPredicate implements Predicate { + instance; + + @Override + public boolean apply(Permanent input, Game game) { + return input.getPower().getValue() + input.getToughness().getValue() <= 5; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/DominariaUnited.java b/Mage.Sets/src/mage/sets/DominariaUnited.java index fc9e054131..302f4ba0e2 100644 --- a/Mage.Sets/src/mage/sets/DominariaUnited.java +++ b/Mage.Sets/src/mage/sets/DominariaUnited.java @@ -32,6 +32,7 @@ public final class DominariaUnited extends ExpansionSet { cards.add(new SetCardInfo("Benalish Sleeper", 8, Rarity.COMMON, mage.cards.b.BenalishSleeper.class)); cards.add(new SetCardInfo("Caves of Koilos", 244, Rarity.RARE, mage.cards.c.CavesOfKoilos.class)); cards.add(new SetCardInfo("Charismatic Vanguard", 10, Rarity.COMMON, mage.cards.c.CharismaticVanguard.class)); + cards.add(new SetCardInfo("Cut Down", 89, Rarity.UNCOMMON, mage.cards.c.CutDown.class)); cards.add(new SetCardInfo("Evolved Sleeper", 93, Rarity.RARE, mage.cards.e.EvolvedSleeper.class)); cards.add(new SetCardInfo("Forest", 274, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Herd Migration", 429, Rarity.RARE, mage.cards.h.HerdMigration.class));