From d78fe4065a1190fb293e831a0f62b9c8d9e65cfa Mon Sep 17 00:00:00 2001 From: fireshoes Date: Tue, 1 Sep 2015 20:22:36 -0500 Subject: [PATCH] Implemented Drowner of Hope, Arcades Sabboth, Dwell on the Past, Pulse of the Forge, and Rime Dryad. --- .../sets/battleforzendikar/DrownerOfHope.java | 94 ++++++++++++ .../mage/sets/darksteel/PulseOfTheForge.java | 99 +++++++++++++ Mage.Sets/src/mage/sets/iceage/RimeDryad.java | 72 +++++++++ .../src/mage/sets/legends/ArcadesSabboth.java | 52 +++++++ .../masterseditioniii/ArcadesSabboth.java | 97 ++++++++++++ .../src/mage/sets/torment/DwellOnThePast.java | 140 ++++++++++++++++++ Utils/mtg-cards-data.txt | 1 + 7 files changed, 555 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/DrownerOfHope.java create mode 100644 Mage.Sets/src/mage/sets/darksteel/PulseOfTheForge.java create mode 100644 Mage.Sets/src/mage/sets/iceage/RimeDryad.java create mode 100644 Mage.Sets/src/mage/sets/legends/ArcadesSabboth.java create mode 100644 Mage.Sets/src/mage/sets/masterseditioniii/ArcadesSabboth.java create mode 100644 Mage.Sets/src/mage/sets/torment/DwellOnThePast.java diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/DrownerOfHope.java b/Mage.Sets/src/mage/sets/battleforzendikar/DrownerOfHope.java new file mode 100644 index 00000000000..c71ed280b54 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/DrownerOfHope.java @@ -0,0 +1,94 @@ +/* + * 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.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.TapTargetEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.permanent.token.EldraziScionToken; +import mage.target.common.TargetControlledPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class DrownerOfHope extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("an Eldrazi Scion"); + + static { + filter.add(Predicates.and( + new SubtypePredicate("Eldrazi"), + new SubtypePredicate("Scion"))); + } + + public DrownerOfHope(UUID ownerId) { + super(ownerId, 57, "Drowner of Hope", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{U}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + + // When Drowner of Hope enters the battlefield, put two 1/1 colorless Eldrazi Scion creature tokens onto the battlefield. They have "Sacrifice this creature: Add {1} to your mana pool." + Effect effect = new CreateTokenEffect(new EldraziScionToken(), 2); + effect.setText("put two 1/1 colorless Eldrazi Scion creature tokens onto the battlefield. They have \"Sacrifice this creature: Add {1} to your mana pool"); + this.addAbility(new EntersBattlefieldTriggeredAbility(effect, false)); + + // Sacrifice an Eldrazi Scion: Tap target creature. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new SacrificeTargetCost(new TargetControlledPermanent(filter))); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public DrownerOfHope(final DrownerOfHope card) { + super(card); + } + + @Override + public DrownerOfHope copy() { + return new DrownerOfHope(this); + } +} diff --git a/Mage.Sets/src/mage/sets/darksteel/PulseOfTheForge.java b/Mage.Sets/src/mage/sets/darksteel/PulseOfTheForge.java new file mode 100644 index 00000000000..0771972dbfd --- /dev/null +++ b/Mage.Sets/src/mage/sets/darksteel/PulseOfTheForge.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.darksteel; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetPlayer; + +/** + * + * @author fireshoes + */ +public class PulseOfTheForge extends CardImpl { + + public PulseOfTheForge(UUID ownerId) { + super(ownerId, 66, "Pulse of the Forge", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{1}{R}{R}"); + this.expansionSetCode = "DST"; + + // Pulse of the Forge deals 4 damage to target player. Then if that player has more life than you, return Pulse of the Forge to its owner's hand. + this.getSpellAbility().addEffect(new DamageTargetEffect(4)); + this.getSpellAbility().addTarget(new TargetPlayer()); + this.getSpellAbility().addEffect(new PulseOfTheForgeReturnToHandEffect()); + } + + public PulseOfTheForge(final PulseOfTheForge card) { + super(card); + } + + @Override + public PulseOfTheForge copy() { + return new PulseOfTheForge(this); + } +} + +class PulseOfTheForgeReturnToHandEffect extends OneShotEffect { + + PulseOfTheForgeReturnToHandEffect() { + super(Outcome.Benefit); + this.staticText = "Then if that player has more life than you, return {this} to its owner's hand"; + } + + PulseOfTheForgeReturnToHandEffect(final PulseOfTheForgeReturnToHandEffect effect) { + super(effect); + } + + @Override + public PulseOfTheForgeReturnToHandEffect copy() { + return new PulseOfTheForgeReturnToHandEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + Player player = game.getPlayer(source.getFirstTarget()); + if (player != null && player.getLife() > controller.getLife()) { + Card card = game.getCard(source.getSourceId()); + controller.moveCards(card, null, Zone.HAND, source, game); + return true; + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/RimeDryad.java b/Mage.Sets/src/mage/sets/iceage/RimeDryad.java new file mode 100644 index 00000000000..52c0dc56319 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/RimeDryad.java @@ -0,0 +1,72 @@ +/* + * 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.iceage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.LandwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.mageobject.SupertypePredicate; + +/** + * + * @author fireshoes + */ +public class RimeDryad extends CardImpl { + + private static final FilterLandPermanent filter = new FilterLandPermanent("snow forest"); + + static { + filter.add(new SupertypePredicate("Snow")); + filter.add(new SubtypePredicate("Forest")); + } + + public RimeDryad(UUID ownerId) { + super(ownerId, 148, "Rime Dryad", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{G}"); + this.expansionSetCode = "ICE"; + this.subtype.add("Dryad"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // Snow forestwalk + this.addAbility(new LandwalkAbility(filter)); + } + + public RimeDryad(final RimeDryad card) { + super(card); + } + + @Override + public RimeDryad copy() { + return new RimeDryad(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/ArcadesSabboth.java b/Mage.Sets/src/mage/sets/legends/ArcadesSabboth.java new file mode 100644 index 00000000000..0fe40090c40 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/ArcadesSabboth.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 fireshoes + */ +public class ArcadesSabboth extends mage.sets.masterseditioniii.ArcadesSabboth { + + public ArcadesSabboth(UUID ownerId) { + super(ownerId); + this.cardNumber = 258; + this.expansionSetCode = "LEG"; + } + + public ArcadesSabboth(final ArcadesSabboth card) { + super(card); + } + + @Override + public ArcadesSabboth copy() { + return new ArcadesSabboth(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/ArcadesSabboth.java b/Mage.Sets/src/mage/sets/masterseditioniii/ArcadesSabboth.java new file mode 100644 index 00000000000..0820d13dadb --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/ArcadesSabboth.java @@ -0,0 +1,97 @@ +/* + * 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.masterseditioniii; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; +import mage.abilities.effects.common.continuous.BoostAllEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.permanent.AttackingPredicate; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.filter.predicate.permanent.TappedPredicate; + +/** + * + * @author fireshoes + */ +public class ArcadesSabboth extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("untapped creatures you control"); + + static { + filter.add(new ControllerPredicate(TargetController.YOU)); + filter.add(Predicates.not(new TappedPredicate())); + filter.add(Predicates.not(new AttackingPredicate())); + } + + public ArcadesSabboth(UUID ownerId) { + super(ownerId, 142, "Arcades Sabboth", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{G}{G}{W}{W}{U}{U}"); + this.expansionSetCode = "ME3"; + this.supertype.add("Legendary"); + this.subtype.add("Elder"); + this.subtype.add("Dragon"); + this.power = new MageInt(7); + this.toughness = new MageInt(7); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // At the beginning of your upkeep, sacrifice Arcades Sabboth unless you pay {G}{W}{U}. + this.addAbility(new BeginningOfUpkeepTriggeredAbility( + new SacrificeSourceUnlessPaysEffect(new ManaCostsImpl("{G}{W}{U}")), TargetController.YOU, false)); + + // Each untapped creature you control gets +0/+2 as long as it's not attacking. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(0, 2, Duration.WhileOnBattlefield, filter, false))); + + // {W}: Arcades Sabboth gets +0/+1 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(0, 1, Duration.EndOfTurn), new ManaCostsImpl("{W}"))); + } + + public ArcadesSabboth(final ArcadesSabboth card) { + super(card); + } + + @Override + public ArcadesSabboth copy() { + return new ArcadesSabboth(this); + } +} diff --git a/Mage.Sets/src/mage/sets/torment/DwellOnThePast.java b/Mage.Sets/src/mage/sets/torment/DwellOnThePast.java new file mode 100644 index 00000000000..e1c8774608a --- /dev/null +++ b/Mage.Sets/src/mage/sets/torment/DwellOnThePast.java @@ -0,0 +1,140 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.torment; + +import java.util.List; +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetCard; +import mage.target.TargetPlayer; + +/** + * + * @author fireshoes + */ +public class DwellOnThePast extends CardImpl { + + public DwellOnThePast(UUID ownerId) { + super(ownerId, 124, "Dwell on the Past", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{G}"); + this.expansionSetCode = "TOR"; + + // Target player shuffles up to four target cards from his or her graveyard into his or her library. + this.getSpellAbility().addEffect(new DwellOnThePastEffect()); + this.getSpellAbility().addTarget(new TargetPlayer()); + this.getSpellAbility().addTarget(new DwellOnThePastTarget()); + + } + + public DwellOnThePast(final DwellOnThePast card) { + super(card); + } + + @Override + public DwellOnThePast copy() { + return new DwellOnThePast(this); + } +} + +class DwellOnThePastEffect extends OneShotEffect { + + public DwellOnThePastEffect() { + super(Outcome.Neutral); + this.staticText = "Target player shuffles up to four target cards from his or her graveyard into his or her library"; + } + + public DwellOnThePastEffect(final DwellOnThePastEffect effect) { + super(effect); + } + + @Override + public DwellOnThePastEffect copy() { + return new DwellOnThePastEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getFirstTarget()); + if (player != null) { + List targets = source.getTargets().get(1).getTargets(); + boolean shuffle = false; + for (UUID targetId : targets) { + Card card = game.getCard(targetId); + if (card != null) { + if (player.getGraveyard().contains(card.getId())) { + player.getGraveyard().remove(card); + card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); + shuffle = true; + } + } + } + if (shuffle) { + player.shuffleLibrary(game); + } + return true; + } + return false; + } +} + +class DwellOnThePastTarget extends TargetCard { + + public DwellOnThePastTarget() { + super(0, 4, Zone.GRAVEYARD, new FilterCard("cards from target player's graveyard")); + } + + public DwellOnThePastTarget(final DwellOnThePastTarget target) { + super(target); + } + + @Override + public boolean canTarget(UUID id, Ability source, Game game) { + Card card = game.getCard(id); + if (card != null && game.getState().getZone(card.getId()) == Zone.GRAVEYARD) { + UUID firstTarget = source.getFirstTarget(); + if (firstTarget != null && game.getPlayer(firstTarget).getGraveyard().contains(id)) { + return filter.match(card, game); + } + } + return false; + } + + @Override + public DwellOnThePastTarget copy() { + return new DwellOnThePastTarget(this); + } +} diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt index 21372f8ee9f..95a1c1f292a 100644 --- a/Utils/mtg-cards-data.txt +++ b/Utils/mtg-cards-data.txt @@ -27338,6 +27338,7 @@ Hero of Goma Fada|Battle for Zendikar|31|R|{4}{W}|Creature - Human Knight Ally|4 Lantern Scout|Battle for Zendikar|37|R|{2}{W}|Creature - Human Scout Ally|3|2|Rally - Whenever Lantern Scout or another Ally enters the battlefield under your control, creatures you control gain lifelink until end of turn.| Retreat to Emeria|Battle for Zendikar|44|U|{3}{W}|Enchantment|||Landfall - Whenever a land enters the battlefield under you control, choose one - Put a 1/1 white Kor Ally creature token onto the battlefield; or Creatures you control get +1/+1 until end of turn.| Sheer Drop|Battle for Zendikar|48|C|{2}{W}|Sorcery|||Destroy target tapped creature.$Awaken 3-{5}{W} (If you cast this spell for {5}{W}, also put three +1/+1 counters on target land you control and it becomes a 0/0 Elemental creature with haste. It's still a land.)| +Drowner of Hope|Battle for Zendikar|57|R|{5}{U}|Creature - Eldrazi|5|5|Devoid (This card has no color.)$When Drowner of Hope enters the battlefield, put two 1/1 colorless Eldrazi Scion creature tokens onto the battlefield. They have "Sacrifice this creature: Add {1} to your mana pool."$Sacrifice an Eldrazi Scion: Tap target creature.| Incubator Drone|Battle for Zendikar|60|C|{3}{U}|Creature - Eldrazi Drone|2|3|Devoid (This card has no color.)$Whenever Incubator Drone enters the battlefield, put a 1/1 colorless Eldrazi Scion creature token onto the battlefield. It has "Sacrifice this creature: Add {1} to your mana pool."| Mist Intruder|Battle for Zendikar|61|C|{1}{U}|Creature - Eldrazi Drone|1|2|Devoid (This card has no color.)$Flying$Ingest (Whenever this creature deals combat damage to a player, that player exiles the top card of his or her library.)| Coastal Discovery|Battle for Zendikar|73|U|{3}{U}|Sorcery|||Draw two cards.$Awaken 4 - {5}U} If you cast this spell for {5}{U}, also put four +1/+1 counters on target land you control and it becomes a 0/0 Elemental creature with haste. It's still a land.)|