From 2da11a0c8e310ff7c8cf36c523de39cc5ef243f4 Mon Sep 17 00:00:00 2001 From: Loki Date: Mon, 3 Oct 2011 01:18:49 +0300 Subject: [PATCH] cards --- .../mage/sets/lorwyn/StonybrookAngler.java | 75 ++++++++++++++++ .../mirrodinbesieged/VedalkenAnatomist.java | 42 +-------- .../src/mage/sets/tempest/PuppetStrings.java | 68 +++++++++++++++ Mage.Sets/src/mage/sets/tenth/Puppeteer.java | 75 ++++++++++++++++ .../sets/worldwake/TideforceElemental.java | 85 +++++++++++++++++++ .../common/MayTapOrUntapTargetEffect.java | 55 ++++++++++++ 6 files changed, 360 insertions(+), 40 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/lorwyn/StonybrookAngler.java create mode 100644 Mage.Sets/src/mage/sets/tempest/PuppetStrings.java create mode 100644 Mage.Sets/src/mage/sets/tenth/Puppeteer.java create mode 100644 Mage.Sets/src/mage/sets/worldwake/TideforceElemental.java create mode 100644 Mage/src/mage/abilities/effects/common/MayTapOrUntapTargetEffect.java diff --git a/Mage.Sets/src/mage/sets/lorwyn/StonybrookAngler.java b/Mage.Sets/src/mage/sets/lorwyn/StonybrookAngler.java new file mode 100644 index 00000000000..108e2f8f684 --- /dev/null +++ b/Mage.Sets/src/mage/sets/lorwyn/StonybrookAngler.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.lorwyn; + +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.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.MayTapOrUntapTargetEffect; +import mage.cards.CardImpl; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author Loki + */ +public class StonybrookAngler extends CardImpl { + + public StonybrookAngler(UUID ownerId) { + super(ownerId, 90, "Stonybrook Angler", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "LRW"; + this.subtype.add("Merfolk"); + this.subtype.add("Wizard"); + + this.color.setBlue(true); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // {1}{U}, {tap}: You may tap or untap target creature. + Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new MayTapOrUntapTargetEffect(), new ManaCostsImpl("{1}{U}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public StonybrookAngler(final StonybrookAngler card) { + super(card); + } + + @Override + public StonybrookAngler copy() { + return new StonybrookAngler(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/VedalkenAnatomist.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/VedalkenAnatomist.java index b54618173f5..b8f01fcb5f0 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/VedalkenAnatomist.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/VedalkenAnatomist.java @@ -37,13 +37,10 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.MayTapOrUntapTargetEffect; import mage.abilities.effects.common.counter.AddCountersTargetEffect; import mage.cards.CardImpl; import mage.counters.CounterType; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; import mage.target.common.TargetCreaturePermanent; /** @@ -63,7 +60,7 @@ public class VedalkenAnatomist extends CardImpl { this.toughness = new MageInt(2); Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.M1M1.createInstance()), new ManaCostsImpl("{2}{U}")); - ability.addEffect(new VedalkenAnatomistEffect()); + ability.addEffect(new MayTapOrUntapTargetEffect()); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); @@ -78,38 +75,3 @@ public class VedalkenAnatomist extends CardImpl { return new VedalkenAnatomist(this); } } - -class VedalkenAnatomistEffect extends OneShotEffect { - VedalkenAnatomistEffect() { - super(Constants.Outcome.Benefit); - staticText = "You may tap or untap that creature"; - } - - VedalkenAnatomistEffect(final VedalkenAnatomistEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent target = game.getPermanent(targetPointer.getFirst(source)); - Player player = game.getPlayer(source.getControllerId()); - if (target != null && player != null) { - if (target.isTapped()) { - if (player.chooseUse(Constants.Outcome.Untap, "Untap that creature?", game)) { - target.untap(game); - } - } else { - if (player.chooseUse(Constants.Outcome.Tap, "Tap that creature?", game)) { - target.tap(game); - } - } - return true; - } - return false; - } - - @Override - public VedalkenAnatomistEffect copy() { - return new VedalkenAnatomistEffect(this); - } -} diff --git a/Mage.Sets/src/mage/sets/tempest/PuppetStrings.java b/Mage.Sets/src/mage/sets/tempest/PuppetStrings.java new file mode 100644 index 00000000000..46912577fc1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempest/PuppetStrings.java @@ -0,0 +1,68 @@ +/* + * 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.tempest; + +import java.util.UUID; + +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.MayTapOrUntapTargetEffect; +import mage.cards.CardImpl; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author Loki + */ +public class PuppetStrings extends CardImpl { + + public PuppetStrings(UUID ownerId) { + super(ownerId, 294, "Puppet Strings", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{3}"); + this.expansionSetCode = "TMP"; + + // {2}, {tap}: You may tap or untap target creature. + Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new MayTapOrUntapTargetEffect(), new GenericManaCost(2)); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public PuppetStrings(final PuppetStrings card) { + super(card); + } + + @Override + public PuppetStrings copy() { + return new PuppetStrings(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tenth/Puppeteer.java b/Mage.Sets/src/mage/sets/tenth/Puppeteer.java new file mode 100644 index 00000000000..33799ff6d70 --- /dev/null +++ b/Mage.Sets/src/mage/sets/tenth/Puppeteer.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.tenth; + +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.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ColoredManaCost; +import mage.abilities.effects.common.MayTapOrUntapTargetEffect; +import mage.cards.CardImpl; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author Loki + */ +public class Puppeteer extends CardImpl { + + public Puppeteer(UUID ownerId) { + super(ownerId, 98, "Puppeteer", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); + this.expansionSetCode = "10E"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + + this.color.setBlue(true); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // {U}, {tap}: You may tap or untap target creature. + Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new MayTapOrUntapTargetEffect(), new ColoredManaCost(Constants.ColoredManaSymbol.U)); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public Puppeteer(final Puppeteer card) { + super(card); + } + + @Override + public Puppeteer copy() { + return new Puppeteer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/worldwake/TideforceElemental.java b/Mage.Sets/src/mage/sets/worldwake/TideforceElemental.java new file mode 100644 index 00000000000..f36cff0bb8b --- /dev/null +++ b/Mage.Sets/src/mage/sets/worldwake/TideforceElemental.java @@ -0,0 +1,85 @@ +/* + * 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.worldwake; + +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.common.LandfallAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ColoredManaCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.MayTapOrUntapTargetEffect; +import mage.abilities.effects.common.UntapSourceEffect; +import mage.cards.CardImpl; +import mage.filter.common.FilterCreaturePermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author Loki + */ +public class TideforceElemental extends CardImpl { + private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("another creature"); + + static { + filter.setAnother(true); + } + + public TideforceElemental(UUID ownerId) { + super(ownerId, 41, "Tideforce Elemental", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); + this.expansionSetCode = "WWK"; + this.subtype.add("Elemental"); + + this.color.setBlue(true); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // {U}, {tap}: You may tap or untap another target creature. + Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new MayTapOrUntapTargetEffect(), new ColoredManaCost(Constants.ColoredManaSymbol.U)); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + // Landfall - Whenever a land enters the battlefield under your control, you may untap Tideforce Elemental. + this.addAbility(new LandfallAbility(new UntapSourceEffect(), true)); + } + + public TideforceElemental(final TideforceElemental card) { + super(card); + } + + @Override + public TideforceElemental copy() { + return new TideforceElemental(this); + } +} diff --git a/Mage/src/mage/abilities/effects/common/MayTapOrUntapTargetEffect.java b/Mage/src/mage/abilities/effects/common/MayTapOrUntapTargetEffect.java new file mode 100644 index 00000000000..3305ee9d284 --- /dev/null +++ b/Mage/src/mage/abilities/effects/common/MayTapOrUntapTargetEffect.java @@ -0,0 +1,55 @@ +package mage.abilities.effects.common; + +import mage.Constants; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.effects.OneShotEffect; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; + +/** + * @author Loki + */ +public class MayTapOrUntapTargetEffect extends OneShotEffect { + public MayTapOrUntapTargetEffect() { + super(Constants.Outcome.Benefit); + } + + public MayTapOrUntapTargetEffect(final MayTapOrUntapTargetEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent target = game.getPermanent(targetPointer.getFirst(source)); + Player player = game.getPlayer(source.getControllerId()); + if (target != null && player != null) { + if (target.isTapped()) { + if (player.chooseUse(Constants.Outcome.Untap, "Untap that creature?", game)) { + target.untap(game); + } + } else { + if (player.chooseUse(Constants.Outcome.Tap, "Tap that creature?", game)) { + target.tap(game); + } + } + return true; + } + return false; + } + + @Override + public MayTapOrUntapTargetEffect copy() { + return new MayTapOrUntapTargetEffect(this); + } + + @Override + public String getText(Mode mode) { + if (mode.getTargets().isEmpty()) { + return "You may tap or untap it"; + } else { + return "You may tap or untap target " + mode.getTargets().get(0).getTargetName(); + } + } +}