From 25b283483fa5d0b0109a16ee20fb7768c5a5bb53 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Fri, 24 May 2013 08:30:25 +0200 Subject: [PATCH] Added Grinding Stone ; Terrarion and Krak-Clan Ironworks. Made targets of Tamiyo the Moon Sage mandatory. --- .../avacynrestored/TamiyoTheMoonSage.java | 7 +- .../mage/sets/fifthdawn/GrindingStation.java | 83 +++++++++++ .../sets/fifthdawn/KrarkClanIronworks.java | 66 +++++++++ .../src/mage/sets/ravnika/Terrarion.java | 129 ++++++++++++++++++ 4 files changed, 283 insertions(+), 2 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/fifthdawn/GrindingStation.java create mode 100644 Mage.Sets/src/mage/sets/fifthdawn/KrarkClanIronworks.java create mode 100644 Mage.Sets/src/mage/sets/ravnika/Terrarion.java diff --git a/Mage.Sets/src/mage/sets/avacynrestored/TamiyoTheMoonSage.java b/Mage.Sets/src/mage/sets/avacynrestored/TamiyoTheMoonSage.java index d5af6f49a3e..9ccc1cfa6d9 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/TamiyoTheMoonSage.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/TamiyoTheMoonSage.java @@ -56,6 +56,7 @@ import mage.game.Game; import mage.game.command.Emblem; import mage.game.events.GameEvent; import mage.game.events.ZoneChangeEvent; +import mage.target.Target; import mage.target.TargetPermanent; import mage.target.TargetPlayer; import mage.target.targetpointer.FixedTarget; @@ -79,12 +80,14 @@ public class TamiyoTheMoonSage extends CardImpl { // +1: Tap target permanent. It doesn't untap during its controller's next untap step. LoyaltyAbility ability = new LoyaltyAbility(new TapTargetEffect(), 1); ability.addEffect(new SkipNextUntapTargetEffect()); - ability.addTarget(new TargetPermanent()); + Target target = new TargetPermanent(); + target.setRequired(true); + ability.addTarget(target); this.addAbility(ability); // -2: Draw a card for each tapped creature target player controls. ability = new LoyaltyAbility(new DrawCardControllerEffect(new TappedCreaturesControlledByTargetCount()), -2); - ability.addTarget(new TargetPlayer()); + ability.addTarget(new TargetPlayer(true)); this.addAbility(ability); // -8: You get an emblem with "You have no maximum hand size" and "Whenever a card is put into your graveyard from anywhere, you may return it to your hand." diff --git a/Mage.Sets/src/mage/sets/fifthdawn/GrindingStation.java b/Mage.Sets/src/mage/sets/fifthdawn/GrindingStation.java new file mode 100644 index 00000000000..3a41d2ec420 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthdawn/GrindingStation.java @@ -0,0 +1,83 @@ +/* + * 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.fifthdawn; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldAllTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.PutTopCardOfTargetPlayerLibraryIntoGraveEffect; +import mage.abilities.effects.common.UntapSourceEffect; +import mage.cards.CardImpl; +import mage.filter.common.FilterArtifactPermanent; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.target.TargetPlayer; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author LevelX2 + */ +public class GrindingStation extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("an artifact"); + static { + filter.add(new CardTypePredicate(CardType.ARTIFACT)); + } + + public GrindingStation(UUID ownerId) { + super(ownerId, 127, "Grinding Station", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "5DN"; + + // {tap}, Sacrifice an artifact: Target player puts the top three cards of his or her library into his or her graveyard. + Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new PutTopCardOfTargetPlayerLibraryIntoGraveEffect(3), new TapSourceCost()); + ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter))); + ability.addTarget(new TargetPlayer(true)); + this.addAbility(ability); + + // Whenever an artifact enters the battlefield, you may untap Grinding Station. + this.addAbility(new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new UntapSourceEffect(), new FilterArtifactPermanent("an artifact"), true)); + + } + + public GrindingStation(final GrindingStation card) { + super(card); + } + + @Override + public GrindingStation copy() { + return new GrindingStation(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthdawn/KrarkClanIronworks.java b/Mage.Sets/src/mage/sets/fifthdawn/KrarkClanIronworks.java new file mode 100644 index 00000000000..f914319ca41 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthdawn/KrarkClanIronworks.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.fifthdawn; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.Mana; +import mage.abilities.Ability; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.mana.SimpleManaAbility; +import mage.cards.CardImpl; +import mage.filter.common.FilterControlledArtifactPermanent; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author LevelX2 + */ +public class KrarkClanIronworks extends CardImpl { + + public KrarkClanIronworks(UUID ownerId) { + super(ownerId, 134, "Krark-Clan Ironworks", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{4}"); + this.expansionSetCode = "5DN"; + + // Sacrifice an artifact: Add {2} to your mana pool. + Ability ability = new SimpleManaAbility(Zone.BATTLEFIELD, Mana.ColorlessMana(2), new SacrificeTargetCost(new TargetControlledPermanent(new FilterControlledArtifactPermanent("an artifact")))); + this.addAbility(ability); + + } + + public KrarkClanIronworks(final KrarkClanIronworks card) { + super(card); + } + + @Override + public KrarkClanIronworks copy() { + return new KrarkClanIronworks(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ravnika/Terrarion.java b/Mage.Sets/src/mage/sets/ravnika/Terrarion.java new file mode 100644 index 00000000000..6acdf04fb0f --- /dev/null +++ b/Mage.Sets/src/mage/sets/ravnika/Terrarion.java @@ -0,0 +1,129 @@ +/* + * 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.ravnika; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.Mana; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTappedAbility; +import mage.abilities.common.PutIntoGraveFromBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.DrawCardControllerEffect; +import mage.abilities.effects.common.ManaEffect; +import mage.abilities.mana.SimpleManaAbility; +import mage.cards.CardImpl; +import mage.choices.ChoiceColor; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author LevelX2 + */ +public class Terrarion extends CardImpl { + + public Terrarion(UUID ownerId) { + super(ownerId, 273, "Terrarion", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{1}"); + this.expansionSetCode = "RAV"; + + // Terrarion enters the battlefield tapped. + this.addAbility(new EntersBattlefieldTappedAbility()); + // {2}, {tap}, Sacrifice Terrarion: Add two mana in any combination of colors to your mana pool. + Ability ability = new SimpleManaAbility(Zone.BATTLEFIELD, new TerrarionManaEffect(), new GenericManaCost(2)); + ability.addCost(new TapSourceCost()); + ability.addCost(new SacrificeSourceCost()); + ability.addChoice(new ChoiceColor()); + ability.addChoice(new ChoiceColor()); + this.addAbility(ability); + // When Terrarion is put into a graveyard from the battlefield, draw a card. + this.addAbility(new PutIntoGraveFromBattlefieldTriggeredAbility(new DrawCardControllerEffect(1))); + } + + public Terrarion(final Terrarion card) { + super(card); + } + + @Override + public Terrarion copy() { + return new Terrarion(this); + } +} + +class TerrarionManaEffect extends ManaEffect { + + public TerrarionManaEffect() { + super(); + this.staticText = "Add two mana in any combination of colors to your mana pool"; + } + + public TerrarionManaEffect(final TerrarionManaEffect effect) { + super(effect); + } + + @Override + public TerrarionManaEffect copy() { + return new TerrarionManaEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + + boolean result = false; + for (int i = 0; i < 2; i++) { + ChoiceColor choice = (ChoiceColor) source.getChoices().get(i); + Mana mana = null; + if (choice.getColor().isBlack()) { + mana = Mana.BlackMana(1); + } else if (choice.getColor().isBlue()) { + mana = Mana.BlueMana(1); + } else if (choice.getColor().isRed()) { + mana = Mana.RedMana(1); + } else if (choice.getColor().isGreen()) { + mana = Mana.GreenMana(1); + } else if (choice.getColor().isWhite()) { + mana = Mana.WhiteMana(1); + } + + if (mana != null) { + player.getManaPool().addMana(mana, game, source); + result = true; + } + } + return result; + } +}