From 1c1ad8f073dcfb6fc0115b81b07b6c85cd4ec893 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 11 Sep 2021 15:33:56 -0400 Subject: [PATCH] [MID] Implemented Burn the Accursed --- .../src/mage/cards/b/BurnTheAccursed.java | 70 +++++++++++++++++++ .../src/mage/sets/InnistradMidnightHunt.java | 1 + 2 files changed, 71 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/b/BurnTheAccursed.java diff --git a/Mage.Sets/src/mage/cards/b/BurnTheAccursed.java b/Mage.Sets/src/mage/cards/b/BurnTheAccursed.java new file mode 100644 index 00000000000..f8a73c59a94 --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BurnTheAccursed.java @@ -0,0 +1,70 @@ +package mage.cards.b; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ExileTargetIfDiesEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCreaturePermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class BurnTheAccursed extends CardImpl { + + public BurnTheAccursed(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{4}{R}"); + + // Burn the Accused deals 5 damage to target creature and 2 damage to that creature's controller. If that creature would die this turn, exile it instead. + this.getSpellAbility().addEffect(new BurnTheAccursedEffect()); + this.getSpellAbility().addEffect(new ExileTargetIfDiesEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + private BurnTheAccursed(final BurnTheAccursed card) { + super(card); + } + + @Override + public BurnTheAccursed copy() { + return new BurnTheAccursed(this); + } +} + +class BurnTheAccursedEffect extends OneShotEffect { + + BurnTheAccursedEffect() { + super(Outcome.Benefit); + staticText = "{this} deals 5 damage to target creature and 2 damage to that creature's controller."; + } + + private BurnTheAccursedEffect(final BurnTheAccursedEffect effect) { + super(effect); + } + + @Override + public BurnTheAccursedEffect copy() { + return new BurnTheAccursedEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (permanent == null) { + return false; + } + permanent.damage(5, source.getSourceId(), source, game); + Player player = game.getPlayer(permanent.getControllerId()); + if (player != null) { + player.damage(2, source.getSourceId(), source, game); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/InnistradMidnightHunt.java b/Mage.Sets/src/mage/sets/InnistradMidnightHunt.java index f8153536038..e46a2e84d32 100644 --- a/Mage.Sets/src/mage/sets/InnistradMidnightHunt.java +++ b/Mage.Sets/src/mage/sets/InnistradMidnightHunt.java @@ -60,6 +60,7 @@ public final class InnistradMidnightHunt extends ExpansionSet { cards.add(new SetCardInfo("Brood Weaver", 173, Rarity.UNCOMMON, mage.cards.b.BroodWeaver.class)); cards.add(new SetCardInfo("Burly Breaker", 174, Rarity.UNCOMMON, mage.cards.b.BurlyBreaker.class)); cards.add(new SetCardInfo("Burn Down the House", 131, Rarity.RARE, mage.cards.b.BurnDownTheHouse.class)); + cards.add(new SetCardInfo("Burn the Accursed", 132, Rarity.COMMON, mage.cards.b.BurnTheAccursed.class)); cards.add(new SetCardInfo("Can't Stay Away", 213, Rarity.RARE, mage.cards.c.CantStayAway.class)); cards.add(new SetCardInfo("Candlegrove Witch", 8, Rarity.COMMON, mage.cards.c.CandlegroveWitch.class)); cards.add(new SetCardInfo("Candlelit Cavalry", 175, Rarity.COMMON, mage.cards.c.CandlelitCavalry.class));