From 6daffd3a81d96533504e2121aafd2301243c434b Mon Sep 17 00:00:00 2001 From: Loki Date: Thu, 19 Jul 2012 22:38:55 +1200 Subject: [PATCH] [M13] Rewind --- .../src/mage/sets/eighthedition/Rewind.java | 54 ++++++++++++++++ Mage.Sets/src/mage/sets/magic2013/Rewind.java | 54 ++++++++++++++++ .../src/mage/sets/ninthedition/Rewind.java | 54 ++++++++++++++++ Mage.Sets/src/mage/sets/urzassaga/Rewind.java | 64 +++++++++++++++++++ .../effects/common/UntapLandsEffect.java | 49 ++++++++++++++ 5 files changed, 275 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/eighthedition/Rewind.java create mode 100644 Mage.Sets/src/mage/sets/magic2013/Rewind.java create mode 100644 Mage.Sets/src/mage/sets/ninthedition/Rewind.java create mode 100644 Mage.Sets/src/mage/sets/urzassaga/Rewind.java create mode 100644 Mage/src/mage/abilities/effects/common/UntapLandsEffect.java diff --git a/Mage.Sets/src/mage/sets/eighthedition/Rewind.java b/Mage.Sets/src/mage/sets/eighthedition/Rewind.java new file mode 100644 index 00000000000..a05fd8eb2ae --- /dev/null +++ b/Mage.Sets/src/mage/sets/eighthedition/Rewind.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.eighthedition; + +import java.util.UUID; +import mage.Constants.Rarity; + +/** + * + * @author Loki + */ +public class Rewind extends mage.sets.urzassaga.Rewind { + + public Rewind(UUID ownerId) { + super(ownerId); + this.cardNumber = 96; + this.expansionSetCode = "8ED"; + this.rarity = Rarity.UNCOMMON; + } + + public Rewind(final Rewind card) { + super(card); + } + + @Override + public Rewind copy() { + return new Rewind(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magic2013/Rewind.java b/Mage.Sets/src/mage/sets/magic2013/Rewind.java new file mode 100644 index 00000000000..5a7a95ce5af --- /dev/null +++ b/Mage.Sets/src/mage/sets/magic2013/Rewind.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.magic2013; + +import java.util.UUID; +import mage.Constants.Rarity; + +/** + * + * @author Loki + */ +public class Rewind extends mage.sets.urzassaga.Rewind { + + public Rewind(UUID ownerId) { + super(ownerId); + this.cardNumber = 65; + this.expansionSetCode = "M13"; + this.rarity = Rarity.UNCOMMON; + } + + public Rewind(final Rewind card) { + super(card); + } + + @Override + public Rewind copy() { + return new Rewind(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ninthedition/Rewind.java b/Mage.Sets/src/mage/sets/ninthedition/Rewind.java new file mode 100644 index 00000000000..7d69fa61dd5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ninthedition/Rewind.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.ninthedition; + +import java.util.UUID; +import mage.Constants.Rarity; + +/** + * + * @author Loki + */ +public class Rewind extends mage.sets.urzassaga.Rewind { + + public Rewind(UUID ownerId) { + super(ownerId); + this.cardNumber = 94; + this.expansionSetCode = "9ED"; + this.rarity = Rarity.UNCOMMON; + } + + public Rewind(final Rewind card) { + super(card); + } + + @Override + public Rewind copy() { + return new Rewind(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/Rewind.java b/Mage.Sets/src/mage/sets/urzassaga/Rewind.java new file mode 100644 index 00000000000..2f69a0c0bad --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/Rewind.java @@ -0,0 +1,64 @@ +/* + * 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.abilities.effects.common.CounterTargetEffect; +import mage.abilities.effects.common.UntapLandsEffect; +import mage.cards.CardImpl; +import mage.target.TargetSpell; + +/** + * + * @author Loki + */ +public class Rewind extends CardImpl { + + public Rewind(UUID ownerId) { + super(ownerId, 93, "Rewind", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{U}{U}"); + this.expansionSetCode = "USG"; + + this.color.setBlue(true); + + // Counter target spell. Untap up to four lands. + this.getSpellAbility().addTarget(new TargetSpell()); + this.getSpellAbility().addEffect(new CounterTargetEffect()); + this.getSpellAbility().addEffect(new UntapLandsEffect(4)); + } + + public Rewind(final Rewind card) { + super(card); + } + + @Override + public Rewind copy() { + return new Rewind(this); + } +} diff --git a/Mage/src/mage/abilities/effects/common/UntapLandsEffect.java b/Mage/src/mage/abilities/effects/common/UntapLandsEffect.java new file mode 100644 index 00000000000..ef2f6498aa4 --- /dev/null +++ b/Mage/src/mage/abilities/effects/common/UntapLandsEffect.java @@ -0,0 +1,49 @@ +package mage.abilities.effects.common; + +import mage.Constants; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.filter.common.FilterLandPermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetLandPermanent; + +import java.util.UUID; + +/** + * "Untap up to X lands" effect + */ +public class UntapLandsEffect extends OneShotEffect { + private int amount; + + public UntapLandsEffect(int amount) { + super(Constants.Outcome.Untap); + this.amount = amount; + staticText = "Untap up to " + amount + " lands"; + } + + public UntapLandsEffect(final UntapLandsEffect effect) { + super(effect); + this.amount = effect.amount; + } + + @Override + public boolean apply(Game game, Ability source) { + TargetLandPermanent target = new TargetLandPermanent(1, amount, new FilterLandPermanent(), true); + if (target.canChoose(source.getControllerId(), game)) { + if (target.choose(Constants.Outcome.Untap, source.getControllerId(), source.getSourceId(), game)) { + for (Object targetId : target.getTargets()) { + Permanent p = game.getPermanent((UUID) targetId); + if (p.isTapped()) + p.untap(game); + } + } + } + return false; + } + + @Override + public UntapLandsEffect copy() { + return new UntapLandsEffect(this); + } +}