From efc6ea155d64b23b27435db6e734253a232e6225 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 11 Jan 2020 17:06:46 -0500 Subject: [PATCH] Implemented Agonizing Remorse --- .../src/mage/cards/a/AgonizingRemorse.java | 92 +++++++++++++++++++ .../src/mage/sets/TherosBeyondDeath.java | 1 + 2 files changed, 93 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/a/AgonizingRemorse.java diff --git a/Mage.Sets/src/mage/cards/a/AgonizingRemorse.java b/Mage.Sets/src/mage/cards/a/AgonizingRemorse.java new file mode 100644 index 0000000000..8faa8ff542 --- /dev/null +++ b/Mage.Sets/src/mage/cards/a/AgonizingRemorse.java @@ -0,0 +1,92 @@ +package mage.cards.a; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.cards.Cards; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.common.FilterNonlandCard; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetCard; +import mage.target.common.TargetCardInGraveyard; +import mage.target.common.TargetCardInHand; +import mage.target.common.TargetOpponent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class AgonizingRemorse extends CardImpl { + + public AgonizingRemorse(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{B}"); + + // Target opponent reveals their hand. You choose a nonland card from it or a card from their graveyard. Exile that card. You lose 1 life. + this.getSpellAbility().addEffect(new AgonizingRemorseEffect()); + this.getSpellAbility().addTarget(new TargetOpponent()); + } + + private AgonizingRemorse(final AgonizingRemorse card) { + super(card); + } + + @Override + public AgonizingRemorse copy() { + return new AgonizingRemorse(this); + } +} + +class AgonizingRemorseEffect extends OneShotEffect { + + AgonizingRemorseEffect() { + super(Outcome.Benefit); + staticText = "Target opponent reveals their hand. You choose a nonland card from it " + + "or a card from their graveyard. Exile that card. You lose 1 life."; + } + + private AgonizingRemorseEffect(final AgonizingRemorseEffect effect) { + super(effect); + } + + @Override + public AgonizingRemorseEffect copy() { + return new AgonizingRemorseEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Player opponent = game.getPlayer(source.getFirstTarget()); + if (controller == null || opponent == null) { + return false; + } + opponent.revealCards(source, opponent.getHand(), game); + TargetCard target; + Cards cards; + if (controller.chooseUse(outcome, "Exile a card from hand or graveyard?", null, "Hand", "Graveyard", source, game)) { + target = new TargetCardInHand(new FilterNonlandCard("nonland card in " + opponent.getName() + "'s hand")); + target.setNotTarget(true); + cards = opponent.getHand(); + } else { + target = new TargetCardInGraveyard(new FilterCard("card in " + opponent.getName() + "'s graveyard")); + target.setNotTarget(true); + cards = opponent.getGraveyard(); + } + if (!controller.choose(outcome, cards, target, game)) { + return true; + } + Card card = game.getCard(target.getFirstTarget()); + if (card == null) { + return true; + } + controller.moveCards(card, Zone.EXILED, source, game); + return true; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/TherosBeyondDeath.java b/Mage.Sets/src/mage/sets/TherosBeyondDeath.java index f18c490f9a..27e3ea877f 100644 --- a/Mage.Sets/src/mage/sets/TherosBeyondDeath.java +++ b/Mage.Sets/src/mage/sets/TherosBeyondDeath.java @@ -27,6 +27,7 @@ public final class TherosBeyondDeath extends ExpansionSet { this.maxCardNumberInBooster = 254; cards.add(new SetCardInfo("Acolyte of Affliction", 206, Rarity.UNCOMMON, mage.cards.a.AcolyteOfAffliction.class)); + cards.add(new SetCardInfo("Agonizing Remorse", 83, Rarity.UNCOMMON, mage.cards.a.AgonizingRemorse.class)); cards.add(new SetCardInfo("Alirios, Enraptured", 42, Rarity.UNCOMMON, mage.cards.a.AliriosEnraptured.class)); cards.add(new SetCardInfo("Allure of the Unknown", 207, Rarity.RARE, mage.cards.a.AllureOfTheUnknown.class)); cards.add(new SetCardInfo("Alseid of Life's Bounty", 1, Rarity.UNCOMMON, mage.cards.a.AlseidOfLifesBounty.class));