From b6f358482287682d8ee79298b4a9816bbd7a4f5c Mon Sep 17 00:00:00 2001 From: Plopman Date: Fri, 5 Apr 2013 17:59:16 +0200 Subject: [PATCH] [ALA] All black cards (9 cards) --- .../sets/shardsofalara/ArchdemonOfUnx.java | 85 ++++++++ .../shardsofalara/BanewaspAffliction.java | 121 +++++++++++ .../sets/shardsofalara/CorpseConnoisseur.java | 122 +++++++++++ .../mage/sets/shardsofalara/GlazeFiend.java | 78 +++++++ .../sets/shardsofalara/GrixisBattlemage.java | 79 +++++++ .../mage/sets/shardsofalara/ImmortalCoil.java | 200 ++++++++++++++++++ .../sets/shardsofalara/PuppetConjurer.java | 99 +++++++++ .../mage/sets/shardsofalara/SalvageTitan.java | 84 ++++++++ .../mage/sets/shardsofalara/VeinDrinker.java | 121 +++++++++++ 9 files changed, 989 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/shardsofalara/ArchdemonOfUnx.java create mode 100644 Mage.Sets/src/mage/sets/shardsofalara/BanewaspAffliction.java create mode 100644 Mage.Sets/src/mage/sets/shardsofalara/CorpseConnoisseur.java create mode 100644 Mage.Sets/src/mage/sets/shardsofalara/GlazeFiend.java create mode 100644 Mage.Sets/src/mage/sets/shardsofalara/GrixisBattlemage.java create mode 100644 Mage.Sets/src/mage/sets/shardsofalara/ImmortalCoil.java create mode 100644 Mage.Sets/src/mage/sets/shardsofalara/PuppetConjurer.java create mode 100644 Mage.Sets/src/mage/sets/shardsofalara/SalvageTitan.java create mode 100644 Mage.Sets/src/mage/sets/shardsofalara/VeinDrinker.java diff --git a/Mage.Sets/src/mage/sets/shardsofalara/ArchdemonOfUnx.java b/Mage.Sets/src/mage/sets/shardsofalara/ArchdemonOfUnx.java new file mode 100644 index 0000000000..c49e3f4702 --- /dev/null +++ b/Mage.Sets/src/mage/sets/shardsofalara/ArchdemonOfUnx.java @@ -0,0 +1,85 @@ +/* + * 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.shardsofalara; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.SacrificeControllerEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.permanent.token.ZombieToken; + +/** + * + * @author Plopman + */ +public class ArchdemonOfUnx extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("non-Zombie creature"); + static { + filter.add(Predicates.not(new SubtypePredicate("Zombie"))); + } + + public ArchdemonOfUnx(UUID ownerId) { + super(ownerId, 64, "Archdemon of Unx", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{B}{B}"); + this.expansionSetCode = "ALA"; + this.subtype.add("Demon"); + + this.color.setBlack(true); + this.power = new MageInt(6); + this.toughness = new MageInt(6); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Trample + this.addAbility(TrampleAbility.getInstance()); + // At the beginning of your upkeep, sacrifice a non-Zombie creature, then put a 2/2 black Zombie creature token onto the battlefield. + Ability ability = new BeginningOfUpkeepTriggeredAbility(new SacrificeControllerEffect(filter, 1, ""), Constants.TargetController.YOU, false); + ability.addEffect(new CreateTokenEffect(new ZombieToken())); + this.addAbility(ability); + } + + public ArchdemonOfUnx(final ArchdemonOfUnx card) { + super(card); + } + + @Override + public ArchdemonOfUnx copy() { + return new ArchdemonOfUnx(this); + } +} diff --git a/Mage.Sets/src/mage/sets/shardsofalara/BanewaspAffliction.java b/Mage.Sets/src/mage/sets/shardsofalara/BanewaspAffliction.java new file mode 100644 index 0000000000..c484bb0a72 --- /dev/null +++ b/Mage.Sets/src/mage/sets/shardsofalara/BanewaspAffliction.java @@ -0,0 +1,121 @@ +/* + * 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.shardsofalara; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.common.DiesAttachedTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author Plopman + */ +public class BanewaspAffliction extends CardImpl { + + public BanewaspAffliction(UUID ownerId) { + super(ownerId, 65, "Banewasp Affliction", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}"); + this.expansionSetCode = "ALA"; + this.subtype.add("Aura"); + + this.color.setBlack(true); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Benefit)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // When enchanted creature dies, that creature's controller loses life equal to its toughness. + ability = new DiesAttachedTriggeredAbility(new LoseLifeEffect(), "enchanted creature"); + this.addAbility(ability); + } + + public BanewaspAffliction(final BanewaspAffliction card) { + super(card); + } + + @Override + public BanewaspAffliction copy() { + return new BanewaspAffliction(this); + } +} + + +class LoseLifeEffect extends OneShotEffect { + + public LoseLifeEffect() { + super(Outcome.LoseLife); + } + + public LoseLifeEffect(LoseLifeEffect copy) { + super(copy); + } + + + @Override + public LoseLifeEffect copy() { + return new LoseLifeEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent banewaspAffliction = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD); + if(banewaspAffliction != null){ + Permanent creature = (Permanent) game.getLastKnownInformation(banewaspAffliction.getAttachedTo(), Zone.BATTLEFIELD); + if(creature != null){ + Player player = game.getPlayer(creature.getOwnerId()); + if (player != null) { + player.loseLife(creature.getToughness().getValue(), game); + return true; + } + } + } + return false; + } + + @Override + public String getText(Mode mode) { + return "that creature's controller loses life equal to its toughness"; + } + + +} diff --git a/Mage.Sets/src/mage/sets/shardsofalara/CorpseConnoisseur.java b/Mage.Sets/src/mage/sets/shardsofalara/CorpseConnoisseur.java new file mode 100644 index 0000000000..41bac0b614 --- /dev/null +++ b/Mage.Sets/src/mage/sets/shardsofalara/CorpseConnoisseur.java @@ -0,0 +1,122 @@ +/* + * 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.shardsofalara; + +import java.util.List; +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.SearchEffect; +import mage.abilities.keyword.UnearthAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.filter.common.FilterCreatureCard; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author Plopman + */ +public class CorpseConnoisseur extends CardImpl { + + public CorpseConnoisseur(UUID ownerId) { + super(ownerId, 68, "Corpse Connoisseur", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{B}"); + this.expansionSetCode = "ALA"; + this.subtype.add("Zombie"); + this.subtype.add("Wizard"); + + this.color.setBlack(true); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // When Corpse Connoisseur enters the battlefield, you may search your library for a creature card and put that card into your graveyard. If you do, shuffle your library. + this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInGraveyard(), true)); + // Unearth {3}{B} + this.addAbility(new UnearthAbility(new ManaCostsImpl("{3}{B}"))); + } + + public CorpseConnoisseur(final CorpseConnoisseur card) { + super(card); + } + + @Override + public CorpseConnoisseur copy() { + return new CorpseConnoisseur(this); + } +} + +class SearchLibraryPutInGraveyard extends SearchEffect { + + public SearchLibraryPutInGraveyard() { + super(new TargetCardInLibrary(new FilterCreatureCard()), Constants.Outcome.Neutral); + staticText = "search your library for a card and put that card into your graveyard. Then shuffle your library"; + } + + public SearchLibraryPutInGraveyard(final SearchLibraryPutInGraveyard effect) { + super(effect); + } + + @Override + public SearchLibraryPutInGraveyard copy() { + return new SearchLibraryPutInGraveyard(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + if (player.searchLibrary(target, game)) { + if (target.getTargets().size() > 0) { + Cards cards = new CardsImpl(); + for (UUID cardId: (List)target.getTargets()) { + Card card = player.getLibrary().remove(cardId, game); + if (card != null){ + card.moveToZone(Constants.Zone.GRAVEYARD, source.getId(), game, false); + } + } + } + player.shuffleLibrary(game); + return true; + } + player.shuffleLibrary(game); + return false; + } + + +} diff --git a/Mage.Sets/src/mage/sets/shardsofalara/GlazeFiend.java b/Mage.Sets/src/mage/sets/shardsofalara/GlazeFiend.java new file mode 100644 index 0000000000..af2e8b037c --- /dev/null +++ b/Mage.Sets/src/mage/sets/shardsofalara/GlazeFiend.java @@ -0,0 +1,78 @@ +/* + * 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.shardsofalara; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility; +import mage.abilities.effects.common.continious.BoostSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.filter.common.FilterArtifactPermanent; +import mage.filter.predicate.permanent.AnotherPredicate; +import mage.filter.predicate.permanent.ControllerPredicate; + +/** + * + * @author Plopman + */ +public class GlazeFiend extends CardImpl { + + private static final FilterArtifactPermanent filter = new FilterArtifactPermanent("another artifact"); + static { + filter.add(new AnotherPredicate()); + filter.add(new ControllerPredicate(Constants.TargetController.YOU)); + } + + public GlazeFiend(UUID ownerId) { + super(ownerId, 77, "Glaze Fiend", Rarity.COMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "ALA"; + this.subtype.add("Illusion"); + + this.color.setBlack(true); + this.power = new MageInt(0); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Whenever another artifact enters the battlefield under your control, Glaze Fiend gets +2/+2 until end of turn. + this.addAbility(new EntersBattlefieldControlledTriggeredAbility(new BoostSourceEffect(2, 2, Constants.Duration.EndOfTurn), filter)); + } + + public GlazeFiend(final GlazeFiend card) { + super(card); + } + + @Override + public GlazeFiend copy() { + return new GlazeFiend(this); + } +} diff --git a/Mage.Sets/src/mage/sets/shardsofalara/GrixisBattlemage.java b/Mage.Sets/src/mage/sets/shardsofalara/GrixisBattlemage.java new file mode 100644 index 0000000000..11f38291e6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/shardsofalara/GrixisBattlemage.java @@ -0,0 +1,79 @@ +/* + * 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.shardsofalara; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CantBlockTargetEffect; +import mage.abilities.effects.common.DrawDiscardControllerEffect; +import mage.cards.CardImpl; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author Plopman + */ +public class GrixisBattlemage extends CardImpl { + + public GrixisBattlemage(UUID ownerId) { + super(ownerId, 78, "Grixis Battlemage", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "ALA"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + + this.color.setBlack(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {U}, {tap}: Draw a card, then discard a card. + Ability ability1 = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new DrawDiscardControllerEffect(), new ManaCostsImpl("{U}")); + ability1.addCost(new TapSourceCost()); + this.addAbility(ability1); + // {R}, {tap}: Target creature can't block this turn. + Ability ability2 = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new CantBlockTargetEffect(Constants.Duration.EndOfTurn), new ManaCostsImpl("{R}")); + ability2.addCost(new TapSourceCost()); + ability2.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability2); + } + + public GrixisBattlemage(final GrixisBattlemage card) { + super(card); + } + + @Override + public GrixisBattlemage copy() { + return new GrixisBattlemage(this); + } +} diff --git a/Mage.Sets/src/mage/sets/shardsofalara/ImmortalCoil.java b/Mage.Sets/src/mage/sets/shardsofalara/ImmortalCoil.java new file mode 100644 index 0000000000..1df5ad0413 --- /dev/null +++ b/Mage.Sets/src/mage/sets/shardsofalara/ImmortalCoil.java @@ -0,0 +1,200 @@ +/* + * 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.shardsofalara; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.Ability; +import mage.abilities.StateTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.ExileFromGraveCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.PreventionEffectImpl; +import mage.abilities.effects.common.DrawCardControllerEffect; +import mage.abilities.effects.common.SacrificeSourceEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.filter.FilterCard; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.players.Player; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author Plopman + */ +public class ImmortalCoil extends CardImpl { + + public ImmortalCoil(UUID ownerId) { + super(ownerId, 79, "Immortal Coil", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{2}{B}{B}"); + this.expansionSetCode = "ALA"; + + this.color.setBlack(true); + + // {tap}, Exile two cards from your graveyard: Draw a card. + Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new DrawCardControllerEffect(1), new TapSourceCost()); + ability.addCost(new ExileFromGraveCost(new TargetCardInYourGraveyard(2, new FilterCard("cards from your graveyard")))); + this.addAbility(ability); + // If damage would be dealt to you, prevent that damage. Exile a card from your graveyard for each 1 damage prevented this way. + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new PreventAllDamageToControllerEffect())); + // When there are no cards in your graveyard, you lose the game. + this.addAbility(new ImmortalCoilAbility()); + } + + public ImmortalCoil(final ImmortalCoil card) { + super(card); + } + + @Override + public ImmortalCoil copy() { + return new ImmortalCoil(this); + } +} + +class ImmortalCoilAbility extends StateTriggeredAbility { + + public ImmortalCoilAbility() { + super(Constants.Zone.BATTLEFIELD, new SacrificeSourceEffect()); + this.addEffect(new LoseGameEffect()); + } + + public ImmortalCoilAbility(final ImmortalCoilAbility ability) { + super(ability); + } + + @Override + public ImmortalCoilAbility copy() { + return new ImmortalCoilAbility(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Player player = game.getPlayer(this.getControllerId()); + if(player != null && player.getGraveyard().size() == 0){ + return true; + } + return false; + } + + @Override + public String getRule() { + return "When there are no cards in your graveyard, you lose the game"; + } + +} + +class LoseGameEffect extends OneShotEffect { + + public LoseGameEffect() { + super(Constants.Outcome.Neutral); + staticText = "you lose the game"; + } + + public LoseGameEffect(final LoseGameEffect effect) { + super(effect); + } + + @Override + public LoseGameEffect copy() { + return new LoseGameEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + player.lost(game); + return true; + } + return false; + } +} + +class PreventAllDamageToControllerEffect extends PreventionEffectImpl { + + + public PreventAllDamageToControllerEffect() { + super(Constants.Duration.WhileOnBattlefield); + staticText = "If damage would be dealt to you, prevent that damage. Exile a card from your graveyard for each 1 damage prevented this way"; + } + + public PreventAllDamageToControllerEffect(final PreventAllDamageToControllerEffect effect) { + super(effect); + } + + @Override + public PreventAllDamageToControllerEffect copy() { + return new PreventAllDamageToControllerEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), event.getAmount(), false); + if (!game.replaceEvent(preventEvent)) { + int damage = event.getAmount(); + Player player = game.getPlayer(source.getControllerId()); + if(player != null){ + TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(Math.min(damage, player.getGraveyard().size()), new FilterCard()); + target.setRequired(true); + if (target.choose(Constants.Outcome.Exile, source.getControllerId(), source.getId(), game)) { + for (UUID targetId: target.getTargets()) { + Card card = player.getGraveyard().get(targetId, game); + if (card != null) { + card.moveToZone(Constants.Zone.EXILED, source.getSourceId(), game, false); + } + } + } + } + event.setAmount(0); + game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), damage)); + } + return false; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (super.applies(event, source, game)) { + if (event.getTargetId().equals(source.getControllerId())){ + return true; + } + + } + return false; + } + +} diff --git a/Mage.Sets/src/mage/sets/shardsofalara/PuppetConjurer.java b/Mage.Sets/src/mage/sets/shardsofalara/PuppetConjurer.java new file mode 100644 index 0000000000..d79a1b4407 --- /dev/null +++ b/Mage.Sets/src/mage/sets/shardsofalara/PuppetConjurer.java @@ -0,0 +1,99 @@ +/* + * 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.shardsofalara; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.SacrificeEffect; +import mage.cards.CardImpl; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.permanent.token.Token; + +/** + * + * @author Plopman + */ +public class PuppetConjurer extends CardImpl { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Homunculus"); + static { + filter.add(new SubtypePredicate("Homunculus")); + } + + public PuppetConjurer(UUID ownerId) { + super(ownerId, 82, "Puppet Conjurer", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "ALA"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + + this.color.setBlack(true); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // {U}, {tap}: Put a 0/1 blue Homunculus artifact creature token onto the battlefield. + Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new CreateTokenEffect(new HomunculusToken()), new ManaCostsImpl("{U}")); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + // At the beginning of your upkeep, sacrifice a Homunculus. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeEffect(filter, 1, ""), Constants.TargetController.ANY, false)); + } + + public PuppetConjurer(final PuppetConjurer card) { + super(card); + } + + @Override + public PuppetConjurer copy() { + return new PuppetConjurer(this); + } +} + +class HomunculusToken extends Token { + + public HomunculusToken() { + super("Homunculus", "0/1 blue Homunculus artifact creature token"); + cardType.add(CardType.CREATURE); + cardType.add(CardType.ARTIFACT); + color = ObjectColor.BLUE; + subtype.add("Homunculus"); + power = new MageInt(0); + toughness = new MageInt(1); + } + +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/shardsofalara/SalvageTitan.java b/Mage.Sets/src/mage/sets/shardsofalara/SalvageTitan.java new file mode 100644 index 0000000000..e7842f8614 --- /dev/null +++ b/Mage.Sets/src/mage/sets/shardsofalara/SalvageTitan.java @@ -0,0 +1,84 @@ +/* + * 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.shardsofalara; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.AlternativeCostImpl; +import mage.abilities.costs.Cost; +import mage.abilities.costs.common.ExileFromGraveCost; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.effects.common.ReturnSourceFromGraveyardToHandEffect; +import mage.cards.CardImpl; +import mage.filter.common.FilterArtifactCard; +import mage.filter.common.FilterControlledArtifactPermanent; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.target.common.TargetCardInYourGraveyard; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author Plopman + */ +public class SalvageTitan extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("artifacts"); + static{ + filter.add(new CardTypePredicate(CardType.ARTIFACT)); + } + + public SalvageTitan(UUID ownerId) { + super(ownerId, 84, "Salvage Titan", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{4}{B}{B}"); + this.expansionSetCode = "ALA"; + this.subtype.add("Golem"); + + this.color.setBlack(true); + this.power = new MageInt(6); + this.toughness = new MageInt(4); + + // You may sacrifice three artifacts rather than pay Salvage Titan's mana cost. + Cost cost = new SacrificeTargetCost(new TargetControlledPermanent(3, 3, new FilterControlledArtifactPermanent(), true)); + this.getSpellAbility().addAlternativeCost(new AlternativeCostImpl("You may sacrifice three artifacts rather than pay {this}'s mana cost", cost)); + // Exile three artifact cards from your graveyard: Return Salvage Titan from your graveyard to your hand. + this.addAbility(new SimpleActivatedAbility(Constants.Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(), new ExileFromGraveCost(new TargetCardInYourGraveyard(3, new FilterArtifactCard())))); + } + + public SalvageTitan(final SalvageTitan card) { + super(card); + } + + @Override + public SalvageTitan copy() { + return new SalvageTitan(this); + } +} diff --git a/Mage.Sets/src/mage/sets/shardsofalara/VeinDrinker.java b/Mage.Sets/src/mage/sets/shardsofalara/VeinDrinker.java new file mode 100644 index 0000000000..806852cf42 --- /dev/null +++ b/Mage.Sets/src/mage/sets/shardsofalara/VeinDrinker.java @@ -0,0 +1,121 @@ +/* + * 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.shardsofalara; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.common.DiesAndDealtDamageThisTurnTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author Plopman + */ +public class VeinDrinker extends CardImpl { + + public VeinDrinker(UUID ownerId) { + super(ownerId, 91, "Vein Drinker", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{B}{B}"); + this.expansionSetCode = "ALA"; + this.subtype.add("Vampire"); + + this.color.setBlack(true); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // {R}, {tap}: Vein Drinker deals damage equal to its power to target creature. That creature deals damage equal to its power to Vein Drinker. + Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new VeinDrinkerEffect(), new ManaCostsImpl("{R}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + // Whenever a creature dealt damage by Vein Drinker this turn dies, put a +1/+1 counter on Vein Drinker. + this.addAbility(new DiesAndDealtDamageThisTurnTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()))); + } + + public VeinDrinker(final VeinDrinker card) { + super(card); + } + + @Override + public VeinDrinker copy() { + return new VeinDrinker(this); + } +} + +class VeinDrinkerEffect extends OneShotEffect { + + public VeinDrinkerEffect() { + super(Constants.Outcome.Damage); + } + + public VeinDrinkerEffect(final VeinDrinkerEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent creatureSource = game.getPermanent(source.getSourceId()); + Permanent creatureTarget = game.getPermanent(source.getTargets().get(0).getFirstTarget()); + if (creatureSource != null && creatureTarget != null) { + if (creatureSource.getCardType().contains(CardType.CREATURE) && creatureTarget.getCardType().contains(CardType.CREATURE)) { + creatureSource.damage(creatureTarget.getPower().getValue(), creatureTarget.getId(), game, true, false); + creatureTarget.damage(creatureSource.getPower().getValue(), creatureSource.getId(), game, true, false); + return true; + } + } + return false; + } + + @Override + public VeinDrinkerEffect copy() { + return new VeinDrinkerEffect(this); + } + + @Override + public String getText(Mode mode) { + return "{this} deals damage equal to its power to target creature. That creature deals damage equal to its power to {this}"; + } + +}