* Fixed a bug with some of multiple targets getting illegal after casting Vines of Vastwood to protect a target.

This commit is contained in:
LevelX2 2014-12-11 14:58:48 +01:00
parent 641623a4b5
commit 4b5191af26
3 changed files with 11 additions and 11 deletions

View file

@ -29,14 +29,13 @@
package mage.sets.tenth; package mage.sets.tenth;
import java.util.UUID; import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.PutOnLibraryTargetEffect; import mage.abilities.effects.common.PutOnLibraryTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone; import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
@ -50,7 +49,7 @@ import mage.target.common.TargetAttackingCreature;
public class Condemn extends CardImpl { public class Condemn extends CardImpl {
public Condemn(UUID ownerId) { public Condemn(UUID ownerId) {
super(ownerId, 13, "Condemn", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{W}"); super(ownerId, 13, "Condemn", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{W}");
this.expansionSetCode = "10E"; this.expansionSetCode = "10E";
this.color.setWhite(true); this.color.setWhite(true);
// Put target attacking creature on the bottom of its owner's library. // Put target attacking creature on the bottom of its owner's library.

View file

@ -48,7 +48,7 @@ public class CantBeTargetedTargetEffect extends ContinuousRuleModifiyingEffectIm
private final FilterStackObject filterSource; private final FilterStackObject filterSource;
public CantBeTargetedTargetEffect(FilterStackObject filterSource, Duration duration) { public CantBeTargetedTargetEffect(FilterStackObject filterSource, Duration duration) {
super(duration, Outcome.Benefit); super(duration, Outcome.Benefit, false, false);
this.filterSource = filterSource; this.filterSource = filterSource;
} }

View file

@ -328,7 +328,7 @@ public abstract class TargetImpl implements Target {
public boolean isLegal(Ability source, Game game) { public boolean isLegal(Ability source, Game game) {
//20101001 - 608.2b //20101001 - 608.2b
Set <UUID> illegalTargets = new HashSet<>(); Set <UUID> illegalTargets = new HashSet<>();
int replacedTargets = 0; // int replacedTargets = 0;
for (UUID targetId: targets.keySet()) { for (UUID targetId: targets.keySet()) {
Card card = game.getCard(targetId); Card card = game.getCard(targetId);
if (card != null) { if (card != null) {
@ -338,7 +338,8 @@ public abstract class TargetImpl implements Target {
} }
} }
if (!notTarget && game.replaceEvent(GameEvent.getEvent(EventType.TARGET, targetId, source.getSourceId(), source.getControllerId()))) { if (!notTarget && game.replaceEvent(GameEvent.getEvent(EventType.TARGET, targetId, source.getSourceId(), source.getControllerId()))) {
replacedTargets++; // replacedTargets++;
illegalTargets.add(targetId);
continue; continue;
} }
if (!canTarget(targetId, source, game)) { if (!canTarget(targetId, source, game)) {
@ -349,9 +350,9 @@ public abstract class TargetImpl implements Target {
for (UUID targetId: illegalTargets) { for (UUID targetId: illegalTargets) {
targets.remove(targetId); targets.remove(targetId);
} }
if (replacedTargets > 0 && replacedTargets == targets.size()) { // if (replacedTargets > 0 && replacedTargets == targets.size()) {
return false; // return false;
} // }
if (minNumberOfTargets == 0 && targets.isEmpty()) { if (minNumberOfTargets == 0 && targets.isEmpty()) {
return true; return true;
} }