From 4e9bf6693a0812e81f787971f4911aaed4c69e5c Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 29 Mar 2014 09:57:43 +0100 Subject: [PATCH] * Added Goryo's Vengeance, Spirit Link and Whirlpool Rider. --- .../mage/sets/apocalypse/WhirlpoolRider.java | 113 +++++++++++++ .../betrayersofkamigawa/GoryosVengeance.java | 137 ++++++++++++++++ .../championsofkamigawa/ThroughTheBreach.java | 33 ++-- .../mage/sets/eighthedition/SpiritLink.java | 52 ++++++ .../mage/sets/fifthedition/SpiritLink.java | 52 ++++++ .../mage/sets/fourthedition/SpiritLink.java | 52 ++++++ .../src/mage/sets/legends/SpiritLink.java | 52 ++++++ .../mage/sets/ninthedition/SpiritLink.java | 52 ++++++ .../mage/sets/seventhedition/SpiritLink.java | 152 ++++++++++++++++++ .../mage/sets/sixthedition/SpiritLink.java | 52 ++++++ Mage.Sets/src/mage/sets/tenth/SpiritLink.java | 52 ++++++ 11 files changed, 784 insertions(+), 15 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/apocalypse/WhirlpoolRider.java create mode 100644 Mage.Sets/src/mage/sets/betrayersofkamigawa/GoryosVengeance.java create mode 100644 Mage.Sets/src/mage/sets/eighthedition/SpiritLink.java create mode 100644 Mage.Sets/src/mage/sets/fifthedition/SpiritLink.java create mode 100644 Mage.Sets/src/mage/sets/fourthedition/SpiritLink.java create mode 100644 Mage.Sets/src/mage/sets/legends/SpiritLink.java create mode 100644 Mage.Sets/src/mage/sets/ninthedition/SpiritLink.java create mode 100644 Mage.Sets/src/mage/sets/seventhedition/SpiritLink.java create mode 100644 Mage.Sets/src/mage/sets/sixthedition/SpiritLink.java create mode 100644 Mage.Sets/src/mage/sets/tenth/SpiritLink.java diff --git a/Mage.Sets/src/mage/sets/apocalypse/WhirlpoolRider.java b/Mage.Sets/src/mage/sets/apocalypse/WhirlpoolRider.java new file mode 100644 index 00000000000..b0c5fd8d344 --- /dev/null +++ b/Mage.Sets/src/mage/sets/apocalypse/WhirlpoolRider.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.apocalypse; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author LevelX2 + */ +public class WhirlpoolRider extends CardImpl { + + public WhirlpoolRider(UUID ownerId) { + super(ownerId, 35, "Whirlpool Rider", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "APC"; + this.subtype.add("Merfolk"); + + this.color.setBlue(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // When Whirlpool Rider enters the battlefield, shuffle the cards from your hand into your library, then draw that many cards. + this.addAbility(new EntersBattlefieldTriggeredAbility(new WhirlpoolRiderTriggeredEffect())); + + } + + public WhirlpoolRider(final WhirlpoolRider card) { + super(card); + } + + @Override + public WhirlpoolRider copy() { + return new WhirlpoolRider(this); + } +} + +class WhirlpoolRiderTriggeredEffect extends OneShotEffect { + + public WhirlpoolRiderTriggeredEffect() { + super(Outcome.DrawCard); + this.staticText = "shuffle the cards from your hand into your library, then draw that many cards"; + } + + public WhirlpoolRiderTriggeredEffect(final WhirlpoolRiderTriggeredEffect effect) { + super(effect); + } + + @Override + public WhirlpoolRiderTriggeredEffect copy() { + return new WhirlpoolRiderTriggeredEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + int cardsHand = controller.getHand().size(); + if (cardsHand > 0){ + Cards cards = controller.getHand(); + for (UUID cardId: cards) { + Card card = game.getCard(cardId); + if (card != null) { + controller.removeFromHand(card, game); + card.moveToZone(Zone.LIBRARY, source.getId(), game, true); + } + } + controller.shuffleLibrary(game); + controller.drawCards(cardsHand, game); + return true; + } + } + + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/GoryosVengeance.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/GoryosVengeance.java new file mode 100644 index 00000000000..22cf43eaa7f --- /dev/null +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/GoryosVengeance.java @@ -0,0 +1,137 @@ +/* + * 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.betrayersofkamigawa; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.DelayedTriggeredAbility; +import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.abilities.effects.common.continious.GainAbilityTargetEffect; +import mage.abilities.keyword.HasteAbility; +import mage.abilities.keyword.SpliceOntoArcaneAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.SupertypePredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCardInYourGraveyard; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author LevelX2 + */ +public class GoryosVengeance extends CardImpl { + + private static final FilterCard filter = new FilterCard("legendary creature card"); + + static { + filter.add(new SupertypePredicate("Legendary")); + } + + public GoryosVengeance(UUID ownerId) { + super(ownerId, 67, "Goryo's Vengeance", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{1}{B}"); + this.expansionSetCode = "BOK"; + this.subtype.add("Arcane"); + + this.color.setBlack(true); + + // Return target legendary creature card from your graveyard to the battlefield. That creature gains haste. Exile it at the beginning of the next end step. + this.getSpellAbility().addEffect(new GoryosVengeanceEffect()); + this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(filter, true)); + + // Splice onto Arcane {2}{B} + this.addAbility(new SpliceOntoArcaneAbility("{2}{B}")); + } + + public GoryosVengeance(final GoryosVengeance card) { + super(card); + } + + @Override + public GoryosVengeance copy() { + return new GoryosVengeance(this); + } +} + +class GoryosVengeanceEffect extends OneShotEffect { + + public GoryosVengeanceEffect() { + super(Outcome.PutCardInPlay); + this.staticText = "Return target legendary creature card from your graveyard to the battlefield. That creature gains haste. Exile it at the beginning of the next end step"; + } + + public GoryosVengeanceEffect(final GoryosVengeanceEffect effect) { + super(effect); + } + + @Override + public GoryosVengeanceEffect copy() { + return new GoryosVengeanceEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + Card card = game.getCard(targetPointer.getFirst(game, source)); + if (card != null) { + if (controller.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getId())) { + Permanent permanent = game.getPermanent(card.getId()); + if (permanent != null) { + // Haste + ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.Custom); + effect.setTargetPointer(new FixedTarget(permanent.getId())); + game.addEffect(effect, source); + // Exile it at end of turn + Effect exileEffect = new ExileTargetEffect(new StringBuilder("Exile ").append(permanent.getName()).append(" at the beginning of the next end step").toString()); + exileEffect.setTargetPointer(new FixedTarget(card.getId())); + DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(exileEffect); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + game.addDelayedTriggeredAbility(delayedAbility); + return true; + + } + } + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/ThroughTheBreach.java b/Mage.Sets/src/mage/sets/championsofkamigawa/ThroughTheBreach.java index c17f0046f89..ec8dbd6828e 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/ThroughTheBreach.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/ThroughTheBreach.java @@ -101,27 +101,30 @@ class ThroughTheBreachEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - if (player.chooseUse(Outcome.PutCreatureInPlay, choiceText, game)) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + if (controller.chooseUse(Outcome.PutCreatureInPlay, choiceText, game)) { TargetCardInHand target = new TargetCardInHand(new FilterCreatureCard()); - if (player.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) { + if (controller.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) { Card card = game.getCard(target.getFirstTarget()); if (card != null) { - if (card.putOntoBattlefield(game, Zone.HAND, source.getId(), source.getControllerId())) { + if (controller.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId())) { Permanent permanent = game.getPermanent(card.getId()); - ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.Custom); - effect.setTargetPointer(new FixedTarget(permanent.getId())); - game.addEffect(effect, source); - SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice " + card.getName()); - sacrificeEffect.setTargetPointer(new FixedTarget(card.getId())); - DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(sacrificeEffect); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - game.addDelayedTriggeredAbility(delayedAbility); + if (permanent != null) { + ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.Custom); + effect.setTargetPointer(new FixedTarget(permanent.getId())); + game.addEffect(effect, source); + SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice " + card.getName()); + sacrificeEffect.setTargetPointer(new FixedTarget(card.getId())); + DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(sacrificeEffect); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + game.addDelayedTriggeredAbility(delayedAbility); + return true; + } } - return true; } + return false; } } return true; diff --git a/Mage.Sets/src/mage/sets/eighthedition/SpiritLink.java b/Mage.Sets/src/mage/sets/eighthedition/SpiritLink.java new file mode 100644 index 00000000000..3f3a2e6cb9f --- /dev/null +++ b/Mage.Sets/src/mage/sets/eighthedition/SpiritLink.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.eighthedition; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class SpiritLink extends mage.sets.seventhedition.SpiritLink { + + public SpiritLink(UUID ownerId) { + super(ownerId); + this.cardNumber = 47; + this.expansionSetCode = "8ED"; + } + + public SpiritLink(final SpiritLink card) { + super(card); + } + + @Override + public SpiritLink copy() { + return new SpiritLink(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/SpiritLink.java b/Mage.Sets/src/mage/sets/fifthedition/SpiritLink.java new file mode 100644 index 00000000000..43087118a1e --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/SpiritLink.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.fifthedition; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class SpiritLink extends mage.sets.seventhedition.SpiritLink { + + public SpiritLink(UUID ownerId) { + super(ownerId); + this.cardNumber = 288; + this.expansionSetCode = "5ED"; + } + + public SpiritLink(final SpiritLink card) { + super(card); + } + + @Override + public SpiritLink copy() { + return new SpiritLink(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/SpiritLink.java b/Mage.Sets/src/mage/sets/fourthedition/SpiritLink.java new file mode 100644 index 00000000000..d4455f755cc --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/SpiritLink.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.fourthedition; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class SpiritLink extends mage.sets.seventhedition.SpiritLink { + + public SpiritLink(UUID ownerId) { + super(ownerId); + this.cardNumber = 301; + this.expansionSetCode = "4ED"; + } + + public SpiritLink(final SpiritLink card) { + super(card); + } + + @Override + public SpiritLink copy() { + return new SpiritLink(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/SpiritLink.java b/Mage.Sets/src/mage/sets/legends/SpiritLink.java new file mode 100644 index 00000000000..d149b2415c6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/SpiritLink.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.legends; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class SpiritLink extends mage.sets.seventhedition.SpiritLink { + + public SpiritLink(UUID ownerId) { + super(ownerId); + this.cardNumber = 206; + this.expansionSetCode = "LEG"; + } + + public SpiritLink(final SpiritLink card) { + super(card); + } + + @Override + public SpiritLink copy() { + return new SpiritLink(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ninthedition/SpiritLink.java b/Mage.Sets/src/mage/sets/ninthedition/SpiritLink.java new file mode 100644 index 00000000000..6ed604d4866 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ninthedition/SpiritLink.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.ninthedition; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class SpiritLink extends mage.sets.seventhedition.SpiritLink { + + public SpiritLink(UUID ownerId) { + super(ownerId); + this.cardNumber = 47; + this.expansionSetCode = "9ED"; + } + + public SpiritLink(final SpiritLink card) { + super(card); + } + + @Override + public SpiritLink copy() { + return new SpiritLink(this); + } +} diff --git a/Mage.Sets/src/mage/sets/seventhedition/SpiritLink.java b/Mage.Sets/src/mage/sets/seventhedition/SpiritLink.java new file mode 100644 index 00000000000..d70c1f46290 --- /dev/null +++ b/Mage.Sets/src/mage/sets/seventhedition/SpiritLink.java @@ -0,0 +1,152 @@ +/* + * 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.seventhedition; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.keyword.EnchantAbility; +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.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class SpiritLink extends CardImpl { + + public SpiritLink(UUID ownerId) { + super(ownerId, 47, "Spirit Link", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{W}"); + this.expansionSetCode = "7ED"; + this.subtype.add("Aura"); + + this.color.setWhite(true); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // Whenever enchanted creature deals damage, you gain that much life. + this.addAbility(new SpiritLinkTriggeredAbility()); + } + + public SpiritLink(final SpiritLink card) { + super(card); + } + + @Override + public SpiritLink copy() { + return new SpiritLink(this); + } +} + +class SpiritLinkTriggeredAbility extends TriggeredAbilityImpl { + + public SpiritLinkTriggeredAbility() { + super(Zone.BATTLEFIELD, new SpiritLinkEffect(), false); + } + + public SpiritLinkTriggeredAbility(final SpiritLinkTriggeredAbility ability) { + super(ability); + } + + @Override + public SpiritLinkTriggeredAbility copy() { + return new SpiritLinkTriggeredAbility(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType().equals(GameEvent.EventType.DAMAGED_CREATURE) + || event.getType().equals(GameEvent.EventType.DAMAGED_PLAYER) + || event.getType().equals(GameEvent.EventType.DAMAGED_PLANESWALKER)) { + Permanent enchantment = game.getPermanent(this.getSourceId()); + if (enchantment == null || enchantment.getAttachedTo() == null) { + return false; + } + Permanent enchanted = game.getPermanent(enchantment.getAttachedTo()); + if (enchanted != null && event.getSourceId().equals(enchanted.getId())) { + for (Effect effect : this.getEffects()) { + effect.setValue("damage", event.getAmount()); + } + return true; + } + } + return false; + } + + @Override + public String getRule() { + return "Whenever enchanted creature deals damage, " + super.getRule(); + } +} + +class SpiritLinkEffect extends OneShotEffect { + + public SpiritLinkEffect() { + super(Outcome.GainLife); + this.staticText = "you gain that much life"; + } + + public SpiritLinkEffect(final SpiritLinkEffect effect) { + super(effect); + } + + @Override + public SpiritLinkEffect copy() { + return new SpiritLinkEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + int amount = (Integer) getValue("damage"); + if (amount > 0) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + controller.gainLife(amount, game); + return true; + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/sixthedition/SpiritLink.java b/Mage.Sets/src/mage/sets/sixthedition/SpiritLink.java new file mode 100644 index 00000000000..50208a23e66 --- /dev/null +++ b/Mage.Sets/src/mage/sets/sixthedition/SpiritLink.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.sixthedition; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class SpiritLink extends mage.sets.seventhedition.SpiritLink { + + public SpiritLink(UUID ownerId) { + super(ownerId); + this.cardNumber = 43; + this.expansionSetCode = "6ED"; + } + + public SpiritLink(final SpiritLink card) { + super(card); + } + + @Override + public SpiritLink copy() { + return new SpiritLink(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tenth/SpiritLink.java b/Mage.Sets/src/mage/sets/tenth/SpiritLink.java new file mode 100644 index 00000000000..96e810ca40f --- /dev/null +++ b/Mage.Sets/src/mage/sets/tenth/SpiritLink.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.tenth; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class SpiritLink extends mage.sets.seventhedition.SpiritLink { + + public SpiritLink(UUID ownerId) { + super(ownerId); + this.cardNumber = 45; + this.expansionSetCode = "10E"; + } + + public SpiritLink(final SpiritLink card) { + super(card); + } + + @Override + public SpiritLink copy() { + return new SpiritLink(this); + } +}