From fa387696cc1fc4d09c70fdd84cf96bc69acb41dd Mon Sep 17 00:00:00 2001 From: FateRevoked Date: Fri, 11 Jan 2019 23:43:58 -0800 Subject: [PATCH] Implemented Final Payment --- Mage.Sets/src/mage/cards/f/FinalPayment.java | 60 +++++++++++++++++++ .../src/mage/sets/RavnicaAllegiance.java | 1 + 2 files changed, 61 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/f/FinalPayment.java diff --git a/Mage.Sets/src/mage/cards/f/FinalPayment.java b/Mage.Sets/src/mage/cards/f/FinalPayment.java new file mode 100644 index 0000000000..22486309c3 --- /dev/null +++ b/Mage.Sets/src/mage/cards/f/FinalPayment.java @@ -0,0 +1,60 @@ +package mage.cards.f; + +import java.util.UUID; + +import mage.abilities.costs.AlternativeCostSourceAbility; +import mage.abilities.costs.Cost; +import mage.abilities.costs.OptionalAdditionalCost; +import mage.abilities.costs.OrCost; +import mage.abilities.costs.common.PayLifeCost; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.dynamicvalue.common.SacrificeCostCreaturesToughness; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetControlledPermanent; +import mage.target.common.TargetCreaturePermanent; +import mage.target.common.TargetOpponentsCreaturePermanent; + +/** + * + * @author FateRevoked + */ +public final class FinalPayment extends CardImpl { + private static final FilterControlledPermanent filter = new FilterControlledPermanent("a creature or enchantment"); + + static { + filter.add(Predicates.or(new CardTypePredicate(CardType.CREATURE), new CardTypePredicate(CardType.ENCHANTMENT))); + } + + public FinalPayment(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{W}{B}"); + + // As an additional cost to cast this spell, pay 5 life or sacrifice a creature or enchantment. + final Cost lifeCost = new PayLifeCost(5); + final Cost sacrificeCost = new SacrificeTargetCost(new TargetControlledPermanent(filter)); + + this.getSpellAbility().addCost(new OrCost(lifeCost, sacrificeCost, + "pay 5 life or sacrifice a creature or enchantment")); + + // Destroy target creature + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + public FinalPayment(final FinalPayment card) { + super(card); + } + + @Override + public FinalPayment copy() { + return new FinalPayment(this); + } +} diff --git a/Mage.Sets/src/mage/sets/RavnicaAllegiance.java b/Mage.Sets/src/mage/sets/RavnicaAllegiance.java index 8c26a4b5ac..0a28389a52 100644 --- a/Mage.Sets/src/mage/sets/RavnicaAllegiance.java +++ b/Mage.Sets/src/mage/sets/RavnicaAllegiance.java @@ -111,6 +111,7 @@ public final class RavnicaAllegiance extends ExpansionSet { cards.add(new SetCardInfo("Eyes Everywhere", 38, Rarity.UNCOMMON, mage.cards.e.EyesEverywhere.class)); cards.add(new SetCardInfo("Faerie Duelist", 39, Rarity.COMMON, mage.cards.f.FaerieDuelist.class)); cards.add(new SetCardInfo("Feral Maaka", 100, Rarity.COMMON, mage.cards.f.FeralMaaka.class)); + cards.add(new SetCardInfo("Final Payment", 171, Rarity.COMMON, mage.cards.f.FinalPayment.class)); cards.add(new SetCardInfo("Fireblade Artist", 172, Rarity.UNCOMMON, mage.cards.f.FirebladeArtist.class)); cards.add(new SetCardInfo("Font of Agonies", 74, Rarity.RARE, mage.cards.f.FontOfAgonies.class)); cards.add(new SetCardInfo("Footlight Fiend", 216, Rarity.COMMON, mage.cards.f.FootlightFiend.class));