From e4f74f1e6b49b8510c90f786f9fb382fec76a622 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Mon, 5 Jul 2021 16:16:30 -0400 Subject: [PATCH] [AFR] Implemented Precipitous Drop --- .../src/mage/cards/p/PrecipitousDrop.java | 59 +++++++++++++++++++ .../sets/AdventuresInTheForgottenRealms.java | 1 + 2 files changed, 60 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/p/PrecipitousDrop.java diff --git a/Mage.Sets/src/mage/cards/p/PrecipitousDrop.java b/Mage.Sets/src/mage/cards/p/PrecipitousDrop.java new file mode 100644 index 00000000000..b1665ca8b13 --- /dev/null +++ b/Mage.Sets/src/mage/cards/p/PrecipitousDrop.java @@ -0,0 +1,59 @@ +package mage.cards.p; + +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.CompletedDungeonCondition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.effects.keyword.VentureIntoTheDungeonEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; +import mage.watchers.common.CompletedDungeonWatcher; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class PrecipitousDrop extends CardImpl { + + public PrecipitousDrop(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); + + // When Precipitous Drop enters the battlefield, venture into the dungeon. + this.addAbility(new EntersBattlefieldTriggeredAbility(new VentureIntoTheDungeonEffect())); + + // Enchanted creature gets -2/-2. It gets -5/-5 instead as long as you've completed a dungeon. + this.addAbility(new SimpleStaticAbility(new ConditionalContinuousEffect( + new BoostEnchantedEffect(-5, -5), new BoostEnchantedEffect(-2, -2), + CompletedDungeonCondition.instance, "enchanted creature gets -2/-2. " + + "It gets -5/-5 instead as long as you've completed a dungeon" + )).addHint(CompletedDungeonCondition.getHint()), new CompletedDungeonWatcher()); + } + + private PrecipitousDrop(final PrecipitousDrop card) { + super(card); + } + + @Override + public PrecipitousDrop copy() { + return new PrecipitousDrop(this); + } +} diff --git a/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java b/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java index a4e509148d1..2d6f9d4c597 100644 --- a/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java +++ b/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java @@ -121,6 +121,7 @@ public final class AdventuresInTheForgottenRealms extends ExpansionSet { cards.add(new SetCardInfo("Portable Hole", 33, Rarity.UNCOMMON, mage.cards.p.PortableHole.class)); cards.add(new SetCardInfo("Potion of Healing", 34, Rarity.COMMON, mage.cards.p.PotionOfHealing.class)); cards.add(new SetCardInfo("Power Word Kill", 114, Rarity.UNCOMMON, mage.cards.p.PowerWordKill.class)); + cards.add(new SetCardInfo("Precipitous Drop", 115, Rarity.COMMON, mage.cards.p.PrecipitousDrop.class)); cards.add(new SetCardInfo("Prosperous Innkeeper", 200, Rarity.UNCOMMON, mage.cards.p.ProsperousInnkeeper.class)); cards.add(new SetCardInfo("Purple Worm", 201, Rarity.UNCOMMON, mage.cards.p.PurpleWorm.class)); cards.add(new SetCardInfo("Ranger's Hawk", 37, Rarity.COMMON, mage.cards.r.RangersHawk.class));