mirror of
https://github.com/correl/mage.git
synced 2025-01-12 19:25:44 +00: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
|
@ -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());
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
|
|
@ -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)));
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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,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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
|
@ -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}");
|
||||
|
||||
// <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 effect = new ConditionalContinuousEffect(
|
||||
new BoostTargetEffect(2,2,Duration.EndOfTurn),
|
||||
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");
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -132,7 +132,7 @@ class SylvanLibraryEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
}
|
||||
controller.putCardsOnTopOfLibrary(cardsPutBack, game, source, applyEffectsAfter);
|
||||
controller.putCardsOnTopOfLibrary(cardsPutBack, game, source, false);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -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 -
|
||||
// <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();
|
||||
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);
|
||||
|
||||
// <strong><EFBFBD></strong> 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);
|
||||
|
||||
|
||||
// <strong><EFBFBD></strong> 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) {
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)) {
|
||||
|
|
|
@ -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("<i>Inspired</i> - Whenever {this} becomes untapped, ").append(super.getRule()).toString();
|
||||
return "<i>Inspired</i> - Whenever {this} becomes untapped, " + super.getRule();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue