From cee3db672acfd239371f31ce369a3c5c357281ac Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Mon, 5 Jul 2021 21:18:14 -0400 Subject: [PATCH] [AFR] Implemented Ray of Enfeeblement --- .../src/mage/cards/r/RayOfEnfeeblement.java | 68 +++++++++++++++++++ .../sets/AdventuresInTheForgottenRealms.java | 1 + Utils/mtg-cards-data.txt | 2 +- 3 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 Mage.Sets/src/mage/cards/r/RayOfEnfeeblement.java diff --git a/Mage.Sets/src/mage/cards/r/RayOfEnfeeblement.java b/Mage.Sets/src/mage/cards/r/RayOfEnfeeblement.java new file mode 100644 index 0000000000..724c65f4be --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RayOfEnfeeblement.java @@ -0,0 +1,68 @@ +package mage.cards.r; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetCreaturePermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class RayOfEnfeeblement extends CardImpl { + + public RayOfEnfeeblement(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{B}"); + + // Target creature gets -4/-1 until end of turn. If that creature is white, it gets -4/-4 until end of turn instead. + this.getSpellAbility().addEffect(new RayOfEnfeeblementEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + private RayOfEnfeeblement(final RayOfEnfeeblement card) { + super(card); + } + + @Override + public RayOfEnfeeblement copy() { + return new RayOfEnfeeblement(this); + } +} + +class RayOfEnfeeblementEffect extends OneShotEffect { + + RayOfEnfeeblementEffect() { + super(Outcome.Benefit); + staticText = "target creature gets -4/-1 until end of turn. " + + "If that creature is white, it gets -4/-4 until end of turn instead"; + } + + private RayOfEnfeeblementEffect(final RayOfEnfeeblementEffect effect) { + super(effect); + } + + @Override + public RayOfEnfeeblementEffect copy() { + return new RayOfEnfeeblementEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (permanent == null) { + return false; + } + game.addEffect(new BoostTargetEffect( + -4, permanent.getColor(game).isWhite() ? -4 : -1, Duration.EndOfTurn + ), source); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java b/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java index 7a68dd9091..43e9103021 100644 --- a/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java +++ b/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java @@ -133,6 +133,7 @@ public final class AdventuresInTheForgottenRealms extends ExpansionSet { 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)); + cards.add(new SetCardInfo("Ray of Enfeeblement", 116, Rarity.UNCOMMON, mage.cards.r.RayOfEnfeeblement.class)); cards.add(new SetCardInfo("Red Dragon", 160, Rarity.UNCOMMON, mage.cards.r.RedDragon.class)); cards.add(new SetCardInfo("Rimeshield Frost Giant", 69, Rarity.COMMON, mage.cards.r.RimeshieldFrostGiant.class)); cards.add(new SetCardInfo("Rust Monster", 161, Rarity.UNCOMMON, mage.cards.r.RustMonster.class)); diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt index 72cc0fcb42..2f7d89a8d2 100644 --- a/Utils/mtg-cards-data.txt +++ b/Utils/mtg-cards-data.txt @@ -41419,7 +41419,7 @@ Lolth, Spider Queen|Adventures in the Forgotten Realms|112|M|{3}{B}{B}|Legendary Manticore|Adventures in the Forgotten Realms|113|C|{3}{B}|Creature - Manticore|2|1|Flash$Flying$Tail Spikes — When Manticore enters the battlefield, destroy target creature an opponent controls that was dealt damage this turn.| Power Word Kill|Adventures in the Forgotten Realms|114|U|{1}{B}|Instant|||Destroy target non-Angel, non-Demon, non-Devil, non-Dragon creature.| Precipitous Drop|Adventures in the Forgotten Realms|115|C|{2}{B}|Enchantment - Aura|||Enchant creature$When Precipitous Drop enters the battlefield, venture into the dungeon.$Enchanted creature gets -2/-2. It gets -5/-5 instead as long as you've completed a dungeon.| -Ray of Enfeeblement|Adventures in the Forgotten Realms|116|U|{W}|Instant|||Target creature gets -4/-1 until end of turn. If that creature is white, it gets -4/-4 until end of turn instead.| +Ray of Enfeeblement|Adventures in the Forgotten Realms|116|U|{B}|Instant|||Target creature gets -4/-1 until end of turn. If that creature is white, it gets -4/-4 until end of turn instead.| Sepulcher Ghoul|Adventures in the Forgotten Realms|118|C|{1}{B}|Creature - Zombie|2|1|Sacrifice another creature: Sepulcher Ghoul gets +2/+2 until end of turn. Activate only once each turn.| Shambling Ghast|Adventures in the Forgotten Realms|119|C|{B}|Creature - Zombie|1|1|When Shambling Ghast dies, choose one —$• Brave the Stench — Target creature an opponent controls -1/-1 until end of turn.$• Search the Body — Create a Treasure token.| Skullport Merchant|Adventures in the Forgotten Realms|120|U|{2}{B}|Creature - Dwarf Citizen|1|4|When Skullport Merchant enters the battlefield, create a Treasure token.${1}{B}, Sacrifice another creature or a Treasure: Draw a card.|