fix for quicksilver fountain, as it let you target all lands in play instead of your own

This commit is contained in:
igoudt 2017-04-30 17:45:23 +02:00
parent 3f125db074
commit 01813cce0c

View file

@ -27,7 +27,6 @@
*/ */
package mage.cards.q; package mage.cards.q;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.BeginningOfEndStepTriggeredAbility; import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
@ -38,12 +37,9 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.BecomesBasicLandTargetEffect; import mage.abilities.effects.common.continuous.BecomesBasicLandTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.*;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.common.FilterControlledLandPermanent;
import mage.filter.common.FilterLandPermanent; import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.Predicates; import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate;
@ -51,9 +47,11 @@ import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
import mage.target.Target; import mage.target.Target;
import mage.target.common.TargetLandPermanent; import mage.target.TargetPermanent;
import mage.target.targetpointer.FixedTarget; import mage.target.targetpointer.FixedTarget;
import java.util.UUID;
/** /**
* *
* @author jeffwadsworth * @author jeffwadsworth
@ -84,7 +82,7 @@ public class QuicksilverFountain extends CardImpl {
class QuicksilverFountainEffect extends OneShotEffect { class QuicksilverFountainEffect extends OneShotEffect {
static final private FilterLandPermanent filterNonIslandLand = new FilterLandPermanent("non-Island land"); static final private FilterControlledLandPermanent filterNonIslandLand = new FilterControlledLandPermanent("non-Island land");
static { static {
filterNonIslandLand.add(Predicates.not(new SubtypePredicate("Island"))); filterNonIslandLand.add(Predicates.not(new SubtypePredicate("Island")));
@ -102,7 +100,7 @@ class QuicksilverFountainEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(targetPointer.getFirst(game, source)); Player player = game.getPlayer(targetPointer.getFirst(game, source));
Target targetNonIslandLand = new TargetLandPermanent(filterNonIslandLand); Target targetNonIslandLand = new TargetPermanent(filterNonIslandLand);
if (player != null) { if (player != null) {
if (player.choose(Outcome.Neutral, targetNonIslandLand, source.getId(), game)) { if (player.choose(Outcome.Neutral, targetNonIslandLand, source.getId(), game)) {
Permanent landChosen = game.getPermanent(targetNonIslandLand.getFirstTarget()); Permanent landChosen = game.getPermanent(targetNonIslandLand.getFirstTarget());