refactor text gen for ExileTopXMayPlayUntilEffect

This commit is contained in:
xenohedron 2024-01-21 01:26:19 -05:00
parent 038cf01aa8
commit cac779cbec
62 changed files with 276 additions and 303 deletions

View file

@ -3,7 +3,7 @@ package mage.cards.a;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.abilities.keyword.ProwessAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -26,7 +26,8 @@ public final class AbbotOfKeralKeep extends CardImpl {
this.addAbility(new ProwessAbility());
// When Abbot of Keral Keep enters the battlefield, exile the top card of your library. Until end of turn, you may play that card.
this.addAbility(new EntersBattlefieldTriggeredAbility(new ExileTopXMayPlayUntilEndOfTurnEffect(1)));
this.addAbility(new EntersBattlefieldTriggeredAbility(new ExileTopXMayPlayUntilEffect(1, Duration.EndOfTurn)
.withTextOptions("that card", false)));
}
private AbbotOfKeralKeep(final AbbotOfKeralKeep card) {

View file

@ -1,9 +1,10 @@
package mage.cards.a;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import java.util.UUID;
@ -17,7 +18,9 @@ public final class ActOnImpulse extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{R}");
// Exile the top three cards of your library. Until end of turn, you may play cards exiled this way.
this.getSpellAbility().addEffect(new ExileTopXMayPlayUntilEndOfTurnEffect(3));
this.getSpellAbility().addEffect(new ExileTopXMayPlayUntilEffect(3, Duration.EndOfTurn)
.withTextOptions("cards exiled this way. <i>(If you cast a spell this way, you still pay its costs. " +
"You can play a land this way only if you have an available land play remaining.)</i>", false));
}
private ActOnImpulse(final ActOnImpulse card) {
@ -29,4 +32,3 @@ public final class ActOnImpulse extends CardImpl {
return new ActOnImpulse(this);
}
}

View file

@ -4,11 +4,12 @@ import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
/**
@ -30,8 +31,8 @@ public final class AerialCaravan extends CardImpl {
// {1}{U}{U}: Exile the top card of your library. Until end of turn, you may play that card.
this.addAbility(new SimpleActivatedAbility(
new ExileTopXMayPlayUntilEndOfTurnEffect(1).setText("Exile the top card of your library. " +
"Until end of turn, you may play that card. <i>(Reveal the card as you exile it.)</i>"),
new ExileTopXMayPlayUntilEffect(1, Duration.EndOfTurn)
.withTextOptions("that card. <i>(Reveal the card as you exile it.)</i>", false),
new ManaCostsImpl<>("{1}{U}{U}")));
}

View file

@ -6,11 +6,12 @@ import mage.abilities.common.AttacksTriggeredAbility;
import mage.abilities.costs.Cost;
import mage.abilities.costs.CostImpl;
import mage.abilities.effects.common.DoIfCostPaid;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.filter.FilterCard;
@ -38,8 +39,7 @@ public final class ArdentDustspeaker extends CardImpl {
// If you do, exile the top two cards of your library. You may play those cards this turn.
this.addAbility(new AttacksTriggeredAbility(
new DoIfCostPaid(
new ExileTopXMayPlayUntilEndOfTurnEffect(2)
.setText("exile the top two cards of your library. You may play those cards this turn"),
new ExileTopXMayPlayUntilEffect(2, Duration.EndOfTurn),
new ArdentDustspeakerCost()
),
false
@ -61,7 +61,7 @@ class ArdentDustspeakerCost extends CostImpl {
private static final FilterCard filter
= new FilterInstantOrSorceryCard("instant or sorcery card from your graveyard");
public ArdentDustspeakerCost() {
ArdentDustspeakerCost() {
TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(filter);
target.withNotTarget(true);
this.addTarget(target);
@ -85,13 +85,11 @@ class ArdentDustspeakerCost extends CostImpl {
@Override
public boolean pay(Ability ability, Game game, Ability source, UUID controllerId, boolean noMana, Cost costToPay) {
Player controller = game.getPlayer(controllerId);
if (controller != null) {
if (controller.chooseTarget(Outcome.Benefit, this.getTargets().get(0), source, game)) {
Card card = game.getCard(this.getTargets().get(0).getFirstTarget());
if (card != null) {
controller.putCardsOnBottomOfLibrary(card, game, source, true);
paid = true;
}
if (controller != null && (controller.chooseTarget(Outcome.Benefit, this.getTargets().get(0), source, game))) {
Card card = game.getCard(this.getTargets().get(0).getFirstTarget());
if (card != null) {
controller.putCardsOnBottomOfLibrary(card, game, source, true);
paid = true;
}
}
return paid;

View file

@ -5,7 +5,7 @@ import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.common.DiesSourceTriggeredAbility;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
@ -40,8 +40,8 @@ public final class AtsushiTheBlazingSky extends CardImpl {
// When Atsushi, the Blazing Sky dies, choose one
// Exile the top two cards of your library. Until the end of your next turn, you may play those cards.
Ability ability = new DiesSourceTriggeredAbility(new ExileTopXMayPlayUntilEndOfTurnEffect(
2, false, Duration.UntilEndOfYourNextTurn
Ability ability = new DiesSourceTriggeredAbility(new ExileTopXMayPlayUntilEffect(
2, Duration.UntilEndOfYourNextTurn
), false);
// Create three Treasure tokens.

View file

@ -5,7 +5,7 @@ import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.common.SpellCastControllerTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.abilities.effects.common.continuous.GainClassAbilitySourceEffect;
import mage.abilities.effects.common.cost.SpellsCostReductionControllerEffect;
import mage.abilities.keyword.ClassLevelAbility;
@ -61,8 +61,8 @@ public final class BardClass extends CardImpl {
// Whenever you cast a legendary spell, exile the top two cards of your library. You may play them this turn.
this.addAbility(new SimpleStaticAbility(new GainClassAbilitySourceEffect(
new SpellCastControllerTriggeredAbility(
new ExileTopXMayPlayUntilEndOfTurnEffect(2)
.setText("exile the top two cards of your library. You may play them this turn"),
new ExileTopXMayPlayUntilEffect(2, Duration.EndOfTurn)
.withTextOptions("them", true),
filter2, false
), 3
)));

View file

@ -8,7 +8,7 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.abilities.effects.common.InfoEffect;
import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect;
import mage.cards.Card;
@ -52,7 +52,8 @@ public final class BellBorcaSpectralSergeant extends CardImpl {
// At the beginning of your upkeep, exile the top card of your library. You may play that card this turn.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(
new ExileTopXMayPlayUntilEndOfTurnEffect(1), TargetController.YOU, false
new ExileTopXMayPlayUntilEffect(1, Duration.EndOfTurn),
TargetController.YOU, false
), new BellBorcaSpectralSergeantWatcher());
}

View file

@ -7,7 +7,7 @@ import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SpellCastControllerTriggeredAbility;
import mage.abilities.costs.common.DiscardCardCost;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.abilities.keyword.BoastAbility;
import mage.cards.CardSetInfo;
import mage.cards.ModalDoubleFacedCard;
@ -48,7 +48,7 @@ public final class BirgiGodOfStorytelling extends ModalDoubleFacedCard {
// Legendary Artifact
// Discard a card: Exile the top two cards of your library. You may play those cards this turn.
this.getRightHalfCard().addAbility(new SimpleActivatedAbility(
new ExileTopXMayPlayUntilEndOfTurnEffect(2), new DiscardCardCost()
new ExileTopXMayPlayUntilEffect(2, Duration.EndOfTurn).withTextOptions("those cards", true), new DiscardCardCost()
));
}

View file

@ -1,6 +1,6 @@
package mage.cards.b;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -23,8 +23,8 @@ public final class BlazingCrescendo extends CardImpl {
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
// Exile the top card of your library. Until the end of your next turn, you may play that card.
this.getSpellAbility().addEffect(new ExileTopXMayPlayUntilEndOfTurnEffect(
1, false, Duration.UntilEndOfYourNextTurn
this.getSpellAbility().addEffect(new ExileTopXMayPlayUntilEffect(
1, Duration.UntilEndOfYourNextTurn
).concatBy("<br>"));
}

View file

@ -6,7 +6,7 @@ import mage.abilities.common.DiesCreatureTriggeredAbility;
import mage.abilities.condition.common.RaidCondition;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.DamagePlayersEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.abilities.hint.common.RaidHint;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -44,8 +44,8 @@ public final class BrazenCannonade extends CardImpl {
// Raid -- At the beginning of your postcombat main phase, if you attacked with a creature this turn, exile the top card of your library. Until end of combat on your next turn, you may play that card.
Ability ability = new ConditionalInterveningIfTriggeredAbility(
new BeginningOfPostCombatMainTriggeredAbility(
new ExileTopXMayPlayUntilEndOfTurnEffect(
1, false, Duration.UntilEndCombatOfYourNextTurn
new ExileTopXMayPlayUntilEffect(
1, Duration.UntilEndCombatOfYourNextTurn
), TargetController.YOU, false
), RaidCondition.instance, "At the beginning of your postcombat main phase, " +
"if you attacked with a creature this turn, exile the top card of your library. " +

View file

@ -5,7 +5,7 @@ import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.common.AttacksCreatureYouControlTriggeredAbility;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.abilities.effects.common.combat.CantBlockTargetEffect;
import mage.abilities.hint.common.ModesAlreadyUsedHint;
import mage.abilities.keyword.FirstStrikeAbility;
@ -56,8 +56,8 @@ public final class BreechesEagerPillager extends CardImpl {
// * Exile the top card of your library. You may play it this turn.
ability.addMode(new Mode(
new ExileTopXMayPlayUntilEndOfTurnEffect(1)
.setText("exile the top card of your library. You may play it this turn")
new ExileTopXMayPlayUntilEffect(1, Duration.EndOfTurn)
.withTextOptions("it", true)
).setModeTag("exile top card"));
ability.addHint(ModesAlreadyUsedHint.instance);

View file

@ -1,6 +1,6 @@
package mage.cards.c;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -26,7 +26,7 @@ public final class CampusRenovation extends CardImpl {
// Return up to one target artifact or enchantment card from your graveyard to the battlefield. Exile the top two cards of your library. Until the end of your next turn, you may play those cards.
this.getSpellAbility().addEffect(new ReturnFromGraveyardToBattlefieldTargetEffect());
this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(0, 1, filter));
this.getSpellAbility().addEffect(new ExileTopXMayPlayUntilEndOfTurnEffect(2, false, Duration.UntilEndOfYourNextTurn));
this.getSpellAbility().addEffect(new ExileTopXMayPlayUntilEffect(2, Duration.UntilEndOfYourNextTurn));
}
private CampusRenovation(final CampusRenovation card) {

View file

@ -3,7 +3,7 @@ package mage.cards.c;
import mage.MageInt;
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -29,7 +29,7 @@ public final class CapriciousSliver extends CardImpl {
// Sliver creatures you control have "Whenever this creature deals combat damage to a player, exile the top card of your library. You may play that card this turn."
this.addAbility(new SimpleStaticAbility(new GainAbilityControlledEffect(
new DealsCombatDamageToAPlayerTriggeredAbility(
new ExileTopXMayPlayUntilEndOfTurnEffect(1), false
new ExileTopXMayPlayUntilEffect(1, Duration.EndOfTurn).withTextOptions("that card", true), false
).setTriggerPhrase("Whenever this creature deals combat damage to a player, "),
Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_SLIVERS
)));

View file

@ -7,7 +7,7 @@ import mage.abilities.LoyaltyAbility;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.abilities.effects.common.asthought.PlayFromNotOwnHandZoneTargetEffect;
import mage.abilities.effects.common.discard.DiscardHandControllerEffect;
import mage.abilities.effects.mana.BasicManaEffect;
@ -46,7 +46,9 @@ public final class ChandraHeartOfFire extends CardImpl {
// +1: Discard your hand, then exile the top three cards of your library. Until end of turn, you may play cards exiled this way.
Ability ability = new LoyaltyAbility(new DiscardHandControllerEffect(), 1);
ability.addEffect(new ExileTopXMayPlayUntilEndOfTurnEffect(3).concatBy(", then"));
ability.addEffect(new ExileTopXMayPlayUntilEffect(3, Duration.EndOfTurn)
.withTextOptions("cards exiled this way", false)
.concatBy(", then"));
this.addAbility(ability);
// +1: Chandra, Heart of Fire deals 2 damage to any target.

View file

@ -2,11 +2,12 @@ package mage.cards.c;
import mage.MageInt;
import mage.abilities.common.AttacksTriggeredAbility;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.abilities.effects.common.RollDieWithResultTableEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import java.util.UUID;
@ -29,16 +30,16 @@ public final class ChaosChanneler extends CardImpl {
this.addAbility(new AttacksTriggeredAbility(effect).withFlavorWord("Wild Magic Surge"));
// 1-9 | Exile the top card of your library. You may play it this turn.
effect.addTableEntry(1, 9, new ExileTopXMayPlayUntilEndOfTurnEffect(1)
.setText("exile the top card of your library. You may play it this turn"));
effect.addTableEntry(1, 9, new ExileTopXMayPlayUntilEffect(1, Duration.EndOfTurn)
.withTextOptions("it", true));
// 10-19 | Exile the top two cards of your library. You may play them this turn.
effect.addTableEntry(10, 19, new ExileTopXMayPlayUntilEndOfTurnEffect(2)
.setText("exile the top two cards of your library. You may play them this turn"));
effect.addTableEntry(10, 19, new ExileTopXMayPlayUntilEffect(2, Duration.EndOfTurn)
.withTextOptions("them", true));
// 20 | Exile the top three cards of your library. You may play them this turn.
effect.addTableEntry(20, 20, new ExileTopXMayPlayUntilEndOfTurnEffect(3)
.setText("exile the top three cards of your library. You may play them this turn"));
effect.addTableEntry(20, 20, new ExileTopXMayPlayUntilEffect(3, Duration.EndOfTurn)
.withTextOptions("them", true));
}
private ChaosChanneler(final ChaosChanneler card) {

View file

@ -4,19 +4,17 @@ import mage.MageInt;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.PutIntoGraveFromBattlefieldAllTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.RemoveCounterCost;
import mage.abilities.costs.common.RemoveCountersSourceCost;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.counters.CounterType;
import mage.filter.StaticFilters;
import mage.game.permanent.token.PhyrexianBeastToxicToken;
import mage.game.permanent.token.PhyrexianGoblinToken;
import java.util.UUID;
@ -41,8 +39,7 @@ public class Charforger extends CardImpl {
));
//Remove three oil counters from Charforger: Exile the top card of your library. You may play that card this turn.
this.addAbility(new SimpleActivatedAbility(new ExileTopXMayPlayUntilEndOfTurnEffect(1)
.setText("Exile the top card of your library. You may play that card this turn"),
this.addAbility(new SimpleActivatedAbility(new ExileTopXMayPlayUntilEffect(1, Duration.EndOfTurn),
new RemoveCountersSourceCost(CounterType.OIL.createInstance(3))
));
}

View file

@ -2,7 +2,7 @@ package mage.cards.c;
import mage.MageInt;
import mage.abilities.common.TransformIntoSourceTriggeredAbility;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
@ -29,7 +29,7 @@ public final class CompleatedConjurer extends CardImpl {
// When this creature transforms into Compleated Conjurer, exile the top card of your library. Until the end of your next turn, you may play that card.
this.addAbility(new TransformIntoSourceTriggeredAbility(
new ExileTopXMayPlayUntilEndOfTurnEffect(1, false, Duration.UntilEndOfYourNextTurn)
new ExileTopXMayPlayUntilEffect(1, Duration.UntilEndOfYourNextTurn)
));
}

View file

@ -5,13 +5,13 @@ import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.filter.StaticFilters;
import mage.target.common.TargetControlledPermanent;
import java.util.UUID;
@ -30,8 +30,7 @@ public final class DarkDwellerOracle extends CardImpl {
// {1}, Sacrifice a creature: Exile the top card of your library. You may play that card this turn.
Ability ability = new SimpleActivatedAbility(
new ExileTopXMayPlayUntilEndOfTurnEffect(1, true)
.setText("exile the top card of your library. You may play that card this turn"),
new ExileTopXMayPlayUntilEffect(1, Duration.EndOfTurn).withTextOptions("that card", true),
new GenericManaCost(1)
);
ability.addCost(new SacrificeTargetCost(StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT));

View file

@ -6,11 +6,12 @@ import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.RemoveCountersSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.counters.CounterType;
@ -40,8 +41,7 @@ public final class EmbodimentOfFlame extends CardImpl {
// {1}, Remove a flame counter from Embodiment of Flame: Exile the top card of your library. You may play that card this turn.
Ability ability = new SimpleActivatedAbility(
new ExileTopXMayPlayUntilEndOfTurnEffect(1)
.setText("exile the top card of your library. You may play that card this turn"),
new ExileTopXMayPlayUntilEffect(1, Duration.EndOfTurn),
new GenericManaCost(1)
);
ability.addCost(new RemoveCountersSourceCost(CounterType.FLAME.createInstance()));

View file

@ -6,10 +6,11 @@ import mage.abilities.common.EntersBattlefieldOrLeavesSourceTriggeredAbility;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.game.permanent.token.SamuraiToken;
import java.util.UUID;
@ -24,7 +25,7 @@ public final class ExperimentalSynthesizer extends CardImpl {
// When Experimental Synthesizer enters or leaves the battlefield, exile the top card of your library. Until end of turn, you may play that card.
this.addAbility(new EntersBattlefieldOrLeavesSourceTriggeredAbility(
new ExileTopXMayPlayUntilEndOfTurnEffect(1), false
new ExileTopXMayPlayUntilEffect(1, Duration.EndOfTurn).withTextOptions("that card", false), false
));
// {2}{R}, Sacrifice Experimental Synthesizer: Create a 2/2 white Samurai creature token with vigilance. Activate only as a sorcery.

View file

@ -8,13 +8,10 @@ import mage.abilities.costs.common.DiscardCardCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.constants.Zone;
import mage.constants.*;
import mage.game.Game;
import mage.game.events.EntersTheBattlefieldEvent;
import mage.game.events.GameEvent;
@ -42,8 +39,8 @@ public final class FaldornDreadWolfHerald extends CardImpl {
this.addAbility(new FaldornDreadWolfHeraldTriggeredAbility());
// {1}, {T}, Discard a card: Exile the top card of your library. You may play it this turn.
Ability ability = new SimpleActivatedAbility(
new ExileTopXMayPlayUntilEndOfTurnEffect(1), new GenericManaCost(1)
Ability ability = new SimpleActivatedAbility(new ExileTopXMayPlayUntilEffect(1, Duration.EndOfTurn)
.withTextOptions("it", true), new GenericManaCost(1)
);
ability.addCost(new TapSourceCost());
ability.addCost(new DiscardCardCost());

View file

@ -8,11 +8,12 @@ import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.dynamicvalue.common.GetXValue;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.counters.CounterType;
import mage.filter.StaticFilters;
import mage.target.common.TargetAnyTarget;
@ -45,8 +46,7 @@ public final class GeistflameReservoir extends CardImpl {
// {1}{R}, {T}: Exile the top card of your library. You may play that card this turn.
ability = new SimpleActivatedAbility(
new ExileTopXMayPlayUntilEndOfTurnEffect(1)
.setText("exile the top card of your library. You may play that card this turn"),
new ExileTopXMayPlayUntilEffect(1, Duration.EndOfTurn),
new ManaCostsImpl<>("{1}{R}")
);
ability.addCost(new TapSourceCost());

View file

@ -2,10 +2,11 @@ package mage.cards.g;
import mage.MageInt;
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import java.util.UUID;
@ -24,7 +25,7 @@ public final class GrotagNightRunner extends CardImpl {
this.toughness = new MageInt(3);
// Whenever Grotag Night-Runner deals combat damage to a player, exile the top card of your library. You may play that card this turn.
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new ExileTopXMayPlayUntilEndOfTurnEffect(1), false));
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new ExileTopXMayPlayUntilEffect(1, Duration.EndOfTurn), false));
}
private GrotagNightRunner(final GrotagNightRunner card) {

View file

@ -7,17 +7,16 @@ import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledArtifactPermanent;
import mage.filter.common.FilterControlledPermanent;
import mage.target.common.TargetControlledPermanent;
import mage.target.common.TargetOpponent;
import mage.target.common.TargetSacrifice;
import java.util.UUID;
@ -44,7 +43,7 @@ public final class HedronDetonator extends CardImpl {
this.addAbility(ability);
// {T}, Sacrifice two artifacts: Exile the top card of your library. You may play that card this turn.
ability = new SimpleActivatedAbility(new ExileTopXMayPlayUntilEndOfTurnEffect(1), new TapSourceCost());
ability = new SimpleActivatedAbility(new ExileTopXMayPlayUntilEffect(1, Duration.EndOfTurn), new TapSourceCost());
ability.addCost(new SacrificeTargetCost(2, filter));
this.addAbility(ability);
}

View file

@ -1,7 +1,7 @@
package mage.cards.i;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
@ -19,8 +19,8 @@ public final class InspiredTinkering extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{R}");
// Exile the top three cards of your library. Until the end of your next turn, you may play those cards.
this.getSpellAbility().addEffect(new ExileTopXMayPlayUntilEndOfTurnEffect(
3, false, Duration.UntilEndOfYourNextTurn
this.getSpellAbility().addEffect(new ExileTopXMayPlayUntilEffect(
3, Duration.UntilEndOfYourNextTurn
));
// Create three Treasure tokens.

View file

@ -6,7 +6,7 @@ import mage.abilities.common.AttacksWithCreaturesTriggeredAbility;
import mage.abilities.common.delayed.ReflexiveTriggeredAbility;
import mage.abilities.costs.common.DiscardCardCost;
import mage.abilities.effects.common.DoWhenCostPaid;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.abilities.keyword.TrampleAbility;
@ -45,7 +45,7 @@ public final class IntiSeneschalOfTheSun extends CardImpl {
ability, new DiscardCardCost(), "Discard a card?"
), 1));
// Whenever you discard one or more cards, exile the top card of your library. You may play it until your next end step.
// Whenever you discard one or more cards, exile the top card of your library. You may play that card until your next end step.
this.addAbility(new IntiSeneschalOfTheSunTriggeredAbility());
}
@ -62,7 +62,7 @@ public final class IntiSeneschalOfTheSun extends CardImpl {
class IntiSeneschalOfTheSunTriggeredAbility extends TriggeredAbilityImpl {
IntiSeneschalOfTheSunTriggeredAbility() {
super(Zone.BATTLEFIELD, new ExileTopXMayPlayUntilEndOfTurnEffect(1, false, Duration.UntilYourNextEndStep));
super(Zone.BATTLEFIELD, new ExileTopXMayPlayUntilEffect(1, Duration.UntilYourNextEndStep));
this.setTriggerPhrase("Whenever you discard one or more cards, ");
}

View file

@ -5,12 +5,13 @@ import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.TurnedFaceUpSourceTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.abilities.keyword.MenaceAbility;
import mage.abilities.keyword.MorphAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
/**
@ -33,7 +34,8 @@ public final class IreShaman extends CardImpl {
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{R}"), true));
// When Ire Shaman is turned face up, exile the top card of your library. Until end of turn, you may play that card.
this.addAbility(new TurnedFaceUpSourceTriggeredAbility(new ExileTopXMayPlayUntilEndOfTurnEffect(1), false));
this.addAbility(new TurnedFaceUpSourceTriggeredAbility(new ExileTopXMayPlayUntilEffect(1, Duration.EndOfTurn)
.withTextOptions("that card", false), false));
}
private IreShaman(final IreShaman card) {

View file

@ -5,10 +5,11 @@ import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.condition.common.ControlACommanderCondition;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.game.Game;
import mage.players.Player;
@ -35,7 +36,8 @@ public final class JeskasWill extends CardImpl {
this.getSpellAbility().addTarget(new TargetOpponent());
// Exile the top three cards of your library. You may play them this turn.
this.getSpellAbility().addMode(new Mode(new ExileTopXMayPlayUntilEndOfTurnEffect(3)));
this.getSpellAbility().addMode(new Mode(new ExileTopXMayPlayUntilEffect(3, Duration.EndOfTurn)
.withTextOptions("them", true)));
}
private JeskasWill(final JeskasWill card) {

View file

@ -3,11 +3,12 @@ package mage.cards.k;
import mage.MageInt;
import mage.abilities.common.AttacksCreatureYouControlTriggeredAbility;
import mage.abilities.common.SpellCastControllerTriggeredAbility;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.counters.CounterType;
@ -40,7 +41,7 @@ public final class KamiOfCelebration extends CardImpl {
// Whenever a modified creature you control attacks, exile the top card of your library. You may play that card this turn.
this.addAbility(new AttacksCreatureYouControlTriggeredAbility(
new ExileTopXMayPlayUntilEndOfTurnEffect(1), false, filter
new ExileTopXMayPlayUntilEffect(1, Duration.EndOfTurn), false, filter
));
// Whenever you cast a spell from exile, put a +1/+1 counter on target creature you control.

View file

@ -3,16 +3,13 @@ package mage.cards.l;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.AttacksTriggeredAbility;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.HasteAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.constants.Zone;
import mage.constants.*;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
@ -39,7 +36,7 @@ public final class LaeliaTheBladeReforged extends CardImpl {
this.addAbility(HasteAbility.getInstance());
// Whenever Laelia, the Blade Reforged attacks, exile the top card of your library. You may play that card this turn.
this.addAbility(new AttacksTriggeredAbility(new ExileTopXMayPlayUntilEndOfTurnEffect(1), false));
this.addAbility(new AttacksTriggeredAbility(new ExileTopXMayPlayUntilEffect(1, Duration.EndOfTurn), false));
// Whenever a spell or ability you control exiles one or more cards from your library and/or your graveyard, put a +1/+1 counter on Laelia.
this.addAbility(new LaeliaTheBladeReforgedAddCountersTriggeredAbility());

View file

@ -1,14 +1,12 @@
package mage.cards.l;
import mage.abilities.Ability;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.abilities.keyword.SpectacleAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import java.util.Set;
import java.util.UUID;
/**
@ -20,8 +18,8 @@ public final class LightUpTheStage extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{R}");
// Exile the top two cards of your library. Until the end of your next turn, you may play those cards.
this.getSpellAbility().addEffect(new ExileTopXMayPlayUntilEndOfTurnEffect(
2, false, Duration.UntilEndOfYourNextTurn
this.getSpellAbility().addEffect(new ExileTopXMayPlayUntilEffect(
2, Duration.UntilEndOfYourNextTurn
));
// Spectacle {R}

View file

@ -4,14 +4,11 @@ import mage.MageInt;
import mage.Mana;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapTargetCost;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.abilities.mana.SimpleManaAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.constants.Zone;
import mage.constants.*;
import mage.filter.common.FilterControlledArtifactPermanent;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.permanent.TappedPredicate;
@ -50,7 +47,7 @@ public final class MeriaScholarOfAntiquity extends CardImpl {
// Tap two untapped nontoken artifacts you control: Exile the top card of your library. You may play it this turn.
this.addAbility(new SimpleActivatedAbility(
new ExileTopXMayPlayUntilEndOfTurnEffect(1),
new ExileTopXMayPlayUntilEffect(1, Duration.EndOfTurn).withTextOptions("it", true),
new TapTargetCost(new TargetControlledPermanent(2, filter))
));
}

View file

@ -2,11 +2,12 @@ package mage.cards.m;
import mage.MageInt;
import mage.abilities.common.DealsDamageToAPlayerAllTriggeredAbility;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.abilities.keyword.DoubleStrikeAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SetTargetPointer;
import mage.constants.SubType;
import mage.filter.FilterPermanent;
@ -42,7 +43,7 @@ public final class MoriaMarauder extends CardImpl {
// Whenever a Goblin or Orc you control deals combat damage to a player, exile the top card of your library. You may play that card this turn.
this.addAbility(new DealsDamageToAPlayerAllTriggeredAbility(
new ExileTopXMayPlayUntilEndOfTurnEffect(1), filter,
new ExileTopXMayPlayUntilEffect(1, Duration.EndOfTurn), filter,
false, SetTargetPointer.NONE, true
));
}

View file

@ -8,7 +8,7 @@ import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.decorator.ConditionalActivatedAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.abilities.effects.common.asthought.PlayFromNotOwnHandZoneTargetEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
@ -29,7 +29,8 @@ public final class OraclesVault extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{4}");
// {2}, {T}: Exile the top card of your library. Until end of turn, you may play that card.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTopXMayPlayUntilEndOfTurnEffect(1), new GenericManaCost(2));
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTopXMayPlayUntilEffect(1, Duration.EndOfTurn)
.withTextOptions("that card", false), new GenericManaCost(2));
ability.addCost(new TapSourceCost());
// Put a brick counter on Oracle's Vault.

View file

@ -9,10 +9,11 @@ import mage.abilities.condition.common.ModeChoiceSourceCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.effects.common.ChooseModeEffect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.common.FilterControlledCreaturePermanent;
@ -36,7 +37,7 @@ public final class OutpostSiege extends CardImpl {
// * Khans - At the beginning of your upkeep, exile the top card of your library. Until end of turn, you may play that card.
this.addAbility(new ConditionalTriggeredAbility(
new BeginningOfUpkeepTriggeredAbility(new ExileTopXMayPlayUntilEndOfTurnEffect(1), TargetController.YOU, false),
new BeginningOfUpkeepTriggeredAbility(new ExileTopXMayPlayUntilEffect(1, Duration.EndOfTurn), TargetController.YOU, false),
new ModeChoiceSourceCondition("Khans"),
ruleTrigger1));

View file

@ -5,11 +5,12 @@ import mage.abilities.common.DealCombatDamageControlledTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.abilities.keyword.MenaceAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.filter.common.FilterControlledPermanent;
import mage.game.permanent.token.TreasureToken;
@ -40,7 +41,7 @@ public final class ProfessionalFaceBreaker extends CardImpl {
// Sacrifice a Treasure: Exile the top card of your library. You may play that card this turn.
this.addAbility(new SimpleActivatedAbility(
new ExileTopXMayPlayUntilEndOfTurnEffect(1, false), new SacrificeTargetCost(filter)
new ExileTopXMayPlayUntilEffect(1, Duration.EndOfTurn), new SacrificeTargetCost(filter)
));
}

View file

@ -1,20 +1,17 @@
package mage.cards.p;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
import mage.abilities.common.PlayCardTriggeredAbility;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.abilities.keyword.DeathtouchAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.token.TreasureToken;
import mage.game.stack.Spell;
import java.util.UUID;
@ -37,8 +34,8 @@ public final class ProsperTomeBound extends CardImpl {
// Mystic Arcanum At the beginning of your end step, exile the top card of your library. Until the end of your next turn, you may play that card.
this.addAbility(new BeginningOfEndStepTriggeredAbility(
new ExileTopXMayPlayUntilEndOfTurnEffect(
1, false, Duration.UntilEndOfYourNextTurn
new ExileTopXMayPlayUntilEffect(
1, Duration.UntilEndOfYourNextTurn
), TargetController.YOU, false
).withFlavorWord("Mystic Arcanum"));

View file

@ -5,10 +5,11 @@ import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.DiscardTargetCost;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.DiscardCardControllerTriggeredAbility;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.filter.StaticFilters;
import mage.target.common.TargetAnyTarget;
import mage.target.common.TargetCardInHand;
@ -36,7 +37,7 @@ public final class PyreOfTheWorldTree extends CardImpl {
// Whenever you discard a land card, exile the top card of your library. You may play that card this turn.
this.addAbility(new DiscardCardControllerTriggeredAbility(
new ExileTopXMayPlayUntilEndOfTurnEffect(1),
new ExileTopXMayPlayUntilEffect(1, Duration.EndOfTurn),
false, StaticFilters.FILTER_CARD_LAND_A
));
}

View file

@ -3,7 +3,7 @@ package mage.cards.q;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.common.SpellCastControllerTriggeredAbility;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.AdventureCard;
import mage.cards.CardSetInfo;
@ -49,7 +49,7 @@ public final class QuestingDruid extends AdventureCard {
// Seek the Beast
// Exile the top two cards of your library. Until your next end step, you may play those cards.
this.getSpellCard().getSpellAbility().addEffect(
new ExileTopXMayPlayUntilEndOfTurnEffect(2, false, Duration.UntilYourNextEndStep)
new ExileTopXMayPlayUntilEffect(2, Duration.UntilYourNextEndStep)
);
this.finalizeAdventure();

View file

@ -1,6 +1,6 @@
package mage.cards.r;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
@ -17,8 +17,8 @@ public final class RecklessImpulse extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{R}");
// Exile the top two cards of your library. Until the end of your next turn, you may play those cards.
this.getSpellAbility().addEffect(new ExileTopXMayPlayUntilEndOfTurnEffect(
2, false, Duration.UntilEndOfYourNextTurn
this.getSpellAbility().addEffect(new ExileTopXMayPlayUntilEffect(
2, Duration.UntilEndOfYourNextTurn
));
}

View file

@ -6,18 +6,18 @@ import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.DoIfCostPaid;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.MenaceAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.TargetController;
import mage.counters.CounterType;
import mage.filter.StaticFilters;
import mage.game.permanent.token.RatCantBlockToken;
import mage.target.common.TargetControlledPermanent;
import java.util.UUID;
@ -47,7 +47,7 @@ public final class RedcapGutterDweller extends CardImpl {
new SacrificeTargetCost(StaticFilters.FILTER_CONTROLLED_ANOTHER_CREATURE),
"Sacrifice another creature? If you do, put a +1/+1 counter on {this} "
+ "and exile the top card of your library. You may play that card this turn."
).addEffect(new ExileTopXMayPlayUntilEndOfTurnEffect(1, false)
).addEffect(new ExileTopXMayPlayUntilEffect(1, Duration.EndOfTurn)
.setText("and exile the top card of your library. You may play that card this turn")),
TargetController.YOU,
false

View file

@ -3,7 +3,7 @@ package mage.cards.r;
import mage.ObjectColor;
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.abilities.effects.common.continuous.BoostEquippedEffect;
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.keyword.EquipAbility;
@ -36,7 +36,7 @@ public class ReysLightsaber extends CardImpl {
//That player may play that card until next turn.
DealsCombatDamageToAPlayerTriggeredAbility dealsCombatDamageToAPlayerTriggeredAbility =
new DealsCombatDamageToAPlayerTriggeredAbility(
new ExileTopXMayPlayUntilEndOfTurnEffect(1, false), false);
new ExileTopXMayPlayUntilEffect(1, Duration.EndOfTurn), false);
dealsCombatDamageToAPlayerTriggeredAbility.addTarget(new TargetPlayer());
this.addAbility(new SimpleStaticAbility(new GainAbilityAttachedEffect(
dealsCombatDamageToAPlayerTriggeredAbility, AttachmentType.EQUIPMENT)));

View file

@ -2,7 +2,7 @@ package mage.cards.r;
import mage.abilities.Mode;
import mage.abilities.effects.common.ExileGraveyardAllTargetPlayerEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.abilities.effects.common.SacrificeEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -39,8 +39,8 @@ public final class RiveteersCharm extends CardImpl {
this.getSpellAbility().addTarget(new TargetOpponent());
// Exile the top three cards of your library. Until your next end step, you may play those cards.
this.getSpellAbility().addMode(new Mode(new ExileTopXMayPlayUntilEndOfTurnEffect(
3, false, Duration.UntilYourNextEndStep
this.getSpellAbility().addMode(new Mode(new ExileTopXMayPlayUntilEffect(
3, Duration.UntilYourNextEndStep
)));
// Exile target player's graveyard.

View file

@ -1,10 +1,11 @@
package mage.cards.r;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.abilities.keyword.CasualtyAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import java.util.UUID;
@ -20,7 +21,7 @@ public final class RobTheArchives extends CardImpl {
this.addAbility(new CasualtyAbility(1));
// Exile the top two cards of your library. You may play those cards this turn.
this.getSpellAbility().addEffect(new ExileTopXMayPlayUntilEndOfTurnEffect(2, false));
this.getSpellAbility().addEffect(new ExileTopXMayPlayUntilEffect(2, Duration.EndOfTurn));
}
private RobTheArchives(final RobTheArchives card) {

View file

@ -7,12 +7,13 @@ import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.CountersSourceCount;
import mage.abilities.effects.common.DoIfCostPaid;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.MenaceAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.counters.CounterType;
@ -41,7 +42,7 @@ public final class RotisserieElemental extends CardImpl {
false
).withRuleTextReplacement(false);
ability.addEffect(new DoIfCostPaid(
new ExileTopXMayPlayUntilEndOfTurnEffect(xValue)
new ExileTopXMayPlayUntilEffect(xValue, Duration.EndOfTurn)
.setText("exile the top X cards of your library, where X is the number of skewer counters "
+ "on {this}. You may play those cards this turn"),
new SacrificeSourceCost().setText("sacrifice it")

View file

@ -7,17 +7,17 @@ import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledArtifactPermanent;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.permanent.TokenPredicate;
import mage.game.permanent.token.TreasureToken;
import mage.target.common.TargetControlledPermanent;
import java.util.UUID;
@ -50,7 +50,7 @@ public final class ScionOfOpulence extends CardImpl {
// {R}, Sacrifice two artifacts: Exile the top card of your library. You may play that card this turn.
Ability ability = new SimpleActivatedAbility(
new ExileTopXMayPlayUntilEndOfTurnEffect(1), new ManaCostsImpl<>("{R}")
new ExileTopXMayPlayUntilEffect(1, Duration.EndOfTurn), new ManaCostsImpl<>("{R}")
);
ability.addCost(new SacrificeTargetCost(2, filter2));
this.addAbility(ability);

View file

@ -5,12 +5,13 @@ import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.abilities.keyword.MadnessAbility;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
/**
@ -30,7 +31,8 @@ public final class StromkirkOccultist extends CardImpl {
this.addAbility(TrampleAbility.getInstance());
// Whenever Stromkirk Mystic deals combat damage to a player, exile the top card of your library. Until end of turn, you may play that card.
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new ExileTopXMayPlayUntilEndOfTurnEffect(1), false));
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new ExileTopXMayPlayUntilEffect(1, Duration.EndOfTurn)
.withTextOptions("that card", false), false));
// Madness {1}{R}
this.addAbility(new MadnessAbility(new ManaCostsImpl<>("{1}{R}")));

View file

@ -5,7 +5,7 @@ import mage.abilities.Ability;
import mage.abilities.common.DealsDamageToAPlayerAttachedTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.abilities.effects.common.continuous.BoostEquippedEffect;
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.effects.common.continuous.PlayAdditionalLandsControllerEffect;
@ -35,7 +35,7 @@ public final class SwordOfForgeAndFrontier extends CardImpl {
"and has protection from red and from green"));
this.addAbility(ability);
// Whenever equipped creature deals combat damage to a player, exile the top two cards of your library. You may play those cards this turn. You may play an additional land this turn.
Ability ability2 = new DealsDamageToAPlayerAttachedTriggeredAbility(new ExileTopXMayPlayUntilEndOfTurnEffect(2),"equipped creature", false);
Ability ability2 = new DealsDamageToAPlayerAttachedTriggeredAbility(new ExileTopXMayPlayUntilEffect(2, Duration.EndOfTurn),"equipped creature", false);
ability2.addEffect(new PlayAdditionalLandsControllerEffect(1, Duration.EndOfTurn));
this.addAbility(ability2);

View file

@ -6,13 +6,10 @@ import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.constants.Zone;
import mage.constants.*;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.stack.Spell;
@ -56,7 +53,7 @@ public final class SyrCarahTheBold extends CardImpl {
class SyrCarahTheBoldTriggeredAbility extends TriggeredAbilityImpl {
SyrCarahTheBoldTriggeredAbility() {
super(Zone.BATTLEFIELD, new ExileTopXMayPlayUntilEndOfTurnEffect(1), false);
super(Zone.BATTLEFIELD, new ExileTopXMayPlayUntilEffect(1, Duration.EndOfTurn), false);
}
private SyrCarahTheBoldTriggeredAbility(final SyrCarahTheBoldTriggeredAbility ability) {

View file

@ -1,10 +1,11 @@
package mage.cards.t;
import mage.abilities.common.AttacksAloneControlledTriggeredAbility;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import java.util.UUID;
@ -17,7 +18,7 @@ public final class TemperedInSolitude extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}");
// Whenever a creature you control attacks alone, exile the top card of your library. You may play that card this turn.
this.addAbility(new AttacksAloneControlledTriggeredAbility(new ExileTopXMayPlayUntilEndOfTurnEffect(1)));
this.addAbility(new AttacksAloneControlledTriggeredAbility(new ExileTopXMayPlayUntilEffect(1, Duration.EndOfTurn)));
}
private TemperedInSolitude(final TemperedInSolitude card) {

View file

@ -3,7 +3,7 @@ package mage.cards.t;
import mage.Mana;
import mage.abilities.common.SagaAbility;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.abilities.effects.mana.BasicManaEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -37,8 +37,8 @@ public final class TheFlux extends CardImpl {
// II, III, IV, V -- Exile the top card of your library. You may play that card this turn.
sagaAbility.addChapterEffect(
this, SagaChapter.CHAPTER_II, SagaChapter.CHAPTER_V,
new ExileTopXMayPlayUntilEndOfTurnEffect(
1, false, Duration.EndOfTurn
new ExileTopXMayPlayUntilEffect(
1, Duration.EndOfTurn
)
);

View file

@ -3,8 +3,9 @@ package mage.cards.t;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.abilities.keyword.BoastAbility;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -25,7 +26,7 @@ public final class TuskeriFirewalker extends CardImpl {
this.toughness = new MageInt(2);
// Boast {1}: Exile the top card of your library. You may play that card this turn.
this.addAbility(new BoastAbility(new ExileTopXMayPlayUntilEndOfTurnEffect(1), new GenericManaCost(1)));
this.addAbility(new BoastAbility(new ExileTopXMayPlayUntilEffect(1, Duration.EndOfTurn), new GenericManaCost(1)));
}
private TuskeriFirewalker(final TuskeriFirewalker card) {

View file

@ -4,7 +4,7 @@ import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.abilities.keyword.HasteAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
@ -36,7 +36,7 @@ public final class UrabraskHereticPraetor extends CardImpl {
// At the beginning of your upkeep, exile the top card of your library. You may play it this turn.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(
new ExileTopXMayPlayUntilEndOfTurnEffect(1, false),
new ExileTopXMayPlayUntilEffect(1, Duration.EndOfTurn).withTextOptions("it", true),
TargetController.YOU, false
));

View file

@ -2,10 +2,11 @@ package mage.cards.v;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.cards.AdventureCard;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
@ -67,7 +68,7 @@ class VirtueOfCourageTriggeredAbility extends TriggeredAbilityImpl {
return false;
}
this.getEffects().clear();
this.addEffect(new ExileTopXMayPlayUntilEndOfTurnEffect(event.getAmount()));
this.addEffect(new ExileTopXMayPlayUntilEffect(event.getAmount(), Duration.EndOfTurn));
return true;
}

View file

@ -5,13 +5,10 @@ import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.condition.Condition;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.TargetController;
import mage.constants.WatcherScope;
import mage.constants.Zone;
import mage.constants.*;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.token.PowerstoneToken;
@ -32,7 +29,7 @@ public final class VisionsOfPhyrexia extends CardImpl {
// At the beginning of your upkeep, exile the top card of your library. You may play that card this turn.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(
new ExileTopXMayPlayUntilEndOfTurnEffect(1), TargetController.YOU, false
new ExileTopXMayPlayUntilEffect(1, Duration.EndOfTurn), TargetController.YOU, false
));
// At the beginning of your end step, if you didn't play a card from exile this turn, create a tapped Powerstone token.

View file

@ -7,16 +7,13 @@ import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.ActivateAsSorceryActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.DamageControllerEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.abilities.effects.common.TransformSourceEffect;
import mage.abilities.keyword.TransformAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.WatcherScope;
import mage.constants.Zone;
import mage.constants.*;
import mage.game.ExileZone;
import mage.game.Game;
import mage.game.events.GameEvent;
@ -44,7 +41,7 @@ public final class VoltaicVisionary extends CardImpl {
Ability ability = new ActivateAsSorceryActivatedAbility(
new DamageControllerEffect(2), new TapSourceCost()
);
ability.addEffect(new ExileTopXMayPlayUntilEndOfTurnEffect(1));
ability.addEffect(new ExileTopXMayPlayUntilEffect(1, Duration.EndOfTurn));
this.addAbility(ability);
// When you play a card exiled with Voltaic Visionary, transform Voltaic Visionary.

View file

@ -6,7 +6,7 @@ import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
@ -31,7 +31,7 @@ public final class WarehouseThief extends CardImpl {
// {2}, {T}, Sacrifice an artifact or creature: Exile the top card of your library. Until the end of your next turn, you may play that card.
Ability ability = new SimpleActivatedAbility(
new ExileTopXMayPlayUntilEndOfTurnEffect(1, false, Duration.UntilEndOfYourNextTurn), new GenericManaCost(2)
new ExileTopXMayPlayUntilEffect(1, Duration.UntilEndOfYourNextTurn), new GenericManaCost(2)
);
ability.addCost(new TapSourceCost());
ability.addCost(new SacrificeTargetCost(StaticFilters.FILTER_CONTROLLED_ARTIFACT_OR_CREATURE_SHORT_TEXT));

View file

@ -5,9 +5,7 @@ import mage.abilities.Ability;
import mage.abilities.common.AttacksWithCreaturesTriggeredAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.hint.Hint;
import mage.abilities.hint.ValueHint;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.UndyingAbility;
import mage.cards.CardImpl;
@ -15,7 +13,6 @@ import mage.cards.CardSetInfo;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.constants.*;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
@ -48,7 +45,7 @@ public final class WitchKingSkyScourge extends CardImpl {
// Whenever you attack with one or more Wraiths, exile the top X cards of your library, where X is their total power. You may play those cards this turn.
this.addAbility(new AttacksWithCreaturesTriggeredAbility(Zone.BATTLEFIELD,
new ExileTopXMayPlayUntilEndOfTurnEffect(TotalTargetsPowerValue.instance)
new ExileTopXMayPlayUntilEffect(TotalTargetsPowerValue.instance, Duration.EndOfTurn)
.setText("exile the top X cards of your library, where X is their total power. You may play those cards this turn.")
, 1, filter, true));

View file

@ -1,6 +1,6 @@
package mage.cards.w;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
@ -17,7 +17,7 @@ public final class WrennsResolve extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{R}");
// Exile the top two cards of your library. Until the end of your next turn, you may play those cards.
this.getSpellAbility().addEffect(new ExileTopXMayPlayUntilEndOfTurnEffect(2, false, Duration.UntilEndOfYourNextTurn));
this.getSpellAbility().addEffect(new ExileTopXMayPlayUntilEffect(2, Duration.UntilEndOfYourNextTurn));
}
private WrennsResolve(final WrennsResolve card) {

View file

@ -3,7 +3,7 @@ package mage.cards.y;
import mage.MageInt;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
import mage.abilities.keyword.DoctorsCompanionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -29,8 +29,8 @@ public final class YasminKhan extends CardImpl {
this.toughness = new MageInt(3);
// {T}: Exile the top card of your library. Until your next end step, you may play it.
this.addAbility(new SimpleActivatedAbility(new ExileTopXMayPlayUntilEndOfTurnEffect(
1, false, Duration.UntilYourNextEndStep
this.addAbility(new SimpleActivatedAbility(new ExileTopXMayPlayUntilEffect(
1, Duration.UntilYourNextEndStep
), new TapSourceCost()));
// Doctor's companion

View file

@ -0,0 +1,88 @@
package mage.abilities.effects.common;
import mage.abilities.Ability;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.asthought.PlayFromNotOwnHandZoneTargetEffect;
import mage.cards.Card;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game;
import mage.players.Player;
import mage.target.targetpointer.FixedTargets;
import mage.util.CardUtil;
import java.util.Set;
public class ExileTopXMayPlayUntilEffect extends OneShotEffect {
private final DynamicValue amount;
private final Duration duration;
public ExileTopXMayPlayUntilEffect(int amount, Duration duration) {
this(StaticValue.get(amount), duration);
}
public ExileTopXMayPlayUntilEffect(DynamicValue amount, Duration duration) {
super(Outcome.Benefit);
this.amount = amount.copy();
this.duration = duration;
makeText(amount.toString().equals("1") ? "that card" : "those cards", duration == Duration.EndOfTurn);
}
private ExileTopXMayPlayUntilEffect(final ExileTopXMayPlayUntilEffect effect) {
super(effect);
this.amount = effect.amount.copy();
this.duration = effect.duration;
}
@Override
public ExileTopXMayPlayUntilEffect copy() {
return new ExileTopXMayPlayUntilEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller == null) {
return false;
}
int resolvedAmount = amount.calculate(game, source, this);
Set<Card> cards = controller.getLibrary().getTopCards(game, resolvedAmount);
if (cards.isEmpty()) {
return true;
}
controller.moveCardsToExile(cards, source, game, true, CardUtil.getExileZoneId(game, source), CardUtil.getSourceName(game, source));
// remove cards that could not be moved to exile
cards.removeIf(card -> !Zone.EXILED.equals(game.getState().getZone(card.getId())));
if (!cards.isEmpty()) {
game.addEffect(new PlayFromNotOwnHandZoneTargetEffect(Zone.EXILED, duration)
.setTargetPointer(new FixedTargets(cards, game)), source);
}
return true;
}
/**
* [Until end of turn, ] you may play [refCardText] [this turn]
*/
public ExileTopXMayPlayUntilEffect withTextOptions(String refCardText, boolean durationRuleAtEnd) {
makeText(refCardText, durationRuleAtEnd);
return this;
}
private void makeText(String refCardText, boolean durationRuleAtEnd) {
String text = "exile the top ";
boolean singular = amount.toString().equals("1");
text += singular ? "card" : CardUtil.numberToText(amount.toString()) + " cards";
text += " of your library. ";
if (durationRuleAtEnd) {
text += "You may play " + refCardText + ' ' + (duration == Duration.EndOfTurn ? "this turn" : duration.toString());
} else {
text += CardUtil.getTextWithFirstCharUpperCase(duration.toString()) + ", you may play " + refCardText;
}
this.staticText = text;
}
}

View file

@ -1,109 +0,0 @@
package mage.abilities.effects.common;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.asthought.PlayFromNotOwnHandZoneTargetEffect;
import mage.cards.Card;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game;
import mage.players.Player;
import mage.target.targetpointer.FixedTargets;
import mage.util.CardUtil;
import java.util.Set;
public class ExileTopXMayPlayUntilEndOfTurnEffect extends OneShotEffect {
private final DynamicValue amount;
private final boolean showHint;
private final Duration duration;
public ExileTopXMayPlayUntilEndOfTurnEffect(int amount) {
this(amount, false);
}
public ExileTopXMayPlayUntilEndOfTurnEffect(int amount, boolean showHint) {
this(amount, showHint, Duration.EndOfTurn);
}
public ExileTopXMayPlayUntilEndOfTurnEffect(int amount, boolean showHint, Duration duration) {
this(StaticValue.get(amount), showHint, duration);
}
public ExileTopXMayPlayUntilEndOfTurnEffect(DynamicValue amount) {
this(amount, false);
}
public ExileTopXMayPlayUntilEndOfTurnEffect(DynamicValue amount, boolean showHint) {
this(amount, showHint, Duration.EndOfTurn);
}
public ExileTopXMayPlayUntilEndOfTurnEffect(DynamicValue amount, boolean showHint, Duration duration) {
super(Outcome.Benefit);
this.amount = amount.copy();
this.showHint = showHint;
this.duration = duration;
}
private ExileTopXMayPlayUntilEndOfTurnEffect(final ExileTopXMayPlayUntilEndOfTurnEffect effect) {
super(effect);
this.amount = effect.amount.copy();
this.showHint = effect.showHint;
this.duration = effect.duration;
}
@Override
public ExileTopXMayPlayUntilEndOfTurnEffect copy() {
return new ExileTopXMayPlayUntilEndOfTurnEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller == null) {
return false;
}
int resolvedAmount = amount.calculate(game, source, this);
Set<Card> cards = controller.getLibrary().getTopCards(game, resolvedAmount);
if (cards.isEmpty()) {
return true;
}
controller.moveCardsToExile(cards, source, game, true, CardUtil.getExileZoneId(game, source), CardUtil.getSourceName(game, source));
// remove cards that could not be moved to exile
cards.removeIf(card -> !Zone.EXILED.equals(game.getState().getZone(card.getId())));
if (!cards.isEmpty()) {
game.addEffect(new PlayFromNotOwnHandZoneTargetEffect(Zone.EXILED, duration)
.setTargetPointer(new FixedTargets(cards, game)), source);
}
return true;
}
@Override
public String getText(Mode mode) {
if (staticText != null && !staticText.isEmpty()) {
return staticText;
}
StringBuilder sb = new StringBuilder("exile the top ");
if (amount.toString().equals("1")) {
sb.append("card of your library. ");
} else {
sb.append(CardUtil.numberToText(amount.toString()));
sb.append(" cards of your library. ");
}
sb.append(CardUtil.getTextWithFirstCharUpperCase(duration.toString()));
sb.append(", you may play ");
sb.append(amount.toString().equals("1") ? "that card"
: amount.toString().equals("2") ? "those cards" // That is weird.
: "cards exiled this way");
if (showHint) {
sb.append(". <i>(You still pay its costs. You can play a land this way only if you have an available land play remaining.)</i>");
}
return sb.toString();
}
}