From 9d43cebd2fca679497078a3f2ad7eb5787ee7b47 Mon Sep 17 00:00:00 2001 From: Andy Fries Date: Thu, 6 Aug 2015 09:52:36 -0700 Subject: [PATCH 1/4] implemented Voidmage Husher --- .../sets/mediainserts/VoidmageHusher.java | 82 +++++++++++++++++++ .../mage/sets/timespiral/VoidmageHusher.java | 54 ++++++++++++ 2 files changed, 136 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/mediainserts/VoidmageHusher.java create mode 100644 Mage.Sets/src/mage/sets/timespiral/VoidmageHusher.java diff --git a/Mage.Sets/src/mage/sets/mediainserts/VoidmageHusher.java b/Mage.Sets/src/mage/sets/mediainserts/VoidmageHusher.java new file mode 100644 index 00000000000..6fc12f98694 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mediainserts/VoidmageHusher.java @@ -0,0 +1,82 @@ +/* + * 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.mediainserts; + +import mage.MageInt; +import mage.MageObjectReference; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CounterTargetEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.ReturnToHandSourceEffect; +import mage.abilities.keyword.FlashAbility; +import mage.cards.CardImpl; +import mage.constants.*; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetActivatedAbility; + +import java.util.UUID; + +/** + * + * @author andyfries + */ +public class VoidmageHusher extends CardImpl { + + public VoidmageHusher(UUID ownerId) { + super(ownerId, 62, "Voidmage Husher", Rarity.SPECIAL, new CardType[]{CardType.CREATURE}, "{3}{U}"); + this.expansionSetCode = "MBP"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flash + this.addAbility(FlashAbility.getInstance()); + + // When Voidmage Husher enters the battlefield, counter target activated ability. + Ability ability = new EntersBattlefieldTriggeredAbility(new CounterTargetEffect()); + ability.addTarget(new TargetActivatedAbility()); + this.addAbility(ability); + + // Whenever you cast a spell, you may return Voidmage Husher to its owner's hand. + this.addAbility(new SpellCastControllerTriggeredAbility(new ReturnToHandSourceEffect(true), true)); + } + + public VoidmageHusher(final VoidmageHusher card) { + super(card); + } + + @Override + public VoidmageHusher copy() { + return new VoidmageHusher(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/timespiral/VoidmageHusher.java b/Mage.Sets/src/mage/sets/timespiral/VoidmageHusher.java new file mode 100644 index 00000000000..f74b44b3dcb --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/VoidmageHusher.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.timespiral; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author andyfries + */ +public class VoidmageHusher extends mage.sets.mediainserts.VoidmageHusher { + + public VoidmageHusher(UUID ownerId) { + super(ownerId); + this.cardNumber = 92; + this.expansionSetCode = "TSP"; + this.rarity = Rarity.UNCOMMON; + } + + public VoidmageHusher(final VoidmageHusher card) { + super(card); + } + + @Override + public VoidmageHusher copy() { + return new VoidmageHusher(this); + } +} From ddceaa3e5423b52a5e7cb382be1a51c928d0d9ae Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Fri, 7 Aug 2015 20:51:27 +0200 Subject: [PATCH 2/4] *Fixed name of Historical and Super Standard format. --- .../Mage.Deck.Constructed/src/mage/deck/HistoricalStandard.java | 2 +- .../Mage.Deck.Constructed/src/mage/deck/SuperStandard.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/HistoricalStandard.java b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/HistoricalStandard.java index 38c577f35ad..9fef3463b57 100644 --- a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/HistoricalStandard.java +++ b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/HistoricalStandard.java @@ -85,7 +85,7 @@ public class HistoricalStandard extends Constructed { * done in the overridden validate function. */ public HistoricalStandard() { - super("Variant Magic - Historical Standard"); + super("Constructed - Historical Standard"); // banned cards banned.add("Balance"); diff --git a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/SuperStandard.java b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/SuperStandard.java index f1fa0b0fa50..4eb4d5c4e8a 100644 --- a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/SuperStandard.java +++ b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/SuperStandard.java @@ -61,7 +61,7 @@ public class SuperStandard extends Constructed { * done in the overridden validate function. */ public SuperStandard() { - super("Variant Magic - Super Standard"); + super("Constructed - Super Standard"); banned.add("Ancient Den"); banned.add("Disciple of the Vault"); From 21cfe0611c15604e19bf26baf7dfbb6344c1594c Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Fri, 7 Aug 2015 21:31:22 +0200 Subject: [PATCH 3/4] * Some fixes to Liting Refrain, Dying Wish and Violet Pall. --- .../src/mage/sets/gatecrash/DyingWish.java | 48 +++++++++++++-- .../src/mage/sets/morningtide/VioletPall.java | 19 +++++- .../mage/sets/urzassaga/LiltingRefrain.java | 4 +- Mage/src/mage/counters/CounterType.java | 61 ++++++++++--------- 4 files changed, 95 insertions(+), 37 deletions(-) diff --git a/Mage.Sets/src/mage/sets/gatecrash/DyingWish.java b/Mage.Sets/src/mage/sets/gatecrash/DyingWish.java index 772d3a72ad9..6b98ffc389e 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/DyingWish.java +++ b/Mage.Sets/src/mage/sets/gatecrash/DyingWish.java @@ -28,17 +28,21 @@ package mage.sets.gatecrash; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; import mage.abilities.Ability; import mage.abilities.common.DiesAttachedTriggeredAbility; import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.effects.common.LoseLifeTargetEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.permanent.Permanent; import mage.target.TargetPermanent; import mage.target.TargetPlayer; import mage.target.common.TargetControlledCreaturePermanent; @@ -62,9 +66,8 @@ public class DyingWish extends CardImpl { Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); - // When enchanted creature dies, target player loses X life and you gain X life, where X is its power. - DynamicValue attachedPower = new AttachedPermanentPowerCount(); + DynamicValue attachedPower = new DyingWishAttachedPermanentPowerCount(); ability = new DiesAttachedTriggeredAbility(new LoseLifeTargetEffect(attachedPower), "enchanted creature"); ability.addEffect(new GainLifeEffect(attachedPower)); ability.addTarget(new TargetPlayer()); @@ -80,3 +83,38 @@ public class DyingWish extends CardImpl { return new DyingWish(this); } } + +class DyingWishAttachedPermanentPowerCount implements DynamicValue { + + @Override + public int calculate(Game game, Ability sourceAbility, Effect effect) { + Permanent attachmentPermanent = game.getPermanent(sourceAbility.getSourceId()); + if (attachmentPermanent == null) { + attachmentPermanent = (Permanent) game.getLastKnownInformation(sourceAbility.getSourceId(), Zone.BATTLEFIELD, sourceAbility.getSourceObjectZoneChangeCounter()); + } + if (attachmentPermanent != null && attachmentPermanent.getAttachedTo() != null) { + if (effect.getValue("attachedTo") != null) { + Permanent attached = (Permanent) effect.getValue("attachedTo"); + if (attached != null) { + return attached.getPower().getValue(); + } + } + } + return 0; + } + + @Override + public DynamicValue copy() { + return new DyingWishAttachedPermanentPowerCount(); + } + + @Override + public String toString() { + return "X"; + } + + @Override + public String getMessage() { + return "its power"; + } +} diff --git a/Mage.Sets/src/mage/sets/morningtide/VioletPall.java b/Mage.Sets/src/mage/sets/morningtide/VioletPall.java index 228a57579be..7b760e28e44 100644 --- a/Mage.Sets/src/mage/sets/morningtide/VioletPall.java +++ b/Mage.Sets/src/mage/sets/morningtide/VioletPall.java @@ -28,15 +28,18 @@ package mage.sets.morningtide; import java.util.UUID; +import mage.MageInt; import mage.constants.CardType; import mage.constants.Rarity; import mage.ObjectColor; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.ColorPredicate; +import mage.game.permanent.token.Token; import mage.target.common.TargetCreaturePermanent; /** @@ -58,7 +61,7 @@ public class VioletPall extends CardImpl { this.getSpellAbility().addEffect(new DestroyTargetEffect()); this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); - this.getSpellAbility().addEffect(new CreateTokenEffect(new FaerieToken(), 1)); + this.getSpellAbility().addEffect(new CreateTokenEffect(new VioletPallFaerieToken(), 1)); } public VioletPall(final VioletPall card) { @@ -70,3 +73,17 @@ public class VioletPall extends CardImpl { return new VioletPall(this); } } + +class VioletPallFaerieToken extends Token { + + VioletPallFaerieToken() { + super("Faerie Rogue", "1/1 black Faerie Rogue creature token with flying"); + cardType.add(CardType.CREATURE); + color.setBlack(true); + subtype.add("Faerie"); + subtype.add("Rogue"); + power = new MageInt(1); + toughness = new MageInt(1); + this.addAbility(FlyingAbility.getInstance()); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/LiltingRefrain.java b/Mage.Sets/src/mage/sets/urzassaga/LiltingRefrain.java index cf8cf62f232..e4cfe2d3823 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/LiltingRefrain.java +++ b/Mage.Sets/src/mage/sets/urzassaga/LiltingRefrain.java @@ -55,7 +55,7 @@ public class LiltingRefrain extends CardImpl { // At the beginning of your upkeep, you may put a verse counter on Lilting Refrain. this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(CounterType.VERSE.createInstance()), TargetController.YOU, true)); - + // Sacrifice Lilting Refrain: Counter target spell unless its controller pays {X}, where X is the number of verse counters on Lilting Refrain. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CounterUnlessPaysEffect(new CountersCount(CounterType.VERSE)), new SacrificeSourceCost()); ability.addTarget(new TargetSpell()); @@ -70,4 +70,4 @@ public class LiltingRefrain extends CardImpl { public LiltingRefrain copy() { return new LiltingRefrain(this); } -} \ No newline at end of file +} diff --git a/Mage/src/mage/counters/CounterType.java b/Mage/src/mage/counters/CounterType.java index 2f0aa49ad8d..18177a03392 100644 --- a/Mage/src/mage/counters/CounterType.java +++ b/Mage/src/mage/counters/CounterType.java @@ -1,31 +1,30 @@ /* -* 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. -*/ - + * 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.counters; /** @@ -34,6 +33,7 @@ package mage.counters; * @author nantuko */ public enum CounterType { + AGE("age"), AIM("aim"), ARROWHEAD("arrowhead"), @@ -76,6 +76,7 @@ public enum CounterType { POISON("poison"), PRESSURE("pressure"), QUEST("quest"), + SHIELD("shield"), SLIME("slime"), SPORE("spore"), STORAGE("storage"), @@ -85,6 +86,7 @@ public enum CounterType { TOWER("tower"), VELOCITY("velocity"), VILE("vile"), + VERSE("verse"), WISH("wish"); private final String name; @@ -112,7 +114,8 @@ public enum CounterType { } /** - * Create instance of counter type with defined amount of counters of the given type. + * Create instance of counter type with defined amount of counters of the + * given type. * * @param amount amount of counters of the given type. * @return @@ -129,4 +132,4 @@ public enum CounterType { return new Counter(name, amount); } } -} \ No newline at end of file +} From 851ff6672109f22d4ceeb789647125c847ee9fb5 Mon Sep 17 00:00:00 2001 From: Andy Fries Date: Sun, 9 Aug 2015 10:12:09 -0700 Subject: [PATCH 4/4] implemented Political Trickery --- .../mage/sets/mirage/PoliticalTrickery.java | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/mirage/PoliticalTrickery.java diff --git a/Mage.Sets/src/mage/sets/mirage/PoliticalTrickery.java b/Mage.Sets/src/mage/sets/mirage/PoliticalTrickery.java new file mode 100644 index 00000000000..75727938267 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/PoliticalTrickery.java @@ -0,0 +1,79 @@ +/* + * 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.mirage; + +import java.util.UUID; + +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.ExchangeControlTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.filter.common.FilterControlledLandPermanent; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.target.TargetPermanent; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author andyfries + */ +public class PoliticalTrickery extends CardImpl { + + private static final String rule = "exchange control of target land you control and target land an opponent controls"; + + private static final FilterLandPermanent filter = new FilterLandPermanent("land an opponent controls"); + + static { + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public PoliticalTrickery(UUID ownerId) { + super(ownerId, 81, "Political Trickery", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{U}"); + this.expansionSetCode = "MIR"; + + // Exchange control of target land you control and target land an opponent controls. + Effect effect = new ExchangeControlTargetEffect(Duration.EndOfGame, rule, false, true); + effect.setText("exchange control of target land you control and target land an opponent controls"); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetControlledPermanent(new FilterControlledLandPermanent())); + this.getSpellAbility().addTarget(new TargetPermanent(filter)); + } + + public PoliticalTrickery(final PoliticalTrickery card) { + super(card); + } + + @Override + public PoliticalTrickery copy() { + return new PoliticalTrickery(this); + } +}