From a73e49cb4a706f4d020f12435330277f114f8b1e Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Thu, 23 May 2019 18:50:26 -0400 Subject: [PATCH] Implemented Force of Despair --- .../src/mage/cards/f/ForceOfDespair.java | 57 +++++++++++++++++++ Mage.Sets/src/mage/sets/ModernHorizons.java | 1 + 2 files changed, 58 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/f/ForceOfDespair.java diff --git a/Mage.Sets/src/mage/cards/f/ForceOfDespair.java b/Mage.Sets/src/mage/cards/f/ForceOfDespair.java new file mode 100644 index 0000000000..f0ec1ce8c1 --- /dev/null +++ b/Mage.Sets/src/mage/cards/f/ForceOfDespair.java @@ -0,0 +1,57 @@ +package mage.cards.f; + +import mage.ObjectColor; +import mage.abilities.condition.common.NotMyTurnCondition; +import mage.abilities.costs.AlternativeCostSourceAbility; +import mage.abilities.costs.common.ExileFromHandCost; +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.FilterCreaturePermanent; +import mage.filter.common.FilterOwnedCard; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.filter.predicate.permanent.EnteredThisTurnPredicate; +import mage.target.common.TargetCardInHand; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class ForceOfDespair extends CardImpl { + + private static final FilterOwnedCard filter + = new FilterOwnedCard("a black card from your hand"); + private static final FilterPermanent filter2 + = new FilterCreaturePermanent("creatures that entered the battlefield this turn"); + + static { + filter.add(new ColorPredicate(ObjectColor.BLACK)); + filter2.add(new EnteredThisTurnPredicate()); + } + + public ForceOfDespair(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{B}{B}"); + + // If it's not your turn, you may exile a black card from your hand rather than pay this spell's mana cost. + this.addAbility(new AlternativeCostSourceAbility( + new ExileFromHandCost(new TargetCardInHand(filter)), NotMyTurnCondition.instance, + "If it's not your turn, you may exile a black card from " + + "your hand rather than pay this spell's mana cost." + )); + + // Destroy all creatures that entered the battlefield this turn. + this.getSpellAbility().addEffect(new DestroyAllEffect(filter2)); + } + + private ForceOfDespair(final ForceOfDespair card) { + super(card); + } + + @Override + public ForceOfDespair copy() { + return new ForceOfDespair(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ModernHorizons.java b/Mage.Sets/src/mage/sets/ModernHorizons.java index 274491081a..5f7e3e3c92 100644 --- a/Mage.Sets/src/mage/sets/ModernHorizons.java +++ b/Mage.Sets/src/mage/sets/ModernHorizons.java @@ -45,6 +45,7 @@ public final class ModernHorizons extends ExpansionSet { cards.add(new SetCardInfo("Fiery Islet", 238, Rarity.RARE, mage.cards.f.FieryIslet.class)); cards.add(new SetCardInfo("Firebolt", 122, Rarity.UNCOMMON, mage.cards.f.Firebolt.class)); cards.add(new SetCardInfo("Flusterstorm", 255, Rarity.RARE, mage.cards.f.Flusterstorm.class)); + cards.add(new SetCardInfo("Force of Despair", 92, Rarity.RARE, mage.cards.f.ForceOfDespair.class)); cards.add(new SetCardInfo("Force of Negation", 52, Rarity.RARE, mage.cards.f.ForceOfNegation.class)); cards.add(new SetCardInfo("Force of Vigor", 164, Rarity.RARE, mage.cards.f.ForceOfVigor.class)); cards.add(new SetCardInfo("Frostwalk Bastion", 240, Rarity.UNCOMMON, mage.cards.f.FrostwalkBastion.class));