* Prismatic Strands - Added game log message with the color chosen.

This commit is contained in:
LevelX2 2016-06-21 10:15:16 +02:00
parent d26cc4ac1b
commit 8beaeab485

View file

@ -58,6 +58,7 @@ import mage.target.common.TargetControlledCreaturePermanent;
public class PrismaticStrands extends CardImpl { public class PrismaticStrands extends CardImpl {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("untapped white creature you control"); private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("untapped white creature you control");
static { static {
filter.add(Predicates.not(new TappedPredicate())); filter.add(Predicates.not(new TappedPredicate()));
filter.add(new ColorPredicate(ObjectColor.WHITE)); filter.add(new ColorPredicate(ObjectColor.WHITE));
@ -103,12 +104,18 @@ class PrismaticStrandsEffect extends OneShotEffect {
@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());
if (controller != null) { MageObject sourceObject = game.getObject(source.getSourceId());
if (controller != null && sourceObject != null) {
ChoiceColor choice = new ChoiceColor(); ChoiceColor choice = new ChoiceColor();
controller.choose(Outcome.PreventDamage, choice, game); controller.choose(Outcome.PreventDamage, choice, game);
if (choice.isChosen()) {
if (!game.isSimulation()) {
game.informPlayers(sourceObject.getLogName() + ": " + controller.getLogName() + " has chosen sources of the color " + choice.getChoice());
}
game.addEffect(new PrismaticStrandsPreventionEffect(choice.getColor()), source); game.addEffect(new PrismaticStrandsPreventionEffect(choice.getColor()), source);
return true; return true;
} }
}
return false; return false;
} }
} }