From 03474e37dae7e7cfb8203a2c9cd42b801fe329cc Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 27 Mar 2016 09:30:18 +0200 Subject: [PATCH] [SOI] Added the missing blue cards. --- .../sets/avacynrestored/CripplingChill.java | 12 +- .../FleetingMemories.java | 70 +++++++++ .../ForgottenCreation.java | 101 +++++++++++++ .../shadowsoverinnistrad/GhostlyWings.java | 125 ++++++++++++++++ .../shadowsoverinnistrad/GoneMissing.java | 64 ++++++++ .../JaceUnravelerOfSecrets.java | 138 ++++++++++++++++++ .../shadowsoverinnistrad/NaggingThoughts.java | 66 +++++++++ .../PersistentNightmare.java | 70 +++++++++ .../shadowsoverinnistrad/PressForAnswers.java | 70 +++++++++ .../SilburlindSnapper.java | 113 ++++++++++++++ .../shadowsoverinnistrad/StartledAwake.java | 113 ++++++++++++++ .../WelcomeToTheFold.java | 112 ++++++++++++++ .../src/mage/sets/torment/GhostlyWings.java | 52 +++++++ 13 files changed, 1099 insertions(+), 7 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/shadowsoverinnistrad/FleetingMemories.java create mode 100644 Mage.Sets/src/mage/sets/shadowsoverinnistrad/ForgottenCreation.java create mode 100644 Mage.Sets/src/mage/sets/shadowsoverinnistrad/GhostlyWings.java create mode 100644 Mage.Sets/src/mage/sets/shadowsoverinnistrad/GoneMissing.java create mode 100644 Mage.Sets/src/mage/sets/shadowsoverinnistrad/JaceUnravelerOfSecrets.java create mode 100644 Mage.Sets/src/mage/sets/shadowsoverinnistrad/NaggingThoughts.java create mode 100644 Mage.Sets/src/mage/sets/shadowsoverinnistrad/PersistentNightmare.java create mode 100644 Mage.Sets/src/mage/sets/shadowsoverinnistrad/PressForAnswers.java create mode 100644 Mage.Sets/src/mage/sets/shadowsoverinnistrad/SilburlindSnapper.java create mode 100644 Mage.Sets/src/mage/sets/shadowsoverinnistrad/StartledAwake.java create mode 100644 Mage.Sets/src/mage/sets/shadowsoverinnistrad/WelcomeToTheFold.java create mode 100644 Mage.Sets/src/mage/sets/torment/GhostlyWings.java diff --git a/Mage.Sets/src/mage/sets/avacynrestored/CripplingChill.java b/Mage.Sets/src/mage/sets/avacynrestored/CripplingChill.java index 760f392723..706b58722e 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/CripplingChill.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/CripplingChill.java @@ -27,16 +27,15 @@ */ package mage.sets.avacynrestored; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import java.util.UUID; import mage.abilities.effects.common.DontUntapInControllersNextUntapStepTargetEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.TapTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.target.common.TargetCreaturePermanent; -import java.util.UUID; - /** * * @author noxx @@ -47,11 +46,10 @@ public class CripplingChill extends CardImpl { super(ownerId, 46, "Crippling Chill", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{U}"); this.expansionSetCode = "AVR"; - // Tap target creature. It doesn't untap during its controller's next untap step. this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addEffect(new TapTargetEffect()); - this.getSpellAbility().addEffect(new DontUntapInControllersNextUntapStepTargetEffect()); + this.getSpellAbility().addEffect(new DontUntapInControllersNextUntapStepTargetEffect("It")); // Draw a card. this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); } diff --git a/Mage.Sets/src/mage/sets/shadowsoverinnistrad/FleetingMemories.java b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/FleetingMemories.java new file mode 100644 index 0000000000..f9a3a984a5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/FleetingMemories.java @@ -0,0 +1,70 @@ +/* + * 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.shadowsoverinnistrad; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SacrificeAllTriggeredAbility; +import mage.abilities.effects.common.PutTopCardOfLibraryIntoGraveTargetEffect; +import mage.abilities.effects.keyword.InvestigateEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.filter.common.FilterCreaturePermanent; +import mage.target.TargetPlayer; + +/** + * + * @author LevelX2 + */ +public class FleetingMemories extends CardImpl { + + public FleetingMemories(UUID ownerId) { + super(ownerId, 62, "Fleeting Memories", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}"); + this.expansionSetCode = "SOI"; + + // When Fleeting Memories enters the battlefield, investigate. + this.addAbility(new EntersBattlefieldTriggeredAbility(new InvestigateEffect(), false)); + + // Whenever you sacrifice a Clue, target player puts the top three cards of his or her graveyard into his or her graveyard. + Ability ability = new SacrificeAllTriggeredAbility(new PutTopCardOfLibraryIntoGraveTargetEffect(3), new FilterCreaturePermanent("Clue", "a Clue"), TargetController.YOU, false); + ability.addTarget(new TargetPlayer()); + this.addAbility(ability); + } + + public FleetingMemories(final FleetingMemories card) { + super(card); + } + + @Override + public FleetingMemories copy() { + return new FleetingMemories(this); + } +} diff --git a/Mage.Sets/src/mage/sets/shadowsoverinnistrad/ForgottenCreation.java b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/ForgottenCreation.java new file mode 100644 index 0000000000..b19fd1432f --- /dev/null +++ b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/ForgottenCreation.java @@ -0,0 +1,101 @@ +/* + * 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.shadowsoverinnistrad; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.SkulkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author LevelX2 + */ +public class ForgottenCreation extends CardImpl { + + public ForgottenCreation(UUID ownerId) { + super(ownerId, 63, "Forgotten Creation", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{U}"); + this.expansionSetCode = "SOI"; + this.subtype.add("Zombie"); + this.subtype.add("Horror"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Skulk + this.addAbility(new SkulkAbility()); + // At the beginning of your upkeep, you may discard all the cards in your hand. If you do, draw that many cards. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new ForgottenCreationEffect(), TargetController.YOU, true)); + } + + public ForgottenCreation(final ForgottenCreation card) { + super(card); + } + + @Override + public ForgottenCreation copy() { + return new ForgottenCreation(this); + } +} + +class ForgottenCreationEffect extends OneShotEffect { + + public ForgottenCreationEffect() { + super(Outcome.DrawCard); + this.staticText = "you may discard all the cards in your hand. If you do, draw that many cards"; + } + + public ForgottenCreationEffect(final ForgottenCreationEffect effect) { + super(effect); + } + + @Override + public ForgottenCreationEffect copy() { + return new ForgottenCreationEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + int cardsInHand = controller.getHand().size(); + controller.discard(cardsInHand, false, source, game); + controller.drawCards(cardsInHand, game); + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/shadowsoverinnistrad/GhostlyWings.java b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/GhostlyWings.java new file mode 100644 index 0000000000..f4b02ea6e8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/GhostlyWings.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.shadowsoverinnistrad; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class GhostlyWings extends CardImpl { + + public GhostlyWings(UUID ownerId) { + super(ownerId, 66, "Ghostly Wings", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}"); + this.expansionSetCode = "SOI"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // Enchanted creature gets +1/+1 and has flying. + Effect effect = new BoostEnchantedEffect(1, 1, Duration.WhileOnBattlefield); + effect.setText("Enchanted creature gets +1/+1"); + ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect); + effect = new GainAbilityAttachedEffect(FlyingAbility.getInstance(), AttachmentType.AURA); + effect.setText("and has flying"); + ability.addEffect(effect); + this.addAbility(ability); + // Discard a card: Return enchanted creature to its owner's hand. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GhostlyWingsReturnEffect(), new DiscardCardCost())); + + } + + public GhostlyWings(final GhostlyWings card) { + super(card); + } + + @Override + public GhostlyWings copy() { + return new GhostlyWings(this); + } +} + +class GhostlyWingsReturnEffect extends OneShotEffect { + + public GhostlyWingsReturnEffect() { + super(Outcome.ReturnToHand); + staticText = "Return enchanted creature to its owner's hand"; + } + + public GhostlyWingsReturnEffect(final GhostlyWingsReturnEffect effect) { + super(effect); + } + + @Override + public GhostlyWingsReturnEffect copy() { + return new GhostlyWingsReturnEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = (Permanent) game.getPermanentOrLKIBattlefield(source.getSourceId()); + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null && permanent != null && permanent.getAttachedTo() != null) { + Permanent enchantedCreature = game.getPermanent(permanent.getAttachedTo()); + if (enchantedCreature != null) { + controller.moveCards(enchantedCreature, Zone.HAND, source, game); + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/shadowsoverinnistrad/GoneMissing.java b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/GoneMissing.java new file mode 100644 index 0000000000..d4e0951827 --- /dev/null +++ b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/GoneMissing.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.shadowsoverinnistrad; + +import java.util.UUID; +import mage.abilities.effects.common.PutOnLibraryTargetEffect; +import mage.abilities.effects.keyword.InvestigateEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.TargetPermanent; + +/** + * + * @author LevelX2 + */ +public class GoneMissing extends CardImpl { + + public GoneMissing(UUID ownerId) { + super(ownerId, 67, "Gone Missing", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{4}{U}"); + this.expansionSetCode = "SOI"; + + // Put target permanent on top of its owner's library. + this.getSpellAbility().addEffect(new PutOnLibraryTargetEffect(true)); + this.getSpellAbility().addTarget(new TargetPermanent()); + + // Investigate. + this.getSpellAbility().addEffect(new InvestigateEffect()); + } + + public GoneMissing(final GoneMissing card) { + super(card); + } + + @Override + public GoneMissing copy() { + return new GoneMissing(this); + } +} diff --git a/Mage.Sets/src/mage/sets/shadowsoverinnistrad/JaceUnravelerOfSecrets.java b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/JaceUnravelerOfSecrets.java new file mode 100644 index 0000000000..5b8058739d --- /dev/null +++ b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/JaceUnravelerOfSecrets.java @@ -0,0 +1,138 @@ +/* + * 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.shadowsoverinnistrad; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.LoyaltyAbility; +import mage.abilities.common.SpellCastOpponentTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CounterTargetEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.GetEmblemEffect; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.abilities.effects.keyword.ScryEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.command.Emblem; +import mage.game.events.GameEvent; +import mage.target.common.TargetCreaturePermanent; +import mage.target.targetpointer.FixedTarget; +import mage.watchers.common.SpellsCastWatcher; + +/** + * + * @author LevelX2 + */ +public class JaceUnravelerOfSecrets extends CardImpl { + + public JaceUnravelerOfSecrets(UUID ownerId) { + super(ownerId, 69, "Jace, Unraveler of Secrets", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{3}{U}{U}"); + this.expansionSetCode = "SOI"; + this.subtype.add("Jace"); + + // +1: Scry 1, then draw a card. + Ability ability = new LoyaltyAbility(new ScryEffect(1), 1); + Effect effect = new DrawCardSourceControllerEffect(1); + effect.setText(", then draw a card"); + ability.addEffect(effect); + this.addAbility(ability); + + // -2: Return target creature to its owner's hand. + ability = new LoyaltyAbility(new ReturnToHandTargetEffect(), -2); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + + // -8: You get an emblem with "Whenever an opponent casts his or her first spell each turn, counter that spell." + LoyaltyAbility ability2 = new LoyaltyAbility(new GetEmblemEffect(new JaceUnravelerOfSecretsEmblem()), -8); + this.addAbility(ability2, new SpellsCastWatcher()); + + } + + public JaceUnravelerOfSecrets(final JaceUnravelerOfSecrets card) { + super(card); + } + + @Override + public JaceUnravelerOfSecrets copy() { + return new JaceUnravelerOfSecrets(this); + } +} + +/** + * Emblem: "Whenever an opponent casts his or her first spell each turn, counter + * that spell." + */ +class JaceUnravelerOfSecretsEmblem extends Emblem { + + public JaceUnravelerOfSecretsEmblem() { + this.setName("EMBLEM: Jace, Unraveler of Secrets"); + Effect effect = new CounterTargetEffect(); + effect.setText("counter that spell"); + this.getAbilities().add(new JaceUnravelerOfSecretsTriggertAbility(effect, false)); + } +} + +class JaceUnravelerOfSecretsTriggertAbility extends SpellCastOpponentTriggeredAbility { + + public JaceUnravelerOfSecretsTriggertAbility(Effect effect, boolean optional) { + super(effect, optional); + } + + public JaceUnravelerOfSecretsTriggertAbility(SpellCastOpponentTriggeredAbility ability) { + super(ability); + } + + @Override + public SpellCastOpponentTriggeredAbility copy() { + return super.copy(); //To change body of generated methods, choose Tools | Templates. + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (super.checkTrigger(event, game)) { + SpellsCastWatcher watcher = (SpellsCastWatcher) game.getState().getWatchers().get(SpellsCastWatcher.class.getName()); + if (watcher != null) { + if (watcher.getSpellsCastThisTurn(event.getPlayerId()) == null) { + for (Effect effect : getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getTargetId())); + } + } + } + } + return false; + } + + @Override + public String getRule() { + return "Whenever an opponent casts his or her first spell each turn, counter that spell."; + } + +} diff --git a/Mage.Sets/src/mage/sets/shadowsoverinnistrad/NaggingThoughts.java b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/NaggingThoughts.java new file mode 100644 index 0000000000..a75df947a7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/NaggingThoughts.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.shadowsoverinnistrad; + +import java.util.UUID; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.common.LookLibraryAndPickControllerEffect; +import mage.abilities.keyword.MadnessAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; + +/** + * + * @author LevelX2 + */ +public class NaggingThoughts extends CardImpl { + + public NaggingThoughts(UUID ownerId) { + super(ownerId, 74, "Nagging Thoughts", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{U}"); + this.expansionSetCode = "SOI"; + + // Look at the top two cards of your library. Put one of them into your hand and the other into your graveyard. + this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(new StaticValue(2), false, new StaticValue(1), new FilterCard(), Zone.GRAVEYARD, false, false)); + + // Madness {1}{U} + this.addAbility(new MadnessAbility(this, new ManaCostsImpl("{1}{U}"))); + } + + public NaggingThoughts(final NaggingThoughts card) { + super(card); + } + + @Override + public NaggingThoughts copy() { + return new NaggingThoughts(this); + } +} diff --git a/Mage.Sets/src/mage/sets/shadowsoverinnistrad/PersistentNightmare.java b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/PersistentNightmare.java new file mode 100644 index 0000000000..07a99a7907 --- /dev/null +++ b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/PersistentNightmare.java @@ -0,0 +1,70 @@ +/* + * 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.shadowsoverinnistrad; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; +import mage.abilities.effects.common.ReturnToHandSourceEffect; +import mage.abilities.keyword.SkulkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class PersistentNightmare extends CardImpl { + + public PersistentNightmare(UUID ownerId) { + super(ownerId, 88, "Persistent Nightmare", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, ""); + this.expansionSetCode = "SOI"; + this.subtype.add("Nightmare"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // this card is the second face of double-faced card + this.nightCard = true; + + // Skulk + this.addAbility(new SkulkAbility()); + + // When Persistent Nightmare deals combat damage to a player, return it to its owner's hand. + this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new ReturnToHandSourceEffect(), false)); + } + + public PersistentNightmare(final PersistentNightmare card) { + super(card); + } + + @Override + public PersistentNightmare copy() { + return new PersistentNightmare(this); + } +} diff --git a/Mage.Sets/src/mage/sets/shadowsoverinnistrad/PressForAnswers.java b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/PressForAnswers.java new file mode 100644 index 0000000000..ee3d153122 --- /dev/null +++ b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/PressForAnswers.java @@ -0,0 +1,70 @@ +/* + * 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.shadowsoverinnistrad; + +import java.util.UUID; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DontUntapInControllersNextUntapStepTargetEffect; +import mage.abilities.effects.common.TapTargetEffect; +import mage.abilities.effects.keyword.InvestigateEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class PressForAnswers extends CardImpl { + + public PressForAnswers(UUID ownerId) { + super(ownerId, 80, "Press for Answers", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{U}"); + this.expansionSetCode = "SOI"; + + // Tap target creature. It doesn't untap during its controller's next untap step. + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addEffect(new TapTargetEffect()); + this.getSpellAbility().addEffect(new DontUntapInControllersNextUntapStepTargetEffect("It")); + + // Investigate. (Put a colorless Clue artifact token onto the battlefield with "2, Sacrifice this artifact: Draw a card.") + Effect effect = new InvestigateEffect(); + effect.setText("
Investigate. (Put a colorless Clue artifact token onto the battlefield with \"2, Sacrifice this artifact: Draw a card.\")"); + this.getSpellAbility().addEffect(effect); + + } + + public PressForAnswers(final PressForAnswers card) { + super(card); + } + + @Override + public PressForAnswers copy() { + return new PressForAnswers(this); + } +} diff --git a/Mage.Sets/src/mage/sets/shadowsoverinnistrad/SilburlindSnapper.java b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/SilburlindSnapper.java new file mode 100644 index 0000000000..409f22f462 --- /dev/null +++ b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/SilburlindSnapper.java @@ -0,0 +1,113 @@ +/* + * 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.shadowsoverinnistrad; + +import java.util.List; +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.RestrictionEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.stack.Spell; +import mage.watchers.common.SpellsCastWatcher; + +/** + * + * @author LevelX2 + */ +public class SilburlindSnapper extends CardImpl { + + public SilburlindSnapper(UUID ownerId) { + super(ownerId, 85, "Silburlind Snapper", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{5}{U}"); + this.expansionSetCode = "SOI"; + this.subtype.add("Turtle"); + this.power = new MageInt(6); + this.toughness = new MageInt(6); + + // Silburlind Snapper can't attack unless you've cast a noncreature spell this turn. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SilburlindSnapperEffect()), new SpellsCastWatcher()); + } + + public SilburlindSnapper(final SilburlindSnapper card) { + super(card); + } + + @Override + public SilburlindSnapper copy() { + return new SilburlindSnapper(this); + } +} + +class SilburlindSnapperEffect extends RestrictionEffect { + + public SilburlindSnapperEffect() { + super(Duration.WhileOnBattlefield); + staticText = "{this} can't attack unless you've cast a noncreature spell this turn"; + } + + public SilburlindSnapperEffect(final SilburlindSnapperEffect effect) { + super(effect); + } + + @Override + public SilburlindSnapperEffect copy() { + return new SilburlindSnapperEffect(this); + } + + @Override + public boolean canAttack(Game game) { + + return false; + } + + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + if (permanent.getId().equals(source.getSourceId())) { + SpellsCastWatcher watcher = (SpellsCastWatcher) game.getState().getWatchers().get(SpellsCastWatcher.class.getName()); + if (watcher != null) { + List spellsCast = watcher.getSpellsCastThisTurn(source.getControllerId()); + if (spellsCast != null) { + for (Spell spell : spellsCast) { + if (!spell.getCardType().contains(CardType.CREATURE)) { + return false; + } + } + } + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/shadowsoverinnistrad/StartledAwake.java b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/StartledAwake.java new file mode 100644 index 0000000000..1c3c3e8d90 --- /dev/null +++ b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/StartledAwake.java @@ -0,0 +1,113 @@ +/* + * 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.shadowsoverinnistrad; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.ActivateAsSorceryActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect; +import mage.abilities.effects.common.ReturnSourceFromGraveyardToBattlefieldEffect; +import mage.abilities.keyword.TransformAbility; +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.game.Game; +import mage.players.Player; +import mage.target.common.TargetOpponent; + +/** + * + * @author LevelX2 + */ +public class StartledAwake extends CardImpl { + + public StartledAwake(UUID ownerId) { + super(ownerId, 88, "Startled Awake", Rarity.MYTHIC, new CardType[]{CardType.SORCERY}, "{2}{U}{U}"); + this.expansionSetCode = "SOI"; + + this.canTransform = true; + this.secondSideCard = new PersistentNightmare(ownerId); + + // Target opponent puts the top thirteen cards of his or her library into his or her graveyard. + this.getSpellAbility().addTarget(new TargetOpponent()); + this.getSpellAbility().addEffect(new PutLibraryIntoGraveTargetEffect(13)); + + // {3}{U}{U}: Put Startled Awake from your graveyard onto the battlefield transformed. Activate this ability only any time you could cast a sorcery. + this.addAbility(new TransformAbility()); + Ability ability = new ActivateAsSorceryActivatedAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToBattlefieldEffect(), new ManaCostsImpl("{3}{U}{U}")); + this.addAbility(ability); + + } + + public StartledAwake(final StartledAwake card) { + super(card); + } + + @Override + public StartledAwake copy() { + return new StartledAwake(this); + } +} + +class StartledAwakeReturnTransformedEffect extends OneShotEffect { + + public StartledAwakeReturnTransformedEffect() { + super(Outcome.PutCardInPlay); + this.staticText = "Put {this} from your graveyard onto the battlefield transformed"; + } + + public StartledAwakeReturnTransformedEffect(final StartledAwakeReturnTransformedEffect effect) { + super(effect); + } + + @Override + public StartledAwakeReturnTransformedEffect copy() { + return new StartledAwakeReturnTransformedEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + if (game.getState().getZone(source.getSourceId()).equals(Zone.GRAVEYARD)) { + game.getState().setValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + source.getSourceId(), Boolean.TRUE); + Card card = game.getCard(source.getSourceId()); + if (card != null) { + controller.moveCards(card, Zone.BATTLEFIELD, source, game); + } + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/shadowsoverinnistrad/WelcomeToTheFold.java b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/WelcomeToTheFold.java new file mode 100644 index 0000000000..1f3bba5e38 --- /dev/null +++ b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/WelcomeToTheFold.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.shadowsoverinnistrad; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.costs.mana.ManaCosts; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.GainControlTargetEffect; +import mage.abilities.keyword.MadnessAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class WelcomeToTheFold extends CardImpl { + + public WelcomeToTheFold(UUID ownerId) { + super(ownerId, 96, "Welcome to the Fold", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{U}{U}"); + this.expansionSetCode = "SOI"; + + // Madness {X}{U}{U} (If you discard this card + // discard it into exile. When you do + // cast it for its madness cost or put it into your graveyard. + Ability ability = new MadnessAbility(this, new ManaCostsImpl("{X}{U}{U}")); + ability.setRuleAtTheTop(true); + this.addAbility(ability); + + // Gain control of target creature if its toughness is 2 or less. If Welcome to the Fold's madness cost was paid, instead gain control of that creature if its toughness is X or less. + this.getSpellAbility().addEffect(new WelcomeToTheFoldEffect(Duration.Custom, true)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + + } + + public WelcomeToTheFold(final WelcomeToTheFold card) { + super(card); + } + + @Override + public WelcomeToTheFold copy() { + return new WelcomeToTheFold(this); + } +} + +class WelcomeToTheFoldEffect extends GainControlTargetEffect { + + public WelcomeToTheFoldEffect(Duration duration, boolean fixedControl) { + super(duration, fixedControl); + staticText = "Gain control of target creature if its toughness is 2 or less. If Welcome to the Fold's madness cost was paid, instead gain control of that creature if its toughness is X or less"; + } + + public WelcomeToTheFoldEffect(GainControlTargetEffect effect) { + super(effect); + } + + @Override + public void init(Ability source, Game game) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + int maxPower = 2; + ManaCosts manaCosts = source.getManaCostsToPay(); + if (!manaCosts.getVariableCosts().isEmpty()) { + maxPower = source.getManaCostsToPay().getX(); + } + Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); + if (permanent != null && permanent.getPower().getValue() <= maxPower) { + this.discard(); + return; + } + } + super.init(source, game); + } + + @Override + public GainControlTargetEffect copy() { + return new WelcomeToTheFoldEffect(this); + } + +} diff --git a/Mage.Sets/src/mage/sets/torment/GhostlyWings.java b/Mage.Sets/src/mage/sets/torment/GhostlyWings.java new file mode 100644 index 0000000000..b9508d4190 --- /dev/null +++ b/Mage.Sets/src/mage/sets/torment/GhostlyWings.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 LevelX2 + */ +public class GhostlyWings extends mage.sets.shadowsoverinnistrad.GhostlyWings { + + public GhostlyWings(UUID ownerId) { + super(ownerId); + this.cardNumber = 38; + this.expansionSetCode = "TOR"; + } + + public GhostlyWings(final GhostlyWings card) { + super(card); + } + + @Override + public GhostlyWings copy() { + return new GhostlyWings(this); + } +}