mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 03:22:00 -08:00
* Removed effect's ApplyEffectsAfter functionality. It's now always applied.
This commit is contained in:
parent
d9ede35857
commit
66bd5294e8
36 changed files with 92 additions and 162 deletions
|
|
@ -49,7 +49,6 @@ public class AcrobaticManeuver extends CardImpl {
|
|||
// 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());
|
||||
|
||||
|
|
|
|||
|
|
@ -56,10 +56,8 @@ public class Ambuscade extends CardImpl {
|
|||
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);
|
||||
|
||||
|
|
|
|||
|
|
@ -49,10 +49,9 @@ public class BarrelDownSokenzan extends CardImpl {
|
|||
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());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)));
|
||||
|
|
|
|||
|
|
@ -42,12 +42,11 @@ import mage.target.common.TargetCreaturePermanent;
|
|||
*/
|
||||
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}");
|
||||
|
||||
|
||||
// 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));
|
||||
|
|
|
|||
|
|
@ -48,11 +48,10 @@ public class ChargeAcrossTheAraba extends CardImpl {
|
|||
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));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,6 @@ public class Cloudshift extends CardImpl {
|
|||
// 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));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
@ -58,7 +59,6 @@ public class EpicConfrontation extends CardImpl {
|
|||
|
||||
// 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();
|
||||
this.getSpellAbility().addEffect(effect);
|
||||
effect = new FightTargetsEffect();
|
||||
effect.setText("It fights target creature you don't control");
|
||||
|
|
|
|||
|
|
@ -59,7 +59,6 @@ public class EssenceFlux extends CardImpl {
|
|||
// 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;
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ import mage.target.common.TargetCreaturePermanent;
|
|||
/**
|
||||
*
|
||||
* @author LoneFox
|
||||
|
||||
*
|
||||
*/
|
||||
public class GrabTheReins extends CardImpl {
|
||||
|
||||
|
|
@ -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");
|
||||
|
|
@ -133,8 +132,7 @@ class GrabTheReinsEffect extends OneShotEffect {
|
|||
player.damage(amount, source.getSourceId(), game, false, true);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
|
@ -62,10 +63,8 @@ public class HuntTheHunter extends CardImpl {
|
|||
public HuntTheHunter(UUID ownerId, CardSetInfo setInfo) {
|
||||
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();
|
||||
this.getSpellAbility().addEffect(effect);
|
||||
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent(1, 1, filterControlledGreen, false));
|
||||
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ 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));
|
||||
}
|
||||
|
|
@ -56,10 +57,8 @@ public class HuntTheWeak extends CardImpl {
|
|||
public HuntTheWeak(UUID ownerId, CardSetInfo setInfo) {
|
||||
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");
|
||||
|
|
|
|||
|
|
@ -64,7 +64,6 @@ public class NissasJudgment extends CardImpl {
|
|||
|
||||
// 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.
|
||||
|
|
|
|||
|
|
@ -49,11 +49,10 @@ public class PlowThroughReito extends CardImpl {
|
|||
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());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,6 @@ import mage.target.Target;
|
|||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
|
|
@ -66,7 +65,6 @@ public class SavagePunch extends CardImpl {
|
|||
new BoostTargetEffect(2, 2, Duration.EndOfTurn),
|
||||
new LockedInCondition(FerociousCondition.instance),
|
||||
"<i>Ferocious</i> — 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.
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -48,10 +48,9 @@ public class SinkIntoTakenuma extends CardImpl {
|
|||
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());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -50,7 +49,6 @@ public class StartYourEngines extends CardImpl {
|
|||
|
||||
// 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.
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ 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));
|
||||
}
|
||||
|
|
@ -56,10 +57,8 @@ public class SwiftKick extends CardImpl {
|
|||
public SwiftKick(UUID ownerId, CardSetInfo setInfo) {
|
||||
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();
|
||||
this.getSpellAbility().addEffect(effect);
|
||||
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
|
||||
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ class SylvanLibraryEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
}
|
||||
controller.putCardsOnTopOfLibrary(cardsPutBack, game, source, applyEffectsAfter);
|
||||
controller.putCardsOnTopOfLibrary(cardsPutBack, game, source, false);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -66,11 +66,9 @@ public class TemurCharm extends CardImpl {
|
|||
public TemurCharm(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{G}{U}{R}");
|
||||
|
||||
|
||||
// Choose one -
|
||||
// <strong><EFBFBD></strong> 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();
|
||||
this.getSpellAbility().addEffect(effect);
|
||||
effect = new FightTargetsEffect();
|
||||
effect.setText("That creature fights target creature you don't control");
|
||||
|
|
|
|||
|
|
@ -58,7 +58,6 @@ public class WildInstincts extends CardImpl {
|
|||
|
||||
// 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();
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
@ -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());
|
||||
|
|
|
|||
|
|
@ -220,12 +220,10 @@ 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,10 +88,6 @@ public interface Effect extends Serializable {
|
|||
|
||||
Object getValue(String key);
|
||||
|
||||
void setApplyEffectsAfter();
|
||||
|
||||
boolean applyEffectsAfter();
|
||||
|
||||
Effect copy();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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)) {
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@
|
|||
* 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("<i>Inspired</i> - Whenever {this} becomes untapped, ").append(super.getRule()).toString();
|
||||
return "<i>Inspired</i> - Whenever {this} becomes untapped, " + super.getRule();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue