From d0652eb9901b96d8a8724dd45aab78197452eb12 Mon Sep 17 00:00:00 2001 From: emerald000 Date: Thu, 17 Jul 2014 06:59:15 -0400 Subject: [PATCH] [NEW] Added Windfall, Yixlid Jailer, Chain Lightning, Read the Runes, Imperial Seal, Yawgmoth's Bargain and Windfall. --- .../src/mage/sets/commander/Windfall.java | 52 ++++++++ .../mage/sets/futuresight/YixlidJailer.java | 125 +++++++++++++++++ .../src/mage/sets/legends/ChainLightning.java | 126 ++++++++++++++++++ .../src/mage/sets/onslaught/ReadTheRunes.java | 107 +++++++++++++++ .../portalthreekingdoms/ImperialSeal.java | 63 +++++++++ .../sets/urzasdestiny/YawgmothsBargain.java | 54 ++++++++ .../src/mage/sets/urzassaga/Windfall.java | 111 +++++++++++++++ .../sets/vintagemasters/ChainLightning.java | 52 ++++++++ .../sets/vintagemasters/YawgmothsBargain.java | 68 ++++++++++ 9 files changed, 758 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/commander/Windfall.java create mode 100644 Mage.Sets/src/mage/sets/futuresight/YixlidJailer.java create mode 100644 Mage.Sets/src/mage/sets/legends/ChainLightning.java create mode 100644 Mage.Sets/src/mage/sets/onslaught/ReadTheRunes.java create mode 100644 Mage.Sets/src/mage/sets/portalthreekingdoms/ImperialSeal.java create mode 100644 Mage.Sets/src/mage/sets/urzasdestiny/YawgmothsBargain.java create mode 100644 Mage.Sets/src/mage/sets/urzassaga/Windfall.java create mode 100644 Mage.Sets/src/mage/sets/vintagemasters/ChainLightning.java create mode 100644 Mage.Sets/src/mage/sets/vintagemasters/YawgmothsBargain.java diff --git a/Mage.Sets/src/mage/sets/commander/Windfall.java b/Mage.Sets/src/mage/sets/commander/Windfall.java new file mode 100644 index 0000000000..7c1fb7dbf3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander/Windfall.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.commander; + +import java.util.UUID; + +/** + * + * @author emerald000 + */ +public class Windfall extends mage.sets.urzassaga.Windfall { + + public Windfall(UUID ownerId) { + super(ownerId); + this.cardNumber = 70; + this.expansionSetCode = "CMD"; + } + + public Windfall(final Windfall card) { + super(card); + } + + @Override + public Windfall copy() { + return new Windfall(this); + } +} diff --git a/Mage.Sets/src/mage/sets/futuresight/YixlidJailer.java b/Mage.Sets/src/mage/sets/futuresight/YixlidJailer.java new file mode 100644 index 0000000000..685f66d1a5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/futuresight/YixlidJailer.java @@ -0,0 +1,125 @@ +/* + * 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.futuresight; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Layer; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SubLayer; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author emerald000 + */ +public class YixlidJailer extends CardImpl { + + public YixlidJailer(UUID ownerId) { + super(ownerId, 93, "Yixlid Jailer", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "FUT"; + this.subtype.add("Zombie"); + this.subtype.add("Wizard"); + + this.color.setBlack(true); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Cards in graveyards lose all abilities. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new YixlidJailerEffect())); + } + + public YixlidJailer(final YixlidJailer card) { + super(card); + } + + @Override + public YixlidJailer copy() { + return new YixlidJailer(this); + } +} + +class YixlidJailerEffect extends ContinuousEffectImpl { + + YixlidJailerEffect() { + super(Duration.WhileOnBattlefield, Outcome.LoseAbility); + staticText = "Cards in graveyards lose all abilities."; + } + + YixlidJailerEffect(final YixlidJailerEffect effect) { + super(effect); + } + + @Override + public YixlidJailerEffect copy() { + return new YixlidJailerEffect(this); + } + + @Override + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { + if (layer == Layer.AbilityAddingRemovingEffects_6) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + for (UUID playerId : controller.getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null) { + for (Card card : player.getGraveyard().getCards(game)) { + if (card != null) { + card.getAbilities().clear(); + game.getContinuousEffects().removeGainedEffectsForSource(card.getId()); + game.getState().resetTriggersForSourceId(card.getId()); + } + } + } + } + return true; + } + } + return false; + } + + @Override + public boolean apply(Game game, Ability source) { + return false; + } + + @Override + public boolean hasLayer(Layer layer) { + return layer == Layer.AbilityAddingRemovingEffects_6; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/legends/ChainLightning.java b/Mage.Sets/src/mage/sets/legends/ChainLightning.java new file mode 100644 index 0000000000..5a309ddd1e --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/ChainLightning.java @@ -0,0 +1,126 @@ +/* + * 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.Ability; +import mage.abilities.costs.Cost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.stack.Spell; +import mage.players.Player; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author emerald000 + */ +public class ChainLightning extends CardImpl { + + public ChainLightning(UUID ownerId) { + super(ownerId, 137, "Chain Lightning", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{R}"); + this.expansionSetCode = "LEG"; + + this.color.setRed(true); + + // Chain Lightning deals 3 damage to target creature or player. Then that player or that creature's controller may pay {R}{R}. If the player does, he or she may copy this spell and may choose a new target for that copy. + this.getSpellAbility().addEffect(new ChainLightningEffect()); + this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); + } + + public ChainLightning(final ChainLightning card) { + super(card); + } + + @Override + public ChainLightning copy() { + return new ChainLightning(this); + } +} + +class ChainLightningEffect extends OneShotEffect { + + ChainLightningEffect() { + super(Outcome.Damage); + this.staticText = "Chain Lightning deals 3 damage to target creature or player. Then that player or that creature's controller may pay {R}{R}. If the player does, he or she may copy this spell and may choose a new target for that copy."; + } + + ChainLightningEffect(final ChainLightningEffect effect) { + super(effect); + } + + @Override + public ChainLightningEffect copy() { + return new ChainLightningEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + UUID targetId = source.getFirstTarget(); + Player affectedPlayer = null; + Player player = game.getPlayer(targetId); + if (player != null) { + player.damage(3, source.getSourceId(), game, false, true); + affectedPlayer = player; + } + else { + Permanent permanent = game.getPermanent(targetId); + if (permanent != null) { + permanent.damage(3, source.getSourceId(), game, true, false); + affectedPlayer = game.getPlayer(permanent.getControllerId()); + } + } + if (affectedPlayer != null) { + if (affectedPlayer.chooseUse(Outcome.Copy, "Pay {R}{R} to copy the spell?", game)) { + Cost cost = new ManaCostsImpl("{R}{R}"); + if (cost.pay(source, game, source.getSourceId(), affectedPlayer.getId(), false)) { + Spell spell = game.getStack().getSpell(source.getSourceId()); + if (spell != null) { + Spell copy = spell.copySpell(); + copy.setControllerId(affectedPlayer.getId()); + copy.setCopiedSpell(true); + game.getStack().push(copy); + copy.chooseNewTargets(game, affectedPlayer.getId()); + game.informPlayers(affectedPlayer.getName() + " copies " + copy.getName() + "."); + } + } + } + return true; + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/ReadTheRunes.java b/Mage.Sets/src/mage/sets/onslaught/ReadTheRunes.java new file mode 100644 index 0000000000..4b2a5e54b6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/ReadTheRunes.java @@ -0,0 +1,107 @@ +/* + * 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.onslaught; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.Target; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author emerald000 + */ +public class ReadTheRunes extends CardImpl { + + public ReadTheRunes(UUID ownerId) { + super(ownerId, 104, "Read the Runes", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{X}{U}"); + this.expansionSetCode = "ONS"; + + this.color.setBlue(true); + + // Draw X cards. For each card drawn this way, discard a card unless you sacrifice a permanent. + this.getSpellAbility().addEffect(new ReadTheRunesEffect()); + } + + public ReadTheRunes(final ReadTheRunes card) { + super(card); + } + + @Override + public ReadTheRunes copy() { + return new ReadTheRunes(this); + } +} + +class ReadTheRunesEffect extends OneShotEffect { + + ReadTheRunesEffect() { + super(Outcome.DrawCard); + this.staticText = "Draw X cards. For each card drawn this way, discard a card unless you sacrifice a permanent."; + } + + ReadTheRunesEffect(final ReadTheRunesEffect effect) { + super(effect); + } + + @Override + public ReadTheRunesEffect copy() { + return new ReadTheRunesEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + int drawnCards = player.drawCards(source.getManaCostsToPay().getX(), game); + Target target = new TargetControlledPermanent(0, drawnCards, new FilterPermanent(), true); + target.choose(Outcome.Sacrifice, player.getId(), source.getSourceId(), game); + int sacrificedPermanents = 0; + for (UUID permanentId : target.getTargets()) { + Permanent permanent = game.getPermanent(permanentId); + if (permanent != null) { + if (permanent.sacrifice(source.getSourceId(), game)) { + sacrificedPermanents++; + } + } + } + player.discard(drawnCards - sacrificedPermanents, source, game); + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/ImperialSeal.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/ImperialSeal.java new file mode 100644 index 0000000000..8dff778a00 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/ImperialSeal.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.portalthreekingdoms; + +import java.util.UUID; +import mage.abilities.effects.common.LoseLifeSourceControllerEffect; +import mage.abilities.effects.common.search.SearchLibraryPutOnLibraryEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author emerald000 + */ +public class ImperialSeal extends CardImpl { + + public ImperialSeal(UUID ownerId) { + super(ownerId, 78, "Imperial Seal", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{B}"); + this.expansionSetCode = "PTK"; + + this.color.setBlack(true); + + // Search your library for a card, then shuffle your library and put that card on top of it. You lose 2 life. + this.getSpellAbility().addEffect(new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary())); + this.getSpellAbility().addEffect(new LoseLifeSourceControllerEffect(2)); + } + + public ImperialSeal(final ImperialSeal card) { + super(card); + } + + @Override + public ImperialSeal copy() { + return new ImperialSeal(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/YawgmothsBargain.java b/Mage.Sets/src/mage/sets/urzasdestiny/YawgmothsBargain.java new file mode 100644 index 0000000000..b519ea3805 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/YawgmothsBargain.java @@ -0,0 +1,54 @@ +/* + * 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.urzasdestiny; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author emerald000 + */ +public class YawgmothsBargain extends mage.sets.vintagemasters.YawgmothsBargain { + + public YawgmothsBargain(UUID ownerId) { + super(ownerId); + this.cardNumber = 75; + this.expansionSetCode = "UDS"; + this.rarity = Rarity.RARE; + } + + public YawgmothsBargain(final YawgmothsBargain card) { + super(card); + } + + @Override + public YawgmothsBargain copy() { + return new YawgmothsBargain(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/Windfall.java b/Mage.Sets/src/mage/sets/urzassaga/Windfall.java new file mode 100644 index 0000000000..96c9939e6a --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/Windfall.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.urzassaga; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author emerald000 + */ +public class Windfall extends CardImpl { + + public Windfall(UUID ownerId) { + super(ownerId, 111, "Windfall", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{2}{U}"); + this.expansionSetCode = "USG"; + + this.color.setBlue(true); + + // Each player discards his or her hand, then draws cards equal to the greatest number of cards a player discarded this way. + this.getSpellAbility().addEffect(new WindfallEffect()); + } + + public Windfall(final Windfall card) { + super(card); + } + + @Override + public Windfall copy() { + return new Windfall(this); + } +} + +class WindfallEffect extends OneShotEffect { + WindfallEffect() { + super(Outcome.Discard); + staticText = "Each player discards his or her hand, then draws cards equal to the greatest number of cards a player discarded this way."; + } + + WindfallEffect(final WindfallEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + int maxDiscarded = 0; + Player sourcePlayer = game.getPlayer(source.getControllerId()); + if (sourcePlayer == null) { + return false; + } + for (UUID playerId : sourcePlayer.getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null) { + int discarded = 0; + for (Card c : player.getHand().getCards(game)) { + if (player.discard(c, source, game)) { + discarded++; + } + } + if (discarded > maxDiscarded) { + maxDiscarded = discarded; + } + } + } + for (UUID playerId : sourcePlayer.getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null) { + player.drawCards(maxDiscarded, game); + } + } + return true; + } + + @Override + public WindfallEffect copy() { + return new WindfallEffect(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/vintagemasters/ChainLightning.java b/Mage.Sets/src/mage/sets/vintagemasters/ChainLightning.java new file mode 100644 index 0000000000..70556af208 --- /dev/null +++ b/Mage.Sets/src/mage/sets/vintagemasters/ChainLightning.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.vintagemasters; + +import java.util.UUID; + +/** + * + * @author emerald000 + */ +public class ChainLightning extends mage.sets.legends.ChainLightning { + + public ChainLightning(UUID ownerId) { + super(ownerId); + this.cardNumber = 153; + this.expansionSetCode = "VMA"; + } + + public ChainLightning(final ChainLightning card) { + super(card); + } + + @Override + public ChainLightning copy() { + return new ChainLightning(this); + } +} diff --git a/Mage.Sets/src/mage/sets/vintagemasters/YawgmothsBargain.java b/Mage.Sets/src/mage/sets/vintagemasters/YawgmothsBargain.java new file mode 100644 index 0000000000..0550994237 --- /dev/null +++ b/Mage.Sets/src/mage/sets/vintagemasters/YawgmothsBargain.java @@ -0,0 +1,68 @@ +/* + * 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.vintagemasters; + +import java.util.UUID; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.PayLifeCost; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.SkipDrawStepEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author emerald000 + */ +public class YawgmothsBargain extends CardImpl { + + public YawgmothsBargain(UUID ownerId) { + super(ownerId, 147, "Yawgmoth's Bargain", Rarity.MYTHIC, new CardType[]{CardType.ENCHANTMENT}, "{4}{B}{B}"); + this.expansionSetCode = "VMA"; + + this.color.setBlack(true); + + // Skip your draw step. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SkipDrawStepEffect())); + + // Pay 1 life: Draw a card. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new PayLifeCost(1))); + } + + public YawgmothsBargain(final YawgmothsBargain card) { + super(card); + } + + @Override + public YawgmothsBargain copy() { + return new YawgmothsBargain(this); + } +}