From a8a53217023ba1b69ae186d5723d4e54015cb219 Mon Sep 17 00:00:00 2001 From: Styxo Date: Sat, 18 Jun 2016 20:36:40 +0200 Subject: [PATCH] Added Brain Pry, Slithering Shade and Gruul Scrapper --- .../src/mage/sets/dissension/BrainPry.java | 123 ++++++++++++++++++ .../mage/sets/dissension/SlitheringShade.java | 84 ++++++++++++ .../mage/sets/guildpact/GruulScrapper.java | 72 ++++++++++ 3 files changed, 279 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/dissension/BrainPry.java create mode 100644 Mage.Sets/src/mage/sets/dissension/SlitheringShade.java create mode 100644 Mage.Sets/src/mage/sets/guildpact/GruulScrapper.java diff --git a/Mage.Sets/src/mage/sets/dissension/BrainPry.java b/Mage.Sets/src/mage/sets/dissension/BrainPry.java new file mode 100644 index 00000000000..17632a9191b --- /dev/null +++ b/Mage.Sets/src/mage/sets/dissension/BrainPry.java @@ -0,0 +1,123 @@ +/* + * 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.dissension; + +import java.util.UUID; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.repository.CardRepository; +import mage.choices.Choice; +import mage.choices.ChoiceImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetPlayer; + +/** + * + * @author Styxo + */ +public class BrainPry extends CardImpl { + + public BrainPry(UUID ownerId) { + super(ownerId, 39, "Brain Pry", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{1}{B}"); + this.expansionSetCode = "DIS"; + + //Name a nonland card. Target player reveals his or her hand. That player discards a card with that name. If he or she can't, you draw a card. + this.getSpellAbility().addTarget(new TargetPlayer()); + this.getSpellAbility().addEffect(new BrainPryEffect()); + } + + public BrainPry(final BrainPry card) { + super(card); + } + + @Override + public BrainPry copy() { + return new BrainPry(this); + } +} + +class BrainPryEffect extends OneShotEffect { + + public BrainPryEffect() { + super(Outcome.Discard); + staticText = "Name a nonland card. Target player reveals his or her hand. That player discards a card with that name. If he or she can't, you draw a card"; + } + + public BrainPryEffect(final BrainPryEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source)); + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = game.getObject(source.getSourceId()); + if (targetPlayer != null && controller != null && sourceObject != null) { + Choice cardChoice = new ChoiceImpl(true); + cardChoice.setMessage("Name a nonland card."); + cardChoice.setChoices(CardRepository.instance.getNonLandNames()); + cardChoice.clearChoice(); + + while (!controller.choose(Outcome.Discard, cardChoice, game)) { + if (!controller.canRespond()) { + return false; + } + } + + String cardName = cardChoice.getChoice(); + Boolean hasDiscarded = false; + game.informPlayers(sourceObject.getLogName() + ", named card: [" + cardName + "]"); + for (Card card : targetPlayer.getHand().getCards(game)) { + if (card.getName().equals(cardName)) { + targetPlayer.discard(card, source, game); + hasDiscarded = true; + break; + } + } + + if (!hasDiscarded) { + controller.drawCards(1, game); + } + + controller.lookAtCards(sourceObject.getName() + " Hand", targetPlayer.getHand(), game); + } + return true; + } + + @Override + public BrainPryEffect copy() { + return new BrainPryEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/dissension/SlitheringShade.java b/Mage.Sets/src/mage/sets/dissension/SlitheringShade.java new file mode 100644 index 00000000000..ff22780547c --- /dev/null +++ b/Mage.Sets/src/mage/sets/dissension/SlitheringShade.java @@ -0,0 +1,84 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.dissension; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.HellbentCondition; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.decorator.ConditionalAsThoughEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.combat.CanAttackAsThoughItDidntHaveDefenderSourceEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.DefenderAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author Styxo + */ +public class SlitheringShade extends CardImpl { + + public SlitheringShade(UUID ownerId) { + super(ownerId, 55, "Slithering Shade", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{B}"); + this.expansionSetCode = "DIS"; + this.subtype.add("Shade"); + + this.power = new MageInt(0); + this.toughness = new MageInt(1); + + //Defender + this.addAbility(DefenderAbility.getInstance()); + + //{B}: Slithering Shade gets +1/+1 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Duration.EndOfTurn), new ManaCostsImpl("{B}"))); + + // Hellbent — Slithering Shade can attack as though it didn't have defender as long as you have no cards in hand. + Effect effect = new ConditionalAsThoughEffect( + new CanAttackAsThoughItDidntHaveDefenderSourceEffect(Duration.WhileOnBattlefield), + HellbentCondition.getInstance()); + effect.setText("Hellbent - {this} can attack as though it didn't have defender as long as you have no cards in hand"); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + + } + + public SlitheringShade(final SlitheringShade card) { + super(card); + } + + @Override + public SlitheringShade copy() { + return new SlitheringShade(this); + } +} diff --git a/Mage.Sets/src/mage/sets/guildpact/GruulScrapper.java b/Mage.Sets/src/mage/sets/guildpact/GruulScrapper.java new file mode 100644 index 00000000000..a0bed3827a3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/guildpact/GruulScrapper.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.guildpact; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.condition.common.ManaWasSpentCondition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.ColoredManaSymbol; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.watchers.common.ManaSpentToCastWatcher; + +/** + * + * @author Styxo + */ +public class GruulScrapper extends CardImpl { + + public GruulScrapper(UUID ownerId) { + super(ownerId, 89, "Gruul Scrapper", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "GPT"; + this.subtype.add("Human"); + this.subtype.add("Berserker"); + + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + //When Gruul Scrapper enters the battlefield, if Red was spent to cast Gruul Scrapper, it gains haste until end of turn. + this.addAbility(new EntersBattlefieldTriggeredAbility(new ConditionalContinuousEffect(new GainAbilitySourceEffect(HasteAbility.getInstance(), Duration.EndOfTurn), new ManaWasSpentCondition(ColoredManaSymbol.R), " if {R} was spent to cast {this}, it gains haste until end of turn")), new ManaSpentToCastWatcher()); + + } + + public GruulScrapper(final GruulScrapper card) { + super(card); + } + + @Override + public GruulScrapper copy() { + return new GruulScrapper(this); + } +}