From 66bd5294e8332b1bb2a871ad1c25c316c3ef849c Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 17 Mar 2018 13:43:31 +0100 Subject: [PATCH] * Removed effect's ApplyEffectsAfter functionality. It's now always applied. --- .../src/mage/cards/a/AcrobaticManeuver.java | 3 +- Mage.Sets/src/mage/cards/a/ActOfTreason.java | 10 +++---- Mage.Sets/src/mage/cards/a/Ambuscade.java | 4 +-- .../src/mage/cards/b/BarrelDownSokenzan.java | 5 ++-- .../src/mage/cards/b/BragoKingEternal.java | 3 +- Mage.Sets/src/mage/cards/c/CauldronHaze.java | 9 +++--- .../mage/cards/c/ChargeAcrossTheAraba.java | 29 +++++++++---------- Mage.Sets/src/mage/cards/c/ClearShot.java | 1 - Mage.Sets/src/mage/cards/c/Cloudshift.java | 3 +- .../src/mage/cards/d/DromokasCommand.java | 2 -- .../src/mage/cards/e/EldraziDisplacer.java | 3 +- .../src/mage/cards/e/EpicConfrontation.java | 8 ++--- Mage.Sets/src/mage/cards/e/EssenceFlux.java | 6 ++-- .../src/mage/cards/f/FelidarGuardian.java | 1 - Mage.Sets/src/mage/cards/g/GrabTheReins.java | 14 ++++----- Mage.Sets/src/mage/cards/h/HuntTheHunter.java | 9 +++--- Mage.Sets/src/mage/cards/h/HuntTheWeak.java | 5 ++-- .../src/mage/cards/n/NissasJudgment.java | 3 +- .../src/mage/cards/p/PlowThroughReito.java | 7 ++--- Mage.Sets/src/mage/cards/s/SavagePunch.java | 6 ++-- Mage.Sets/src/mage/cards/s/SavageStomp.java | 1 - .../src/mage/cards/s/SinkIntoTakenuma.java | 5 ++-- .../src/mage/cards/s/StartYourEngines.java | 6 ++-- Mage.Sets/src/mage/cards/s/SwiftKick.java | 11 ++++--- Mage.Sets/src/mage/cards/s/SylvanLibrary.java | 2 +- Mage.Sets/src/mage/cards/t/TemurCharm.java | 18 +++++------- Mage.Sets/src/mage/cards/w/WildInstincts.java | 3 +- .../src/mage/cards/w/WispweaverAngel.java | 5 ++-- .../src/mage/cards/z/ZealousConscripts.java | 2 +- .../main/java/mage/abilities/AbilityImpl.java | 6 ++-- .../dynamicvalue/common/SweepNumber.java | 27 ++++------------- .../java/mage/abilities/effects/Effect.java | 4 --- .../mage/abilities/effects/EffectImpl.java | 14 --------- .../continuous/BoostControlledEffect.java | 9 +++--- .../effects/keyword/SweepEffect.java | 2 +- .../abilities/keyword/InspiredAbility.java | 8 ++--- 36 files changed, 92 insertions(+), 162 deletions(-) diff --git a/Mage.Sets/src/mage/cards/a/AcrobaticManeuver.java b/Mage.Sets/src/mage/cards/a/AcrobaticManeuver.java index 79d5c8820ce..dc93cd129d6 100644 --- a/Mage.Sets/src/mage/cards/a/AcrobaticManeuver.java +++ b/Mage.Sets/src/mage/cards/a/AcrobaticManeuver.java @@ -44,12 +44,11 @@ import mage.target.common.TargetControlledCreaturePermanent; public class AcrobaticManeuver extends CardImpl { public AcrobaticManeuver(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{W}"); // Exile target creature you control, then return that card to the battlefield under its owner's control. this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); Effect effect = new ExileTargetForSourceEffect(); - effect.setApplyEffectsAfter(); this.getSpellAbility().addEffect(effect); this.getSpellAbility().addEffect(new ReturnToBattlefieldUnderOwnerControlTargetEffect()); diff --git a/Mage.Sets/src/mage/cards/a/ActOfTreason.java b/Mage.Sets/src/mage/cards/a/ActOfTreason.java index bed4e24e0c3..d8285a01dcb 100644 --- a/Mage.Sets/src/mage/cards/a/ActOfTreason.java +++ b/Mage.Sets/src/mage/cards/a/ActOfTreason.java @@ -1,16 +1,16 @@ /* * 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 @@ -20,7 +20,7 @@ * 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. diff --git a/Mage.Sets/src/mage/cards/a/Ambuscade.java b/Mage.Sets/src/mage/cards/a/Ambuscade.java index dc4f37d9670..e97592cb703 100644 --- a/Mage.Sets/src/mage/cards/a/Ambuscade.java +++ b/Mage.Sets/src/mage/cards/a/Ambuscade.java @@ -52,14 +52,12 @@ public class Ambuscade extends CardImpl { static { filter.add(new ControllerPredicate(TargetController.NOT_YOU)); } - + public Ambuscade(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{G}"); - // Target creature you control gets +1/+0 until end of turn. Effect effect = new BoostTargetEffect(1, 0, Duration.EndOfTurn); - effect.setApplyEffectsAfter(); // needed to count the boost for the second effect this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); this.getSpellAbility().addEffect(effect); diff --git a/Mage.Sets/src/mage/cards/b/BarrelDownSokenzan.java b/Mage.Sets/src/mage/cards/b/BarrelDownSokenzan.java index 931cc8fe137..ae2f5fedbe3 100644 --- a/Mage.Sets/src/mage/cards/b/BarrelDownSokenzan.java +++ b/Mage.Sets/src/mage/cards/b/BarrelDownSokenzan.java @@ -46,13 +46,12 @@ import mage.target.common.TargetCreaturePermanent; public class BarrelDownSokenzan extends CardImpl { public BarrelDownSokenzan(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{R}"); this.subtype.add(SubType.ARCANE); - // Sweep - Return any number of Mountains you control to their owner's hand. Barrel Down Sokenzan deals damage to target creature equal to twice the number of Mountains returned this way. this.getSpellAbility().addEffect(new SweepEffect(SubType.MOUNTAIN)); - DynamicValue sweepValue = new MultipliedValue(new SweepNumber("Mountain", false), 2); + DynamicValue sweepValue = new MultipliedValue(new SweepNumber("Mountain"), 2); this.getSpellAbility().addEffect(new DamageTargetEffect(sweepValue)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); } diff --git a/Mage.Sets/src/mage/cards/b/BragoKingEternal.java b/Mage.Sets/src/mage/cards/b/BragoKingEternal.java index 91743d6bcf9..c69b88afc32 100644 --- a/Mage.Sets/src/mage/cards/b/BragoKingEternal.java +++ b/Mage.Sets/src/mage/cards/b/BragoKingEternal.java @@ -53,7 +53,7 @@ import mage.target.common.TargetControlledPermanent; public class BragoKingEternal extends CardImpl { public BragoKingEternal(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W}{U}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}{U}"); addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.SPIRIT); @@ -65,7 +65,6 @@ public class BragoKingEternal extends CardImpl { // When Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner's control. Effect effect = new ExileTargetEffect(this.getId(), this.getName(), Zone.BATTLEFIELD); effect.setText("exile any number of target nonland permanents you control"); - effect.setApplyEffectsAfter(); Ability ability = new DealsCombatDamageToAPlayerTriggeredAbility(effect, false); FilterControlledPermanent filterControlledNonlandPermanent = new FilterControlledPermanent(); filterControlledNonlandPermanent.add(Predicates.not(new CardTypePredicate(CardType.LAND))); diff --git a/Mage.Sets/src/mage/cards/c/CauldronHaze.java b/Mage.Sets/src/mage/cards/c/CauldronHaze.java index 7f3fbe6ed50..6521ec0c8c2 100644 --- a/Mage.Sets/src/mage/cards/c/CauldronHaze.java +++ b/Mage.Sets/src/mage/cards/c/CauldronHaze.java @@ -41,17 +41,16 @@ import mage.target.common.TargetCreaturePermanent; * @author jeffwadsworth */ public class CauldronHaze extends CardImpl { - - private String rule = "Choose any number of target creatures. Each of those creatures gains persist until end of turn"; + + private final String rule = "Choose any number of target creatures. Each of those creatures gains persist until end of turn"; public CauldronHaze(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{W/B}"); - + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{W/B}"); // Choose any number of target creatures. Each of those creatures gains persist until end of turn. this.getSpellAbility().addEffect(new GainAbilityTargetEffect(new PersistAbility(), Duration.EndOfTurn, rule)); this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, Integer.MAX_VALUE)); - + } public CauldronHaze(final CauldronHaze card) { diff --git a/Mage.Sets/src/mage/cards/c/ChargeAcrossTheAraba.java b/Mage.Sets/src/mage/cards/c/ChargeAcrossTheAraba.java index 9cbb73c1995..d7467b824a4 100644 --- a/Mage.Sets/src/mage/cards/c/ChargeAcrossTheAraba.java +++ b/Mage.Sets/src/mage/cards/c/ChargeAcrossTheAraba.java @@ -1,4 +1,4 @@ - /* +/* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are @@ -27,16 +27,16 @@ */ package mage.cards.c; - import java.util.UUID; - import mage.abilities.dynamicvalue.DynamicValue; - import mage.abilities.dynamicvalue.common.SweepNumber; - import mage.abilities.effects.common.continuous.BoostControlledEffect; - import mage.abilities.effects.keyword.SweepEffect; - import mage.cards.CardImpl; - import mage.cards.CardSetInfo; - import mage.constants.CardType; - import mage.constants.Duration; - import mage.constants.SubType; +import java.util.UUID; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.SweepNumber; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.abilities.effects.keyword.SweepEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SubType; /** * @@ -45,14 +45,13 @@ package mage.cards.c; public class ChargeAcrossTheAraba extends CardImpl { public ChargeAcrossTheAraba(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{4}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{4}{W}"); this.subtype.add(SubType.ARCANE); - // Sweep - Return any number of Plains you control to their owner's hand. Creatures you control get +1/+1 until end of turn for each Plains returned this way. this.getSpellAbility().addEffect(new SweepEffect(SubType.PLAINS)); - DynamicValue sweepValue = new SweepNumber("Plains", true); - this.getSpellAbility().addEffect(new BoostControlledEffect(sweepValue, sweepValue, Duration.EndOfTurn)); + DynamicValue sweepValue = new SweepNumber("Plains"); + this.getSpellAbility().addEffect(new BoostControlledEffect(sweepValue, sweepValue, Duration.EndOfTurn, null, false, true)); } diff --git a/Mage.Sets/src/mage/cards/c/ClearShot.java b/Mage.Sets/src/mage/cards/c/ClearShot.java index cab3685ca7a..65597c5b025 100644 --- a/Mage.Sets/src/mage/cards/c/ClearShot.java +++ b/Mage.Sets/src/mage/cards/c/ClearShot.java @@ -58,7 +58,6 @@ public class ClearShot extends CardImpl { // Target creature you control gets +1/+1 until end of turn. Effect effect = new BoostTargetEffect(1, 1, Duration.EndOfTurn); - effect.setApplyEffectsAfter(); // needed to count the boost for the second effect this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); this.getSpellAbility().addEffect(effect); diff --git a/Mage.Sets/src/mage/cards/c/Cloudshift.java b/Mage.Sets/src/mage/cards/c/Cloudshift.java index b1119bd4b9a..5f6941023f7 100644 --- a/Mage.Sets/src/mage/cards/c/Cloudshift.java +++ b/Mage.Sets/src/mage/cards/c/Cloudshift.java @@ -43,12 +43,11 @@ import mage.target.common.TargetControlledCreaturePermanent; public class Cloudshift extends CardImpl { public Cloudshift(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{W}"); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{W}"); // Exile target creature you control, then return that card to the battlefield under your control. this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); Effect effect = new ExileTargetForSourceEffect(); - effect.setApplyEffectsAfter(); this.getSpellAbility().addEffect(effect); this.getSpellAbility().addEffect(new ReturnToBattlefieldUnderYourControlTargetEffect(true)); } diff --git a/Mage.Sets/src/mage/cards/d/DromokasCommand.java b/Mage.Sets/src/mage/cards/d/DromokasCommand.java index 51bb89c387e..f825b0d34c0 100644 --- a/Mage.Sets/src/mage/cards/d/DromokasCommand.java +++ b/Mage.Sets/src/mage/cards/d/DromokasCommand.java @@ -78,7 +78,6 @@ public class DromokasCommand extends CardImpl { Mode mode = new Mode(); Effect effect = new SacrificeEffect(filterEnchantment, 1, "target player"); effect.setText("Target player sacrifices an enchantment"); - effect.setApplyEffectsAfter(); // so P/T chnaging effects take place before the fighting effect is applied mode.getEffects().add(effect); mode.getTargets().add(new TargetPlayer()); this.getSpellAbility().getModes().addMode(mode); @@ -87,7 +86,6 @@ public class DromokasCommand extends CardImpl { mode = new Mode(); effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance()); effect.setText("Put a +1/+1 counter on target creature"); - effect.setApplyEffectsAfter(); // so the counter is taken into account if the target is also used in mode 4 mode.getEffects().add(effect); mode.getTargets().add(new TargetCreaturePermanent(filterCreature)); this.getSpellAbility().getModes().addMode(mode); diff --git a/Mage.Sets/src/mage/cards/e/EldraziDisplacer.java b/Mage.Sets/src/mage/cards/e/EldraziDisplacer.java index ceaa7cfbf9b..1252e16a38a 100644 --- a/Mage.Sets/src/mage/cards/e/EldraziDisplacer.java +++ b/Mage.Sets/src/mage/cards/e/EldraziDisplacer.java @@ -58,7 +58,7 @@ public class EldraziDisplacer extends CardImpl { } public EldraziDisplacer(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}"); this.subtype.add(SubType.ELDRAZI); this.power = new MageInt(3); this.toughness = new MageInt(3); @@ -69,7 +69,6 @@ public class EldraziDisplacer extends CardImpl { // {2}{C}: Exile another target creature, then return it to the battlefield tapped under its owner's control. Effect effect = new ExileTargetForSourceEffect(); effect.setText("Exile another target creature"); - effect.setApplyEffectsAfter(); // Needed to let temporary continuous effects end if a permanent is blinked Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl<>("{2}{C}")); effect = new ReturnToBattlefieldUnderOwnerControlTargetEffect(true); effect.setText(", then return it to the battlefield tapped under its owner's control"); diff --git a/Mage.Sets/src/mage/cards/e/EpicConfrontation.java b/Mage.Sets/src/mage/cards/e/EpicConfrontation.java index 30f6f9e8842..8fa809a30e1 100644 --- a/Mage.Sets/src/mage/cards/e/EpicConfrontation.java +++ b/Mage.Sets/src/mage/cards/e/EpicConfrontation.java @@ -47,6 +47,7 @@ import mage.target.common.TargetCreaturePermanent; * @author fireshoes */ public class EpicConfrontation extends CardImpl { + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control"); static { @@ -54,18 +55,17 @@ public class EpicConfrontation extends CardImpl { } public EpicConfrontation(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{G}"); // Target creature you control gets +1/+2 until end of turn. It fights target creature you don't control. - Effect effect = new BoostTargetEffect(1,2,Duration.EndOfTurn); - effect.setApplyEffectsAfter(); + Effect effect = new BoostTargetEffect(1, 2, Duration.EndOfTurn); this.getSpellAbility().addEffect(effect); effect = new FightTargetsEffect(); effect.setText("It fights target creature you don't control"); this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); Target target = new TargetCreaturePermanent(filter); - this.getSpellAbility().addTarget(target); + this.getSpellAbility().addTarget(target); } public EpicConfrontation(final EpicConfrontation card) { diff --git a/Mage.Sets/src/mage/cards/e/EssenceFlux.java b/Mage.Sets/src/mage/cards/e/EssenceFlux.java index 2c7a534e996..d96176c17bd 100644 --- a/Mage.Sets/src/mage/cards/e/EssenceFlux.java +++ b/Mage.Sets/src/mage/cards/e/EssenceFlux.java @@ -54,12 +54,11 @@ import mage.util.CardUtil; public class EssenceFlux extends CardImpl { public EssenceFlux(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{U}"); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{U}"); // Exile target creature you control, then return that card to the battlefield under its owner's control. If it's a Spirit, put a +1/+1 counter on it. this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); Effect effect = new ExileTargetForSourceEffect(); - effect.setApplyEffectsAfter(); this.getSpellAbility().addEffect(effect); this.getSpellAbility().addEffect(new EssenceFluxEffect()); } @@ -102,8 +101,7 @@ class EssenceFluxEffect extends OneShotEffect { for (UUID targetId : this.getTargetPointer().getTargets(game, source)) { if (exileZone.contains(targetId)) { cardsToBattlefield.add(targetId); - } - else { + } else { Card card = game.getCard(targetId); if (card != null && card instanceof MeldCard) { MeldCard meldCard = (MeldCard) card; diff --git a/Mage.Sets/src/mage/cards/f/FelidarGuardian.java b/Mage.Sets/src/mage/cards/f/FelidarGuardian.java index c7acc317d93..020fb9748c5 100644 --- a/Mage.Sets/src/mage/cards/f/FelidarGuardian.java +++ b/Mage.Sets/src/mage/cards/f/FelidarGuardian.java @@ -64,7 +64,6 @@ public class FelidarGuardian extends CardImpl { // When Felidar Guardian enters the battlefield, you may exile another target permanent you control, then return that card to the battlefield under its owner's control. Effect effect = new ExileTargetForSourceEffect(); - effect.setApplyEffectsAfter(); Ability ability = new EntersBattlefieldTriggeredAbility(effect, true); ability.addEffect(new ReturnToBattlefieldUnderOwnerControlTargetEffect()); ability.addTarget(new TargetControlledPermanent(filter)); diff --git a/Mage.Sets/src/mage/cards/g/GrabTheReins.java b/Mage.Sets/src/mage/cards/g/GrabTheReins.java index 5782572e465..0a0e42f590d 100644 --- a/Mage.Sets/src/mage/cards/g/GrabTheReins.java +++ b/Mage.Sets/src/mage/cards/g/GrabTheReins.java @@ -51,12 +51,12 @@ import mage.target.common.TargetCreaturePermanent; /** * * @author LoneFox - + * */ public class GrabTheReins extends CardImpl { public GrabTheReins(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{3}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{R}"); // Choose one - this.getSpellAbility().getModes().setMinModes(1); @@ -64,7 +64,6 @@ public class GrabTheReins extends CardImpl { // Until end of turn, you gain control of target creature and it gains haste; Effect effect = new GainControlTargetEffect(Duration.EndOfTurn); effect.setText("Until end of turn, you gain control of target creature"); - effect.setApplyEffectsAfter(); this.getSpellAbility().addEffect(effect); effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn); effect.setText("and it gains haste"); @@ -111,15 +110,15 @@ class GrabTheReinsEffect extends OneShotEffect { Target target = new TargetCreaturePermanent(); target.setNotTarget(true); target.setTargetName("a creature to sacrifice"); - if(!target.canChoose(source.getSourceId(), controllerId, game)) { + if (!target.canChoose(source.getSourceId(), controllerId, game)) { return false; } Player player = game.getPlayer(controllerId); - if(player != null) { + if (player != null) { player.chooseTarget(Outcome.Sacrifice, target, source, game); Permanent creatureToSacrifice = game.getPermanent(target.getTargets().get(0)); int amount = creatureToSacrifice.getPower().getValue(); - if(!creatureToSacrifice.sacrifice(creatureToSacrifice.getId(), game)) { + if (!creatureToSacrifice.sacrifice(creatureToSacrifice.getId(), game)) { return false; } if (amount > 0) { @@ -133,8 +132,7 @@ class GrabTheReinsEffect extends OneShotEffect { player.damage(amount, source.getSourceId(), game, false, true); return true; } - } - else { + } else { return true; } } diff --git a/Mage.Sets/src/mage/cards/h/HuntTheHunter.java b/Mage.Sets/src/mage/cards/h/HuntTheHunter.java index 9c35eb5c08d..9a2dc29460f 100644 --- a/Mage.Sets/src/mage/cards/h/HuntTheHunter.java +++ b/Mage.Sets/src/mage/cards/h/HuntTheHunter.java @@ -53,6 +53,7 @@ public class HuntTheHunter extends CardImpl { private static final FilterControlledCreaturePermanent filterControlledGreen = new FilterControlledCreaturePermanent("green creature you control"); private static final FilterCreaturePermanent filterOpponentGreen = new FilterCreaturePermanent("green creature an opponent controls"); + static { filterControlledGreen.add(new ColorPredicate(ObjectColor.GREEN)); filterOpponentGreen.add(new ControllerPredicate(TargetController.OPPONENT)); @@ -60,14 +61,12 @@ public class HuntTheHunter extends CardImpl { } public HuntTheHunter(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{G}"); - + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{G}"); // Target green creature you control gets +2/+2 until end of turn. It fights target green creature an opponent controls. - Effect effect = new BoostTargetEffect(2,2, Duration.EndOfTurn); - effect.setApplyEffectsAfter(); + Effect effect = new BoostTargetEffect(2, 2, Duration.EndOfTurn); this.getSpellAbility().addEffect(effect); - this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent(1,1,filterControlledGreen, false)); + this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent(1, 1, filterControlledGreen, false)); effect = new FightTargetsEffect(); effect.setText("It fights target green creature an opponent controls"); diff --git a/Mage.Sets/src/mage/cards/h/HuntTheWeak.java b/Mage.Sets/src/mage/cards/h/HuntTheWeak.java index 4b026e2b9e6..4670631262e 100644 --- a/Mage.Sets/src/mage/cards/h/HuntTheWeak.java +++ b/Mage.Sets/src/mage/cards/h/HuntTheWeak.java @@ -49,17 +49,16 @@ import mage.target.common.TargetCreaturePermanent; public class HuntTheWeak extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control"); + static { filter.add(new ControllerPredicate(TargetController.NOT_YOU)); } public HuntTheWeak(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{G}"); - + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{G}"); // Put a +1/+1 counter on target creature you control. Then that creature fights target creature you don't control. Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance()); - effect.setApplyEffectsAfter(); this.getSpellAbility().addEffect(effect); effect = new FightTargetsEffect(); effect.setText("Then that creature fights target creature you don't control"); diff --git a/Mage.Sets/src/mage/cards/n/NissasJudgment.java b/Mage.Sets/src/mage/cards/n/NissasJudgment.java index e2c2e3b44cc..f0c9807ad18 100644 --- a/Mage.Sets/src/mage/cards/n/NissasJudgment.java +++ b/Mage.Sets/src/mage/cards/n/NissasJudgment.java @@ -60,11 +60,10 @@ public class NissasJudgment extends CardImpl { } public NissasJudgment(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{4}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{G}"); // Support 2. Effect effect = new SupportEffect(this, 2, false); - effect.setApplyEffectsAfter(); getSpellAbility().addEffect(effect); // Choose up to one target creature an opponent controls. Each creature you control with a +1/+1 counter on it deals damage equal to its power to that creature. diff --git a/Mage.Sets/src/mage/cards/p/PlowThroughReito.java b/Mage.Sets/src/mage/cards/p/PlowThroughReito.java index 1b573a46561..24edcbcd25a 100644 --- a/Mage.Sets/src/mage/cards/p/PlowThroughReito.java +++ b/Mage.Sets/src/mage/cards/p/PlowThroughReito.java @@ -46,14 +46,13 @@ import mage.target.common.TargetCreaturePermanent; public class PlowThroughReito extends CardImpl { public PlowThroughReito(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{W}"); this.subtype.add(SubType.ARCANE); - // Sweep - Return any number of Plains you control to their owner's hand. Target creature gets +1/+1 until end of turn for each Plains returned this way. this.getSpellAbility().addEffect(new SweepEffect(SubType.PLAINS)); - DynamicValue sweepValue = new SweepNumber("Plains", true); - this.getSpellAbility().addEffect(new BoostTargetEffect(sweepValue, sweepValue, Duration.EndOfTurn)); + DynamicValue sweepValue = new SweepNumber("Plains"); + this.getSpellAbility().addEffect(new BoostTargetEffect(sweepValue, sweepValue, Duration.EndOfTurn, true)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); } diff --git a/Mage.Sets/src/mage/cards/s/SavagePunch.java b/Mage.Sets/src/mage/cards/s/SavagePunch.java index 9599a521e56..486b48dcf87 100644 --- a/Mage.Sets/src/mage/cards/s/SavagePunch.java +++ b/Mage.Sets/src/mage/cards/s/SavagePunch.java @@ -45,7 +45,6 @@ import mage.target.Target; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreaturePermanent; - /** * * @author LevelX2 @@ -59,14 +58,13 @@ public class SavagePunch extends CardImpl { } public SavagePunch(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{G}"); // Ferocious - The creature you control gets +2/+2 until end of turn before it fights if you control a creature with power 4 or greater. Effect effect = new ConditionalContinuousEffect( - new BoostTargetEffect(2,2,Duration.EndOfTurn), + new BoostTargetEffect(2, 2, Duration.EndOfTurn), new LockedInCondition(FerociousCondition.instance), "Ferocious — The creature you control gets +2/+2 until end of turn before it fights if you control a creature with power 4 or greater"); - effect.setApplyEffectsAfter(); this.getSpellAbility().addEffect(effect); // Target creature you control fights target creature you don't control. diff --git a/Mage.Sets/src/mage/cards/s/SavageStomp.java b/Mage.Sets/src/mage/cards/s/SavageStomp.java index 96c8084d4c5..50890212100 100644 --- a/Mage.Sets/src/mage/cards/s/SavageStomp.java +++ b/Mage.Sets/src/mage/cards/s/SavageStomp.java @@ -75,7 +75,6 @@ public class SavageStomp extends CardImpl { // Put a +1/+1 counter on target creature you control. Then that creature fights target creature you don't control. Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance()); - effect.setApplyEffectsAfter(); this.getSpellAbility().addEffect(effect); effect = new FightTargetsEffect(); effect.setText("Then that creature fights target creature you don't control"); diff --git a/Mage.Sets/src/mage/cards/s/SinkIntoTakenuma.java b/Mage.Sets/src/mage/cards/s/SinkIntoTakenuma.java index f4691dd9c67..99e5c2edb8d 100644 --- a/Mage.Sets/src/mage/cards/s/SinkIntoTakenuma.java +++ b/Mage.Sets/src/mage/cards/s/SinkIntoTakenuma.java @@ -45,13 +45,12 @@ import mage.target.TargetPlayer; public class SinkIntoTakenuma extends CardImpl { public SinkIntoTakenuma(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{B}"); this.subtype.add(SubType.ARCANE); - // Sweep - Return any number of Swamps you control to their owner's hand. Target player discards a card for each Swamp returned this way. this.getSpellAbility().addEffect(new SweepEffect(SubType.SWAMP)); - DynamicValue sweepValue = new SweepNumber("Swamp", false); + DynamicValue sweepValue = new SweepNumber("Swamp"); this.getSpellAbility().addEffect(new DiscardTargetEffect(sweepValue)); this.getSpellAbility().addTarget(new TargetPlayer()); } diff --git a/Mage.Sets/src/mage/cards/s/StartYourEngines.java b/Mage.Sets/src/mage/cards/s/StartYourEngines.java index 4cc5a1ad2eb..c4e0b086579 100644 --- a/Mage.Sets/src/mage/cards/s/StartYourEngines.java +++ b/Mage.Sets/src/mage/cards/s/StartYourEngines.java @@ -27,6 +27,7 @@ */ package mage.cards.s; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.Effect; @@ -37,8 +38,6 @@ import mage.constants.*; import mage.game.Game; import mage.game.permanent.Permanent; -import java.util.UUID; - /** * * @author LevelX2 @@ -46,11 +45,10 @@ import java.util.UUID; public class StartYourEngines extends CardImpl { public StartYourEngines(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{R}"); // Vehicles you control becomes artifact creatures until end of turn. Effect effect = new StartYourEnginesEffect(); - effect.setApplyEffectsAfter(); // needed to recognize vehicle as creatures by the next effect this.getSpellAbility().addEffect(effect); // Creatures you control get +2/+0 until end of turn. diff --git a/Mage.Sets/src/mage/cards/s/SwiftKick.java b/Mage.Sets/src/mage/cards/s/SwiftKick.java index c34d8f1e9f7..f83098c618c 100644 --- a/Mage.Sets/src/mage/cards/s/SwiftKick.java +++ b/Mage.Sets/src/mage/cards/s/SwiftKick.java @@ -49,23 +49,22 @@ import mage.target.common.TargetCreaturePermanent; public class SwiftKick extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control"); + static { filter.add(new ControllerPredicate(TargetController.NOT_YOU)); } public SwiftKick(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{3}{R}"); - + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{R}"); // Target creature you control gets +1/+0 until end of turn. It fights target creature you don't control. - Effect effect = new BoostTargetEffect(1,0,Duration.EndOfTurn); - effect.setApplyEffectsAfter(); + Effect effect = new BoostTargetEffect(1, 0, Duration.EndOfTurn); this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); - + effect = new FightTargetsEffect(); effect.setText("It fights target creature you don't control"); - this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addEffect(effect); Target target = new TargetCreaturePermanent(filter); this.getSpellAbility().addTarget(target); diff --git a/Mage.Sets/src/mage/cards/s/SylvanLibrary.java b/Mage.Sets/src/mage/cards/s/SylvanLibrary.java index c0acfd38018..27106b90094 100644 --- a/Mage.Sets/src/mage/cards/s/SylvanLibrary.java +++ b/Mage.Sets/src/mage/cards/s/SylvanLibrary.java @@ -132,7 +132,7 @@ class SylvanLibraryEffect extends OneShotEffect { } } } - controller.putCardsOnTopOfLibrary(cardsPutBack, game, source, applyEffectsAfter); + controller.putCardsOnTopOfLibrary(cardsPutBack, game, source, false); } } return true; diff --git a/Mage.Sets/src/mage/cards/t/TemurCharm.java b/Mage.Sets/src/mage/cards/t/TemurCharm.java index 88a27cfcde4..cf9306775a3 100644 --- a/Mage.Sets/src/mage/cards/t/TemurCharm.java +++ b/Mage.Sets/src/mage/cards/t/TemurCharm.java @@ -57,39 +57,37 @@ public class TemurCharm extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control"); private static final FilterCreaturePermanent filterCantBlock = new FilterCreaturePermanent("Creatures with power 3 or less"); - + static { filter.add(new ControllerPredicate(TargetController.NOT_YOU)); filterCantBlock.add(new PowerPredicate(ComparisonType.FEWER_THAN, 4)); } - - public TemurCharm(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{G}{U}{R}"); + public TemurCharm(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{G}{U}{R}"); // Choose one - // Target creature you control gets +1/+1 until end of turn. That creature fights target creature you don't control. - Effect effect = new BoostTargetEffect(1,1,Duration.EndOfTurn); - effect.setApplyEffectsAfter(); + Effect effect = new BoostTargetEffect(1, 1, Duration.EndOfTurn); this.getSpellAbility().addEffect(effect); effect = new FightTargetsEffect(); effect.setText("That creature fights target creature you don't control"); this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); Target target = new TargetCreaturePermanent(filter); - this.getSpellAbility().addTarget(target); - + this.getSpellAbility().addTarget(target); + // Counter target spell unless its controller pays {3}. Mode mode = new Mode(); mode.getEffects().add(new CounterUnlessPaysEffect(new GenericManaCost(3))); mode.getTargets().add(new TargetSpell()); this.getSpellAbility().addMode(mode); - + // Creatures with power 3 or less can't block this turn. mode = new Mode(); mode.getEffects().add(new CantBlockAllEffect(filterCantBlock, Duration.EndOfTurn)); this.getSpellAbility().addMode(mode); - + } public TemurCharm(final TemurCharm card) { diff --git a/Mage.Sets/src/mage/cards/w/WildInstincts.java b/Mage.Sets/src/mage/cards/w/WildInstincts.java index 845c74b808e..0dea866d011 100644 --- a/Mage.Sets/src/mage/cards/w/WildInstincts.java +++ b/Mage.Sets/src/mage/cards/w/WildInstincts.java @@ -54,11 +54,10 @@ public class WildInstincts extends CardImpl { } public WildInstincts(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{G}"); // Target creature you control gets +2/+2 until end of turn. It fights target creature an opponent controls. Effect effect = new BoostTargetEffect(2, 2, Duration.EndOfTurn); - effect.setApplyEffectsAfter(); getSpellAbility().addEffect(effect); getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); effect = new FightTargetsEffect(); diff --git a/Mage.Sets/src/mage/cards/w/WispweaverAngel.java b/Mage.Sets/src/mage/cards/w/WispweaverAngel.java index 21c0c3db4f3..7adfdf9fa97 100644 --- a/Mage.Sets/src/mage/cards/w/WispweaverAngel.java +++ b/Mage.Sets/src/mage/cards/w/WispweaverAngel.java @@ -42,8 +42,8 @@ import mage.cards.Cards; import mage.cards.CardsImpl; import mage.cards.MeldCard; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Outcome; +import mage.constants.SubType; import mage.constants.Zone; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.permanent.AnotherPredicate; @@ -66,7 +66,7 @@ public class WispweaverAngel extends CardImpl { } public WispweaverAngel(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{W}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{W}{W}"); this.subtype.add(SubType.ANGEL); this.power = new MageInt(4); this.toughness = new MageInt(4); @@ -76,7 +76,6 @@ public class WispweaverAngel extends CardImpl { // When Wispweaver Angel enters the battlefield, you may exile another target creature you control, then return that card to the battlefield under its owner's control. Effect effect = new ExileTargetForSourceEffect(); - effect.setApplyEffectsAfter(); Ability ability = new EntersBattlefieldTriggeredAbility(effect, true); ability.addTarget(new TargetControlledCreaturePermanent(1, 1, filter, false)); ability.addEffect(new WispweaverAngelEffect()); diff --git a/Mage.Sets/src/mage/cards/z/ZealousConscripts.java b/Mage.Sets/src/mage/cards/z/ZealousConscripts.java index 4b8ef517ddc..ffb48ffb74d 100644 --- a/Mage.Sets/src/mage/cards/z/ZealousConscripts.java +++ b/Mage.Sets/src/mage/cards/z/ZealousConscripts.java @@ -49,7 +49,7 @@ import mage.target.TargetPermanent; public class ZealousConscripts extends CardImpl { public ZealousConscripts(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{R}"); this.subtype.add(SubType.HUMAN, SubType.WARRIOR); this.power = new MageInt(3); diff --git a/Mage/src/main/java/mage/abilities/AbilityImpl.java b/Mage/src/main/java/mage/abilities/AbilityImpl.java index 25528d242b6..0a4d9588731 100644 --- a/Mage/src/main/java/mage/abilities/AbilityImpl.java +++ b/Mage/src/main/java/mage/abilities/AbilityImpl.java @@ -220,10 +220,8 @@ public abstract class AbilityImpl implements Ability { * too late Example: * {@link org.mage.test.cards.replacement.DryadMilitantTest#testDiesByDestroy testDiesByDestroy} */ - if (effect.applyEffectsAfter()) { - game.applyEffects(); - game.getState().getTriggers().checkStateTriggers(game); - } + game.applyEffects(); + game.getState().getTriggers().checkStateTriggers(game); } } return result; diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/SweepNumber.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/SweepNumber.java index 815988f7844..6aebb054ed2 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/SweepNumber.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/SweepNumber.java @@ -30,7 +30,6 @@ package mage.abilities.dynamicvalue.common; import mage.abilities.Ability; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.Effect; -import mage.cards.Card; import mage.game.Game; /** @@ -39,37 +38,21 @@ import mage.game.Game; */ public class SweepNumber implements DynamicValue { - private int zoneChangeCounter = 0; private final String sweepSubtype; - private final boolean previousZone; - public SweepNumber(String sweepSubtype, boolean previousZone) { + public SweepNumber(String sweepSubtype) { this.sweepSubtype = sweepSubtype; - this.previousZone = previousZone; } @Override public int calculate(Game game, Ability source, Effect effect) { - if (zoneChangeCounter == 0) { - Card card = game.getCard(source.getSourceId()); - if (card != null) { - zoneChangeCounter = card.getZoneChangeCounter(game); - if (previousZone) { - zoneChangeCounter--; - } - } - } - int number = 0; - Integer sweepNumber = (Integer) game.getState().getValue(new StringBuilder("sweep").append(source.getSourceId()).append(zoneChangeCounter).toString()); - if (sweepNumber != null) { - number = sweepNumber; - } - return number; + Integer sweepNumber = (Integer) game.getState().getValue("sweep" + source.getSourceId() + game.getState().getZoneChangeCounter(source.getSourceId())); + return sweepNumber != null ? sweepNumber : 0; } @Override public SweepNumber copy() { - return new SweepNumber(sweepSubtype, previousZone); + return new SweepNumber(sweepSubtype); } @Override @@ -79,6 +62,6 @@ public class SweepNumber implements DynamicValue { @Override public String getMessage() { - return new StringBuilder("the number of ").append(sweepSubtype).append(sweepSubtype.endsWith("s") ? "":"s").append(" returned this way").toString(); + return "the number of " + sweepSubtype + (sweepSubtype.endsWith("s") ? "" : "s") + " returned this way"; } } diff --git a/Mage/src/main/java/mage/abilities/effects/Effect.java b/Mage/src/main/java/mage/abilities/effects/Effect.java index cc7d51c7b34..2042446cf3b 100644 --- a/Mage/src/main/java/mage/abilities/effects/Effect.java +++ b/Mage/src/main/java/mage/abilities/effects/Effect.java @@ -88,10 +88,6 @@ public interface Effect extends Serializable { Object getValue(String key); - void setApplyEffectsAfter(); - - boolean applyEffectsAfter(); - Effect copy(); } diff --git a/Mage/src/main/java/mage/abilities/effects/EffectImpl.java b/Mage/src/main/java/mage/abilities/effects/EffectImpl.java index ccc7f08f3d8..873111014ea 100644 --- a/Mage/src/main/java/mage/abilities/effects/EffectImpl.java +++ b/Mage/src/main/java/mage/abilities/effects/EffectImpl.java @@ -138,18 +138,4 @@ public abstract class EffectImpl implements Effect { } return values.get(key); } - - /** - * If set, the game.applyEffects() method will be called to apply the - * effects before the next effect (of the same ability) will resolve. - */ - @Override - public void setApplyEffectsAfter() { - applyEffectsAfter = true; - } - - @Override - public boolean applyEffectsAfter() { - return applyEffectsAfter; - } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostControlledEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostControlledEffect.java index 7a743e6f5e8..f6059d89d8b 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostControlledEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BoostControlledEffect.java @@ -37,6 +37,7 @@ import mage.constants.Duration; import mage.constants.Layer; import mage.constants.Outcome; import mage.constants.SubLayer; +import mage.filter.StaticFilters; import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.game.permanent.Permanent; @@ -54,15 +55,15 @@ public class BoostControlledEffect extends ContinuousEffectImpl { protected boolean lockedIn = false; public BoostControlledEffect(int power, int toughness, Duration duration) { - this(power, toughness, duration, new FilterCreaturePermanent("creatures"), false); + this(power, toughness, duration, StaticFilters.FILTER_PERMANENT_CREATURES, false); } public BoostControlledEffect(DynamicValue power, DynamicValue toughness, Duration duration) { - this(power, toughness, duration, new FilterCreaturePermanent("creatures"), false); + this(power, toughness, duration, StaticFilters.FILTER_PERMANENT_CREATURES, false); } public BoostControlledEffect(int power, int toughness, Duration duration, boolean excludeSource) { - this(power, toughness, duration, new FilterCreaturePermanent("creatures"), excludeSource); + this(power, toughness, duration, StaticFilters.FILTER_PERMANENT_CREATURES, excludeSource); } public BoostControlledEffect(int power, int toughness, Duration duration, FilterCreaturePermanent filter) { @@ -91,7 +92,7 @@ public class BoostControlledEffect extends ContinuousEffectImpl { super(duration, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.BoostCreature); this.power = power; this.toughness = toughness; - this.filter = filter; + this.filter = (filter == null ? StaticFilters.FILTER_PERMANENT_CREATURES : filter); this.excludeSource = excludeSource; this.lockedIn = lockedIn; setText(); diff --git a/Mage/src/main/java/mage/abilities/effects/keyword/SweepEffect.java b/Mage/src/main/java/mage/abilities/effects/keyword/SweepEffect.java index ba0f02e42b7..b70c5895679 100644 --- a/Mage/src/main/java/mage/abilities/effects/keyword/SweepEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/keyword/SweepEffect.java @@ -70,7 +70,7 @@ public class SweepEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - FilterPermanent filter = new FilterControlledLandPermanent(new StringBuilder("any number of ").append(sweepSubtype).append("s you control").toString()); + FilterPermanent filter = new FilterControlledLandPermanent("any number of " + sweepSubtype + "s you control"); filter.add(new SubtypePredicate(sweepSubtype)); Target target = new TargetPermanent(0, Integer.MAX_VALUE, filter, true); if (controller.chooseTarget(outcome, target, source, game)) { diff --git a/Mage/src/main/java/mage/abilities/keyword/InspiredAbility.java b/Mage/src/main/java/mage/abilities/keyword/InspiredAbility.java index 7984d2383a2..23a8b876bb1 100644 --- a/Mage/src/main/java/mage/abilities/keyword/InspiredAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/InspiredAbility.java @@ -1,4 +1,4 @@ - /* +/* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are @@ -24,8 +24,7 @@ * 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.abilities.keyword; import mage.abilities.TriggeredAbilityImpl; @@ -41,7 +40,6 @@ import mage.game.events.GameEvent.EventType; * * @author LevelX2 */ - public class InspiredAbility extends TriggeredAbilityImpl { public InspiredAbility(Effect effect) { @@ -73,6 +71,6 @@ public class InspiredAbility extends TriggeredAbilityImpl { @Override public String getRule() { - return new StringBuilder("Inspired - Whenever {this} becomes untapped, ").append(super.getRule()).toString(); + return "Inspired - Whenever {this} becomes untapped, " + super.getRule(); } }