Sudden Demise - Color choice is now done on resolution time.

This commit is contained in:
LevelX2 2013-12-02 23:31:07 +01:00
parent 436a6be297
commit b97049d0a7

View file

@ -55,7 +55,6 @@ public class SuddenDemise extends CardImpl<SuddenDemise> {
this.color.setRed(true); this.color.setRed(true);
// Choose a color. Sudden Demise deals X damage to each creature of the chosen color. // Choose a color. Sudden Demise deals X damage to each creature of the chosen color.
this.getSpellAbility().addChoice(new ChoiceColor());
this.getSpellAbility().addEffect(new SuddenDemiseDamageEffect()); this.getSpellAbility().addEffect(new SuddenDemiseDamageEffect());
} }
@ -89,8 +88,10 @@ class SuddenDemiseDamageEffect extends OneShotEffect<SuddenDemiseDamageEffect> {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
ChoiceColor choice = (ChoiceColor) source.getChoices().get(0); if (controller != null) {
if (controller != null && choice != null) { ChoiceColor choice = new ChoiceColor();
controller.choose(outcome, choice, game);
if (choice.getColor() != null) {
final int damage = source.getManaCostsToPay().getX(); final int damage = source.getManaCostsToPay().getX();
FilterPermanent filter = new FilterCreaturePermanent(); FilterPermanent filter = new FilterCreaturePermanent();
filter.add(new ColorPredicate(choice.getColor())); filter.add(new ColorPredicate(choice.getColor()));
@ -99,6 +100,7 @@ class SuddenDemiseDamageEffect extends OneShotEffect<SuddenDemiseDamageEffect> {
} }
return true; return true;
} }
}
return false; return false;
} }
} }