From b97049d0a7d60dcd7de32d47555a2a38fa55d710 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Mon, 2 Dec 2013 23:31:07 +0100 Subject: [PATCH] Sudden Demise - Color choice is now done on resolution time. --- .../mage/sets/commander2013/SuddenDemise.java | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Mage.Sets/src/mage/sets/commander2013/SuddenDemise.java b/Mage.Sets/src/mage/sets/commander2013/SuddenDemise.java index fed859ff34..03a07b6bae 100644 --- a/Mage.Sets/src/mage/sets/commander2013/SuddenDemise.java +++ b/Mage.Sets/src/mage/sets/commander2013/SuddenDemise.java @@ -54,8 +54,7 @@ public class SuddenDemise extends CardImpl { this.color.setRed(true); - // Choose a color. Sudden Demise deals X damage to each creature of the chosen color. - this.getSpellAbility().addChoice(new ChoiceColor()); + // Choose a color. Sudden Demise deals X damage to each creature of the chosen color. this.getSpellAbility().addEffect(new SuddenDemiseDamageEffect()); } @@ -89,15 +88,18 @@ class SuddenDemiseDamageEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - ChoiceColor choice = (ChoiceColor) source.getChoices().get(0); - if (controller != null && choice != null) { - final int damage = source.getManaCostsToPay().getX(); - FilterPermanent filter = new FilterCreaturePermanent(); - filter.add(new ColorPredicate(choice.getColor())); - for (Permanent permanent:game.getBattlefield().getActivePermanents(filter, source.getControllerId(), id, game)) { - permanent.damage(damage, source.getSourceId(), game, true, false); + if (controller != null) { + ChoiceColor choice = new ChoiceColor(); + controller.choose(outcome, choice, game); + if (choice.getColor() != null) { + final int damage = source.getManaCostsToPay().getX(); + FilterPermanent filter = new FilterCreaturePermanent(); + filter.add(new ColorPredicate(choice.getColor())); + for (Permanent permanent:game.getBattlefield().getActivePermanents(filter, source.getControllerId(), id, game)) { + permanent.damage(damage, source.getSourceId(), game, true, false); + } + return true; } - return true; } return false; }