diff --git a/Mage/src/mage/abilities/effects/common/continious/GainProtectionFromColorTargetEffect.java b/Mage/src/mage/abilities/effects/common/continious/GainProtectionFromColorTargetEffect.java index d1176c92d3..e6d3bd6771 100644 --- a/Mage/src/mage/abilities/effects/common/continious/GainProtectionFromColorTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/GainProtectionFromColorTargetEffect.java @@ -65,11 +65,12 @@ public class GainProtectionFromColorTargetEffect extends GainAbilityTargetEffect @Override public boolean apply(Game game, Ability source) { - ChoiceColor choice = (ChoiceColor) source.getChoices().get(0); - protectionFilter.setColor(choice.getColor()); - protectionFilter.setMessage(choice.getChoice()); Permanent creature = game.getPermanent(source.getFirstTarget()); if (creature != null) { + ChoiceColor choice = (ChoiceColor) source.getChoices().get(0); + protectionFilter.setColor(choice.getColor()); + protectionFilter.setMessage(choice.getChoice()); + ((ProtectionAbility)ability).setFilter(protectionFilter); creature.addAbility(ability); return true; } diff --git a/Mage/src/mage/game/stack/Spell.java b/Mage/src/mage/game/stack/Spell.java index c43eaa8d74..a7ea498f0f 100644 --- a/Mage/src/mage/game/stack/Spell.java +++ b/Mage/src/mage/game/stack/Spell.java @@ -101,6 +101,7 @@ public class Spell> implements StackObject, Card { return result; } //20091005 - 608.2b + game.informPlayers(getName() + " has been fizzled."); counter(null, game); return false; } diff --git a/Mage/src/mage/target/TargetImpl.java b/Mage/src/mage/target/TargetImpl.java index f73ce9fe06..2aa054cb7f 100644 --- a/Mage/src/mage/target/TargetImpl.java +++ b/Mage/src/mage/target/TargetImpl.java @@ -243,12 +243,12 @@ public abstract class TargetImpl> implements Target { public boolean isLegal(Ability source, Game game) { //20101001 - 608.2b for (UUID targetId: targets.keySet()) { - if (!game.replaceEvent(GameEvent.getEvent(EventType.TARGET, targetId, source.getId(), source.getControllerId()))) - return true; - if (canTarget(targetId, source, game)) - return true; + if (game.replaceEvent(GameEvent.getEvent(EventType.TARGET, targetId, source.getId(), source.getControllerId()))) + return false; + if (!canTarget(targetId, source, game)) + return false; } - return false; + return true; } @Override diff --git a/Mage/src/mage/target/Targets.java b/Mage/src/mage/target/Targets.java index ea7debb636..fc55e78238 100644 --- a/Mage/src/mage/target/Targets.java +++ b/Mage/src/mage/target/Targets.java @@ -99,12 +99,16 @@ public class Targets extends ArrayList { } public boolean stillLegal(Ability source, Game game) { + // 608.2 + // The spell or ability is countered if all its targets, for every instance of the word "target," are now illegal + int illegalCount = 0; for (Target target: this) { - if (!target.isLegal(source, game)) { - return false; + if (target.isLegal(source, game)) { + illegalCount++; } } - return true; + // check all are illegal + return this.size() == illegalCount; } /**