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) {
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().addTarget(new TargetOpponent());
}
@ -45,8 +46,8 @@ 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.";
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) {
@ -68,12 +69,15 @@ class AgonizingRemorseEffect extends OneShotEffect {
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 TargetCard(Zone.HAND, new FilterNonlandCard("nonland card in " + opponent.getName() + "'s hand"));
if (controller.chooseUse(outcome, "Exile a card from hand or graveyard?",
null, "Hand", "Graveyard", source, game)) {
target = new TargetCard(Zone.HAND, new FilterNonlandCard("nonland card in "
+ opponent.getName() + "'s hand"));
target.setNotTarget(true);
cards = opponent.getHand();
} 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);
cards = opponent.getGraveyard();
}
@ -85,6 +89,7 @@ class AgonizingRemorseEffect extends OneShotEffect {
return true;
}
controller.moveCards(card, Zone.EXILED, source, game);
controller.loseLife(1, game, false);
return true;
}
}
}

View file

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