From 235bd0bfd33d110522700c6ec658f0dda2c55428 Mon Sep 17 00:00:00 2001 From: North Date: Sun, 11 Dec 2011 19:16:46 +0200 Subject: [PATCH] [M10] Indestructibility, Underworld Dreams, Lurking Predators --- .../sets/magic2010/Indestructibility.java | 76 ++++++++++ .../mage/sets/magic2010/LurkingPredators.java | 143 ++++++++++++++++++ .../mage/sets/magic2010/UnderworldDreams.java | 96 ++++++++++++ .../src/mage/sets/tenth/UnderworldDreams.java | 52 +++++++ 4 files changed, 367 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/magic2010/Indestructibility.java create mode 100644 Mage.Sets/src/mage/sets/magic2010/LurkingPredators.java create mode 100644 Mage.Sets/src/mage/sets/magic2010/UnderworldDreams.java create mode 100644 Mage.Sets/src/mage/sets/tenth/UnderworldDreams.java diff --git a/Mage.Sets/src/mage/sets/magic2010/Indestructibility.java b/Mage.Sets/src/mage/sets/magic2010/Indestructibility.java new file mode 100644 index 0000000000..c90c6a7031 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magic2010/Indestructibility.java @@ -0,0 +1,76 @@ +/* + * 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.magic2010; + +import java.util.UUID; +import mage.Constants.AttachmentType; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continious.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.abilities.keyword.IndestructibleAbility; +import mage.cards.CardImpl; +import mage.target.TargetPermanent; + +/** + * + * @author North + */ +public class Indestructibility extends CardImpl { + + public Indestructibility(UUID ownerId) { + super(ownerId, 17, "Indestructibility", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}"); + this.expansionSetCode = "M10"; + this.subtype.add("Aura"); + + this.color.setWhite(true); + + // Enchant permanent + TargetPermanent auraTarget = new TargetPermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Benefit)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Enchanted permanent is indestructible. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(IndestructibleAbility.getInstance(), AttachmentType.AURA))); + } + + public Indestructibility(final Indestructibility card) { + super(card); + } + + @Override + public Indestructibility copy() { + return new Indestructibility(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magic2010/LurkingPredators.java b/Mage.Sets/src/mage/sets/magic2010/LurkingPredators.java new file mode 100644 index 0000000000..472e91aa3c --- /dev/null +++ b/Mage.Sets/src/mage/sets/magic2010/LurkingPredators.java @@ -0,0 +1,143 @@ +/* + * 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.magic2010; + +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.TriggeredAbilityImpl; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.players.Player; + +/** + * + * @author North + */ +public class LurkingPredators extends CardImpl { + + public LurkingPredators(UUID ownerId) { + super(ownerId, 190, "Lurking Predators", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{4}{G}{G}"); + this.expansionSetCode = "M10"; + + this.color.setGreen(true); + + // Whenever an opponent casts a spell, reveal the top card of your library. If it's a creature card, put it onto the battlefield. Otherwise, you may put that card on the bottom of your library. + this.addAbility(new LurkingPredatorsTriggeredAbility()); + } + + public LurkingPredators(final LurkingPredators card) { + super(card); + } + + @Override + public LurkingPredators copy() { + return new LurkingPredators(this); + } +} + +class LurkingPredatorsTriggeredAbility extends TriggeredAbilityImpl { + + public LurkingPredatorsTriggeredAbility() { + super(Zone.BATTLEFIELD, new LurkingPredatorsEffect()); + } + + public LurkingPredatorsTriggeredAbility(final LurkingPredatorsTriggeredAbility ability) { + super(ability); + } + + @Override + public LurkingPredatorsTriggeredAbility copy() { + return new LurkingPredatorsTriggeredAbility(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.SPELL_CAST && game.getOpponents(controllerId).contains(event.getPlayerId())) { + return true; + } + return false; + } + + @Override + public String getRule() { + return "Whenever an opponent casts a spell, reveal the top card of your library. If it's a creature card, put it onto the battlefield. Otherwise, you may put that card on the bottom of your library"; + } +} + +class LurkingPredatorsEffect extends OneShotEffect { + + public LurkingPredatorsEffect() { + super(Outcome.PutCreatureInPlay); + this.staticText = "reveal the top card of your library. If it's a creature card, put it onto the battlefield. Otherwise, you may put that card on the bottom of your library"; + } + + public LurkingPredatorsEffect(final LurkingPredatorsEffect effect) { + super(effect); + } + + @Override + public LurkingPredatorsEffect copy() { + return new LurkingPredatorsEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + + if (player.getLibrary().size() > 0) { + Card card = player.getLibrary().getFromTop(game); + Cards cards = new CardsImpl(); + cards.add(card); + player.revealCards("Lurking Predators", cards, game); + + if (card != null) { + if (card.getCardType().contains(CardType.CREATURE)) { + player.getLibrary().remove(card.getId(), game); + card.putOntoBattlefield(game, Zone.HAND, source.getId(), source.getControllerId()); + } else if (player.chooseUse(Outcome.Neutral, "Put " + card.getName() + " on the bottom of your library?", game)) { + player.getLibrary().remove(card.getId(), game); + card.moveToZone(Zone.LIBRARY, source.getId(), game, false); + } + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/magic2010/UnderworldDreams.java b/Mage.Sets/src/mage/sets/magic2010/UnderworldDreams.java new file mode 100644 index 0000000000..2ec8ae1d05 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magic2010/UnderworldDreams.java @@ -0,0 +1,96 @@ +/* + * 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.magic2010; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.target.targetpointer.FirstTargetPointer; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author North + */ +public class UnderworldDreams extends CardImpl { + + public UnderworldDreams(UUID ownerId) { + super(ownerId, 115, "Underworld Dreams", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{B}{B}{B}"); + this.expansionSetCode = "M10"; + + this.color.setBlack(true); + + // Whenever an opponent draws a card, Underworld Dreams deals 1 damage to him or her. + this.addAbility(new UnderworldDreamsTriggeredAbility()); + } + + public UnderworldDreams(final UnderworldDreams card) { + super(card); + } + + @Override + public UnderworldDreams copy() { + return new UnderworldDreams(this); + } +} + +class UnderworldDreamsTriggeredAbility extends TriggeredAbilityImpl { + + UnderworldDreamsTriggeredAbility() { + super(Zone.BATTLEFIELD, new DamageTargetEffect(1), false); + } + + UnderworldDreamsTriggeredAbility(final UnderworldDreamsTriggeredAbility ability) { + super(ability); + } + + @Override + public UnderworldDreamsTriggeredAbility copy() { + return new UnderworldDreamsTriggeredAbility(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.DREW_CARD && game.getOpponents(this.getControllerId()).contains(event.getPlayerId())) { + getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId())); + return true; + } + return false; + } + + @Override + public String getRule() { + return "Whenever an opponent draws a card, Underworld Dreams deals 1 damage to him or her"; + } +} diff --git a/Mage.Sets/src/mage/sets/tenth/UnderworldDreams.java b/Mage.Sets/src/mage/sets/tenth/UnderworldDreams.java new file mode 100644 index 0000000000..5899e74e58 --- /dev/null +++ b/Mage.Sets/src/mage/sets/tenth/UnderworldDreams.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 North + */ +public class UnderworldDreams extends mage.sets.magic2010.UnderworldDreams { + + public UnderworldDreams(UUID ownerId) { + super(ownerId); + this.cardNumber = 184; + this.expansionSetCode = "10E"; + } + + public UnderworldDreams(final UnderworldDreams card) { + super(card); + } + + @Override + public UnderworldDreams copy() { + return new UnderworldDreams(this); + } +}