From 8487816425bde1810585ffb35f43a70390a90efd Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 14 Dec 2019 10:39:01 -0500 Subject: [PATCH] Implemented Inevitable End --- Mage.Sets/src/mage/cards/i/InevitableEnd.java | 52 +++++++++++++++++++ .../src/mage/sets/TherosBeyondDeath.java | 1 + 2 files changed, 53 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/i/InevitableEnd.java diff --git a/Mage.Sets/src/mage/cards/i/InevitableEnd.java b/Mage.Sets/src/mage/cards/i/InevitableEnd.java new file mode 100644 index 0000000000..f05ef549b7 --- /dev/null +++ b/Mage.Sets/src/mage/cards/i/InevitableEnd.java @@ -0,0 +1,52 @@ +package mage.cards.i; + +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.SacrificeControllerEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.filter.StaticFilters; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class InevitableEnd extends CardImpl { + + public InevitableEnd(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}"); + + this.subtype.add(SubType.AURA); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // Enchanted creature has "At the beginning of your upkeep, sacrifice a creature." + this.addAbility(new SimpleStaticAbility(new GainAbilityAttachedEffect( + new BeginningOfUpkeepTriggeredAbility(new SacrificeControllerEffect( + StaticFilters.FILTER_PERMANENT_CREATURE, 1, null + ), TargetController.YOU, false), AttachmentType.AURA + ))); + } + + private InevitableEnd(final InevitableEnd card) { + super(card); + } + + @Override + public InevitableEnd copy() { + return new InevitableEnd(this); + } +} diff --git a/Mage.Sets/src/mage/sets/TherosBeyondDeath.java b/Mage.Sets/src/mage/sets/TherosBeyondDeath.java index 2f822b54ed..06fb38f48b 100644 --- a/Mage.Sets/src/mage/sets/TherosBeyondDeath.java +++ b/Mage.Sets/src/mage/sets/TherosBeyondDeath.java @@ -30,6 +30,7 @@ public final class TherosBeyondDeath extends ExpansionSet { cards.add(new SetCardInfo("Elspeth, Sun's Nemesis", 14, Rarity.MYTHIC, mage.cards.e.ElspethSunsNemesis.class)); cards.add(new SetCardInfo("Forest", 254, Rarity.LAND, mage.cards.basiclands.Forest.class, FULL_ART_BFZ_VARIOUS)); cards.add(new SetCardInfo("Indomitable Will", 25, Rarity.COMMON, mage.cards.i.IndomitableWill.class)); + cards.add(new SetCardInfo("Inevitable End", 102, Rarity.UNCOMMON, mage.cards.i.InevitableEnd.class)); cards.add(new SetCardInfo("Island", 251, Rarity.LAND, mage.cards.basiclands.Island.class, FULL_ART_BFZ_VARIOUS)); cards.add(new SetCardInfo("Klothys's Design", 176, Rarity.UNCOMMON, mage.cards.k.KlothyssDesign.class)); cards.add(new SetCardInfo("Leonin of the Lost Pride", 28, Rarity.COMMON, mage.cards.l.LeoninOfTheLostPride.class));