diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/Hinder.java b/Mage.Sets/src/mage/sets/championsofkamigawa/Hinder.java new file mode 100644 index 00000000000..acb841a33da --- /dev/null +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/Hinder.java @@ -0,0 +1,117 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.championsofkamigawa; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.stack.Spell; +import mage.game.stack.StackObject; +import mage.players.Player; +import mage.target.TargetSpell; + +/** + * + * @author North + */ +public class Hinder extends CardImpl { + + public Hinder(UUID ownerId) { + super(ownerId, 65, "Hinder", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{U}{U}"); + this.expansionSetCode = "CHK"; + + this.color.setBlue(true); + + // Counter target spell. If that spell is countered this way, put that card on the top or bottom of its owner's library instead of into that player's graveyard. + this.getSpellAbility().addEffect(new HinderEffect()); + this.getSpellAbility().addTarget(new TargetSpell()); + } + + public Hinder(final Hinder card) { + super(card); + } + + @Override + public Hinder copy() { + return new Hinder(this); + } +} + +class HinderEffect extends OneShotEffect { + + public HinderEffect() { + super(Outcome.Detriment); + this.staticText = "Counter target spell. If that spell is countered this way, put that card on the top or bottom of its owner's library instead of into that player's graveyard"; + } + + public HinderEffect(final HinderEffect effect) { + super(effect); + } + + @Override + public HinderEffect copy() { + return new HinderEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + UUID objectId = source.getFirstTarget(); + UUID sourceId = source.getSourceId(); + + StackObject stackObject = game.getStack().getStackObject(objectId); + if (stackObject != null && !game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.COUNTER, objectId, sourceId, stackObject.getControllerId()))) { + if (stackObject instanceof Spell) { + game.rememberLKI(objectId, Zone.STACK, (Spell) stackObject); + } + game.getStack().remove(stackObject); + MageObject targetObject = game.getObject(stackObject.getSourceId()); + Zone targetZone = Zone.LIBRARY; + if (targetObject instanceof Card) { + Card card = (Card) targetObject; + Player player = game.getPlayer(source.getControllerId()); + boolean top = player.chooseUse(Outcome.Neutral, "Put " + card.getName() + " on top of the library? Otherwise it will be put on the bottom.", game); + card.moveToZone(targetZone, sourceId, game, top); + game.informPlayers(player.getName() + " has put " + card.getName() + " on " + (top ? "top" : "the bottom") + " of the library."); + } else { + game.informPlayers("Server: Couldn't move card to zone = " + targetZone + " as it has other than Card type."); + } + game.fireEvent(GameEvent.getEvent(GameEvent.EventType.COUNTERED, objectId, sourceId, stackObject.getControllerId())); + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/conflux/LapseOfCertainty.java b/Mage.Sets/src/mage/sets/conflux/LapseOfCertainty.java new file mode 100644 index 00000000000..bb0424a1c0f --- /dev/null +++ b/Mage.Sets/src/mage/sets/conflux/LapseOfCertainty.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.conflux; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.abilities.effects.common.CounterTargetWithReplacementEffect; +import mage.cards.CardImpl; +import mage.target.TargetSpell; + +/** + * + * @author North + */ +public class LapseOfCertainty extends CardImpl { + + public LapseOfCertainty(UUID ownerId) { + super(ownerId, 9, "Lapse of Certainty", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{W}"); + this.expansionSetCode = "CON"; + + this.color.setWhite(true); + + // Counter target spell. If that spell is countered this way, put it on top of its owner's library instead of into that player's graveyard. + this.getSpellAbility().addEffect(new CounterTargetWithReplacementEffect(Zone.LIBRARY, true)); + this.getSpellAbility().addTarget(new TargetSpell()); + } + + public LapseOfCertainty(final LapseOfCertainty card) { + super(card); + } + + @Override + public LapseOfCertainty copy() { + return new LapseOfCertainty(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthdawn/FoldIntoAEther.java b/Mage.Sets/src/mage/sets/fifthdawn/FoldIntoAEther.java new file mode 100644 index 00000000000..fac8e1c7812 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthdawn/FoldIntoAEther.java @@ -0,0 +1,111 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthdawn; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.filter.common.FilterCreatureCard; +import mage.game.Game; +import mage.game.stack.StackObject; +import mage.players.Player; +import mage.target.TargetSpell; +import mage.target.common.TargetCardInHand; + +/** + * + * @author North + */ +public class FoldIntoAEther extends CardImpl { + + public FoldIntoAEther(UUID ownerId) { + super(ownerId, 31, "Fold into AEther", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{2}{U}{U}"); + this.expansionSetCode = "5DN"; + + this.color.setBlue(true); + + // Counter target spell. If that spell is countered this way, its controller may put a creature card from his or her hand onto the battlefield. + this.getSpellAbility().addEffect(new FoldIntoAEtherEffect()); + this.getSpellAbility().addTarget(new TargetSpell()); + } + + public FoldIntoAEther(final FoldIntoAEther card) { + super(card); + } + + @Override + public FoldIntoAEther copy() { + return new FoldIntoAEther(this); + } +} + +class FoldIntoAEtherEffect extends OneShotEffect { + + public FoldIntoAEtherEffect() { + super(Outcome.Detriment); + this.staticText = "Counter target spell. If that spell is countered this way, its controller may put a creature card from his or her hand onto the battlefield"; + } + + public FoldIntoAEtherEffect(final FoldIntoAEtherEffect effect) { + super(effect); + } + + @Override + public FoldIntoAEtherEffect copy() { + return new FoldIntoAEtherEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + StackObject stackObject = game.getStack().getStackObject(source.getFirstTarget()); + Player player = null; + if (stackObject != null) { + player = game.getPlayer(stackObject.getControllerId()); + } + if (game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game)) { + TargetCardInHand target = new TargetCardInHand(new FilterCreatureCard()); + if (player != null + && player.chooseUse(Outcome.Neutral, "Put a creature card from your hand in play?", game) + && player.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) { + Card card = game.getCard(target.getFirstTarget()); + if (card != null) { + player.removeFromHand(card, game); + card.putOntoBattlefield(game, Zone.HAND, source.getId(), source.getControllerId()); + } + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/lorwyn/FaerieTrickery.java b/Mage.Sets/src/mage/sets/lorwyn/FaerieTrickery.java new file mode 100644 index 00000000000..bafdf8c7f71 --- /dev/null +++ b/Mage.Sets/src/mage/sets/lorwyn/FaerieTrickery.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.lorwyn; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.abilities.effects.common.CounterTargetWithReplacementEffect; +import mage.cards.CardImpl; +import mage.filter.FilterSpell; +import mage.target.TargetSpell; + +/** + * + * @author North + */ +public class FaerieTrickery extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("non-Faerie spell"); + + static { + filter.getSubtype().add("Faerie"); + filter.setNotSubtype(true); + } + + public FaerieTrickery(UUID ownerId) { + super(ownerId, 62, "Faerie Trickery", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{U}{U}"); + this.expansionSetCode = "LRW"; + this.supertype.add("Tribal"); + this.subtype.add("Faerie"); + + this.color.setBlue(true); + + // Counter target non-Faerie spell. If that spell is countered this way, exile it instead of putting it into its owner's graveyard. + this.getSpellAbility().addEffect(new CounterTargetWithReplacementEffect(Zone.EXILED)); + this.getSpellAbility().addTarget(new TargetSpell(filter)); + } + + public FaerieTrickery(final FaerieTrickery card) { + super(card); + } + + @Override + public FaerieTrickery copy() { + return new FaerieTrickery(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirrodin/AssertAuthority.java b/Mage.Sets/src/mage/sets/mirrodin/AssertAuthority.java new file mode 100644 index 00000000000..c53649d30ca --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirrodin/AssertAuthority.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirrodin; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.abilities.effects.common.CounterTargetWithReplacementEffect; +import mage.abilities.keyword.AffinityForArtifactsAbility; +import mage.cards.CardImpl; +import mage.target.TargetSpell; + +/** + * + * @author North + */ +public class AssertAuthority extends CardImpl { + + public AssertAuthority(UUID ownerId) { + super(ownerId, 30, "Assert Authority", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{5}{U}{U}"); + this.expansionSetCode = "MRD"; + + this.color.setBlue(true); + + // Affinity for artifacts + this.addAbility(new AffinityForArtifactsAbility()); + // Counter target spell. If that spell is countered this way, exile it instead of putting it into its owner's graveyard. + this.getSpellAbility().addEffect(new CounterTargetWithReplacementEffect(Zone.EXILED)); + this.getSpellAbility().addTarget(new TargetSpell()); + } + + public AssertAuthority(final AssertAuthority card) { + super(card); + } + + @Override + public AssertAuthority copy() { + return new AssertAuthority(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ravnika/Remand.java b/Mage.Sets/src/mage/sets/ravnika/Remand.java new file mode 100644 index 00000000000..ff839b80742 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ravnika/Remand.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.ravnika; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.abilities.effects.common.CounterTargetWithReplacementEffect; +import mage.abilities.effects.common.DrawCardControllerEffect; +import mage.cards.CardImpl; +import mage.target.TargetSpell; + +/** + * + * @author North + */ +public class Remand extends CardImpl { + + public Remand(UUID ownerId) { + super(ownerId, 63, "Remand", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{U}"); + this.expansionSetCode = "RAV"; + + this.color.setBlue(true); + + // Counter target spell. If that spell is countered this way, put it into its owner's hand instead of into that player's graveyard. + this.getSpellAbility().addEffect(new CounterTargetWithReplacementEffect(Zone.HAND)); + this.getSpellAbility().addTarget(new TargetSpell()); + // Draw a card. + this.getSpellAbility().addEffect(new DrawCardControllerEffect(1)); + } + + public Remand(final Remand card) { + super(card); + } + + @Override + public Remand copy() { + return new Remand(this); + } +} diff --git a/Mage/src/mage/abilities/effects/common/CounterTargetWithReplacementEffect.java b/Mage/src/mage/abilities/effects/common/CounterTargetWithReplacementEffect.java index 3ea30ae6102..c1acdd8a8da 100644 --- a/Mage/src/mage/abilities/effects/common/CounterTargetWithReplacementEffect.java +++ b/Mage/src/mage/abilities/effects/common/CounterTargetWithReplacementEffect.java @@ -1,35 +1,36 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.effects.common; +import mage.abilities.Mode; +import mage.game.stack.Spell; import mage.MageObject; import mage.abilities.Ability; -import mage.abilities.Mode; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.game.Game; @@ -41,18 +42,33 @@ import java.util.UUID; import static mage.Constants.Outcome; import static mage.Constants.Zone; +/** + * @author nantuko, North + */ public class CounterTargetWithReplacementEffect extends OneShotEffect { private Zone targetZone; + private boolean flag; public CounterTargetWithReplacementEffect(Zone targetZone) { + this(targetZone, false); + } + + /** + * + * @param targetZone + * @param flag use to specify when moving card to library
  • true = put on top
  • false = put on bottom
+ */ + public CounterTargetWithReplacementEffect(Zone targetZone, boolean flag) { super(Outcome.Detriment); this.targetZone = targetZone; + this.flag = flag; } public CounterTargetWithReplacementEffect(final CounterTargetWithReplacementEffect effect) { super(effect); this.targetZone = effect.targetZone; + this.flag = effect.flag; } @Override @@ -66,19 +82,19 @@ public class CounterTargetWithReplacementEffect extends OneShotEffect