diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/KodamasReach.java b/Mage.Sets/src/mage/sets/championsofkamigawa/KodamasReach.java new file mode 100644 index 00000000000..0929eb3d74a --- /dev/null +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/KodamasReach.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.championsofkamigawa; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class KodamasReach extends mage.sets.commander.KodamasReach { + + public KodamasReach(UUID ownerId) { + super(ownerId); + this.cardNumber = 225; + this.expansionSetCode = "CHK"; + } + + public KodamasReach(final KodamasReach card) { + super(card); + } + + @Override + public KodamasReach copy() { + return new KodamasReach(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander/KodamasReach.java b/Mage.Sets/src/mage/sets/commander/KodamasReach.java new file mode 100644 index 00000000000..f05fa597b13 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander/KodamasReach.java @@ -0,0 +1,139 @@ +/* + * 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.commander; + +import java.util.List; +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.common.FilterBasicLandCard; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.TargetCard; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author LevelX2 + */ +public class KodamasReach extends CardImpl { + + public KodamasReach(UUID ownerId) { + super(ownerId, 163, "Kodama's Reach", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{G}"); + this.expansionSetCode = "CMD"; + this.subtype.add("Arcane"); + + this.color.setGreen(true); + + // Search your library for up to two basic land cards, reveal those cards, and put one onto the battlefield tapped and the other into your hand. Then shuffle your library. + this.getSpellAbility().addEffect(new KodamasReachEffect()); + } + + public KodamasReach(final KodamasReach card) { + super(card); + } + + @Override + public KodamasReach copy() { + return new KodamasReach(this); + } +} + +class KodamasReachEffect extends OneShotEffect { + + protected static final FilterCard filter = new FilterCard("card to put on the battlefield tapped"); + + public KodamasReachEffect() { + super(Outcome.PutLandInPlay); + staticText = "Search your library for up to two basic land cards, reveal those cards, and put one onto the battlefield tapped and the other into your hand. Then shuffle your library"; + } + + public KodamasReachEffect(final KodamasReachEffect effect) { + super(effect); + } + + @Override + public KodamasReachEffect copy() { + return new KodamasReachEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + TargetCardInLibrary target = new TargetCardInLibrary(0, 2, new FilterBasicLandCard()); + Player player = game.getPlayer(source.getControllerId()); + if (player.searchLibrary(target, game)) { + if (target.getTargets().size() > 0) { + Cards revealed = new CardsImpl(); + for (UUID cardId: (List)target.getTargets()) { + Card card = player.getLibrary().getCard(cardId, game); + revealed.add(card); + } + player.revealCards("Kodama's Reach", revealed, game); + if (target.getTargets().size() == 2) { + TargetCard target2 = new TargetCard(Zone.PICK, filter); + target2.setRequired(true); + player.choose(Outcome.Benefit, revealed, target2, game); + Card card = revealed.get(target2.getFirstTarget(), game); + card.putOntoBattlefield(game, Zone.LIBRARY, source.getId(), source.getControllerId()); + revealed.remove(card); + Permanent permanent = game.getPermanent(card.getId()); + if (permanent != null) { + permanent.setTapped(true); + } + card = revealed.getCards(game).iterator().next(); + card.moveToZone(Zone.HAND, source.getId(), game, false); + } + else if (target.getTargets().size() == 1) { + Card card = revealed.getCards(game).iterator().next(); + card.putOntoBattlefield(game, Zone.LIBRARY, source.getId(), source.getControllerId()); + Permanent permanent = game.getPermanent(card.getId()); + if (permanent != null) { + permanent.setTapped(true); + } + } + + } + player.shuffleLibrary(game); + return true; + } + player.shuffleLibrary(game); + return false; + + } + +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/futuresight/Imperiosaur.java b/Mage.Sets/src/mage/sets/futuresight/Imperiosaur.java new file mode 100644 index 00000000000..864ce03ce15 --- /dev/null +++ b/Mage.Sets/src/mage/sets/futuresight/Imperiosaur.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.futuresight; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class Imperiosaur extends mage.sets.modernmasters.Imperiosaur { + + public Imperiosaur(UUID ownerId) { + super(ownerId); + this.cardNumber = 145; + this.expansionSetCode = "FUT"; + this.rarity = Rarity.UNCOMMON; + } + + public Imperiosaur(final Imperiosaur card) { + super(card); + } + + @Override + public Imperiosaur copy() { + return new Imperiosaur(this); + } +} diff --git a/Mage.Sets/src/mage/sets/modernmasters/FuryCharm.java b/Mage.Sets/src/mage/sets/modernmasters/FuryCharm.java new file mode 100644 index 00000000000..3d8fea9f959 --- /dev/null +++ b/Mage.Sets/src/mage/sets/modernmasters/FuryCharm.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.modernmasters; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class FuryCharm extends mage.sets.planarchaos.FuryCharm { + + public FuryCharm(UUID ownerId) { + super(ownerId); + this.cardNumber = 114; + this.expansionSetCode = "MMA"; + } + + public FuryCharm(final FuryCharm card) { + super(card); + } + + @Override + public FuryCharm copy() { + return new FuryCharm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/modernmasters/Imperiosaur.java b/Mage.Sets/src/mage/sets/modernmasters/Imperiosaur.java new file mode 100644 index 00000000000..328d6265684 --- /dev/null +++ b/Mage.Sets/src/mage/sets/modernmasters/Imperiosaur.java @@ -0,0 +1,96 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.modernmasters; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.StaticAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SupertypePredicate; + +/** + * + * @author LevelX2 + */ +public class Imperiosaur extends CardImpl { + + private static final FilterLandPermanent filter = new FilterLandPermanent(); + static { + filter.add(new SupertypePredicate("Basic")); + } + + public Imperiosaur(UUID ownerId) { + super(ownerId, 148, "Imperiosaur", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}{G}"); + this.expansionSetCode = "MMA"; + this.subtype.add("Lizard"); + + this.color.setGreen(true); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Spend only mana produced by basic lands to cast Imperiosaur. + this.addAbility(new ImperiosaurStaticAbility()); + this.getSpellAbility().getManaCostsToPay().setSourceFilter(filter); + this.getSpellAbility().getManaCosts().setSourceFilter(filter); + } + + public Imperiosaur(final Imperiosaur card) { + super(card); + } + + @Override + public Imperiosaur copy() { + return new Imperiosaur(this); + } +} + +class ImperiosaurStaticAbility extends StaticAbility { + + public ImperiosaurStaticAbility() { + super(Zone.STACK, null); + } + + public ImperiosaurStaticAbility(ImperiosaurStaticAbility ability) { + super(ability); + } + + @Override + public ImperiosaurStaticAbility copy() { + return new ImperiosaurStaticAbility(this); + } + + @Override + public String getRule() { + return "Spend only mana produced by basic lands to cast {this}."; + } + +} diff --git a/Mage.Sets/src/mage/sets/modernmasters/KodamasReach.java b/Mage.Sets/src/mage/sets/modernmasters/KodamasReach.java new file mode 100644 index 00000000000..085b2a953e9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/modernmasters/KodamasReach.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.modernmasters; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class KodamasReach extends mage.sets.commander.KodamasReach { + + public KodamasReach(UUID ownerId) { + super(ownerId); + this.cardNumber = 151; + this.expansionSetCode = "MMA"; + } + + public KodamasReach(final KodamasReach card) { + super(card); + } + + @Override + public KodamasReach copy() { + return new KodamasReach(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planarchaos/FuryCharm.java b/Mage.Sets/src/mage/sets/planarchaos/FuryCharm.java new file mode 100644 index 00000000000..facc65b4451 --- /dev/null +++ b/Mage.Sets/src/mage/sets/planarchaos/FuryCharm.java @@ -0,0 +1,163 @@ +/* + * 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.UUID; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.SpellAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.continious.BoostTargetEffect; +import mage.abilities.effects.common.continious.GainAbilityTargetEffect; +import mage.abilities.keyword.SuspendAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.choices.Choice; +import mage.choices.ChoiceImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.counters.CounterType; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.filter.predicate.permanent.CounterPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.Target; +import mage.target.common.TargetArtifactPermanent; +import mage.target.common.TargetCardInExile; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class FuryCharm extends CardImpl { + + private static final FilterCard filter = new FilterCard("suspended card"); + static { + filter.add(new CounterPredicate(CounterType.TIME)); + filter.add(new AbilityPredicate(SuspendAbility.class)); + } + + public FuryCharm(UUID ownerId) { + super(ownerId, 100, "Fury Charm", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{R}"); + this.expansionSetCode = "PLC"; + + this.color.setRed(true); + + // Choose one - + this.getSpellAbility().getModes().setMinModes(1); + this.getSpellAbility().getModes().setMaxModes(1); + // Destroy target artifact; + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addTarget(new TargetArtifactPermanent()); + // or target creature gets +1/+1 and gains trample until end of turn; + Mode mode = new Mode(); + mode.getEffects().add(new BoostTargetEffect(1,1, Duration.EndOfTurn)); + mode.getEffects().add(new GainAbilityTargetEffect(TrampleAbility.getInstance(),Duration.EndOfTurn)); + mode.getTargets().add(new TargetCreaturePermanent()); + this.getSpellAbility().getModes().addMode(mode); + // or remove two time counters from target permanent or suspended card. + mode = new Mode(); + Choice targetChoice = new ChoiceImpl(); + targetChoice.setMessage("Choose what to target"); + targetChoice.getChoices().add("Permanent"); + targetChoice.getChoices().add("Suspended Card"); + mode.getChoices().add(targetChoice); + mode.getEffects().add(new FuryCharmRemoveCounterEffect()); + this.getSpellAbility().getModes().addMode(mode); + + + + } + + @Override + public void adjustTargets(Ability ability, Game game) { + if (ability instanceof SpellAbility) { + for(Effect effect :ability.getEffects()) { + if (effect instanceof FuryCharmRemoveCounterEffect) { + Choice targetChoice = ability.getChoices().get(0); + if (targetChoice.getChoice().equals("Permanent")) { + ability.addTarget(new TargetCreaturePermanent(true)); + } + if (targetChoice.getChoice().equals("Suspended Card")) { + Target target = new TargetCardInExile(1,1, filter, null, true); + target.setRequired(true); + ability.addTarget(target); + } + } + } + } + } + + public FuryCharm(final FuryCharm card) { + super(card); + } + + @Override + public FuryCharm copy() { + return new FuryCharm(this); + } +} + +class FuryCharmRemoveCounterEffect extends OneShotEffect { + + public FuryCharmRemoveCounterEffect() { + super(Outcome.Benefit); + this.staticText = "remove two time counters from target permanent or suspended card"; + } + + public FuryCharmRemoveCounterEffect(final FuryCharmRemoveCounterEffect effect) { + super(effect); + } + + @Override + public FuryCharmRemoveCounterEffect copy() { + return new FuryCharmRemoveCounterEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(this.getTargetPointer().getFirst(game, source)); + if (permanent != null) { + permanent.getCounters().removeCounter(CounterType.TIME, 2); + return true; + } + Card card = game.getCard(this.getTargetPointer().getFirst(game, source)); + if (card != null) { + card.getCounters().removeCounter(CounterType.TIME, 2); + return true; + } + return false; + } +}