From b577b20cb711890e4afce3f51124a7dfeaab3425 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Sat, 10 Jun 2023 08:39:34 -0400 Subject: [PATCH] [LTR] Implement Banish from Edoras --- .../src/mage/cards/b/BanishFromEdoras.java | 54 +++++++++++++++++++ .../TheLordOfTheRingsTalesOfMiddleEarth.java | 1 + 2 files changed, 55 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/b/BanishFromEdoras.java diff --git a/Mage.Sets/src/mage/cards/b/BanishFromEdoras.java b/Mage.Sets/src/mage/cards/b/BanishFromEdoras.java new file mode 100644 index 00000000000..3935a212697 --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BanishFromEdoras.java @@ -0,0 +1,54 @@ +package mage.cards.b; + +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.Condition; +import mage.abilities.condition.common.SourceTargetsPermanentCondition; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.abilities.effects.common.cost.SpellCostReductionSourceEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.TappedPredicate; +import mage.target.common.TargetCreaturePermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class BanishFromEdoras extends CardImpl { + + private static final FilterPermanent filter + = new FilterCreaturePermanent("a tapped creature"); + + static { + filter.add(TappedPredicate.TAPPED); + } + + private static final Condition condition = new SourceTargetsPermanentCondition(filter); + + public BanishFromEdoras(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{W}"); + + // This spell costs {2} less to cast if it targets a tapped creature. + this.addAbility(new SimpleStaticAbility( + Zone.ALL, new SpellCostReductionSourceEffect(2, condition).setCanWorksOnStackOnly(true) + ).setRuleAtTheTop(true)); + + // Exile target creature. + this.getSpellAbility().addEffect(new ExileTargetEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + private BanishFromEdoras(final BanishFromEdoras card) { + super(card); + } + + @Override + public BanishFromEdoras copy() { + return new BanishFromEdoras(this); + } +} diff --git a/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java b/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java index 88d6171c947..676e1463450 100644 --- a/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java +++ b/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java @@ -25,6 +25,7 @@ public final class TheLordOfTheRingsTalesOfMiddleEarth extends ExpansionSet { cards.add(new SetCardInfo("Arwen, Mortal Queen", 193, Rarity.MYTHIC, mage.cards.a.ArwenMortalQueen.class)); cards.add(new SetCardInfo("Assault on Osgiliath", 285, Rarity.RARE, mage.cards.a.AssaultOnOsgiliath.class)); cards.add(new SetCardInfo("Bag End Porter", 153, Rarity.COMMON, mage.cards.b.BagEndPorter.class)); + cards.add(new SetCardInfo("Banish from Edoras", 1, Rarity.COMMON, mage.cards.b.BanishFromEdoras.class)); cards.add(new SetCardInfo("Barad-dur", 253, Rarity.RARE, mage.cards.b.BaradDur.class)); cards.add(new SetCardInfo("Battle-Scarred Goblin", 115, Rarity.COMMON, mage.cards.b.BattleScarredGoblin.class)); cards.add(new SetCardInfo("Bilbo, Retired Burglar", 196, Rarity.UNCOMMON, mage.cards.b.BilboRetiredBurglar.class));