This commit is contained in:
jeffwadsworth 2020-01-20 10:05:04 -06:00
parent 8c65ca69e1
commit 5000020592
2 changed files with 20 additions and 15 deletions

View file

@ -26,7 +26,8 @@ public final class AgonizingRemorse extends CardImpl {
public AgonizingRemorse(UUID ownerId, CardSetInfo setInfo) { public AgonizingRemorse(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{B}"); 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. // 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().addEffect(new AgonizingRemorseEffect());
this.getSpellAbility().addTarget(new TargetOpponent()); this.getSpellAbility().addTarget(new TargetOpponent());
} }
@ -45,8 +46,8 @@ class AgonizingRemorseEffect extends OneShotEffect {
AgonizingRemorseEffect() { AgonizingRemorseEffect() {
super(Outcome.Benefit); super(Outcome.Benefit);
staticText = "Target opponent reveals their hand. You choose a nonland card from it " + 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."; + "or a card from their graveyard. Exile that card. You lose 1 life.";
} }
private AgonizingRemorseEffect(final AgonizingRemorseEffect effect) { private AgonizingRemorseEffect(final AgonizingRemorseEffect effect) {
@ -68,12 +69,15 @@ class AgonizingRemorseEffect extends OneShotEffect {
opponent.revealCards(source, opponent.getHand(), game); opponent.revealCards(source, opponent.getHand(), game);
TargetCard target; TargetCard target;
Cards cards; Cards cards;
if (controller.chooseUse(outcome, "Exile a card from hand or graveyard?", null, "Hand", "Graveyard", source, game)) { if (controller.chooseUse(outcome, "Exile a card from hand or graveyard?",
target = new TargetCard(Zone.HAND, new FilterNonlandCard("nonland card in " + opponent.getName() + "'s hand")); null, "Hand", "Graveyard", source, game)) {
target = new TargetCard(Zone.HAND, new FilterNonlandCard("nonland card in "
+ opponent.getName() + "'s hand"));
target.setNotTarget(true); target.setNotTarget(true);
cards = opponent.getHand(); cards = opponent.getHand();
} else { } else {
target = new TargetCard(Zone.GRAVEYARD, new FilterCard("card in " + opponent.getName() + "'s graveyard")); target = new TargetCard(Zone.GRAVEYARD, new FilterCard("card in "
+ opponent.getName() + "'s graveyard"));
target.setNotTarget(true); target.setNotTarget(true);
cards = opponent.getGraveyard(); cards = opponent.getGraveyard();
} }
@ -85,6 +89,7 @@ class AgonizingRemorseEffect extends OneShotEffect {
return true; return true;
} }
controller.moveCards(card, Zone.EXILED, source, game); controller.moveCards(card, Zone.EXILED, source, game);
controller.loseLife(1, game, false);
return true; return true;
} }
} }

View file

@ -10,7 +10,6 @@ import mage.constants.CardType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.game.Game; import mage.game.Game;
import mage.players.Player; import mage.players.Player;
import java.util.Objects; import java.util.Objects;
import java.util.UUID; import java.util.UUID;
@ -40,8 +39,8 @@ class WhirlwindDenialEffect extends OneShotEffect {
WhirlwindDenialEffect() { WhirlwindDenialEffect() {
super(Outcome.Benefit); super(Outcome.Benefit);
staticText = "For each spell and ability your opponents control, " + staticText = "For each spell and ability your opponents control, "
"counter it unless its controller pays {4}."; + "counter it unless its controller pays {4}.";
} }
private WhirlwindDenialEffect(final WhirlwindDenialEffect effect) { private WhirlwindDenialEffect(final WhirlwindDenialEffect effect) {
@ -59,7 +58,7 @@ class WhirlwindDenialEffect extends OneShotEffect {
.stream() .stream()
.filter(Objects::nonNull) .filter(Objects::nonNull)
.forEachOrdered(stackObject -> { .forEachOrdered(stackObject -> {
if (!game.getOpponents(stackObject.getControllerId()).contains(source.getControllerId())) { if (!game.getOpponents(source.getControllerId()).contains(stackObject.getControllerId())) {
return; return;
} }
Player player = game.getPlayer(stackObject.getControllerId()); Player player = game.getPlayer(stackObject.getControllerId());
@ -67,13 +66,14 @@ class WhirlwindDenialEffect extends OneShotEffect {
return; return;
} }
Cost cost = new GenericManaCost(4); Cost cost = new GenericManaCost(4);
if (cost.canPay(source, source.getSourceId(), source.getControllerId(), game) if (cost.canPay(source, source.getSourceId(), stackObject.getControllerId(), game)
&& player.chooseUse(outcome, "Pay {4} to prevent " + stackObject.getIdName() + " from being countered?", source, game) && player.chooseUse(outcome, "Pay {4} to prevent "
&& cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) { + stackObject.getIdName() + " from being countered?", source, game)
&& cost.pay(source, game, source.getSourceId(), stackObject.getControllerId(), false)) {
return; return;
} }
stackObject.counter(source.getSourceId(), game); stackObject.counter(source.getSourceId(), game);
}); });
return true; return true;
} }
} }