diff --git a/Mage.Sets/src/mage/sets/eventide/NettleSentinel.java b/Mage.Sets/src/mage/sets/eventide/NettleSentinel.java new file mode 100644 index 0000000000..62f253c5fb --- /dev/null +++ b/Mage.Sets/src/mage/sets/eventide/NettleSentinel.java @@ -0,0 +1,80 @@ +/* + * 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.eventide; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.common.SpellCastTriggeredAbility; +import mage.abilities.effects.common.SkipUntapSourceEffect; +import mage.abilities.effects.common.UntapSourceEffect; +import mage.cards.CardImpl; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author jonubuu + */ +public class NettleSentinel extends CardImpl { + + private final static FilterSpell filter = new FilterSpell("a green spell"); + + static { + filter.add(new ColorPredicate(ObjectColor.GREEN)); + } + + public NettleSentinel(UUID ownerId) { + super(ownerId, 71, "Nettle Sentinel", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{G}"); + this.expansionSetCode = "EVE"; + this.subtype.add("Elf"); + this.subtype.add("Warrior"); + + this.color.setGreen(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Nettle Sentinel doesn't untap during your untap step. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SkipUntapSourceEffect())); + // Whenever you cast a green spell, you may untap Nettle Sentinel. + this.addAbility(new SpellCastTriggeredAbility(new UntapSourceEffect(), filter, true)); + } + + public NettleSentinel(final NettleSentinel card) { + super(card); + } + + @Override + public NettleSentinel copy() { + return new NettleSentinel(this); + } +} diff --git a/Mage.Sets/src/mage/sets/eventide/RegalForce.java b/Mage.Sets/src/mage/sets/eventide/RegalForce.java new file mode 100644 index 0000000000..bf6d66fe92 --- /dev/null +++ b/Mage.Sets/src/mage/sets/eventide/RegalForce.java @@ -0,0 +1,75 @@ +/* + * 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.eventide; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.common.DrawCardControllerEffect; +import mage.cards.CardImpl; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author jonubuu + */ +public class RegalForce extends CardImpl { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("green creature you control"); + + static { + filter.add(new ColorPredicate(ObjectColor.GREEN)); + } + + public RegalForce(UUID ownerId) { + super(ownerId, 74, "Regal Force", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{G}{G}{G}"); + this.expansionSetCode = "EVE"; + this.subtype.add("Elemental"); + + this.color.setGreen(true); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // When Regal Force enters the battlefield, draw a card for each green creature you control. + this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardControllerEffect(new PermanentsOnBattlefieldCount(filter)))); + } + + public RegalForce(final RegalForce card) { + super(card); + } + + @Override + public RegalForce copy() { + return new RegalForce(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthdawn/SteelshapersGift.java b/Mage.Sets/src/mage/sets/fifthdawn/SteelshapersGift.java new file mode 100644 index 0000000000..d61b17fbe8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthdawn/SteelshapersGift.java @@ -0,0 +1,71 @@ +/* + * 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.abilities.effects.common.search.SearchLibraryPutInHandEffect; +import mage.cards.CardImpl; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author jonubuu + */ +public class SteelshapersGift extends CardImpl { + + private static final FilterCard filter = new FilterCard("Equipment card"); + + static { + filter.add(new CardTypePredicate(CardType.ARTIFACT)); + filter.add(new SubtypePredicate("Equipment")); + } + + public SteelshapersGift(UUID ownerId) { + super(ownerId, 19, "Steelshaper's Gift", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{W}"); + this.expansionSetCode = "5DN"; + + this.color.setWhite(true); + + // Search your library for an Equipment card, reveal that card, and put it into your hand. Then shuffle your library. + this.getSpellAbility().addEffect(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(1, 1, filter), true)); + } + + public SteelshapersGift(final SteelshapersGift card) { + super(card); + } + + @Override + public SteelshapersGift copy() { + return new SteelshapersGift(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/Brainstorm.java b/Mage.Sets/src/mage/sets/fifthedition/Brainstorm.java new file mode 100644 index 0000000000..2b424822fe --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/Brainstorm.java @@ -0,0 +1,108 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInHand; + +/** + * + * @author jonubuu + */ +public class Brainstorm extends CardImpl { + + public Brainstorm(UUID ownerId) { + super(ownerId, 76, "Brainstorm", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}"); + this.expansionSetCode = "5ED"; + + this.color.setBlue(true); + + // Draw three cards, then put two cards from your hand on top of your library in any order. + this.getSpellAbility().addEffect(new BrainstormEffect()); + } + + public Brainstorm(final Brainstorm card) { + super(card); + } + + @Override + public Brainstorm copy() { + return new Brainstorm(this); + } +} + +class BrainstormEffect extends OneShotEffect { + + public BrainstormEffect() { + super(Outcome.DrawCard); + staticText = "Draw three cards, then put two cards from your hand on top of your library in any order"; + } + + public BrainstormEffect(final BrainstormEffect effect) { + super(effect); + } + + @Override + public BrainstormEffect copy() { + return new BrainstormEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + player.drawCards(3, game); + putOnLibrary(player, source, game); + putOnLibrary(player, source, game); + return true; + } + return false; + } + + private boolean putOnLibrary(Player player, Ability source, Game game) { + TargetCardInHand target = new TargetCardInHand(); + target.setRequired(true); + player.chooseTarget(Outcome.ReturnToHand, target, source, game); + Card card = player.getHand().get(target.getFirstTarget(), game); + if (card != null) { + player.getHand().remove(card); + card.moveToZone(Zone.LIBRARY, source.getId(), game, true); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/guildpact/Electrolyze.java b/Mage.Sets/src/mage/sets/guildpact/Electrolyze.java new file mode 100644 index 0000000000..6ef0f4eaf7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/guildpact/Electrolyze.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.guildpact; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.effects.common.DamageMultiEffect; +import mage.abilities.effects.common.DrawCardControllerEffect; +import mage.cards.CardImpl; +import mage.target.common.TargetCreatureOrPlayerAmount; + +/** + * + * @author jonubuu + */ +public class Electrolyze extends CardImpl { + + public Electrolyze(UUID ownerId) { + super(ownerId, 111, "Electrolyze", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{U}{R}"); + this.expansionSetCode = "GPT"; + + this.color.setRed(true); + this.color.setBlue(true); + + // Electrolyze deals 2 damage divided as you choose among one or two target creatures and/or players. + this.getSpellAbility().addEffect(new DamageMultiEffect(2)); + this.getSpellAbility().addTarget(new TargetCreatureOrPlayerAmount(3)); + // Draw a card. + this.getSpellAbility().addEffect(new DrawCardControllerEffect(1)); + } + + public Electrolyze(final Electrolyze card) { + super(card); + } + + @Override + public Electrolyze copy() { + return new Electrolyze(this); + } +} diff --git a/Mage.Sets/src/mage/sets/judgment/CabalTherapy.java b/Mage.Sets/src/mage/sets/judgment/CabalTherapy.java new file mode 100644 index 0000000000..8c6b6627e3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/judgment/CabalTherapy.java @@ -0,0 +1,120 @@ +/* + * 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.judgment; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.Constants.TimingRule; +import mage.Constants.Zone; +import mage.abilities.Ability; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.FlashbackAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.choices.Choice; +import mage.choices.ChoiceImpl; +import mage.game.Game; +import mage.players.Player; +import mage.sets.Sets; +import mage.target.TargetPlayer; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author jonubuu + */ +public class CabalTherapy extends CardImpl { + + public CabalTherapy(UUID ownerId) { + super(ownerId, 62, "Cabal Therapy", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{B}"); + this.expansionSetCode = "JUD"; + + this.color.setBlack(true); + + // Name a nonland card. Target player reveals his or her hand and discards all cards with that name. + this.getSpellAbility().addTarget(new TargetPlayer()); + this.getSpellAbility().addEffect(new CabalTherapyEffect()); + // Flashback-Sacrifice a creature. + this.addAbility(new FlashbackAbility(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1)), TimingRule.SORCERY)); + } + + public CabalTherapy(final CabalTherapy card) { + super(card); + } + + @Override + public CabalTherapy copy() { + return new CabalTherapy(this); + } +} + +class CabalTherapyEffect extends OneShotEffect { + + public CabalTherapyEffect() { + super(Outcome.Exile); + staticText = "Name a nonland card. Search target player's hand for all cards with that name and discard them."; + } + + public CabalTherapyEffect(final CabalTherapyEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(targetPointer.getFirst(game, source)); + Player controller = game.getPlayer(source.getControllerId()); + if (player != null && controller != null) { + Choice cardChoice = new ChoiceImpl(); + cardChoice.setChoices(Sets.getNonLandCardNames()); + cardChoice.clearChoice(); + + while (!controller.choose(Outcome.Discard, cardChoice, game)) { + game.debugMessage("player canceled choosing name. retrying."); + } + + String cardName = cardChoice.getChoice(); + game.informPlayers("Cabal Therapy, named card: [" + cardName + "]"); + for (Card card : player.getHand().getCards(game)) { + if (card.getName().equals(cardName)) { + card.moveToZone(Zone.GRAVEYARD, source.getId(), game, false); + } + } + + controller.lookAtCards("Cabal Therapy Hand", player.getHand(), game); + } + return true; + } + + @Override + public CabalTherapyEffect copy() { + return new CabalTherapyEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/Brainstorm.java b/Mage.Sets/src/mage/sets/mercadianmasques/Brainstorm.java new file mode 100644 index 0000000000..e567631fbb --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/Brainstorm.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.mercadianmasques; + +import java.util.UUID; + +/** + * + * @author jonubuu + */ +public class Brainstorm extends mage.sets.fifthedition.Brainstorm { + + public Brainstorm(UUID ownerId) { + super(ownerId); + this.cardNumber = 61; + this.expansionSetCode = "MMQ"; + } + + public Brainstorm(final Brainstorm card) { + super(card); + } + + @Override + public Brainstorm copy() { + return new Brainstorm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/GoblinPiledriver.java b/Mage.Sets/src/mage/sets/onslaught/GoblinPiledriver.java new file mode 100644 index 0000000000..a1db5805ae --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/GoblinPiledriver.java @@ -0,0 +1,88 @@ +/* + * 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.onslaught; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Duration; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.common.continious.BoostSourceEffect; +import mage.abilities.keyword.ProtectionAbility; +import mage.cards.CardImpl; +import mage.filter.FilterCard; +import mage.filter.common.FilterAttackingCreature; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.AnotherPredicate; + +/** + * + * @author jonubuu + */ +public class GoblinPiledriver extends CardImpl { + + private static final FilterCard filter1 = new FilterCard("blue"); + private static final FilterAttackingCreature filter2 = new FilterAttackingCreature("other attacking Goblin"); + + static { + filter1.add(new ColorPredicate(ObjectColor.BLUE)); + filter2.add(new SubtypePredicate("Goblin")); + filter2.add(new AnotherPredicate()); + } + + public GoblinPiledriver(UUID ownerId) { + super(ownerId, 205, "Goblin Piledriver", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{R}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Goblin"); + this.subtype.add("Warrior"); + + this.color.setRed(true); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // Protection from blue + this.addAbility(new ProtectionAbility(filter1)); + // Whenever Goblin Piledriver attacks, it gets +2/+0 until end of turn for each other attacking Goblin. + PermanentsOnBattlefieldCount value = new PermanentsOnBattlefieldCount(filter2, 2); + this.addAbility(new AttacksTriggeredAbility(new BoostSourceEffect(value, new StaticValue(0), Duration.EndOfTurn), false)); + } + + public GoblinPiledriver(final GoblinPiledriver card) { + super(card); + } + + @Override + public GoblinPiledriver copy() { + return new GoblinPiledriver(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/GoblinSharpshooter.java b/Mage.Sets/src/mage/sets/onslaught/GoblinSharpshooter.java new file mode 100644 index 0000000000..02183db0e1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/GoblinSharpshooter.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.onslaught; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DiesCreatureTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.SkipUntapSourceEffect; +import mage.abilities.effects.common.UntapSourceEffect; +import mage.cards.CardImpl; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author jonubuu + */ +public class GoblinSharpshooter extends CardImpl { + + public GoblinSharpshooter(UUID ownerId) { + super(ownerId, 207, "Goblin Sharpshooter", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Goblin"); + + this.color.setRed(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Goblin Sharpshooter doesn't untap during your untap step. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SkipUntapSourceEffect())); + // Whenever a creature dies, untap Goblin Sharpshooter. + this.addAbility(new DiesCreatureTriggeredAbility(new UntapSourceEffect(), true)); + // {tap}: Goblin Sharpshooter deals 1 damage to target creature or player. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new TapSourceCost()); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public GoblinSharpshooter(final GoblinSharpshooter card) { + super(card); + } + + @Override + public GoblinSharpshooter copy() { + return new GoblinSharpshooter(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planarchaos/Extirpate.java b/Mage.Sets/src/mage/sets/planarchaos/Extirpate.java new file mode 100644 index 0000000000..7c61f23768 --- /dev/null +++ b/Mage.Sets/src/mage/sets/planarchaos/Extirpate.java @@ -0,0 +1,180 @@ +/* + * 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.planarchaos; + +import java.util.List; +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.effects.OneShotEffect; +import mage.abilities.keyword.SplitSecondAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.NamePredicate; +import mage.filter.predicate.mageobject.SupertypePredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInGraveyard; +import mage.target.common.TargetCardInHand; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author jonubuu + */ +public class Extirpate extends CardImpl { + + private static final FilterCard filter = new FilterCard("card in a graveyard other than a basic land card"); + + static { + filter.add(Predicates.not(new SupertypePredicate("Basic"))); + } + + public Extirpate(UUID ownerId) { + super(ownerId, 71, "Extirpate", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{B}"); + this.expansionSetCode = "PLC"; + + this.color.setBlack(true); + + // Split second + this.addAbility(SplitSecondAbility.getInstance()); + // Choose target card in a graveyard other than a basic land card. Search its owner's graveyard, hand, and library for all cards with the same name as that card and exile them. Then that player shuffles his or her library. + this.getSpellAbility().addEffect(new ExtirpateEffect()); + this.getSpellAbility().addTarget(new TargetCardInGraveyard(filter)); + } + + public Extirpate(final Extirpate card) { + super(card); + } + + @Override + public Extirpate copy() { + return new Extirpate(this); + } +} + +class ExtirpateEffect extends OneShotEffect { + + public ExtirpateEffect() { + super(Outcome.Exile); + this.staticText = "Choose target card in a graveyard other than a basic land card. Search its owner's graveyard, hand, and library for any number of cards with the same name as that card and exile them. Then that player shuffles his or her library"; + } + + public ExtirpateEffect(final ExtirpateEffect effect) { + super(effect); + } + + @Override + public ExtirpateEffect copy() { + return new ExtirpateEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Card card = game.getCard(source.getFirstTarget()); + Player player = game.getPlayer(source.getControllerId()); + + if (card != null && player != null) { + Player targetPlayer = game.getPlayer(card.getOwnerId()); + if (targetPlayer != null) { + FilterCard filter = new FilterCard("card named " + card.getName()); + filter.add(new NamePredicate(card.getName())); + + Cards cardsInLibrary = new CardsImpl(Zone.LIBRARY); + cardsInLibrary.addAll(targetPlayer.getLibrary().getCards(game)); + + // cards in Graveyard + int cardsCount = targetPlayer.getGraveyard().count(filter, game); + if (cardsCount > 0) { + filter.setMessage("card named " + card.getName() + " in the graveyard of " + targetPlayer.getName()); + TargetCardInGraveyard target = new TargetCardInGraveyard(0, cardsCount, filter); + if (player.choose(Outcome.Exile, targetPlayer.getGraveyard(), target, game)) { + List targets = target.getTargets(); + for (UUID targetId : targets) { + Card targetCard = targetPlayer.getGraveyard().get(targetId, game); + if (targetCard != null) { + targetPlayer.getGraveyard().remove(targetCard); + targetCard.moveToZone(Zone.EXILED, source.getId(), game, false); + } + } + } + } + + // cards in Hand + cardsCount = targetPlayer.getHand().count(filter, game); + if (cardsCount > 0) { + filter.setMessage("card named " + card.getName() + " in the hand of " + targetPlayer.getName()); + TargetCardInHand target = new TargetCardInHand(0, cardsCount, filter); + if (player.choose(Outcome.Exile, targetPlayer.getHand(), target, game)) { + List targets = target.getTargets(); + for (UUID targetId : targets) { + Card targetCard = targetPlayer.getHand().get(targetId, game); + if (targetCard != null) { + targetPlayer.getHand().remove(targetCard); + targetCard.moveToZone(Zone.EXILED, source.getId(), game, false); + } + } + } + } else { + player.lookAtCards(targetPlayer.getName() + " hand", targetPlayer.getHand(), game); + } + + // cards in Library + cardsCount = cardsInLibrary.count(filter, game); + if (cardsCount > 0) { + filter.setMessage("card named " + card.getName() + " in the library of " + targetPlayer.getName()); + TargetCardInLibrary target = new TargetCardInLibrary(0, cardsCount, filter); + if (player.choose(Outcome.Exile, cardsInLibrary, target, game)) { + List targets = target.getTargets(); + for (UUID targetId : targets) { + Card targetCard = targetPlayer.getLibrary().remove(targetId, game); + if (targetCard != null) { + targetCard.moveToZone(Zone.EXILED, source.getId(), game, false); + } + } + } + } else { + player.lookAtCards(targetPlayer.getName() + " library", cardsInLibrary, game); + } + } + + targetPlayer.shuffleLibrary(game); + + return true; + } + + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/scourge/GoblinWarchief.java b/Mage.Sets/src/mage/sets/scourge/GoblinWarchief.java new file mode 100644 index 0000000000..bf65a5b339 --- /dev/null +++ b/Mage.Sets/src/mage/sets/scourge/GoblinWarchief.java @@ -0,0 +1,120 @@ +/* + * 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.scourge; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Duration; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.SpellAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.CostModificationEffectImpl; +import mage.abilities.effects.common.continious.GainAbilityControlledEffect; +import mage.abilities.keyword.HasteAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.Game; +import mage.util.CardUtil; + +/** + * + * @author jonubuu + */ +public class GoblinWarchief extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Goblin creatures"); + + static { + filter.add(new SubtypePredicate("Goblin")); + } + + public GoblinWarchief(UUID ownerId) { + super(ownerId, 97, "Goblin Warchief", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{R}{R}"); + this.expansionSetCode = "SCG"; + this.subtype.add("Goblin"); + + this.color.setRed(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Goblin spells you cast cost {1} less to cast. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GoblinWarchiefEffect())); + // Goblin creatures you control have haste. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield, filter, true))); + } + + public GoblinWarchief(final GoblinWarchief card) { + super(card); + } + + @Override + public GoblinWarchief copy() { + return new GoblinWarchief(this); + } +} + +class GoblinWarchiefEffect extends CostModificationEffectImpl { + + GoblinWarchiefEffect() { + super(Duration.WhileOnBattlefield, Outcome.Benefit); + staticText = "Goblin spells you cast cost {1} less to cast"; + } + + GoblinWarchiefEffect(GoblinWarchiefEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source, Ability abilityToModify) { + SpellAbility spellAbility = (SpellAbility) abilityToModify; + CardUtil.adjustCost(spellAbility, 1); + return true; + } + + @Override + public boolean applies(Ability abilityToModify, Ability source, Game game) { + if (abilityToModify instanceof SpellAbility) { + Card sourceCard = game.getCard(((SpellAbility) abilityToModify).getSourceId()); + if (sourceCard != null && sourceCard.getSubtype().contains("Goblin") && sourceCard.getOwnerId().equals(source.getControllerId())) { + return true; + } + } + return false; + } + + @Override + public GoblinWarchiefEffect copy() { + return new GoblinWarchiefEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/seventhedition/GoblinMatron.java b/Mage.Sets/src/mage/sets/seventhedition/GoblinMatron.java new file mode 100644 index 0000000000..d50e311c18 --- /dev/null +++ b/Mage.Sets/src/mage/sets/seventhedition/GoblinMatron.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.seventhedition; + +import java.util.UUID; +import mage.Constants.Rarity; + +/** + * + * @author jonubuu + */ +public class GoblinMatron extends mage.sets.urzassaga.GoblinMatron { + + public GoblinMatron(UUID ownerId) { + super(ownerId); + this.cardNumber = 191; + this.expansionSetCode = "7ED"; + this.rarity = Rarity.UNCOMMON; + } + + public GoblinMatron(final GoblinMatron card) { + super(card); + } + + @Override + public GoblinMatron copy() { + return new GoblinMatron(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/KrosanGrip.java b/Mage.Sets/src/mage/sets/timespiral/KrosanGrip.java new file mode 100644 index 0000000000..620303bf27 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/KrosanGrip.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.timespiral; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.keyword.SplitSecondAbility; +import mage.cards.CardImpl; +import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.target.TargetPermanent; + +/** + * + * @author jonubuu + */ +public class KrosanGrip extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("artifact or enchantment"); + + static { + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.ENCHANTMENT))); + } + + public KrosanGrip(UUID ownerId) { + super(ownerId, 202, "Krosan Grip", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{2}{G}"); + this.expansionSetCode = "TSP"; + + this.color.setGreen(true); + + // Split second + this.addAbility(SplitSecondAbility.getInstance()); + // Destroy target artifact or enchantment. + this.getSpellAbility().addTarget(new TargetPermanent(filter)); + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + } + + public KrosanGrip(final KrosanGrip card) { + super(card); + } + + @Override + public KrosanGrip copy() { + return new KrosanGrip(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/MoggWarMarshal.java b/Mage.Sets/src/mage/sets/timespiral/MoggWarMarshal.java new file mode 100644 index 0000000000..224e55703c --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/MoggWarMarshal.java @@ -0,0 +1,75 @@ +/* + * 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.timespiral; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.keyword.EchoAbility; +import mage.cards.CardImpl; +import mage.game.permanent.token.GoblinToken; + +/** + * + * @author jonubuu + */ +public class MoggWarMarshal extends CardImpl { + + public MoggWarMarshal(UUID ownerId) { + super(ownerId, 170, "Mogg War Marshal", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Goblin"); + this.subtype.add("Warrior"); + + this.color.setRed(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Echo {1}{R} + this.addAbility(new EchoAbility("{1}{R}")); + // When Mogg War Marshal enters the battlefield or dies, put a 1/1 red Goblin creature token onto the battlefield. + Ability enterAbility = new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new GoblinToken(), 1), false); + this.addAbility(enterAbility); + Ability diesAbility = new DiesTriggeredAbility(new CreateTokenEffect(new GoblinToken(), 1), false); + this.addAbility(diesAbility); + } + + public MoggWarMarshal(final MoggWarMarshal card) { + super(card); + } + + @Override + public MoggWarMarshal copy() { + return new MoggWarMarshal(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/GoblinLackey.java b/Mage.Sets/src/mage/sets/urzassaga/GoblinLackey.java new file mode 100644 index 0000000000..0ad403c8a1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/GoblinLackey.java @@ -0,0 +1,142 @@ +/* + * 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.urzassaga; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.filter.common.FilterCreatureCard; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.players.Player; +import mage.target.common.TargetCardInHand; + +/** + * + * @author jonubuu + */ +public class GoblinLackey extends CardImpl { + + public GoblinLackey(UUID ownerId) { + super(ownerId, 190, "Goblin Lackey", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{R}"); + this.expansionSetCode = "USG"; + this.subtype.add("Goblin"); + + this.color.setRed(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Whenever Goblin Lackey deals damage to a player, you may put a Goblin permanent card from your hand onto the battlefield. + this.addAbility(new GoblinLackeyTriggeredAbility()); + } + + public GoblinLackey(final GoblinLackey card) { + super(card); + } + + @Override + public GoblinLackey copy() { + return new GoblinLackey(this); + } +} + +class GoblinLackeyTriggeredAbility extends TriggeredAbilityImpl { + + public GoblinLackeyTriggeredAbility() { + super(Zone.BATTLEFIELD, new GoblinLackeyEffect(), true); + } + + public GoblinLackeyTriggeredAbility(final GoblinLackeyTriggeredAbility ability) { + super(ability); + } + + @Override + public GoblinLackeyTriggeredAbility copy() { + return new GoblinLackeyTriggeredAbility(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER && event.getSourceId().equals(this.sourceId) + && game.getOpponents(this.getControllerId()).contains(event.getTargetId())) { + return true; + } + return false; + } + + @Override + public String getRule() { + return "Whenever {this} deals damage to an opponent, you may put a Goblin creature card from your hand onto the battlefield."; + } +} + +class GoblinLackeyEffect extends OneShotEffect { + + public GoblinLackeyEffect() { + super(Outcome.PutCreatureInPlay); + this.staticText = "you may put a Goblin creature card from your hand onto the battlefield"; + } + + public GoblinLackeyEffect(final GoblinLackeyEffect effect) { + super(effect); + } + + @Override + public GoblinLackeyEffect copy() { + return new GoblinLackeyEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + + FilterCreatureCard filter = new FilterCreatureCard("Goblin creature card from your hand"); + filter.add(new SubtypePredicate("Goblin")); + TargetCardInHand target = new TargetCardInHand(filter); + if (player.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) { + Card card = game.getCard(target.getFirstTarget()); + if (card != null) { + card.putOntoBattlefield(game, Zone.HAND, source.getId(), source.getControllerId()); + return true; + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/GoblinMatron.java b/Mage.Sets/src/mage/sets/urzassaga/GoblinMatron.java new file mode 100644 index 0000000000..4af9934568 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/GoblinMatron.java @@ -0,0 +1,74 @@ +/* + * 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.urzassaga; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; +import mage.cards.CardImpl; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author jonubuu + */ +public class GoblinMatron extends CardImpl { + + private static final FilterCard filter = new FilterCard("Goblin card"); + + static { + filter.add(new SubtypePredicate("Goblin")); + } + + public GoblinMatron(UUID ownerId) { + super(ownerId, 191, "Goblin Matron", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "USG"; + this.subtype.add("Goblin"); + + this.color.setRed(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // When Goblin Matron enters the battlefield, you may search your library for a Goblin card, reveal that card, and put it into your hand. If you do, shuffle your library. + this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter), true), true)); + } + + public GoblinMatron(final GoblinMatron card) { + super(card); + } + + @Override + public GoblinMatron copy() { + return new GoblinMatron(this); + } +}