From 6988688e6466d9774fdf8a0c4e10afd61e73a5dc Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Tue, 22 Aug 2017 21:00:04 -0400 Subject: [PATCH 1/7] Fixed Animal Magnetism putting card into hand instead of battlefield --- Mage.Sets/src/mage/cards/a/AnimalMagnetism.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Mage.Sets/src/mage/cards/a/AnimalMagnetism.java b/Mage.Sets/src/mage/cards/a/AnimalMagnetism.java index b8a7b3f690e..5a8201c11e4 100644 --- a/Mage.Sets/src/mage/cards/a/AnimalMagnetism.java +++ b/Mage.Sets/src/mage/cards/a/AnimalMagnetism.java @@ -90,9 +90,9 @@ class AnimalMagnetismEffect extends OneShotEffect { cards.addAll(controller.getLibrary().getTopCards(game, 5)); if (!cards.isEmpty()) { controller.revealCards(staticText, cards, game); - Card cardToHand; + Card cardToBattlefield; if (cards.size() == 1) { - cardToHand = cards.getRandom(game); + cardToBattlefield = cards.getRandom(game); } else { Player opponent; Set opponents = game.getOpponents(controller.getId()); @@ -105,11 +105,11 @@ class AnimalMagnetismEffect extends OneShotEffect { } TargetCard target = new TargetCard(1, Zone.LIBRARY, new FilterCreatureCard()); opponent.chooseTarget(outcome, cards, target, source, game); - cardToHand = game.getCard(target.getFirstTarget()); + cardToBattlefield = game.getCard(target.getFirstTarget()); } - if (cardToHand != null) { - controller.moveCards(cardToHand, Zone.HAND, source, game); - cards.remove(cardToHand); + if (cardToBattlefield != null) { + controller.moveCards(cardToBattlefield, Zone.BATTLEFIELD, source, game); + cards.remove(cardToBattlefield); } controller.moveCards(cards, Zone.GRAVEYARD, source, game); } From 12cedf945d8135ded9c06a4559607f93675a4b8b Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Tue, 22 Aug 2017 21:34:14 -0400 Subject: [PATCH 2/7] Fixed bug #3835, stolen creatures that exploit themselves now trigger for the appropriate player --- .../abilities/common/ExploitCreatureTriggeredAbility.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Mage/src/main/java/mage/abilities/common/ExploitCreatureTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/ExploitCreatureTriggeredAbility.java index c5e4f734f45..ab918463199 100644 --- a/Mage/src/main/java/mage/abilities/common/ExploitCreatureTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/ExploitCreatureTriggeredAbility.java @@ -63,7 +63,6 @@ public class ExploitCreatureTriggeredAbility extends TriggeredAbilityImpl { return new ExploitCreatureTriggeredAbility(this); } - @Override public boolean checkEventType(GameEvent event, Game game) { return event.getType() == GameEvent.EventType.EXPLOITED_CREATURE; @@ -74,7 +73,8 @@ public class ExploitCreatureTriggeredAbility extends TriggeredAbilityImpl { if (event.getTargetId().equals(getSourceId()) && event.getSourceId().equals(getSourceId())) { if (!this.hasSourceObjectAbility(game, source, event)) { return false; - } + } + this.setControllerId(event.getPlayerId()); return true; // if Exploits creature sacrifices itself, exploit triggers } return super.isInUseableZone(game, source, event); @@ -83,7 +83,7 @@ public class ExploitCreatureTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getSourceId().equals(getSourceId())) { - for (Effect effect: getEffects()) { + for (Effect effect : getEffects()) { if (setTargetPointer == SetTargetPointer.PERMANENT) { effect.setTargetPointer(new FixedTarget(event.getTargetId())); } @@ -98,4 +98,3 @@ public class ExploitCreatureTriggeredAbility extends TriggeredAbilityImpl { return "When {this} exploits a creature, " + super.getRule(); } } - From c61651da699a911171ae4eb65634e3b9f41bf45d Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Tue, 22 Aug 2017 21:44:14 -0400 Subject: [PATCH 3/7] Fixed bug #3777 --- Mage.Sets/src/mage/cards/t/ThunderousMight.java | 7 +++---- .../effects/common/continuous/BoostEnchantedEffect.java | 9 +++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Mage.Sets/src/mage/cards/t/ThunderousMight.java b/Mage.Sets/src/mage/cards/t/ThunderousMight.java index 7b78decae4a..31dd1b480ca 100644 --- a/Mage.Sets/src/mage/cards/t/ThunderousMight.java +++ b/Mage.Sets/src/mage/cards/t/ThunderousMight.java @@ -32,7 +32,6 @@ import mage.abilities.Ability; import mage.abilities.common.AttacksAttachedTriggeredAbility; import mage.abilities.dynamicvalue.common.DevotionCount; import mage.abilities.dynamicvalue.common.StaticValue; -import mage.abilities.effects.Effect; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.continuous.BoostEnchantedEffect; import mage.abilities.keyword.EnchantAbility; @@ -53,10 +52,9 @@ import mage.target.common.TargetCreaturePermanent; public class ThunderousMight extends CardImpl { public ThunderousMight(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}"); this.subtype.add("Aura"); - // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); @@ -65,8 +63,9 @@ public class ThunderousMight extends CardImpl { this.addAbility(ability); // Whenever enchanted creature attacks, it gets +X/+0 until end of turn, where X is your devotion to red. - Effect effect = new BoostEnchantedEffect(new DevotionCount(ColoredManaSymbol.R), new StaticValue(0), Duration.EndOfTurn); + BoostEnchantedEffect effect = new BoostEnchantedEffect(new DevotionCount(ColoredManaSymbol.R), new StaticValue(0), Duration.EndOfTurn); effect.setText("it gets +X/+0 until end of turn, where X is your devotion to red"); + effect.setLockedIn(true); this.addAbility(new AttacksAttachedTriggeredAbility(effect, AttachmentType.AURA, false)); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostEnchantedEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostEnchantedEffect.java index 41d5d5dda20..ffbaa136f68 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostEnchantedEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostEnchantedEffect.java @@ -47,6 +47,7 @@ public class BoostEnchantedEffect extends ContinuousEffectImpl { private DynamicValue power; private DynamicValue toughness; + private boolean lockedIn = false; public BoostEnchantedEffect(int power, int toughness) { this(power, toughness, Duration.WhileOnBattlefield); @@ -81,6 +82,10 @@ public class BoostEnchantedEffect extends ContinuousEffectImpl { @Override public void init(Ability source, Game game) { super.init(source, game); + if (lockedIn) { + power = new StaticValue(power.calculate(game, source, this)); + toughness = new StaticValue(toughness.calculate(game, source, this)); + } if (affectedObjectsSet) { // Added boosts of activated or triggered abilities exist independent from the source they are created by // so a continuous effect for the permanent itself with the attachment is created @@ -113,6 +118,10 @@ public class BoostEnchantedEffect extends ContinuousEffectImpl { return true; } + public void setLockedIn(boolean lockedIn) { + this.lockedIn = lockedIn; + } + private void setText() { StringBuilder sb = new StringBuilder(); sb.append("Enchanted creature gets "); From 22eca2f5cd231392032a9bdd87e04b699b076b8d Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Tue, 22 Aug 2017 21:56:34 -0400 Subject: [PATCH 4/7] Fixed bug #3871 --- Mage.Sets/src/mage/cards/v/VoltaicConstruct.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/cards/v/VoltaicConstruct.java b/Mage.Sets/src/mage/cards/v/VoltaicConstruct.java index 23185e59d8a..b4ec4133272 100644 --- a/Mage.Sets/src/mage/cards/v/VoltaicConstruct.java +++ b/Mage.Sets/src/mage/cards/v/VoltaicConstruct.java @@ -47,7 +47,7 @@ import mage.target.common.TargetCreaturePermanent; */ public class VoltaicConstruct extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("artifact"); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("artifact creature"); static { filter.add(new CardTypePredicate(CardType.ARTIFACT)); From d0744486adc3b986b493089b9fc716236d38dd16 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Wed, 23 Aug 2017 09:40:11 -0400 Subject: [PATCH 5/7] small change --- .../effects/common/continuous/BoostEnchantedEffect.java | 1 + 1 file changed, 1 insertion(+) diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostEnchantedEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostEnchantedEffect.java index ffbaa136f68..884cc61e3af 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostEnchantedEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostEnchantedEffect.java @@ -72,6 +72,7 @@ public class BoostEnchantedEffect extends ContinuousEffectImpl { super(effect); this.power = effect.power.copy(); this.toughness = effect.toughness.copy(); + this.lockedIn = effect.lockedIn; } @Override From c6029176d321be9fe744f53d0e4bbbd5d4ff6d0b Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Wed, 23 Aug 2017 10:52:58 -0400 Subject: [PATCH 6/7] Implemented Varchild's War Raiders --- .../src/mage/cards/v/VarchildsWarRiders.java | 128 ++++++++++++++++++ Mage.Sets/src/mage/sets/Alliances.java | 1 + Mage.Sets/src/mage/sets/MastersEdition.java | 1 + .../game/permanent/token/SurvivorToken.java | 48 +++++++ 4 files changed, 178 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/v/VarchildsWarRiders.java create mode 100644 Mage/src/main/java/mage/game/permanent/token/SurvivorToken.java diff --git a/Mage.Sets/src/mage/cards/v/VarchildsWarRiders.java b/Mage.Sets/src/mage/cards/v/VarchildsWarRiders.java new file mode 100644 index 00000000000..350e1805244 --- /dev/null +++ b/Mage.Sets/src/mage/cards/v/VarchildsWarRiders.java @@ -0,0 +1,128 @@ +/* + * 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.cards.v; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.costs.Cost; +import mage.abilities.costs.CostImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CreateTokenTargetEffect; +import mage.abilities.keyword.CumulativeUpkeepAbility; +import mage.abilities.keyword.RampageAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.filter.FilterOpponent; +import mage.game.Game; +import mage.game.permanent.token.SurvivorToken; +import mage.players.Player; +import mage.target.TargetPlayer; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author TheElk801 + */ +public class VarchildsWarRiders extends CardImpl { + + public VarchildsWarRiders(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}"); + + this.subtype.add("Human"); + this.subtype.add("Warrior"); + this.power = new MageInt(3); + this.toughness = new MageInt(4); + + // Cumulative upkeep-Put a 1/1 red Survivor creature token onto the battlefield under an opponent's control. + this.addAbility(new CumulativeUpkeepAbility(new OpponentCreateSurvivorTokenCost())); + + // Trample; rampage 1 + this.addAbility(TrampleAbility.getInstance()); + this.addAbility(new RampageAbility(1)); + } + + public VarchildsWarRiders(final VarchildsWarRiders card) { + super(card); + } + + @Override + public VarchildsWarRiders copy() { + return new VarchildsWarRiders(this); + } +} + +class OpponentCreateSurvivorTokenCost extends CostImpl { + + private static final FilterOpponent filter = new FilterOpponent(); + + public OpponentCreateSurvivorTokenCost() { + this.text = "have an opponent create a 1/1 red Survivor creature token"; + } + + public OpponentCreateSurvivorTokenCost(OpponentCreateSurvivorTokenCost cost) { + super(cost); + } + + @Override + public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { + Player controller = game.getPlayer(controllerId); + if (controller != null) { + if (!game.getOpponents(controllerId).isEmpty()) { + return true; + } + } + return false; + } + + @Override + public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana, Cost costToPay) { + Player controller = game.getPlayer(controllerId); + if (controller != null) { + TargetPlayer target = new TargetPlayer(1, 1, true, filter); + if (controller.chooseTarget(Outcome.Detriment, target, ability, game)) { + Player opponent = game.getPlayer(target.getFirstTarget()); + if (opponent != null) { + Effect effect = new CreateTokenTargetEffect(new SurvivorToken()); + effect.setTargetPointer(new FixedTarget(opponent.getId(), game)); + paid = effect.apply(game, ability); + } + } + } + return paid; + } + + @Override + public OpponentCreateSurvivorTokenCost copy() { + return new OpponentCreateSurvivorTokenCost(this); + } + +} diff --git a/Mage.Sets/src/mage/sets/Alliances.java b/Mage.Sets/src/mage/sets/Alliances.java index 12e7b0ef472..87f01b760fd 100644 --- a/Mage.Sets/src/mage/sets/Alliances.java +++ b/Mage.Sets/src/mage/sets/Alliances.java @@ -141,6 +141,7 @@ public class Alliances extends ExpansionSet { cards.add(new SetCardInfo("Thawing Glaciers", 189, Rarity.RARE, mage.cards.t.ThawingGlaciers.class)); cards.add(new SetCardInfo("Thought Lash", 58, Rarity.RARE, mage.cards.t.ThoughtLash.class)); cards.add(new SetCardInfo("Tornado", 86, Rarity.RARE, mage.cards.t.Tornado.class)); + cards.add(new SetCardInfo("Varchild's War-Riders", 122, Rarity.RARE, mage.cards.v.VarchildsWarRiders.class)); cards.add(new SetCardInfo("Viscerid Armor", 60, Rarity.COMMON, mage.cards.v.VisceridArmor.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Viscerid Armor", 61, Rarity.COMMON, mage.cards.v.VisceridArmor.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Wandering Mage", 198, Rarity.RARE, mage.cards.w.WanderingMage.class)); diff --git a/Mage.Sets/src/mage/sets/MastersEdition.java b/Mage.Sets/src/mage/sets/MastersEdition.java index a48ab68edd9..d049d73b113 100644 --- a/Mage.Sets/src/mage/sets/MastersEdition.java +++ b/Mage.Sets/src/mage/sets/MastersEdition.java @@ -229,6 +229,7 @@ public class MastersEdition extends ExpansionSet { cards.add(new SetCardInfo("Tornado", 136, Rarity.RARE, mage.cards.t.Tornado.class)); cards.add(new SetCardInfo("Urza's Bauble", 170, Rarity.UNCOMMON, mage.cards.u.UrzasBauble.class)); cards.add(new SetCardInfo("Urza's Chalice", 171, Rarity.COMMON, mage.cards.u.UrzasChalice.class)); + cards.add(new SetCardInfo("Varchild's War-Riders", 110, Rarity.RARE, mage.cards.v.VarchildsWarRiders.class)); cards.add(new SetCardInfo("Vesuvan Doppelganger", 54, Rarity.RARE, mage.cards.v.VesuvanDoppelganger.class)); cards.add(new SetCardInfo("Vodalian Knights", 55, Rarity.UNCOMMON, mage.cards.v.VodalianKnights.class)); cards.add(new SetCardInfo("Walking Wall", 172, Rarity.UNCOMMON, mage.cards.w.WalkingWall.class)); diff --git a/Mage/src/main/java/mage/game/permanent/token/SurvivorToken.java b/Mage/src/main/java/mage/game/permanent/token/SurvivorToken.java new file mode 100644 index 00000000000..886c2045bc1 --- /dev/null +++ b/Mage/src/main/java/mage/game/permanent/token/SurvivorToken.java @@ -0,0 +1,48 @@ +/* + * 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.game.permanent.token; + +import mage.MageInt; +import mage.constants.CardType; +import mage.constants.SubType; + +/** + * + * @author North + */ +public class SurvivorToken extends Token { + + public SurvivorToken() { + super("Survivor", "1/1 red Survivor creature token"); + cardType.add(CardType.CREATURE); + subtype.add(SubType.SURVIVOR); + color.setRed(true); + power = new MageInt(1); + toughness = new MageInt(1); + } +} From f1ba86f5522f1cd44fda84267d69256bfafb5e12 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Wed, 23 Aug 2017 12:14:21 -0400 Subject: [PATCH 7/7] fixed bug #3873 --- Mage.Sets/src/mage/cards/w/WarsToll.java | 40 ++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/Mage.Sets/src/mage/cards/w/WarsToll.java b/Mage.Sets/src/mage/cards/w/WarsToll.java index d34806a0a47..bc0ab5ac593 100644 --- a/Mage.Sets/src/mage/cards/w/WarsToll.java +++ b/Mage.Sets/src/mage/cards/w/WarsToll.java @@ -40,6 +40,7 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.SetTargetPointer; import mage.constants.TargetController; +import mage.filter.FilterPermanent; import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.permanent.ControllerIdPredicate; @@ -56,7 +57,6 @@ public class WarsToll extends CardImpl { private final static FilterCreaturePermanent filterOpponentCreature = new FilterCreaturePermanent("creature an opponent controls"); private final static FilterLandPermanent filterOpponentLand = new FilterLandPermanent("an opponent taps a land"); - static { filterOpponentCreature.add(new ControllerPredicate(TargetController.OPPONENT)); @@ -70,7 +70,7 @@ public class WarsToll extends CardImpl { Effect effect = new TapAllEffect(filterOpponentLand); effect.setText("tap all lands that player controls"); this.addAbility(new TapForManaAllTriggeredAbility(effect, filterOpponentLand, SetTargetPointer.PLAYER)); - + // If a creature an opponent controls attacks, all creatures that opponent controls attack if able. this.addAbility(new AttacksAllTriggeredAbility(new WarsTollEffect(), false, filterOpponentCreature, SetTargetPointer.PERMANENT, true)); @@ -86,6 +86,42 @@ public class WarsToll extends CardImpl { } } +class TapAlEffect extends OneShotEffect { + + protected FilterPermanent filter; + + public TapAlEffect(FilterPermanent filter) { + super(Outcome.Tap); + this.filter = filter; + setText(); + } + + public TapAlEffect(final TapAlEffect effect) { + super(effect); + this.filter = effect.filter.copy(); + } + + @Override + public TapAlEffect copy() { + return new TapAlEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { + if (permanent.getControllerId().equals(source.getFirstTarget())) { + permanent.tap(game); + } + } + return true; + } + + private void setText() { + staticText = "tap all " + filter.getMessage(); + } + +} + class WarsTollEffect extends OneShotEffect { private static final FilterCreaturePermanent filterOpponentCreatures = new FilterCreaturePermanent();