From b7d0017385bea8024e8d10078260ac2db598648e Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 26 Jan 2013 00:51:18 +0100 Subject: [PATCH] [GTC] Nimbus Swimmer, Psychic Strike, Mystic Genesis, Shamleshark, Master Biomancer, Thrull Parasite --- .../mage/sets/gatecrash/MasterBiomancer.java | 129 ++++++++++++++ .../mage/sets/gatecrash/MysticGenesis.java | 119 +++++++++++++ .../mage/sets/gatecrash/NimbusSwimmer.java | 107 ++++++++++++ .../mage/sets/gatecrash/PsychicStrike.java | 108 ++++++++++++ .../src/mage/sets/gatecrash/Shambleshark.java | 69 ++++++++ .../mage/sets/gatecrash/ThrullParasite.java | 158 ++++++++++++++++++ 6 files changed, 690 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/gatecrash/MasterBiomancer.java create mode 100644 Mage.Sets/src/mage/sets/gatecrash/MysticGenesis.java create mode 100644 Mage.Sets/src/mage/sets/gatecrash/NimbusSwimmer.java create mode 100644 Mage.Sets/src/mage/sets/gatecrash/PsychicStrike.java create mode 100644 Mage.Sets/src/mage/sets/gatecrash/Shambleshark.java create mode 100644 Mage.Sets/src/mage/sets/gatecrash/ThrullParasite.java diff --git a/Mage.Sets/src/mage/sets/gatecrash/MasterBiomancer.java b/Mage.Sets/src/mage/sets/gatecrash/MasterBiomancer.java new file mode 100644 index 0000000000..b66fe15f8c --- /dev/null +++ b/Mage.Sets/src/mage/sets/gatecrash/MasterBiomancer.java @@ -0,0 +1,129 @@ +/* +* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. +* +* Redistribution and use in source and binary forms, with or without modification, are +* permitted provided that the following conditions are met: +* +* 1. Redistributions of source code must retain the above copyright notice, this list of +* conditions and the following disclaimer. +* +* 2. Redistributions in binary form must reproduce the above copyright notice, this list +* of conditions and the following disclaimer in the documentation and/or other materials +* provided with the distribution. +* +* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED +* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR +* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +* The views and conclusions contained in the software and documentation are those of the +* authors and should not be interpreted as representing official policies, either expressed +* or implied, of BetaSteward_at_googlemail.com. +*/ +package mage.sets.gatecrash; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Duration; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.abilities.effects.common.continious.AddCardSubTypeTargetEffect; +import mage.cards.CardImpl; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.game.permanent.Permanent; +import mage.target.targetpointer.FixedTarget; + +/** +* +* @author LevelX2 +*/ +public class MasterBiomancer extends CardImpl { + + public MasterBiomancer(UUID ownerId) { + super(ownerId, 176, "Master Biomancer", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{2}{G}{U}"); + this.expansionSetCode = "GTC"; + this.subtype.add("Elf"); + this.subtype.add("Wizard"); + + this.color.setBlue(true); + this.color.setGreen(true); + this.power = new MageInt(2); + this.toughness = new MageInt(4); + + // Each other creature you control enters the battlefield with a number of additional +1/+1 counters on it equal to Master Biomancer's power and as a Mutant in addition to its other types. + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new MasterBiomancerEntersBattlefieldEffect())); + } + + public MasterBiomancer(final MasterBiomancer card) { + super(card); + } + + @Override + public MasterBiomancer copy() { + return new MasterBiomancer(this); + } +} + +class MasterBiomancerEntersBattlefieldEffect extends ReplacementEffectImpl { + + public MasterBiomancerEntersBattlefieldEffect() { + super(Duration.WhileOnBattlefield, Outcome.BoostCreature); + staticText = "Each other creature you control enters the battlefield with a number of additional +1/+1 counters on it equal to Master Biomancer's power and as a Mutant in addition to its other types"; + } + + public MasterBiomancerEntersBattlefieldEffect(MasterBiomancerEntersBattlefieldEffect effect) { + super(effect); + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getType() == EventType.ENTERS_THE_BATTLEFIELD) { + Permanent creature = game.getPermanent(event.getTargetId()); + if (creature != null && creature.getControllerId().equals(source.getControllerId()) && !event.getTargetId().equals(source.getSourceId())) { + return true; + } + } + return false; + } + + @Override + public boolean apply(Game game, Ability source) { + return false; + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + Permanent sourceCreature = game.getPermanent(source.getSourceId()); + Permanent creature = game.getPermanent(event.getTargetId()); + if (sourceCreature != null && creature != null) { + int power = sourceCreature.getPower().getValue(); + if (power > 0) { + creature.addCounters(CounterType.P1P1.createInstance(power), game); + } + ContinuousEffect effect = new AddCardSubTypeTargetEffect("Mutant", Duration.WhileOnBattlefield); + effect.setTargetPointer(new FixedTarget(creature.getId())); + game.addEffect(effect, source); + } + return false; + } + + + @Override + public MasterBiomancerEntersBattlefieldEffect copy() { + return new MasterBiomancerEntersBattlefieldEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/gatecrash/MysticGenesis.java b/Mage.Sets/src/mage/sets/gatecrash/MysticGenesis.java new file mode 100644 index 0000000000..3d12809b8c --- /dev/null +++ b/Mage.Sets/src/mage/sets/gatecrash/MysticGenesis.java @@ -0,0 +1,119 @@ +/* + * 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.gatecrash; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.filter.FilterSpell; +import mage.game.Game; +import mage.game.permanent.token.Token; +import mage.game.stack.StackObject; +import mage.players.Player; +import mage.target.TargetSpell; + +/** + * + * @author LevelX2 + */ +public class MysticGenesis extends CardImpl { + + public MysticGenesis(UUID ownerId) { + super(ownerId, 180, "Mystic Genesis", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{2}{G}{U}{U}"); + this.expansionSetCode = "GTC"; + + this.color.setBlue(true); + this.color.setGreen(true); + + // Counter target spell. Put an X/X green Ooze creature token onto the battlefield, where X is that spell's converted mana cost. + this.getSpellAbility().addTarget(new TargetSpell(new FilterSpell())); + this.getSpellAbility().addEffect(new MysticGenesisEffect()); + + } + + public MysticGenesis(final MysticGenesis card) { + super(card); + } + + @Override + public MysticGenesis copy() { + return new MysticGenesis(this); + } +} + +class MysticGenesisEffect extends OneShotEffect { + + public MysticGenesisEffect() { + super(Outcome.Detriment); + staticText = " Counter target spell. Put an X/X green Ooze creature token onto the battlefield, where X is that spell's converted mana cost"; + } + + public MysticGenesisEffect(final MysticGenesisEffect effect) { + super(effect); + } + + @Override + public MysticGenesisEffect copy() { + return new MysticGenesisEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + StackObject stackObject = game.getStack().getStackObject(targetPointer.getFirst(game, source)); + if (stackObject != null && game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game)) { + if ( stackObject != null ) { + int cmc = stackObject.getManaCost().convertedManaCost(); + if ( cmc > 0 ) { + MysticGenesisOozeToken oozeToken = new MysticGenesisOozeToken(); + oozeToken.getPower().setValue(cmc); + oozeToken.getToughness().setValue(cmc); + oozeToken.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); + } + return true; + + } + } + return false; + } +} + +class MysticGenesisOozeToken extends Token { + public MysticGenesisOozeToken() { + super("Ooze", "X/X green Ooze creature token"); + cardType.add(CardType.CREATURE); + subtype.add("Ooze"); + power = new MageInt(0); + toughness = new MageInt(0); + } +} diff --git a/Mage.Sets/src/mage/sets/gatecrash/NimbusSwimmer.java b/Mage.Sets/src/mage/sets/gatecrash/NimbusSwimmer.java new file mode 100644 index 0000000000..f923a2989a --- /dev/null +++ b/Mage.Sets/src/mage/sets/gatecrash/NimbusSwimmer.java @@ -0,0 +1,107 @@ +/* + * 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.gatecrash; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.SpellAbility; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author LevelX2 + */ +public class NimbusSwimmer extends CardImpl { + + public NimbusSwimmer(UUID ownerId) { + super(ownerId, 181, "Nimbus Swimmer", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{X}{G}{U}"); + this.expansionSetCode = "GTC"; + this.subtype.add("Leviathan"); + + this.color.setBlue(true); + this.color.setGreen(true); + this.power = new MageInt(0); + this.toughness = new MageInt(0); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Nimbus Swimmer enters the battlefield with X +1/+1 counters on it. + this.addAbility(new EntersBattlefieldAbility(new NimbusSwimmerEffect(), true)); + } + + public NimbusSwimmer(final NimbusSwimmer card) { + super(card); + } + + @Override + public NimbusSwimmer copy() { + return new NimbusSwimmer(this); + } +} + +class NimbusSwimmerEffect extends OneShotEffect { + + public NimbusSwimmerEffect() { + super(Constants.Outcome.BoostCreature); + staticText = "{this} enters the battlefield with X +1/+1 counters on it"; + } + + public NimbusSwimmerEffect(final NimbusSwimmerEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null) { + Object obj = getValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (obj != null && obj instanceof SpellAbility) { + int amount = ((SpellAbility)obj).getManaCostsToPay().getX(); + if (amount > 0) { + permanent.addCounters(CounterType.P1P1.createInstance(amount), game); + } + } + } + return true; + } + + @Override + public NimbusSwimmerEffect copy() { + return new NimbusSwimmerEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/gatecrash/PsychicStrike.java b/Mage.Sets/src/mage/sets/gatecrash/PsychicStrike.java new file mode 100644 index 0000000000..0ba08ce7f3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/gatecrash/PsychicStrike.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.gatecrash; + +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.filter.FilterSpell; +import mage.game.Game; +import mage.game.stack.StackObject; +import mage.players.Player; +import mage.target.TargetSpell; + +/** + * + * @author LevelX2 + */ +public class PsychicStrike extends CardImpl { + + public PsychicStrike(UUID ownerId) { + super(ownerId, 189, "Psychic Strike", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{U}{B}"); + this.expansionSetCode = "GTC"; + + this.color.setBlue(true); + this.color.setBlack(true); + + // Counter target spell. Its controller puts the top two cards of his or her library into his or her graveyard. + this.getSpellAbility().addTarget(new TargetSpell(new FilterSpell())); + this.getSpellAbility().addEffect(new PsychicStrikeEffect()); + } + + public PsychicStrike(final PsychicStrike card) { + super(card); + } + + @Override + public PsychicStrike copy() { + return new PsychicStrike(this); + } +} + +class PsychicStrikeEffect extends OneShotEffect { + + public PsychicStrikeEffect() { + super(Outcome.Detriment); + staticText = "Counter target spell. Its controller puts the top two cards of his or her library into his or her graveyard"; + } + + public PsychicStrikeEffect(final PsychicStrikeEffect effect) { + super(effect); + } + + @Override + public PsychicStrikeEffect copy() { + return new PsychicStrikeEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + StackObject stackObject = game.getStack().getStackObject(targetPointer.getFirst(game, source)); + if (stackObject != null && game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game)) { + Player controller = game.getPlayer(stackObject.getControllerId()); + if (controller == null) { + return false; + } + int cardsCount = Math.min(2, controller.getLibrary().size()); + for (int i = 0; i < cardsCount; i++) { + Card card = controller.getLibrary().removeFromTop(game); + if (card != null) { + card.moveToZone(Zone.GRAVEYARD, source.getId(), game, false); + } + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/gatecrash/Shambleshark.java b/Mage.Sets/src/mage/sets/gatecrash/Shambleshark.java new file mode 100644 index 0000000000..22e7f9625e --- /dev/null +++ b/Mage.Sets/src/mage/sets/gatecrash/Shambleshark.java @@ -0,0 +1,69 @@ +/* + * 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.gatecrash; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.keyword.EvolveAbility; +import mage.abilities.keyword.FlashAbility; +import mage.cards.CardImpl; + +/** + * + * @author LevelX2 + */ +public class Shambleshark extends CardImpl { + + public Shambleshark(UUID ownerId) { + super(ownerId, 193, "Shambleshark", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{G}{U}"); + this.expansionSetCode = "GTC"; + this.subtype.add("Fish"); + this.subtype.add("Crab"); + + this.color.setBlue(true); + this.color.setGreen(true); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Flash + this.addAbility(FlashAbility.getInstance()); + // Evolve + this.addAbility(new EvolveAbility()); + } + + public Shambleshark(final Shambleshark card) { + super(card); + } + + @Override + public Shambleshark copy() { + return new Shambleshark(this); + } +} diff --git a/Mage.Sets/src/mage/sets/gatecrash/ThrullParasite.java b/Mage.Sets/src/mage/sets/gatecrash/ThrullParasite.java new file mode 100644 index 0000000000..48bd56710f --- /dev/null +++ b/Mage.Sets/src/mage/sets/gatecrash/ThrullParasite.java @@ -0,0 +1,158 @@ +/* + * 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.gatecrash; + +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.PayLifeCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.ExtortAbility; +import mage.cards.CardImpl; +import mage.choices.Choice; +import mage.choices.ChoiceImpl; +import mage.counters.Counter; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetNonlandPermanent; + +/** +* +* @author LevelX2 +*/ +public class ThrullParasite extends CardImpl { + + public ThrullParasite(UUID ownerId) { + super(ownerId, 81, "Thrull Parasite", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{B}"); + this.expansionSetCode = "GTC"; + this.subtype.add("Thrull"); + + this.color.setBlack(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Extort + this.addAbility(new ExtortAbility()); + // {tap}, Pay 2 life: Remove a counter from target nonland permanent. + Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new RemoveCounterTargetEffect(),new TapSourceCost()); + ability.addTarget(new TargetNonlandPermanent()); + ability.addCost(new PayLifeCost(2)); + this.addAbility(ability); + } + + public ThrullParasite(final ThrullParasite card) { + super(card); + } + + @Override + public ThrullParasite copy() { + return new ThrullParasite(this); + } +} + +class RemoveCounterTargetEffect extends OneShotEffect { + + private CounterType counterTypeToRemove; + + public RemoveCounterTargetEffect() { + super(Outcome.Detriment); + this.staticText = "Remove a counter from target nonland permanent"; + } + + public RemoveCounterTargetEffect(CounterType counterTypeToRemove) { + super(Outcome.Detriment); + this.staticText = "Remove a " + counterTypeToRemove.getName() + " counter from target nonland permanent"; + this.counterTypeToRemove = counterTypeToRemove; + } + + public RemoveCounterTargetEffect(final RemoveCounterTargetEffect effect) { + super(effect); + this.counterTypeToRemove = effect.counterTypeToRemove; + } + + @Override + public RemoveCounterTargetEffect copy() { + return new RemoveCounterTargetEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + boolean result = false; + Player controller = game.getPlayer(source.getControllerId()); + for (UUID targetId: getTargetPointer().getTargets(game, source)) { + Permanent permanent = game.getPermanent(targetId); + if (permanent != null) { + if (permanent.getCounters().size() > 0 && (counterTypeToRemove == null || permanent.getCounters().containsKey(counterTypeToRemove))) { + String counterName = null; + if (counterTypeToRemove != null) { + counterName = counterTypeToRemove.getName(); + } else { + if (permanent.getCounters().size() > 1 && counterTypeToRemove == null) { + Choice choice = new ChoiceImpl(true); + Set choices = new HashSet(); + for (Counter counter : permanent.getCounters().values()) { + if (permanent.getCounters().getCount(counter.getName()) > 0) { + choices.add(counter.getName()); + } + } + choice.setChoices(choices); + choice.setMessage("Choose a counter type to remove from " + permanent.getName()); + controller.choose(Outcome.Detriment, choice, game); + counterName = choice.getChoice(); + } else { + for (Counter counter : permanent.getCounters().values()) { + if (counter.getCount() > 0) { + counterName = counter.getName(); + } + } + } + } + if (counterName != null) { + permanent.removeCounters(counterName, 1, game); + if (permanent.getCounters().getCount(counterName) == 0 ){ + permanent.getCounters().removeCounter(counterName); + } + result |= true; + game.informPlayers(new StringBuilder(controller.getName()).append(" removes a ").append(counterName).append(" counter from ").append(permanent.getName()).toString()); + } + } + } + } + return result; + } +}