diff --git a/Mage.Sets/src/mage/sets/conspiracy/Breakthrough.java b/Mage.Sets/src/mage/sets/conspiracy/Breakthrough.java new file mode 100644 index 0000000000..f99b16a2d5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/conspiracy/Breakthrough.java @@ -0,0 +1,112 @@ +/* + * 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.conspiracy; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInHand; + +/** + * + * @author emerald000 + */ +public class Breakthrough extends CardImpl { + + public Breakthrough(UUID ownerId) { + super(ownerId, 92, "Breakthrough", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{X}{U}"); + this.expansionSetCode = "CNS"; + + this.color.setBlue(true); + + // Draw four cards, + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(4)); + + //then choose X cards in your hand and discard the rest. + this.getSpellAbility().addEffect(new BreakthroughEffect()); + + } + + public Breakthrough(final Breakthrough card) { + super(card); + } + + @Override + public Breakthrough copy() { + return new Breakthrough(this); + } +} + +class BreakthroughEffect extends OneShotEffect { + + BreakthroughEffect() { + super(Outcome.Discard); + this.staticText = ", then choose X cards in your hand and discard the rest."; + } + + BreakthroughEffect(final BreakthroughEffect effect) { + super(effect); + } + + @Override + public BreakthroughEffect copy() { + return new BreakthroughEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + int amountToKeep = source.getManaCostsToPay().getX(); + if (amountToKeep == 0) { + player.discard(player.getHand().size(), source, game); + } + else if (amountToKeep < player.getHand().size()) { + TargetCardInHand target = new TargetCardInHand(amountToKeep, new FilterCard()); + target.setTargetName("cards to keep"); + target.choose(Outcome.Benefit, player.getId(), source.getSourceId(), game); + for (Card card : player.getHand().getCards(game)) { + if (!target.getTargets().contains(card.getId())) { + player.discard(card, source, game); + } + } + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/conspiracy/IllGottenGains.java b/Mage.Sets/src/mage/sets/conspiracy/IllGottenGains.java new file mode 100644 index 0000000000..2a0bc869eb --- /dev/null +++ b/Mage.Sets/src/mage/sets/conspiracy/IllGottenGains.java @@ -0,0 +1,52 @@ +/* + * 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.conspiracy; + +import java.util.UUID; + +/** + * + * @author emerald000 + */ +public class IllGottenGains extends mage.sets.urzassaga.IllGottenGains { + + public IllGottenGains(UUID ownerId) { + super(ownerId); + this.cardNumber = 114; + this.expansionSetCode = "CNS"; + } + + public IllGottenGains(final IllGottenGains card) { + super(card); + } + + @Override + public IllGottenGains copy() { + return new IllGottenGains(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/NetherVoid.java b/Mage.Sets/src/mage/sets/legends/NetherVoid.java new file mode 100644 index 0000000000..875e40187b --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/NetherVoid.java @@ -0,0 +1,64 @@ +/* + * 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.legends; + +import java.util.UUID; +import mage.abilities.common.SpellCastAllTriggeredAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.CounterUnlessPaysEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterSpell; + +/** + * + * @author emerald000 + */ +public class NetherVoid extends CardImpl { + + public NetherVoid(UUID ownerId) { + super(ownerId, 27, "Nether Void", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{B}"); + this.expansionSetCode = "LEG"; + this.supertype.add("World"); + + this.color.setBlack(true); + + // Whenever a player casts a spell, counter it unless that player pays {3}. + this.addAbility(new SpellCastAllTriggeredAbility(new CounterUnlessPaysEffect(new GenericManaCost(3)), new FilterSpell("a spell"), false, true)); + } + + public NetherVoid(final NetherVoid card) { + super(card); + } + + @Override + public NetherVoid copy() { + return new NetherVoid(this); + } +} diff --git a/Mage.Sets/src/mage/sets/torment/Breakthrough.java b/Mage.Sets/src/mage/sets/torment/Breakthrough.java new file mode 100644 index 0000000000..54cc4e2e97 --- /dev/null +++ b/Mage.Sets/src/mage/sets/torment/Breakthrough.java @@ -0,0 +1,52 @@ +/* + * 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.torment; + +import java.util.UUID; + +/** + * + * @author emerald000 + */ +public class Breakthrough extends mage.sets.conspiracy.Breakthrough { + + public Breakthrough(UUID ownerId) { + super(ownerId); + this.cardNumber = 26; + this.expansionSetCode = "TOR"; + } + + public Breakthrough(final Breakthrough card) { + super(card); + } + + @Override + public Breakthrough copy() { + return new Breakthrough(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/IllGottenGains.java b/Mage.Sets/src/mage/sets/urzassaga/IllGottenGains.java new file mode 100644 index 0000000000..ba56adf8df --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/IllGottenGains.java @@ -0,0 +1,115 @@ +/* + * 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.urzassaga; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ExileSpellEffect; +import mage.abilities.effects.common.discard.DiscardHandAllEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.game.Game; +import mage.players.Player; +import mage.target.Target; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author emerald000 + */ +public class IllGottenGains extends CardImpl { + + public IllGottenGains(UUID ownerId) { + super(ownerId, 138, "Ill-Gotten Gains", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{B}{B}"); + this.expansionSetCode = "USG"; + + this.color.setBlack(true); + + // Exile Ill-Gotten Gains. + this.getSpellAbility().addEffect(ExileSpellEffect.getInstance()); + + // Each player discards his or her hand, + this.getSpellAbility().addEffect(new DiscardHandAllEffect()); + + //then returns up to three cards from his or her graveyard to his or her hand. + this.getSpellAbility().addEffect(new IllGottenGainsEffect()); + } + + public IllGottenGains(final IllGottenGains card) { + super(card); + } + + @Override + public IllGottenGains copy() { + return new IllGottenGains(this); + } +} + +class IllGottenGainsEffect extends OneShotEffect { + + IllGottenGainsEffect() { + super(Outcome.ReturnToHand); + this.staticText = ", then returns up to three cards from his or her graveyard to his or her hand."; + } + + IllGottenGainsEffect(final IllGottenGainsEffect effect) { + super(effect); + } + + @Override + public IllGottenGainsEffect copy() { + return new IllGottenGainsEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + for (UUID playerId : controller.getInRange()){ + Player player = game.getPlayer(playerId); + if (player != null) { + Target target = new TargetCardInYourGraveyard(0, 3, new FilterCard()); + if (target.choose(Outcome.ReturnToHand, player.getId(), source.getId(), game)) { + for (UUID targetId : target.getTargets()) { + Card card = game.getCard(targetId); + player.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.GRAVEYARD); + } + } + } + } + return true; + } + return false; + } +} diff --git a/Mage/src/mage/abilities/effects/common/CounterUnlessPaysEffect.java b/Mage/src/mage/abilities/effects/common/CounterUnlessPaysEffect.java index e0c78689ff..0842222034 100644 --- a/Mage/src/mage/abilities/effects/common/CounterUnlessPaysEffect.java +++ b/Mage/src/mage/abilities/effects/common/CounterUnlessPaysEffect.java @@ -28,13 +28,13 @@ package mage.abilities.effects.common; -import mage.constants.Outcome; import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.costs.Cost; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.OneShotEffect; +import mage.constants.Outcome; import mage.game.Game; import mage.game.stack.StackObject; import mage.players.Player; @@ -87,7 +87,7 @@ public class CounterUnlessPaysEffect extends OneShotEffect { } costToPay.clearPaid(); if (!costToPay.pay(source, game, spell.getSourceId(), spell.getControllerId(), false)) { - return game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game); + return game.getStack().counter(spell.getId(), source.getSourceId(), game); } } }