Merge branch 'master' of github.com:magefree/mage into ante

This commit is contained in:
Noah Gleason 2018-07-15 21:02:04 -04:00
commit d511201844
No known key found for this signature in database
GPG key ID: EC030EC6B0650A40
613 changed files with 5552 additions and 2210 deletions

View file

@ -11,7 +11,7 @@ import mage.view.CardView;
*/
public class CardViewEDHPowerLevelComparator implements Comparator<CardView> {
public int getPowerLevel(CardView card) {
private int getPowerLevel(CardView card) {
int thisMaxPower = 0;
@ -306,7 +306,7 @@ public class CardViewEDHPowerLevelComparator implements Comparator<CardView> {
thisMaxPower = Math.max(thisMaxPower, 1);
}
if (card.getCardTypes().contains("Plainswalker")) {
if (card.isPlanesWalker()) {
if (card.getName().toLowerCase(Locale.ENGLISH).equals("jace, the mind sculptor")) {
thisMaxPower = Math.max(thisMaxPower, 6);
}
@ -509,7 +509,7 @@ public class CardViewEDHPowerLevelComparator implements Comparator<CardView> {
@Override
public int compare(CardView o1, CardView o2) {
return Integer.valueOf(getPowerLevel(o1)).compareTo(getPowerLevel(o2));
return Integer.compare(getPowerLevel(o1), getPowerLevel(o2));
}
}

View file

@ -1,13 +1,6 @@
package org.mage.plugins.card.dl.sources;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.InetSocketAddress;
import java.net.Proxy;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
@ -19,18 +12,12 @@ import java.util.Set;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.prefs.Preferences;
import mage.cards.Sets;
import mage.cards.repository.CardCriteria;
import mage.cards.repository.CardInfo;
import mage.cards.repository.CardRepository;
import mage.client.MageFrame;
import mage.client.dialog.PreferencesDialog;
import mage.remote.Connection;
import mage.remote.Connection.ProxyType;
import org.apache.log4j.Logger;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
@ -235,7 +222,7 @@ public enum WizardCardsImageSource implements CardImageSource {
supportedSets.add("AKH");
supportedSets.add("MPS");
supportedSets.add("CMA");
// supportedSets.add("CM2"); // Commander Anthology, Vol. II
supportedSets.add("CM2"); // Commander Anthology, Vol. II
supportedSets.add("E01");
supportedSets.add("HOU");
supportedSets.add("C17");
@ -249,7 +236,10 @@ public enum WizardCardsImageSource implements CardImageSource {
supportedSets.add("RIX"); // Rivals of Ixalan
supportedSets.add("A25"); // Masters 25
supportedSets.add("DOM"); // Dominaria
// supportedSets.add("M19"); // Core 2019
supportedSets.add("M19"); // Core 2019
// supportedSets.add("GRN"); // Guilds of Ravnica
// supportedSets.add("RNA"); // Ravnica Allegiance
// supportedSets.add("C18"); // Commander 2018
sets = new HashMap<>();
setsAliases = new HashMap<>();
@ -286,7 +276,7 @@ public enum WizardCardsImageSource implements CardImageSource {
setsAliases.put("C16", "Commander 2016");
setsAliases.put("C17", "Commander 2017");
setsAliases.put("CMA", "Commander Anthology");
// setsAliases.put("CM2", "Commander Anthology, Vol. II");
setsAliases.put("CM2", "Commander Anthology 2018");
setsAliases.put("CHK", "Champions of Kamigawa");
setsAliases.put("CHR", "Chronicles");
setsAliases.put("CMD", "Magic: The Gathering-Commander");

View file

@ -342,7 +342,17 @@ public class HumanPlayer extends PlayerImpl {
replacementEffectChoice.getChoices().clear();
replacementEffectChoice.setKeyChoices(rEffects);
while (!abort) {
// Check if there are different ones
int differentChoices = 0;
String lastChoice = "";
for (String value : replacementEffectChoice.getKeyChoices().values()) {
if (!lastChoice.equalsIgnoreCase(value)) {
lastChoice = value;
differentChoices++;
}
}
while (!abort && differentChoices > 1) {
updateGameStatePriority("chooseEffect", game);
prepareForResponse(game);
if (!isExecutingMacro()) {

View file

@ -1,4 +1,3 @@
package mage.server.game;
import java.io.*;
@ -1188,8 +1187,13 @@ public class GameController implements GameCallback {
sb.append("<br>Active player is: ");
sb.append(game.getPlayer(state.getActivePlayerId()).getName());
PassAbility pass = new PassAbility();
if (game.getPlayer(state.getActivePlayerId()).hasLeft()) {
Player p = game.getPlayer(state.getActivePlayerId());
if (p != null) {
p.concede(game);
}
Phase currentPhase = game.getPhase();
if (currentPhase != null) {
currentPhase.getStep().skipStep(game, state.getActivePlayerId());
@ -1204,6 +1208,10 @@ public class GameController implements GameCallback {
sb.append("<br>getChoosingPlayerId: ");
if (state.getChoosingPlayerId() != null) {
if (game.getPlayer(state.getChoosingPlayerId()).hasLeft()) {
Player p = game.getPlayer(state.getChoosingPlayerId());
if (p != null) {
p.concede(game);
}
Phase currentPhase = game.getPhase();
if (currentPhase != null && !fixedAlready) {
currentPhase.getStep().endStep(game, state.getActivePlayerId());
@ -1219,6 +1227,10 @@ public class GameController implements GameCallback {
sb.append("<br><font color=orange>Player with Priority is: ");
if (state.getPriorityPlayerId() != null) {
if (game.getPlayer(state.getPriorityPlayerId()).hasLeft()) {
Player p = game.getPlayer(state.getPriorityPlayerId());
if (p != null) {
p.concede(game);
}
Phase currentPhase = game.getPhase();
if (currentPhase != null && !fixedAlready) {
currentPhase.getStep().skipStep(game, state.getActivePlayerId());

View file

@ -5,7 +5,7 @@ import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.condition.common.ControlsCreatureGreatestToughnessCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -27,7 +27,7 @@ public final class AbzanBeastmaster extends CardImpl {
this.toughness = new MageInt(1);
// At the beginning of your upkeep, draw a card if you control the creature with the greatest toughness or tied for the greatest toughness.
this.addAbility(new ConditionalTriggeredAbility(
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
new BeginningOfUpkeepTriggeredAbility(new DrawCardSourceControllerEffect(1), TargetController.YOU, false),
ControlsCreatureGreatestToughnessCondition.instance,
"At the beginning of your upkeep, draw a card if you control the creature with the greatest toughness or tied for the greatest toughness."

View file

@ -0,0 +1,88 @@
package mage.cards.a;
import java.util.UUID;
import mage.abilities.StaticAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.AsThoughEffectImpl;
import mage.abilities.effects.common.continuous.BoostEnchantedEffect;
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.keyword.ReachAbility;
import mage.constants.*;
import mage.abilities.keyword.FlashAbility;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetCreaturePermanent;
import mage.abilities.Ability;
import mage.abilities.effects.common.AttachEffect;
import mage.target.TargetPermanent;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
/**
*
* @author noahg
*/
public final class AetherWeb extends CardImpl {
public AetherWeb(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}");
this.subtype.add(SubType.AURA);
// Flash
this.addAbility(FlashAbility.getInstance());
// Enchant creature
TargetPermanent auraTarget = new TargetCreaturePermanent();
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// Enchanted creature gets +1/+1, has reach, and can block creatures with shadow as though they didn't have shadow.
StaticAbility staticAbility = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1)
.setText("Enchanted creature gets +1/+1, has reach, and can block creatures with shadow as though they didn't have shadow."));
staticAbility.addEffect(new GainAbilityAttachedEffect(ReachAbility.getInstance(), AttachmentType.AURA).setText(""));
staticAbility.addEffect(new AetherWebEffect());
this.addAbility(staticAbility);
}
public AetherWeb(final AetherWeb card) {
super(card);
}
@Override
public AetherWeb copy() {
return new AetherWeb(this);
}
}
class AetherWebEffect extends AsThoughEffectImpl {
public AetherWebEffect() {
super(AsThoughEffectType.BLOCK_SHADOW, Duration.WhileOnBattlefield, Outcome.Benefit);
staticText = "";
}
public AetherWebEffect(final AetherWebEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
return true;
}
@Override
public AetherWebEffect copy() {
return new AetherWebEffect(this);
}
@Override
public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) {
Permanent sourcePermanent = source.getSourcePermanentIfItStillExists(game);
return sourcePermanent != null && sourceId.equals(sourcePermanent.getAttachedTo());
}
}

View file

@ -0,0 +1,93 @@
package mage.cards.a;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.costs.common.ReturnToHandFromBattlefieldSourceCost;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DoIfCostPaid;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.combat.CombatGroup;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCardInHand;
/**
*
* @author noahg
*/
public final class Aetherplasm extends CardImpl {
public Aetherplasm(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}{U}");
this.subtype.add(SubType.ILLUSION);
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// Whenever Aetherplasm blocks a creature, you may return Aetherplasm to its owner's hand. If you do, you may put a creature card from your hand onto the battlefield blocking that creature.
this.addAbility(new BlocksTriggeredAbility(new DoIfCostPaid(new AetherplasmEffect(), new ReturnToHandFromBattlefieldSourceCost()), false, true));
}
public Aetherplasm(final Aetherplasm card) {
super(card);
}
@Override
public Aetherplasm copy() {
return new Aetherplasm(this);
}
}
class AetherplasmEffect extends OneShotEffect {
public AetherplasmEffect() {
super(Outcome.PutCardInPlay);
this.staticText = "you may put a creature card from your hand onto the battlefield blocking that creature";
}
public AetherplasmEffect(AetherplasmEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
if (player.chooseUse(Outcome.PutCardInPlay, "Put a creature card from your hand onto the battlefield?", source, game)) {
TargetCardInHand target = new TargetCardInHand(StaticFilters.FILTER_CARD_CREATURE_A);
if (player.choose(Outcome.PutCardInPlay, target, source.getSourceId(), game)) {
Card card = game.getCard(target.getFirstTarget());
if (card != null) {
Permanent blockedCreature = game.getPermanent(getTargetPointer().getFirst(game, source));
if (player.moveCards(card, Zone.BATTLEFIELD, source, game, false, false, false, null)
&& game.getCombat() != null && blockedCreature != null) {
CombatGroup attacker = game.getCombat().findGroup(blockedCreature.getId());
Permanent putIntoPlay = game.getPermanent(target.getFirstTarget());
if (putIntoPlay != null && putIntoPlay.isCreature() && attacker != null) {
game.getCombat().findGroup(blockedCreature.getId()).addBlocker(putIntoPlay.getId(), source.getControllerId(), game);
}
}
}
}
}
return true;
}
@Override
public AetherplasmEffect copy() {
return new AetherplasmEffect(this);
}
}

View file

@ -6,7 +6,7 @@ import mage.MageInt;
import mage.abilities.TriggeredAbility;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.condition.common.NoSpellsWereCastLastTurnCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.TransformSourceEffect;
import mage.abilities.keyword.TransformAbility;
import mage.cards.CardImpl;
@ -36,7 +36,7 @@ public final class AfflictedDeserter extends CardImpl {
// At the beginning of each upkeep, if no spells were cast last turn, transform Afflicted Deserter.
this.addAbility(new TransformAbility());
TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(true), TargetController.ANY, false);
this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.instance, TransformAbility.NO_SPELLS_TRANSFORM_RULE));
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.instance, TransformAbility.NO_SPELLS_TRANSFORM_RULE));
}
public AfflictedDeserter(final AfflictedDeserter card) {

View file

@ -7,7 +7,7 @@ import mage.abilities.Ability;
import mage.abilities.TriggeredAbility;
import mage.abilities.common.BeginningOfYourEndStepTriggeredAbility;
import mage.abilities.condition.common.RevoltCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.cards.*;
import mage.constants.CardType;
@ -33,7 +33,7 @@ public final class AidFromTheCowl extends CardImpl {
// <i>Revolt</i> &mdash; At the beginning of your end step, if a permanent you controlled left the battlefield this turn,
// reveal the top card of your library. If it is a permanent card, you may put it onto the battlefield. Otherwise, put it on the bottom of your library.
TriggeredAbility ability = new BeginningOfYourEndStepTriggeredAbility(new AidFromTheCowlEffect(), false);
this.addAbility(new ConditionalTriggeredAbility(ability, RevoltCondition.instance, ruleText), new RevoltWatcher());
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, RevoltCondition.instance, ruleText), new RevoltWatcher());
}
public AidFromTheCowl(final AidFromTheCowl card) {

View file

@ -6,7 +6,7 @@ import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.condition.common.RevoltCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
@ -34,7 +34,7 @@ public final class AirdropAeronauts extends CardImpl {
this.addAbility(FlyingAbility.getInstance());
// <i>Revolt</i> &mdash; When Airdrop Aeronauts enters the battlefield, if a permanent you controlled left the battlefield this turn, you gain 5 life.
Ability ability = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(
Ability ability = new ConditionalInterveningIfTriggeredAbility(new EntersBattlefieldTriggeredAbility(
new GainLifeEffect(5), false), RevoltCondition.instance,
"<i>Revolt</i> &mdash; When {this} enters the battlefield, if a permanent you controlled left"
+ " the battlefield this turn, you gain 5 life."

View file

@ -34,7 +34,7 @@ public final class AjaniWiseCounselor extends CardImpl {
// +2: You gain 1 life for each creature you control.
this.addAbility(new LoyaltyAbility(new GainLifeEffect(
new PermanentsOnBattlefieldCount(StaticFilters.FILTER_CONTROLLED_CREATURE)
).setText("you gain 1 life for each "), 2));
).setText("you gain 1 life for each creature you control"), 2));
// 3: Creatures you control get +2/+2 until end of turn.
this.addAbility(new LoyaltyAbility(
@ -46,6 +46,7 @@ public final class AjaniWiseCounselor extends CardImpl {
CounterType.P1P1.createInstance(),
new ControllerLifeCount()
).setText("put X +1/+1 counters on target creature, where X is your life total"), -9);
this.addAbility(ability);
}
public AjaniWiseCounselor(final AjaniWiseCounselor card) {

View file

@ -5,7 +5,7 @@ import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BeginningOfCombatTriggeredAbility;
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
@ -43,7 +43,7 @@ public final class AjanisComrade extends CardImpl {
this.addAbility(TrampleAbility.getInstance());
// At the beginning of combat on your turn, if you control an Ajani planeswalker, put a +1/+1 counter on Ajani's Comrade.
this.addAbility(new ConditionalTriggeredAbility(
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
new BeginningOfCombatTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), TargetController.YOU, false),
new PermanentsOnTheBattlefieldCondition(filter),
"At the beginning of combat on your turn, if you control an Ajani planeswalker, put a +1/+1 counter on {this}."));

View file

@ -5,7 +5,7 @@ import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.DiscardedByOpponentTriggeredAbility;
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.DoIfCostPaid;
import mage.cards.CardImpl;
@ -39,7 +39,7 @@ public final class AjanisLastStand extends CardImpl {
this.addAbility(new AjanisLastStandTriggeredAbility());
// When a spell or ability an opponent controls causes you to discard this card, if you control a Plains, create a 4/4 white Avatar creature token with flying.
this.addAbility(new ConditionalTriggeredAbility(
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
new DiscardedByOpponentTriggeredAbility(new CreateTokenEffect(new AvatarToken2())),
new PermanentsOnTheBattlefieldCondition(filter),
"When a spell or ability an opponent controls causes you to discard this card, "

View file

@ -7,7 +7,7 @@ import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.condition.common.MoreCardsInHandThanOpponentsCondition;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.DoIfCostPaid;
import mage.abilities.effects.common.ReturnSourceFromGraveyardToBattlefieldEffect;
import mage.abilities.keyword.HasteAbility;
@ -40,7 +40,7 @@ public final class AkutaBornOfAsh extends CardImpl {
// Haste
this.addAbility(HasteAbility.getInstance());
// At the beginning of your upkeep, if you have more cards in hand than each opponent, you may sacrifice a Swamp. If you do, return Akuta, Born of Ash from your graveyard to the battlefield.
Ability ability = new ConditionalTriggeredAbility(
Ability ability = new ConditionalInterveningIfTriggeredAbility(
new BeginningOfUpkeepTriggeredAbility(Zone.GRAVEYARD,
new DoIfCostPaid(new ReturnSourceFromGraveyardToBattlefieldEffect(), new SacrificeTargetCost(new TargetControlledPermanent(filterSwamp))),
TargetController.YOU, false),

View file

@ -7,7 +7,7 @@ import mage.abilities.Ability;
import mage.abilities.TriggeredAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.condition.common.KickedCostCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.discard.DiscardTargetEffect;
import mage.abilities.keyword.KickerAbility;
@ -51,12 +51,12 @@ public final class AnaBattlemage extends CardImpl {
// When Ana Battlemage enters the battlefield, if it was kicked with its {2}{U} kicker, target player discards three cards.
TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new DiscardTargetEffect(3));
ability.addTarget(new TargetOpponent());
this.addAbility(new ConditionalTriggeredAbility(ability, new KickedCostCondition("{2}{U}"),
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, new KickedCostCondition("{2}{U}"),
"When {this} enters the battlefield, if it was kicked with its {2}{U} kicker, target player discards three cards."));
// When Ana Battlemage enters the battlefield, if it was kicked with its {1}{B} kicker, tap target untapped creature and that creature deals damage equal to its power to its controller.
ability = new EntersBattlefieldTriggeredAbility(new AnaBattlemageKickerEffect());
ability.addTarget(new TargetCreaturePermanent(filter));
this.addAbility(new ConditionalTriggeredAbility(ability, new KickedCostCondition("{1}{B}"),
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, new KickedCostCondition("{1}{B}"),
"When {this} enters the battlefield, if it was kicked with its {1}{B} kicker, tap target untapped creature and that creature deals damage equal to its power to its controller."));
}

View file

@ -4,7 +4,7 @@ package mage.cards.a;
import java.util.UUID;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.common.SanctuaryTriggeredAbility;
import mage.abilities.common.SanctuaryInterveningIfTriggeredAbility;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
@ -27,7 +27,7 @@ public final class AnaSanctuary extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}");
// At the beginning of your upkeep, if you control a blue or black permanent, target creature gets +1/+1 until end of turn. If you control a blue permanent and a black permanent, that creature gets +5/+5 until end of turn instead.
Ability ability = new SanctuaryTriggeredAbility(
Ability ability = new SanctuaryInterveningIfTriggeredAbility(
new BoostEffect(1), new BoostEffect(5), ObjectColor.BLACK, ObjectColor.BLUE,
"At the beginning of your upkeep, if you control a blue or black permanent, "
+ "target creature gets +1/+1 until end of turn. If you control a blue permanent and a black permanent, that creature gets +5/+5 until end of turn instead."

View file

@ -6,7 +6,7 @@ import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.condition.common.DeliriumCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.abilities.keyword.FlyingAbility;
@ -46,7 +46,7 @@ public final class AngelOfDeliverance extends CardImpl {
// <i>Delirium</i> &mdash; Whenever Angel of Deliverance deals damage, if there are four or more card types among cards in your graveyard,
// exile target creature an opponent controls.
Ability ability = new ConditionalTriggeredAbility(
Ability ability = new ConditionalInterveningIfTriggeredAbility(
new AngelOfDeliveranceDealsDamageTriggeredAbility(),
DeliriumCondition.instance,
"<i>Delirium</i> &mdash; Whenever {this} deals damage, if there are four or more card types among cards in your graveyard, exile target creature an opponent controls"

View file

@ -5,7 +5,7 @@ import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.condition.common.CastFromHandSourceCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.ExileAllEffect;
import mage.abilities.keyword.FlashAbility;
import mage.abilities.keyword.FlyingAbility;
@ -34,7 +34,7 @@ public final class AngelOfTheDireHour extends CardImpl {
// Flying
this.addAbility(FlyingAbility.getInstance());
// When Angel of the Dire Hour enters the battlefield, if you cast it from your hand, exile all attacking creatures.
this.addAbility(new ConditionalTriggeredAbility(
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
new EntersBattlefieldTriggeredAbility(new ExileAllEffect(new FilterAttackingCreature("attacking creatures")), false),
CastFromHandSourceCondition.instance,
"When {this} enters the battlefield, if you cast it from your hand, exile all attacking creatures."),

View file

@ -8,7 +8,7 @@ import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.LeavesBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.SourceOnBattlefieldCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.BoostEnchantedEffect;
@ -47,7 +47,7 @@ public final class AnimateDead extends CardImpl {
// When Animate Dead enters the battlefield, if it's on the battlefield, it loses "enchant creature card in a graveyard"
// and gains "enchant creature put onto the battlefield with Animate Dead." Return enchanted creature card to the battlefield
// under your control and attach Animate Dead to it. When Animate Dead leaves the battlefield, that creature's controller sacrifices it.
Ability ability = new ConditionalTriggeredAbility(
Ability ability = new ConditionalInterveningIfTriggeredAbility(
new EntersBattlefieldTriggeredAbility(new AnimateDeadReAttachEffect(), false),
SourceOnBattlefieldCondition.instance,
"When {this} enters the battlefield, if it's on the battlefield, it loses \"enchant creature card in a graveyard\" and gains \"enchant creature put onto the battlefield with {this}.\" Return enchanted creature card to the battlefield under your control and attach {this} to it.");

View file

@ -5,7 +5,7 @@ import mage.MageInt;
import mage.abilities.TriggeredAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
@ -42,7 +42,7 @@ public final class ApothecaryGeist extends CardImpl {
// When Apothecary Geist enters the battlefield, if you control another Spirit, you gain 3 life.
TriggeredAbility triggeredAbility = new EntersBattlefieldTriggeredAbility(new GainLifeEffect(3));
this.addAbility(new ConditionalTriggeredAbility(
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
triggeredAbility,
new PermanentsOnTheBattlefieldCondition(filter),
"When {this} enters the battlefield, if you control another Spirit, you gain 3 life."));

View file

@ -43,7 +43,7 @@ class ApproachOfTheSecondSunEffect extends OneShotEffect {
public ApproachOfTheSecondSunEffect() {
super(Outcome.Win);
this.staticText
= "If {this} was cast from your hand and you've cast another spell named Approach of the Second Sun this game, you win the game. "
= "If this spell was cast from your hand and you've cast another spell named Approach of the Second Sun this game, you win the game. "
+ "Otherwise, put {this} into its owner's library seventh from the top and you gain 7 life.";
}

View file

@ -7,7 +7,7 @@ import mage.abilities.common.AttacksCreatureYouControlTriggeredAbility;
import mage.abilities.common.BeginningOfCombatTriggeredAbility;
import mage.abilities.condition.common.SourceOnBattlefieldOrCommandZoneCondition;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DoIfCostPaid;
@ -56,7 +56,7 @@ public final class ArahboRoarOfTheWorld extends CardImpl {
this.toughness = new MageInt(5);
// Eminence &mdash; At the beginning of combat on your turn, if Arahbo, Roar of the World is in the command zone or on the battlefield, another target Cat you control gets +3/+3 until end of turn.
Ability ability = new ConditionalTriggeredAbility(
Ability ability = new ConditionalInterveningIfTriggeredAbility(
new BeginningOfCombatTriggeredAbility(Zone.ALL, new BoostTargetEffect(3, 3, Duration.EndOfTurn), TargetController.YOU, false, false),
SourceOnBattlefieldOrCommandZoneCondition.instance,
"<i>Eminence</i> &mdash; At the beginning of combat on your turn, if Arahbo, Roar of the World is in the command zone or on the battlefield, another target Cat you control gets +3/+3 until end of turn.");

View file

@ -8,7 +8,7 @@ import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.condition.common.FatefulHourCondition;
import mage.abilities.costs.common.PayLifeCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.TransformSourceEffect;
import mage.abilities.keyword.TransformAbility;
@ -40,7 +40,7 @@ public final class ArguelsBloodFast extends CardImpl {
// At the beginning of your upkeep, if you have 5 or less life, you may transform Arguel's Blood Fast.
this.addAbility(new TransformAbility());
this.addAbility(new ConditionalTriggeredAbility(
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(true), TargetController.YOU, true),
FatefulHourCondition.instance,
"At the beginning of your upkeep, if you have 5 or less life, you may transform {this}"

View file

@ -32,9 +32,9 @@ public final class ArtisanOfForms extends CardImpl {
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// <i>Heroic</i> &mdash; Whenever you cast a spell that targets Artisan of Forms, you may have Artisan of Forms become a copy of target creature and gain this ability.
// <i>Heroic</i> &mdash; Whenever you cast a spell that targets Artisan of Forms, you may have Artisan of Forms become a copy of target creature, except it has this ability.
Effect effect = new CopyPermanentEffect(StaticFilters.FILTER_PERMANENT_CREATURE, new ArtisanOfFormsApplyToPermanent(), true);
effect.setText("have {this} become a copy of target creature and gain this ability");
effect.setText("have {this} become a copy of target creature, except it has this ability");
Ability ability = new HeroicAbility(effect, true);
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability);
@ -55,7 +55,7 @@ class ArtisanOfFormsApplyToPermanent extends ApplyToPermanent {
@Override
public boolean apply(Game game, MageObject mageObject, Ability source, UUID copyToObjectId) {
Effect effect = new CopyPermanentEffect(new ArtisanOfFormsApplyToPermanent());
effect.setText("have {this} become a copy of target creature and gain this ability");
effect.setText("have {this} become a copy of target creature, except it has this ability");
mageObject.getAbilities().add(new HeroicAbility(effect, true));
return true;
}
@ -63,7 +63,7 @@ class ArtisanOfFormsApplyToPermanent extends ApplyToPermanent {
@Override
public boolean apply(Game game, Permanent permanent, Ability source, UUID copyToObjectId) {
Effect effect = new CopyPermanentEffect(new ArtisanOfFormsApplyToPermanent());
effect.setText("have {this} become a copy of target creature and gain this ability");
effect.setText("have {this} become a copy of target creature, except it has this ability");
permanent.addAbility(new HeroicAbility(effect, true), game);
return true;
}

View file

@ -7,7 +7,7 @@ import mage.abilities.Ability;
import mage.abilities.common.AttacksTriggeredAbility;
import mage.abilities.common.BecomesBlockedTriggeredAbility;
import mage.abilities.condition.common.HateCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.dynamicvalue.common.BlockedCreatureCount;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.combat.BlocksIfAbleTargetEffect;
@ -45,7 +45,7 @@ public final class AsajjVentress extends CardImpl {
this.addAbility(new BecomesBlockedTriggeredAbility(effect, false));
// <i>Hate</i> &mdash; Whenever Asajj Ventress attacks, if an opponent lost life from a source other than combat damage this turn, target creature blocks this turn if able.
Ability ability = new ConditionalTriggeredAbility(
Ability ability = new ConditionalInterveningIfTriggeredAbility(
new AttacksTriggeredAbility(new BlocksIfAbleTargetEffect(Duration.EndOfTurn), false),
HateCondition.instance,
"<i>Hate</i> &mdash; Whenever Asajj Ventress attacks, if an opponent lost life from a source other than combat damage this turn, target creature blocks this turn if able");

View file

@ -7,7 +7,7 @@ import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.condition.common.CardsInHandCondition;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.LoseLifeSourceControllerEffect;
@ -33,7 +33,7 @@ public final class AsylumVisitor extends CardImpl {
this.toughness = new MageInt(1);
// At the beginning of each player's upkeep, if that player has no cards in hand, you draw a card and you lose 1 life.
Ability ability = new ConditionalTriggeredAbility(new BeginningOfUpkeepTriggeredAbility(new DrawCardSourceControllerEffect(1), TargetController.ANY, false),
Ability ability = new ConditionalInterveningIfTriggeredAbility(new BeginningOfUpkeepTriggeredAbility(new DrawCardSourceControllerEffect(1), TargetController.ANY, false),
new CardsInHandCondition(ComparisonType.EQUAL_TO, 0, null, TargetController.ACTIVE),
"At the beginning of each player's upkeep, if that player has no cards in hand, you draw a card and you lose 1 life.");
Effect effect = new LoseLifeSourceControllerEffect(1);

View file

@ -6,7 +6,7 @@ import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.AttacksTriggeredAbility;
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.TapTargetEffect;
import mage.constants.SubType;
import mage.cards.CardImpl;
@ -37,7 +37,7 @@ public final class AuroraChampion extends CardImpl {
this.toughness = new MageInt(2);
// Whenever Aurora Champion attacks, if your team controls another Warrior, tap target creature.
Ability ability = new ConditionalTriggeredAbility(
Ability ability = new ConditionalInterveningIfTriggeredAbility(
new AttacksTriggeredAbility(new TapTargetEffect(), false),
new PermanentsOnTheBattlefieldCondition(filter),
"Whenever {this} attacks, if your team controls another Warrior, tap target creature."

View file

@ -0,0 +1,89 @@
package mage.cards.b;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.keyword.CumulativeUpkeepAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.ManaEvent;
/**
*
* @author noahg
*/
public final class BalduvianFallen extends CardImpl {
public BalduvianFallen(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}");
this.subtype.add(SubType.ZOMBIE);
this.power = new MageInt(3);
this.toughness = new MageInt(5);
// Cumulative upkeep {1}
this.addAbility(new CumulativeUpkeepAbility(new ManaCostsImpl("{1}")));
// Whenever Balduvian Fallen's cumulative upkeep is paid, it gets +1/+0 until end of turn for each {B} or {R} spent this way.
this.addAbility(new BalduvianFallenAbility());
}
public BalduvianFallen(final BalduvianFallen card) {
super(card);
}
@Override
public BalduvianFallen copy() {
return new BalduvianFallen(this);
}
}
class BalduvianFallenAbility extends TriggeredAbilityImpl {
public BalduvianFallenAbility() {
super(Zone.BATTLEFIELD, null, false);
}
public BalduvianFallenAbility(final BalduvianFallenAbility ability) {
super(ability);
}
@Override
public BalduvianFallenAbility copy() {
return new BalduvianFallenAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.PAID_CUMULATIVE_UPKEEP;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
this.getEffects().clear();
if(event.getSourceId() != null && event.getSourceId().equals(this.getSourceId()) && event instanceof ManaEvent) {
ManaEvent manaEvent = (ManaEvent) event;
int total = manaEvent.getMana().getBlack() + manaEvent.getMana().getRed();
if (total > 0) {
this.getEffects().add(new BoostSourceEffect(total, 0, Duration.EndOfTurn));
}
return true;
}
return false;
}
@Override
public String getRule() {
return "Whenever {this}'s cumulative upkeep is paid, it gets +1/+0 until end of turn for each {B} or {R} spent this way";
}
}

View file

@ -7,7 +7,7 @@ import mage.abilities.TriggeredAbility;
import mage.abilities.common.AttacksEachCombatStaticAbility;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.condition.common.TwoOrMoreSpellsWereCastLastTurnCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.TransformSourceEffect;
import mage.abilities.keyword.TransformAbility;
import mage.cards.CardImpl;
@ -38,7 +38,7 @@ public final class BaneOfHanweir extends CardImpl {
// At the beginning of each upkeep, if a player cast two or more spells last turn, transform Bane of Hanweir.
TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(false), TargetController.ANY, false);
this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.instance, TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE));
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.instance, TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE));
}
public BaneOfHanweir(final BaneOfHanweir card) {

View file

@ -6,7 +6,7 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.condition.CompoundCondition;
import mage.abilities.condition.common.CardsInHandCondition;
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.WinGameSourceControllerEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -31,7 +31,7 @@ public final class BarrenGlory extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{4}{W}{W}");
// At the beginning of your upkeep, if you control no permanents other than Barren Glory and have no cards in hand, you win the game.
this.addAbility(new ConditionalTriggeredAbility(
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
new BeginningOfUpkeepTriggeredAbility(new WinGameSourceControllerEffect(), TargetController.YOU, false),
new CompoundCondition(
new CardsInHandCondition(ComparisonType.EQUAL_TO, 0),

View file

@ -6,7 +6,7 @@ import mage.abilities.Ability;
import mage.abilities.TriggeredAbility;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.condition.Condition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.WinGameSourceControllerEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -27,7 +27,7 @@ public final class BattleOfWits extends CardImpl {
// At the beginning of your upkeep, if you have 200 or more cards in your library, you win the game.
TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new WinGameSourceControllerEffect(), TargetController.YOU, false);
this.addAbility(new ConditionalTriggeredAbility(ability, new BattleOfWitsCondition(), "At the beginning of your upkeep, if you have 200 or more cards in your library, you win the game."));
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, new BattleOfWitsCondition(), "At the beginning of your upkeep, if you have 200 or more cards in your library, you win the game."));
}
public BattleOfWits(final BattleOfWits card) {

View file

@ -5,7 +5,7 @@ import mage.MageInt;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.condition.InvertCondition;
import mage.abilities.condition.common.RaidCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.LoseLifeSourceControllerEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -29,7 +29,7 @@ public final class BellowingSaddlebrute extends CardImpl {
this.toughness = new MageInt(5);
// Raid - When Bellowing Saddlebrute enters the battlefield, you lose 4 life unless you attacked with a creature this turn
this.addAbility(new ConditionalTriggeredAbility(
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
new EntersBattlefieldTriggeredAbility(new LoseLifeSourceControllerEffect(4)),
new InvertCondition(RaidCondition.instance),
"<i>Raid</i> &mdash; When {this} enters the battlefield, you lose 4 life unless you attacked with a creature this turn"

View file

@ -6,7 +6,7 @@ import mage.MageInt;
import mage.abilities.TriggeredAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.condition.common.KickedCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.keyword.KickerAbility;
import mage.cards.CardImpl;
@ -33,7 +33,7 @@ public final class BenalishEmissary extends CardImpl {
// When Benalish Emissary enters the battlefield, if it was kicked, destroy target land.
TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect());
ability.addTarget(new TargetLandPermanent());
this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.instance,
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, KickedCondition.instance,
"When {this} enters the battlefield, if it was kicked, destroy target land."));
}

View file

@ -6,7 +6,7 @@ import mage.MageInt;
import mage.abilities.TriggeredAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.condition.common.MetalcraftCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
import mage.abilities.keyword.HasteAbility;
@ -31,9 +31,10 @@ public final class BladeTribeBerserkers extends CardImpl {
this.power = new MageInt(3);
this.toughness = new MageInt(3);
//Metalcraft - When Blade-Tribe Berserkers enters the battlefield, if you control three or more artifacts, Blade-Tribe Berserkers gets +3/+3 and gains haste until end of turn.
TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new BoostSourceEffect(3, 3, Duration.EndOfTurn), false);
ability.addEffect(new GainAbilitySourceEffect(HasteAbility.getInstance(), Duration.EndOfTurn));
this.addAbility(new ConditionalTriggeredAbility(ability, MetalcraftCondition.instance, effectText));
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, MetalcraftCondition.instance, effectText));
}
public BladeTribeBerserkers(final BladeTribeBerserkers card) {

View file

@ -6,7 +6,7 @@ import mage.MageInt;
import mage.abilities.TriggeredAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.condition.common.MetalcraftCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.LoseLifeTargetEffect;
import mage.cards.CardImpl;
@ -31,12 +31,13 @@ public final class BleakCovenVampires extends CardImpl {
this.power = new MageInt(4);
this.toughness = new MageInt(3);
//Metalcraft - When Bleak Coven Vampires enters the battlefield, if you control three or more artifacts, target player loses 4 life and you gain 4 life.
TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new LoseLifeTargetEffect(4), false);
ability.addEffect(new GainLifeEffect(4));
Target target = new TargetPlayer();
ability.addTarget(target);
this.addAbility(new ConditionalTriggeredAbility(ability, MetalcraftCondition.instance, effectText));
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, MetalcraftCondition.instance, effectText));
}
public BleakCovenVampires(final BleakCovenVampires card) {

View file

@ -7,7 +7,7 @@ import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
import mage.abilities.common.PutCardIntoGraveFromAnywhereAllTriggeredAbility;
import mage.abilities.condition.common.OpponentLostLifeCondition;
import mage.abilities.condition.common.SourceHasCounterCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.LoseLifeTargetEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
@ -38,7 +38,7 @@ public final class BloodchiefAscension extends CardImpl {
true));
// Whenever a card is put into an opponent's graveyard from anywhere, if Bloodchief Ascension has three or more quest counters on it, you may have that player lose 2 life. If you do, you gain 2 life.
Ability ability = new ConditionalTriggeredAbility(
Ability ability = new ConditionalInterveningIfTriggeredAbility(
new PutCardIntoGraveFromAnywhereAllTriggeredAbility(
new LoseLifeTargetEffect(2), true, new FilterCard("a card"), TargetController.OPPONENT, SetTargetPointer.PLAYER),
new SourceHasCounterCondition(CounterType.QUEST, 3, Integer.MAX_VALUE),

View file

@ -7,7 +7,7 @@ import mage.abilities.TriggeredAbility;
import mage.abilities.common.EntersBattlefieldOrAttacksSourceTriggeredAbility;
import mage.abilities.condition.common.HellbentCondition;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.keyword.MadnessAbility;
import mage.cards.CardImpl;
@ -31,7 +31,7 @@ public final class BloodhallPriest extends CardImpl {
// Whenever Bloodhall Priest enters the battlefield or attacks, if you have no cards in hand, Bloodhall Priest deals 2 damage to any target.
TriggeredAbility triggeredAbility = new EntersBattlefieldOrAttacksSourceTriggeredAbility(new DamageTargetEffect(2));
triggeredAbility.addTarget(new TargetAnyTarget());
this.addAbility(new ConditionalTriggeredAbility(
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
triggeredAbility,
HellbentCondition.instance,
"Whenever {this} enters the battlefield or attacks, if you have no cards in hand, {this} deals 2 damage to any target"

View file

@ -6,7 +6,7 @@ import mage.abilities.Ability;
import mage.abilities.TriggeredAbility;
import mage.abilities.common.DiesCreatureTriggeredAbility;
import mage.abilities.condition.Condition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
@ -34,12 +34,12 @@ public final class BlowflyInfestation extends CardImpl {
public BlowflyInfestation(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{B}");
//Whenever a creature dies, if it had a -1/-1 counter on it, put a -1/-1 counter on target creature.
Effect effect = new BlowflyInfestationEffect();
TriggeredAbility triggeredAbility = new DiesCreatureTriggeredAbility(effect, false, false, true);
triggeredAbility.addTarget(new TargetCreaturePermanent());
Condition condition = new BlowflyInfestationCondition();
this.addAbility(new ConditionalTriggeredAbility(triggeredAbility, condition, rule));
this.addAbility(new ConditionalInterveningIfTriggeredAbility(triggeredAbility, condition, rule));
}

View file

@ -0,0 +1,97 @@
package mage.cards.b;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.AsEntersBattlefieldAbility;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.effects.common.ChooseACardNameEffect;
import mage.abilities.effects.common.ChooseOpponentEffect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.DoIfCostPaid;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.players.Player;
import mage.target.targetpointer.FixedTarget;
import java.util.UUID;
/**
* @author noahg
*/
public final class BoobyTrap extends CardImpl {
public BoobyTrap(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{6}");
// As Booby Trap enters the battlefield, name a card other than a basic land card and choose an opponent.
AsEntersBattlefieldAbility etbAbility = new AsEntersBattlefieldAbility(new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.NOT_BASIC_LAND_NAME));
etbAbility.addEffect(new ChooseOpponentEffect(Outcome.Damage));
this.addAbility(etbAbility);
// The chosen player reveals each card he or she draws.
// When the chosen player draws the named card, sacrifice Booby Trap. If you do, Booby Trap deals 10 damage to that player.
this.addAbility(new BoobyTrapTriggeredAbility());
}
public BoobyTrap(final BoobyTrap card) {
super(card);
}
@Override
public BoobyTrap copy() {
return new BoobyTrap(this);
}
}
class BoobyTrapTriggeredAbility extends TriggeredAbilityImpl {
public BoobyTrapTriggeredAbility() {
super(Zone.BATTLEFIELD, new DoIfCostPaid(new DamageTargetEffect(10, true, "that player"), new SacrificeSourceCost(), "", false), false);
}
public BoobyTrapTriggeredAbility(BoobyTrapTriggeredAbility ability) {
super(ability);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.DREW_CARD;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
Player controller = game.getPlayer(getControllerId());
if (event.getPlayerId() == null || game.getState() == null || controller == null) {
return false;
}
if (event.getPlayerId().equals(game.getState().getValue(getSourceId().toString() + ChooseOpponentEffect.VALUE_KEY))) {
Card drawn = game.getCard(event.getTargetId());
if (drawn != null) {
controller.revealCards(this, new CardsImpl(drawn), game);
if (drawn.getName().equals(game.getState().getValue(getSourceId().toString() + ChooseACardNameEffect.INFO_KEY))) {
//Set target
this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId()));
return true;
}
}
}
return false;
}
@Override
public BoobyTrapTriggeredAbility copy() {
return new BoobyTrapTriggeredAbility(this);
}
@Override
public String getRule() {
return "The chosen player reveals each card he or she draws.\n" +
"When the chosen player draws the named card, sacrifice {this}. If you do, {this} deals 10 damage to that player.";
}
}

View file

@ -13,11 +13,10 @@ import mage.abilities.costs.common.PayLifeCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
import mage.abilities.mana.SimpleManaAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.FilterCard;
import mage.filter.common.FilterInstantOrSorceryCard;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.stack.Spell;
@ -42,9 +41,9 @@ public final class BoseijuWhoSheltersAll extends CardImpl {
SimpleManaAbility ability = new SimpleManaAbility(Zone.BATTLEFIELD, mana, new TapSourceCost());
ability.addCost(new PayLifeCost(2));
ability.getEffects().get(0).setText("Add {C}. If that mana is spent on an instant or sorcery spell, that spell can't be countered");
this.addAbility(ability);
this.addAbility(ability, new BoseijuWhoSheltersAllWatcher(ability.getOriginalId()));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoseijuWhoSheltersAllCantCounterEffect()), new BoseijuWhoSheltersAllWatcher());
this.addAbility(new SimpleStaticAbility(Zone.ALL, new BoseijuWhoSheltersAllCantCounterEffect()));
}
public BoseijuWhoSheltersAll(final BoseijuWhoSheltersAll card) {
@ -59,14 +58,18 @@ public final class BoseijuWhoSheltersAll extends CardImpl {
class BoseijuWhoSheltersAllWatcher extends Watcher {
public List<UUID> spells = new ArrayList<>();
private List<UUID> spells = new ArrayList<>();
private final String originalId;
public BoseijuWhoSheltersAllWatcher() {
super(BoseijuWhoSheltersAllWatcher.class.getSimpleName(), WatcherScope.GAME);
public BoseijuWhoSheltersAllWatcher(UUID originalId) {
super(BoseijuWhoSheltersAllWatcher.class.getSimpleName(), WatcherScope.CARD);
this.originalId = originalId.toString();
}
public BoseijuWhoSheltersAllWatcher(final BoseijuWhoSheltersAllWatcher watcher) {
super(watcher);
this.spells.addAll(watcher.spells);
this.originalId = watcher.originalId;
}
@Override
@ -77,13 +80,18 @@ class BoseijuWhoSheltersAllWatcher extends Watcher {
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.MANA_PAID) {
MageObject object = game.getObject(event.getSourceId());
// TODO: Replace identification by name by better method that also works if ability is copied from other land with other name
if (object != null && object.getName().equals("Boseiju, Who Shelters All") && event.getFlag()) {
if (event.getData() != null && event.getData().equals(originalId)) {
Card spell = game.getSpell(event.getTargetId());
if (spell != null && (spell.isInstant() || spell.isSorcery())) {
spells.add(event.getTargetId());
}
}
}
}
public boolean spellCantBeCountered(UUID spellId) {
return spells.contains(spellId);
}
@Override
public void reset() {
@ -94,10 +102,8 @@ class BoseijuWhoSheltersAllWatcher extends Watcher {
class BoseijuWhoSheltersAllCantCounterEffect extends ContinuousRuleModifyingEffectImpl {
private static final FilterCard filter = new FilterInstantOrSorceryCard();
public BoseijuWhoSheltersAllCantCounterEffect() {
super(Duration.WhileOnBattlefield, Outcome.Benefit);
super(Duration.EndOfGame, Outcome.Benefit);
staticText = null;
}
@ -119,7 +125,7 @@ class BoseijuWhoSheltersAllCantCounterEffect extends ContinuousRuleModifyingEffe
public String getInfoMessage(Ability source, GameEvent event, Game game) {
MageObject sourceObject = game.getObject(source.getSourceId());
if (sourceObject != null) {
return "This spell can't be countered (" + sourceObject.getName() + ").";
return "This spell can't be countered because mana from " + sourceObject.getName() + " was spent to cast it.";
}
return null;
}
@ -131,13 +137,8 @@ class BoseijuWhoSheltersAllCantCounterEffect extends ContinuousRuleModifyingEffe
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
BoseijuWhoSheltersAllWatcher watcher = (BoseijuWhoSheltersAllWatcher) game.getState().getWatchers().get(BoseijuWhoSheltersAllWatcher.class.getSimpleName());
BoseijuWhoSheltersAllWatcher watcher = (BoseijuWhoSheltersAllWatcher) game.getState().getWatchers().get(BoseijuWhoSheltersAllWatcher.class.getSimpleName(), source.getSourceId());
Spell spell = game.getStack().getSpell(event.getTargetId());
if (spell != null && watcher.spells.contains(spell.getId())) {
if (filter.match(spell.getCard(), game)) {
return true;
}
}
return false;
return spell != null && watcher != null && watcher.spellCantBeCountered(spell.getId());
}
}

View file

@ -6,7 +6,7 @@ import mage.MageInt;
import mage.abilities.TriggeredAbility;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.condition.common.TwoOrMoreSpellsWereCastLastTurnCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.TransformSourceEffect;
import mage.abilities.keyword.TransformAbility;
import mage.cards.CardImpl;
@ -34,7 +34,7 @@ public final class BrandedHowler extends CardImpl {
// At the beginning of each upkeep, if a player cast two or more spells last turn, transform Branded Howler.
TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(false), TargetController.ANY, false);
this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.instance, TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE));
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.instance, TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE));
}
public BrandedHowler(final BrandedHowler card) {

View file

@ -9,7 +9,7 @@ import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.condition.common.CastFromHandSourceCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DontUntapInControllersNextUntapStepTargetEffect;
@ -40,7 +40,7 @@ public final class BreachingLeviathan extends CardImpl {
this.toughness = new MageInt(9);
// When Breaching Leviathan enters the battlefield, if you cast it from your hand, tap all nonblue creatures. Those creatures don't untap during their controllers' next untap steps.
this.addAbility(new ConditionalTriggeredAbility(
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
new EntersBattlefieldTriggeredAbility(new BreachingLeviathanEffect(), false),
CastFromHandSourceCondition.instance,
"When {this} enters the battlefield, if you cast it from your hand, tap all nonblue creatures. Those creatures don't untap during their controllers' next untap steps."),

View file

@ -6,7 +6,7 @@ import mage.MageInt;
import mage.abilities.TriggeredAbility;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.condition.common.NoSpellsWereCastLastTurnCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.TransformSourceEffect;
import mage.abilities.keyword.TransformAbility;
import mage.cards.CardImpl;
@ -34,7 +34,7 @@ public final class BreakneckRider extends CardImpl {
// At the beginning of each upkeep, if no spells were cast last turn, transform Breakneck Rider.
this.addAbility(new TransformAbility());
TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(true), TargetController.ANY, false);
this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.instance, TransformAbility.NO_SPELLS_TRANSFORM_RULE));
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.instance, TransformAbility.NO_SPELLS_TRANSFORM_RULE));
}
public BreakneckRider(final BreakneckRider card) {

View file

@ -7,7 +7,7 @@ import mage.abilities.Ability;
import mage.abilities.TriggeredAbility;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.condition.common.CardsInHandCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.SacrificeSourceEffect;
import mage.cards.Card;
@ -37,7 +37,7 @@ public final class BrinkOfMadness extends CardImpl {
ability.addEffect(new BrinkOfMadnessEffect());
ability.addTarget(new TargetOpponent());
CardsInHandCondition contition = new CardsInHandCondition(ComparisonType.EQUAL_TO, 0);
this.addAbility(new ConditionalTriggeredAbility(ability, contition, "At the beginning of your upkeep, if you have no cards in hand, sacrifice {this} and target opponent discards their hand."));
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, contition, "At the beginning of your upkeep, if you have no cards in hand, sacrifice {this} and target opponent discards their hand."));
}

View file

@ -8,7 +8,7 @@ import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SpellCastControllerTriggeredAbility;
import mage.abilities.condition.common.SourceHasCounterCondition;
import mage.abilities.costs.common.RemoveCountersSourceCost;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.FlipSourceEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
@ -20,7 +20,6 @@ import mage.counters.CounterType;
import mage.filter.StaticFilters;
import mage.game.events.GameEvent;
import mage.game.permanent.token.TokenImpl;
import mage.game.permanent.token.Token;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
@ -44,7 +43,7 @@ public final class BudokaPupil extends CardImpl {
this.addAbility(new SpellCastControllerTriggeredAbility(new AddCountersSourceEffect(CounterType.KI.createInstance()), StaticFilters.SPIRIT_OR_ARCANE_CARD, true));
// At the beginning of the end step, if there are two or more ki counters on Budoka Pupil, you may flip it.
this.addAbility(new ConditionalTriggeredAbility(
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
new OnEventTriggeredAbility(GameEvent.EventType.END_TURN_STEP_PRE, "beginning of the end step", true, new FlipSourceEffect(new IchigaWhoTopplesOaks()), true),
new SourceHasCounterCondition(CounterType.KI, 2, Integer.MAX_VALUE),
"At the beginning of the end step, if there are two or more ki counters on {this}, you may flip it."));

View file

@ -5,7 +5,7 @@ import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.AttacksTriggeredAbility;
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
import mage.abilities.keyword.FirstStrikeAbility;
import mage.constants.SubType;
@ -36,7 +36,7 @@ public final class BullRushBruiser extends CardImpl {
this.toughness = new MageInt(3);
// Whenever Bull-Rush Bruiser attacks, if your team controls another Warrior, Bull-Rush Bruiser gains first strike until end of turn.
this.addAbility(new ConditionalTriggeredAbility(
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
new AttacksTriggeredAbility(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance()), false),
new PermanentsOnTheBattlefieldCondition(filter),
"Whenever {this} attacks, if your team controls another Warrior, "

View file

@ -18,40 +18,41 @@ import mage.target.common.TargetCreaturePermanent;
*
* @author ayratn
*/
public final class BurntheImpure extends CardImpl {
public final class BurnTheImpure extends CardImpl {
public BurntheImpure(UUID ownerId, CardSetInfo setInfo) {
public BurnTheImpure(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{R}");
// Burn the Impure deals 3 damage to target creature. If that creature has infect, Burn the Impure deals 3 damage to that creatures controller.
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addEffect(new BurntheImpureEffect());
this.getSpellAbility().addEffect(new BurnTheImpureEffect());
}
public BurntheImpure(final BurntheImpure card) {
public BurnTheImpure(final BurnTheImpure card) {
super(card);
}
@Override
public BurntheImpure copy() {
return new BurntheImpure(this);
public BurnTheImpure copy() {
return new BurnTheImpure(this);
}
}
class BurntheImpureEffect extends OneShotEffect {
class BurnTheImpureEffect extends OneShotEffect {
public BurntheImpureEffect() {
public BurnTheImpureEffect() {
super(Outcome.Damage);
staticText = "{this} deals 3 damage to target creature. If that creature has infect, {this} deals 3 damage to that creature's controller.";
}
public BurntheImpureEffect(final BurntheImpureEffect effect) {
public BurnTheImpureEffect(final BurnTheImpureEffect effect) {
super(effect);
}
@Override
public BurntheImpureEffect copy() {
return new BurntheImpureEffect(this);
public BurnTheImpureEffect copy() {
return new BurnTheImpureEffect(this);
}
@Override

View file

@ -6,7 +6,7 @@ import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DiesTriggeredAbility;
import mage.abilities.condition.Condition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -31,7 +31,7 @@ public final class BurningEyeZubera extends CardImpl {
this.toughness = new MageInt(3);
// When Burning-Eye Zubera dies, if 4 or more damage was dealt to it this turn, Burning-Eye Zubera deals 3 damage to any target.
Ability ability = new ConditionalTriggeredAbility(new DiesTriggeredAbility(new DamageTargetEffect(3)),new SourceGotFourDamage(),
Ability ability = new ConditionalInterveningIfTriggeredAbility(new DiesTriggeredAbility(new DamageTargetEffect(3)),new SourceGotFourDamage(),
"When {this} dies, if 4 or more damage was dealt to it this turn, Burning-Eye Zubera deals 3 damage to any target");
ability.addTarget(new TargetAnyTarget());
this.addAbility(ability);

View file

@ -5,7 +5,7 @@ import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.condition.common.KickedCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.discard.DiscardEachPlayerEffect;
import mage.abilities.keyword.KickerAbility;
@ -32,7 +32,7 @@ public final class CaligoSkinWitch extends CardImpl {
this.addAbility(new KickerAbility("{3}{B}"));
// When Caligo Skin-Witch enters the battlefield, if it was kicked, each opponent discards two cards.
this.addAbility(new ConditionalTriggeredAbility(
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
new EntersBattlefieldTriggeredAbility(new DiscardEachPlayerEffect(
new StaticValue(2),
false,

View file

@ -6,7 +6,7 @@ import mage.abilities.TriggeredAbility;
import mage.abilities.common.BeginningOfYourEndStepTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.RevoltCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.dynamicvalue.common.CountersSourceCount;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.BoostControlledEffect;
@ -34,7 +34,7 @@ public final class CallForUnity extends CardImpl {
// <i>Revolt</i> &mdash; At the beginning of your end step, if a permanent you controlled left the battlefield this turn, put a unity counter on Call for Unity.
TriggeredAbility ability = new BeginningOfYourEndStepTriggeredAbility(new AddCountersSourceEffect(CounterType.UNITY.createInstance(), true), false);
this.addAbility(new ConditionalTriggeredAbility(ability, RevoltCondition.instance, ruleText), new RevoltWatcher());
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, RevoltCondition.instance, ruleText), new RevoltWatcher());
// Creatures you control get +1/+1 for each unity counter on Call for Unity.
Effect effect = new BoostControlledEffect(new CountersSourceCount(CounterType.UNITY), new CountersSourceCount(CounterType.UNITY), Duration.WhileOnBattlefield,

View file

@ -7,7 +7,7 @@ import mage.abilities.TriggeredAbility;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.TwoOrMoreSpellsWereCastLastTurnCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.SacrificeSourceEffect;
@ -47,7 +47,7 @@ public final class CallOfTheFullMoon extends CardImpl {
// At the beginning of each upkeep, if a player cast two or more spells last turn, sacrifice Call of the Full Moon.
TriggeredAbility ability2 = new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceEffect(), TargetController.ANY, false);
this.addAbility(new ConditionalTriggeredAbility(ability2, TwoOrMoreSpellsWereCastLastTurnCondition.instance,
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability2, TwoOrMoreSpellsWereCastLastTurnCondition.instance,
"At the beginning of each upkeep, if a player cast two or more spells last turn, sacrifice {this}."));
}

View file

@ -6,7 +6,7 @@ import mage.abilities.TriggeredAbility;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.common.OnEventTriggeredAbility;
import mage.abilities.condition.common.CreatureCountCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.SacrificeEffect;
import mage.abilities.effects.common.SacrificeSourceEffect;
import mage.cards.CardImpl;
@ -42,7 +42,7 @@ public final class CallToTheGrave extends CardImpl {
this.addAbility(ability);
// At the beginning of the end step, if no creatures are on the battlefield, sacrifice Call to the Grave.
TriggeredAbility triggered = new OnEventTriggeredAbility(GameEvent.EventType.END_TURN_STEP_PRE, "beginning of the end step", true, new SacrificeSourceEffect());
this.addAbility(new ConditionalTriggeredAbility(triggered, new CreatureCountCondition(0, TargetController.ANY), ruleText));
this.addAbility(new ConditionalInterveningIfTriggeredAbility(triggered, new CreatureCountCondition(0, TargetController.ANY), ruleText));
}
public CallToTheGrave(final CallToTheGrave card) {

View file

@ -10,7 +10,7 @@ import mage.abilities.common.SpellCastControllerTriggeredAbility;
import mage.abilities.condition.common.SourceHasCounterCondition;
import mage.abilities.costs.common.RemoveCountersSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.CounterUnlessPaysEffect;
import mage.abilities.effects.common.FlipSourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
@ -24,7 +24,6 @@ import mage.counters.CounterType;
import mage.filter.StaticFilters;
import mage.game.events.GameEvent;
import mage.game.permanent.token.TokenImpl;
import mage.game.permanent.token.Token;
import mage.target.TargetSpell;
/**
@ -47,7 +46,7 @@ public final class CallowJushi extends CardImpl {
this.addAbility(new SpellCastControllerTriggeredAbility(new AddCountersSourceEffect(CounterType.KI.createInstance()), StaticFilters.SPIRIT_OR_ARCANE_CARD, true));
// At the beginning of the end step, if there are two or more ki counters on Callow Jushi, you may flip it.
this.addAbility(new ConditionalTriggeredAbility(
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
new OnEventTriggeredAbility(GameEvent.EventType.END_TURN_STEP_PRE, "beginning of the end step", true, new FlipSourceEffect(new JarakuTheInterloper()), true),
new SourceHasCounterCondition(CounterType.KI, 2, Integer.MAX_VALUE),
"At the beginning of the end step, if there are two or more ki counters on {this}, you may flip it."));

View file

@ -36,7 +36,7 @@ public final class CemeteryPuca extends CardImpl {
this.power = new MageInt(1);
this.toughness = new MageInt(2);
// Whenever a creature dies, you may pay {1}. If you do, Cemetery Puca becomes a copy of that creature and gains this ability.
// Whenever a creature dies, you may pay {1}. If you do, Cemetery Puca becomes a copy of that creature, except it has this ability.
this.addAbility(new DiesCreatureTriggeredAbility(new DoIfCostPaid(new CemeteryPucaEffect(), new ManaCostsImpl("{1}")), false, new FilterCreaturePermanent("a creature"), true));
}
@ -55,7 +55,7 @@ class CemeteryPucaEffect extends OneShotEffect {
public CemeteryPucaEffect() {
super(Outcome.Copy);
staticText = " {this} becomes a copy of that creature and gains this ability";
staticText = " {this} becomes a copy of that creature, except it has this ability";
}
public CemeteryPucaEffect(final CemeteryPucaEffect effect) {

View file

@ -4,7 +4,7 @@ package mage.cards.c;
import java.util.UUID;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.common.SanctuaryTriggeredAbility;
import mage.abilities.common.SanctuaryInterveningIfTriggeredAbility;
import mage.abilities.effects.common.DrawDiscardControllerEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -20,7 +20,7 @@ public final class CetaSanctuary extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}");
// At the beginning of your upkeep, if you control a red or green permanent, draw a card, then discard a card. If you control a red permanent and a green permanent, instead draw two cards, then discard a card.
Ability ability = new SanctuaryTriggeredAbility(
Ability ability = new SanctuaryInterveningIfTriggeredAbility(
new DrawDiscardControllerEffect(1, 1), new DrawDiscardControllerEffect(2, 1), ObjectColor.GREEN, ObjectColor.RED,
"At the beginning of your upkeep, if you control a red or green permanent, draw a card, then discard a card. "
+ "If you control a red permanent and a green permanent, instead draw two cards, then discard a card."

View file

@ -1,7 +1,6 @@
package mage.cards.c;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SpellCastControllerTriggeredAbility;
@ -15,6 +14,8 @@ import mage.constants.CardType;
import mage.constants.SubType;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author TheElk801

View file

@ -6,7 +6,7 @@ import mage.abilities.TriggeredAbility;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.condition.common.SourceHasCounterCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.WinGameSourceControllerEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
@ -32,7 +32,7 @@ public final class ChanceEncounter extends CardImpl {
// At the beginning of your upkeep, if Chance Encounter has ten or more luck counters on it, you win the game.
TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new WinGameSourceControllerEffect(), TargetController.YOU, false);
this.addAbility(new ConditionalTriggeredAbility(ability, new SourceHasCounterCondition(CounterType.LUCK, 10, Integer.MAX_VALUE),
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, new SourceHasCounterCondition(CounterType.LUCK, 10, Integer.MAX_VALUE),
"At the beginning of your upkeep, if {this} has ten or more luck counters on it, you win the game"));
}

View file

@ -41,7 +41,7 @@ public final class ChoArrimLegate extends CardImpl {
// Protection from black
this.addAbility(ProtectionAbility.from(ObjectColor.BLACK));
// If an opponent controls a Swamp and you control a Plains, you may cast Cho-Arrim Legate without paying its mana cost.
// If an opponent controls a Swamp and you control a Plains, you may cast this spell without paying its mana cost.
Condition condition = new CompoundCondition("If an opponent controls a Swamp and you control a Plains",
new OpponentControlsPermanentCondition(filterSwamp),
new PermanentsOnTheBattlefieldCondition(filterPlains));

View file

@ -7,7 +7,7 @@ import mage.abilities.Ability;
import mage.abilities.common.DiesTriggeredAbility;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.condition.common.LastTimeCounterRemovedCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.CreateTokenCopySourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
@ -46,7 +46,7 @@ public final class Chronozoa extends CardImpl {
// When Chronozoa is put into a graveyard from play, if it had no time counters on it, create two tokens that are copies of it.
Effect effect = new CreateTokenCopySourceEffect(2);
effect.setText("create two tokens that are copies of it");
this.addAbility(new ConditionalTriggeredAbility(new DiesTriggeredAbility(effect, false),
this.addAbility(new ConditionalInterveningIfTriggeredAbility(new DiesTriggeredAbility(effect, false),
LastTimeCounterRemovedCondition.instance,
"When {this} dies, if it had no time counters on it, create two tokens that are copies of it."));
}

View file

@ -1,7 +1,6 @@
package mage.cards.c;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfCombatTriggeredAbility;
import mage.abilities.common.EntersBattlefieldAbility;
@ -21,6 +20,8 @@ import mage.game.Game;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author LevelX2

View file

@ -5,7 +5,7 @@ import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.condition.common.KickedCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.keyword.KickerAbility;
import mage.cards.CardImpl;
@ -31,7 +31,7 @@ public final class CitanulWoodreaders extends CardImpl {
this.addAbility(new KickerAbility("{2}{G}"));
// When Citanul Woodreaders enters the battlefield, if it was kicked, draw two cards.
this.addAbility(new ConditionalTriggeredAbility(
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(2)),
KickedCondition.instance,
"When {this} enters the battlefield, if it was kicked, draw two cards."

View file

@ -11,7 +11,7 @@ import mage.abilities.condition.common.IsStepCondition;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.decorator.ConditionalActivatedAbility;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
@ -51,7 +51,7 @@ public final class ClockworkAvian extends CardImpl {
));
// At end of combat, if Clockwork Avian attacked or blocked this combat, remove a +1/+0 counter from it.
this.addAbility(new ConditionalTriggeredAbility(
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
new EndOfCombatTriggeredAbility(new RemoveCounterSourceEffect(CounterType.P1P0.createInstance()), false),
AttackedOrBlockedThisCombatSourceCondition.instance,
"At end of combat, if {this} attacked or blocked this combat, remove a +1/+0 counter from it."),

View file

@ -11,7 +11,7 @@ import mage.abilities.condition.common.IsStepCondition;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.decorator.ConditionalActivatedAbility;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
@ -47,7 +47,7 @@ public final class ClockworkBeast extends CardImpl {
));
// At end of combat, if Clockwork Beast attacked or blocked this combat, remove a +1/+0 counter from it.
this.addAbility(new ConditionalTriggeredAbility(
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
new EndOfCombatTriggeredAbility(new RemoveCounterSourceEffect(CounterType.P1P0.createInstance()), false),
AttackedOrBlockedThisCombatSourceCondition.instance,
"At end of combat, if {this} attacked or blocked this combat, remove a +1/+0 counter from it."),

View file

@ -12,7 +12,7 @@ import mage.abilities.condition.common.IsStepCondition;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.decorator.ConditionalActivatedAbility;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
import mage.abilities.effects.common.combat.CantBeBlockedByCreaturesSourceEffect;
@ -58,7 +58,7 @@ public final class ClockworkSteed extends CardImpl {
this.addAbility(new SimpleEvasionAbility(new CantBeBlockedByCreaturesSourceEffect(filter, Duration.WhileOnBattlefield)));
// At end of combat, if Clockwork Steed attacked or blocked this combat, remove a +1/+0 counter from it.
this.addAbility(new ConditionalTriggeredAbility(
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
new EndOfCombatTriggeredAbility(new RemoveCounterSourceEffect(CounterType.P1P0.createInstance()), false),
AttackedOrBlockedThisCombatSourceCondition.instance,
"At end of combat, if {this} attacked or blocked this combat, remove a +1/+0 counter from it."),

View file

@ -12,7 +12,7 @@ import mage.abilities.condition.common.IsStepCondition;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.decorator.ConditionalActivatedAbility;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
import mage.abilities.effects.common.combat.CantBeBlockedByCreaturesSourceEffect;
@ -62,7 +62,7 @@ public final class ClockworkSwarm extends CardImpl {
this.addAbility(new SimpleEvasionAbility(new CantBeBlockedByCreaturesSourceEffect(filter, Duration.WhileOnBattlefield)));
// At end of combat, if Clockwork Swarm attacked or blocked this combat, remove a +1/+0 counter from it.
this.addAbility(new ConditionalTriggeredAbility(
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
new EndOfCombatTriggeredAbility(new RemoveCounterSourceEffect(CounterType.P1P0.createInstance()), false),
AttackedOrBlockedThisCombatSourceCondition.instance,
"At end of combat, if {this} attacked or blocked this combat, remove a +1/+0 counter from it."),

View file

@ -6,7 +6,7 @@ import mage.MageInt;
import mage.Mana;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.condition.common.CastFromHandSourceCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.mana.BasicManaEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -27,7 +27,7 @@ public final class CoalStoker extends CardImpl {
this.toughness = new MageInt(3);
// When Coal Stoker enters the battlefield, if you cast it from your hand, add {R}{R}{R}.
this.addAbility(new ConditionalTriggeredAbility(
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
new EntersBattlefieldTriggeredAbility(new BasicManaEffect(Mana.RedMana(3)), false),
CastFromHandSourceCondition.instance,
"When {this} enters the battlefield, if you cast it from your hand, add {R}{R}{R}."),

View file

@ -3,7 +3,7 @@ package mage.cards.c;
import java.util.UUID;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.condition.common.FerociousCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -20,7 +20,7 @@ public final class ColossalMajesty extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}");
// At the beginning of your upkeep, if you control a creature with power 4 or greater, draw a card.
this.addAbility(new ConditionalTriggeredAbility(
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
new BeginningOfUpkeepTriggeredAbility(
new DrawCardSourceControllerEffect(1),
TargetController.YOU, false

View file

@ -6,7 +6,7 @@ import mage.MageInt;
import mage.abilities.TriggeredAbility;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.ReturnToHandSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -31,7 +31,7 @@ public final class ComplexAutomaton extends CardImpl {
// At the beginning of your upkeep, if you control seven or more permanents, return Complex Automaton to its owner's hand.
TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new ReturnToHandSourceEffect(true), TargetController.YOU, false);
this.addAbility(new ConditionalTriggeredAbility(ability, new PermanentsOnTheBattlefieldCondition(new FilterControlledPermanent(), ComparisonType.MORE_THAN, 6),
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, new PermanentsOnTheBattlefieldCondition(new FilterControlledPermanent(), ComparisonType.MORE_THAN, 6),
"At the beginning of your upkeep, if you control seven or more permanents, return Complex Automaton to its owner's hand."));
}

View file

@ -5,7 +5,7 @@ import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.AttacksTriggeredAbility;
import mage.abilities.condition.common.RenownedSourceCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.continuous.BoostControlledEffect;
import mage.abilities.keyword.FirstStrikeAbility;
import mage.abilities.keyword.RenownAbility;
@ -34,7 +34,7 @@ public final class ConsulsLieutenant extends CardImpl {
// Renown 1
this.addAbility(new RenownAbility(1));
// Whenever Consul's Lieutenant attacks, if it's renowned, other attacking creatures you control get +1/+1 until end of turn.
this.addAbility(new ConditionalTriggeredAbility(new AttacksTriggeredAbility(
this.addAbility(new ConditionalInterveningIfTriggeredAbility(new AttacksTriggeredAbility(
new BoostControlledEffect(1, 1, Duration.EndOfTurn, new FilterAttackingCreature("other attacking creatures you control"), true), false),
RenownedSourceCondition.instance,
"Whenever Consul's Lieutenant attacks, if it's renowned, other attacking creatures you control get +1/+1 until end of turn."));

View file

@ -5,7 +5,7 @@ import java.util.UUID;
import mage.abilities.TriggeredAbility;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.condition.common.XorLessLifeCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.GainLifeEffect;
@ -27,7 +27,7 @@ public final class ConvalescentCare extends CardImpl {
Effect effect = new DrawCardSourceControllerEffect(1);
TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new GainLifeEffect(3), TargetController.YOU, false);
ability.addEffect(effect);
this.addAbility(new ConditionalTriggeredAbility(ability, new XorLessLifeCondition(XorLessLifeCondition.CheckType.CONTROLLER, 5), "At the beginning of your upkeep, if you have 5 or less life, you gain 3 life and draw a card."));
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, new XorLessLifeCondition(XorLessLifeCondition.CheckType.CONTROLLER, 5), "At the beginning of your upkeep, if you have 5 or less life, you gain 3 life and draw a card."));
}
public ConvalescentCare(final ConvalescentCare card) {

View file

@ -6,7 +6,7 @@ import mage.MageInt;
import mage.abilities.TriggeredAbility;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.condition.common.NoSpellsWereCastLastTurnCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.TransformSourceEffect;
import mage.abilities.keyword.TransformAbility;
import mage.cards.CardImpl;
@ -35,7 +35,7 @@ public final class ConvictedKiller extends CardImpl {
// At the beginning of each upkeep, if no spells were cast last turn, transform Convicted Killer.
this.addAbility(new TransformAbility());
TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(true), TargetController.ANY, false);
this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.instance, TransformAbility.NO_SPELLS_TRANSFORM_RULE));
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.instance, TransformAbility.NO_SPELLS_TRANSFORM_RULE));
}
public ConvictedKiller(final ConvictedKiller card) {

View file

@ -6,7 +6,7 @@ import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.condition.common.RevoltCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -31,7 +31,7 @@ public final class CountlessGearsRenegade extends CardImpl {
// <i>Revolt</i> &mdash; When Countless Gears Renegade enters the battlefield, if a permanent you controlled
// left the battlefield this turn, create a 1/1 colorless Servo artifact creature token.
Ability ability = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(
Ability ability = new ConditionalInterveningIfTriggeredAbility(new EntersBattlefieldTriggeredAbility(
new CreateTokenEffect(new ServoToken(), 1), false), RevoltCondition.instance,
"<i>Revolt</i> &mdash; When {this} enters the battlefield, if a permanent you controlled left"
+ " the battlefield this turn, create a 1/1 colorless Servo artifact creature token.");

View file

@ -0,0 +1,102 @@
package mage.cards.c;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.PreventionEffectData;
import mage.abilities.effects.PreventionEffectImpl;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.constants.Duration;
import mage.constants.SuperType;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.keyword.CumulativeUpkeepAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
/**
*
* @author noahg
*/
public final class CoverOfWinter extends CardImpl {
public CoverOfWinter(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}");
this.addSuperType(SuperType.SNOW);
// Cumulative upkeep {S}
this.addAbility(new CumulativeUpkeepAbility(new ManaCostsImpl("{S}")));
// If a creature would deal combat damage to you and/or one or more creatures you control, prevent X of that damage, where X is the number of age counters on Cover of Winter.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CoverOfWinterEffect()));
// {S}: Put an age counter on Cover of Winter.
this.addAbility(new SimpleActivatedAbility(new AddCountersSourceEffect(CounterType.AGE.createInstance()), new ManaCostsImpl("{S}")));
}
public CoverOfWinter(final CoverOfWinter card) {
super(card);
}
@Override
public CoverOfWinter copy() {
return new CoverOfWinter(this);
}
}
class CoverOfWinterEffect extends PreventionEffectImpl {
public CoverOfWinterEffect() {
super(Duration.WhileOnBattlefield, -1, true);
this.staticText = "If a creature would deal combat damage to you and/or one or more creatures you control, prevent X of that damage, where X is the number of age counters on {this}";
}
public CoverOfWinterEffect(CoverOfWinterEffect effect) {
super(effect);
}
@Override
public boolean checksEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.DAMAGE_PLAYER || event.getType() == GameEvent.EventType.DAMAGE_CREATURE;
}
@Override
protected PreventionEffectData preventDamageAction(GameEvent event, Ability source, Game game) {
Permanent sourcePermanent = source.getSourcePermanentIfItStillExists(game);
if (sourcePermanent != null) {
return game.preventDamage(event, source, game, sourcePermanent.getCounters(game).getCount(CounterType.AGE));
} else {
this.discard();
return game.preventDamage(event, source, game, 0);
}
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
if (event.getType() == GameEvent.EventType.DAMAGE_PLAYER
&& event.getTargetId().equals(source.getControllerId())) {
return super.applies(event, source, game);
}
if (event.getType() == GameEvent.EventType.DAMAGE_CREATURE) {
Permanent permanent = game.getPermanent(event.getTargetId());
if (permanent != null && permanent.getControllerId().equals(source.getControllerId())) {
return super.applies(event, source, game);
}
}
return false;
}
@Override
public CoverOfWinterEffect copy() {
return new CoverOfWinterEffect(this);
}
}

View file

@ -6,7 +6,7 @@ import mage.MageInt;
import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.YouGainedLifeCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.continuous.GainAbilityAllEffect;
import mage.abilities.keyword.IndestructibleAbility;
@ -47,7 +47,7 @@ public final class CrestedSunmare extends CardImpl {
// At the beginning of each end step, if you gained life this turn, create a 5/5 white Horse creature token.
this.addAbility(
new ConditionalTriggeredAbility(
new ConditionalInterveningIfTriggeredAbility(
new BeginningOfEndStepTriggeredAbility(new CreateTokenEffect(new CrestedSunmareToken()), TargetController.ANY, false),
new YouGainedLifeCondition(ComparisonType.MORE_THAN, 0),
"At the beginning of each end step, if you gained life this turn, create a 5/5 white Horse creature token."),

View file

@ -6,7 +6,7 @@ import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.common.EntersBattlefieldTappedAbility;
import mage.abilities.condition.common.XorLessLifeCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.LoseLifeAllPlayersEffect;
import mage.abilities.effects.common.TransformSourceEffect;
import mage.abilities.keyword.TransformAbility;
@ -39,7 +39,7 @@ public final class CryptolithFragment extends CardImpl {
// At the beginning of your upkeep, if each player has 10 or less life, transform Cryptolith Fragment.
this.addAbility(new TransformAbility());
this.addAbility(new ConditionalTriggeredAbility(
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(true), TargetController.YOU, false),
new XorLessLifeCondition(XorLessLifeCondition.CheckType.EACH_PLAYER, 10),
"At the beginning of your upkeep, if each player has 10 or less life, transform Cryptolith Fragment."));

View file

@ -9,7 +9,7 @@ import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SpellCastControllerTriggeredAbility;
import mage.abilities.condition.common.SourceHasCounterCondition;
import mage.abilities.costs.common.RemoveCountersSourceCost;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.FlipSourceEffect;
import mage.abilities.effects.common.continuous.GainControlTargetEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
@ -24,7 +24,6 @@ import mage.counters.CounterType;
import mage.filter.StaticFilters;
import mage.game.events.GameEvent;
import mage.game.permanent.token.TokenImpl;
import mage.game.permanent.token.Token;
import mage.target.common.TargetCreaturePermanent;
/**
@ -47,7 +46,7 @@ public final class CunningBandit extends CardImpl {
this.addAbility(new SpellCastControllerTriggeredAbility(new AddCountersSourceEffect(CounterType.KI.createInstance()), StaticFilters.SPIRIT_OR_ARCANE_CARD, true));
// At the beginning of the end step, if there are two or more ki counters on Cunning Bandit, you may flip it.
this.addAbility(new ConditionalTriggeredAbility(
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
new OnEventTriggeredAbility(GameEvent.EventType.END_TURN_STEP_PRE, "beginning of the end step", true, new FlipSourceEffect(new AzamukiTreacheryIncarnate()), true),
new SourceHasCounterCondition(CounterType.KI, 2, Integer.MAX_VALUE),
"At the beginning of the end step, if there are two or more ki counters on {this}, you may flip it."));

View file

@ -7,7 +7,7 @@ import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.condition.Condition;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.TransformSourceEffect;
import mage.abilities.keyword.TransformAbility;
import mage.abilities.mana.ConditionalColorlessManaAbility;
@ -42,7 +42,7 @@ public final class CuriousHomunculus extends CardImpl {
// At the beginning of your upkeep, if there are three or more instant and/or sorcery cards in your graveyard, transform Curious Homunculus.
this.addAbility(new TransformAbility());
this.addAbility(new ConditionalTriggeredAbility(
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(true), TargetController.YOU, false),
new InstantOrSorceryCardsInControllerGraveCondition(3),
"At the beginning of your upkeep, if there are three or more instant and/or sorcery cards in your graveyard, transform {this}"));

View file

@ -7,7 +7,7 @@ import mage.abilities.condition.common.SuspendedCondition;
import mage.abilities.costs.Cost;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
@ -45,7 +45,7 @@ public final class CurseOfTheCabal extends CardImpl {
// Suspend 2-{2}{B}{B}
this.addAbility(new SuspendAbility(2, new ManaCostsImpl("{2}{B}{B}"), this));
// At the beginning of each player's upkeep, if Curse of the Cabal is suspended, that player may sacrifice a permanent. If he or she does, put two time counters on Curse of the Cabal.
this.addAbility(new CurseOfTheCabalTriggeredAbility());
this.addAbility(new CurseOfTheCabalInterveningIfTriggeredAbility());
}
public CurseOfTheCabal(final CurseOfTheCabal card) {
@ -99,9 +99,9 @@ class CurseOfTheCabalSacrificeEffect extends OneShotEffect {
}
}
class CurseOfTheCabalTriggeredAbility extends ConditionalTriggeredAbility {
class CurseOfTheCabalInterveningIfTriggeredAbility extends ConditionalInterveningIfTriggeredAbility {
public CurseOfTheCabalTriggeredAbility() {
public CurseOfTheCabalInterveningIfTriggeredAbility() {
super(new BeginningOfUpkeepTriggeredAbility(
Zone.EXILED, new CurseOfTheCabalTriggeredAbilityConditionalDelay(),
TargetController.ANY, false, true
@ -113,13 +113,13 @@ class CurseOfTheCabalTriggeredAbility extends ConditionalTriggeredAbility {
// counters aren't placed
}
public CurseOfTheCabalTriggeredAbility(final CurseOfTheCabalTriggeredAbility effect) {
public CurseOfTheCabalInterveningIfTriggeredAbility(final CurseOfTheCabalInterveningIfTriggeredAbility effect) {
super(effect);
}
@Override
public CurseOfTheCabalTriggeredAbility copy() {
return new CurseOfTheCabalTriggeredAbility(this);
public CurseOfTheCabalInterveningIfTriggeredAbility copy() {
return new CurseOfTheCabalInterveningIfTriggeredAbility(this);
}
}

View file

@ -0,0 +1,44 @@
package mage.cards.c;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.DiesTriggeredAbility;
import mage.abilities.effects.common.ExileSourceEffect;
import mage.abilities.effects.common.continuous.BecomesBasicLandTargetEffect;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.target.common.TargetLandPermanent;
/**
*
* @author noahg
*/
public final class CyclopeanGiant extends CardImpl {
public CyclopeanGiant(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}{B}");
this.subtype.add(SubType.ZOMBIE);
this.subtype.add(SubType.GIANT);
this.power = new MageInt(4);
this.toughness = new MageInt(2);
// When Cyclopean Giant dies, target land becomes a Swamp. Exile Cyclopean Giant.
DiesTriggeredAbility ability = new DiesTriggeredAbility(new BecomesBasicLandTargetEffect(Duration.EndOfGame, SubType.SWAMP));
ability.addEffect(new ExileSourceEffect());
ability.addTarget(new TargetLandPermanent());
this.addAbility(ability);
}
public CyclopeanGiant(final CyclopeanGiant card) {
super(card);
}
@Override
public CyclopeanGiant copy() {
return new CyclopeanGiant(this);
}
}

View file

@ -32,9 +32,9 @@ public final class DacksDuplicate extends CardImpl {
this.power = new MageInt(0);
this.toughness = new MageInt(0);
// You may have Dack's Duplicate enter the battlefield as a copy of any creature on the battlefield except it gains haste and dethrone.
// You may have Dack's Duplicate enter the battlefield as a copy of any creature on the battlefield except it has haste and dethrone.
Effect effect = new CopyPermanentEffect(StaticFilters.FILTER_PERMANENT_CREATURE, new DacksDuplicateApplyToPermanent());
effect.setText("as a copy of any creature on the battlefield except it gains haste and dethrone");
effect.setText("as a copy of any creature on the battlefield except it has haste and dethrone");
this.addAbility(new EntersBattlefieldAbility(effect, true));
}

View file

@ -11,7 +11,7 @@ import mage.abilities.common.LeavesBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.SourceOnBattlefieldCondition;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
@ -52,7 +52,7 @@ public final class DanceOfTheDead extends CardImpl {
Ability enchantAbility = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(enchantAbility);
// When Dance of the Dead enters the battlefield, if it's on the battlefield, it loses "enchant creature card in a graveyard" and gains "enchant creature put onto the battlefield with Dance of the Dead." Put enchanted creature card to the battlefield tapped under your control and attach Dance of the Dead to it. When Dance of the Dead leaves the battlefield, that creature's controller sacrifices it.
Ability ability = new ConditionalTriggeredAbility(
Ability ability = new ConditionalInterveningIfTriggeredAbility(
new EntersBattlefieldTriggeredAbility(new DanceOfTheDeadReAttachEffect(), false),
SourceOnBattlefieldCondition.instance,
"When {this} enters the battlefield, if it's on the battlefield, "

View file

@ -5,7 +5,7 @@ import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EndOfCombatTriggeredAbility;
import mage.abilities.condition.common.AttackedOrBlockedThisCombatSourceCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.CrewAbility;
import mage.cards.CardImpl;
@ -35,7 +35,7 @@ public final class DaredevilDragster extends CardImpl {
this.toughness = new MageInt(4);
// At end of combat, if Daredevil Dragster attacked or blocked this combat, put a velocity counter on it. Then if it has two or more velocity counters on it, sacrifice it and draw two cards.
this.addAbility(new ConditionalTriggeredAbility(
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
new EndOfCombatTriggeredAbility(new DaredevilDragsterEffect(), false),
AttackedOrBlockedThisCombatSourceCondition.instance,
"At end of combat, if {this} attacked or blocked this combat, put a velocity counter on it. Then if it has two or more velocity counters on it, sacrifice it and draw two cards."),

View file

@ -8,7 +8,7 @@ import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.Condition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.abilities.effects.common.counter.RemoveCounterSourceEffect;
@ -59,7 +59,7 @@ public final class DarigaazReincarnated extends CardImpl {
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DarigaazReincarnatedDiesEffect()));
// At the beginning of your upkeep, if Darigaaz is exiled with an egg counter on it, remove an egg counter from it. Then if Darigaaz has no egg counters on it, return it to the battlefield.
this.addAbility(new DarigaazReincarnatedTriggeredAbility());
this.addAbility(new DarigaazReincarnatedInterveningIfTriggeredAbility());
}
public DarigaazReincarnated(final DarigaazReincarnated card) {
@ -119,22 +119,22 @@ class DarigaazReincarnatedDiesEffect extends ReplacementEffectImpl {
}
class DarigaazReincarnatedTriggeredAbility extends ConditionalTriggeredAbility {
class DarigaazReincarnatedInterveningIfTriggeredAbility extends ConditionalInterveningIfTriggeredAbility {
public DarigaazReincarnatedTriggeredAbility() {
public DarigaazReincarnatedInterveningIfTriggeredAbility() {
super(new BeginningOfUpkeepTriggeredAbility(Zone.EXILED, new DarigaazReincarnatedReturnEffect(), TargetController.YOU, false),
DarigaazReincarnatedCondition.instance,
"At the beginning of your upkeep, if {this} is exiled with an egg counter on it, "
+ "remove an egg counter from it. Then if {this} has no egg counters on it, return it to the battlefield");
}
public DarigaazReincarnatedTriggeredAbility(final DarigaazReincarnatedTriggeredAbility effect) {
public DarigaazReincarnatedInterveningIfTriggeredAbility(final DarigaazReincarnatedInterveningIfTriggeredAbility effect) {
super(effect);
}
@Override
public DarigaazReincarnatedTriggeredAbility copy() {
return new DarigaazReincarnatedTriggeredAbility(this);
public DarigaazReincarnatedInterveningIfTriggeredAbility copy() {
return new DarigaazReincarnatedInterveningIfTriggeredAbility(this);
}
}

View file

@ -5,7 +5,7 @@ import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
import mage.abilities.condition.common.HateCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -24,7 +24,7 @@ public final class DarkApprenticeship extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}");
// <i>Hate</i> &mdash; At the beggining of your end step, if an opponent lost life from source other than combat damage this turn, Dark Apprenticeship deals 2 damage to target player.
Ability ability = new ConditionalTriggeredAbility(
Ability ability = new ConditionalInterveningIfTriggeredAbility(
new BeginningOfEndStepTriggeredAbility(new DamageTargetEffect(2), TargetController.YOU, false),
HateCondition.instance,
"<i>Hate</i> &mdash; At the beggining of your end step, if an opponent lost life from source other than combat damage this turn, Dark Apprenticeship deals 2 damage to target player.");

View file

@ -6,7 +6,7 @@ import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.AttacksTriggeredAbility;
import mage.abilities.condition.common.HateCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.combat.CantBeBlockedByTargetSourceEffect;
import mage.abilities.keyword.DoubleStrikeAbility;
import mage.abilities.keyword.HasteAbility;
@ -40,7 +40,7 @@ public final class DarthMaul extends CardImpl {
this.addAbility(HasteAbility.getInstance());
// <i>Hate</i> &mdash; Whenever Darth Maul attacks, if an opponent loses life from a source other than combat damage this turn, target creature can't block this turn.
Ability ability = new ConditionalTriggeredAbility(
Ability ability = new ConditionalInterveningIfTriggeredAbility(
new AttacksTriggeredAbility(new CantBeBlockedByTargetSourceEffect(Duration.EndOfTurn), false),
HateCondition.instance,
"<i>Hate</i> &mdash; Whenever Darth Maul attacks, if an opponent loses life from a source other than combat damage this turn, target creature can't block this turn.");

View file

@ -9,7 +9,7 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.condition.common.NoSpellsWereCastLastTurnCondition;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.TransformSourceEffect;
import mage.abilities.keyword.FlyingAbility;
@ -56,7 +56,7 @@ public final class DaybreakRanger extends CardImpl {
// At the beginning of each upkeep, if no spells were cast last turn, transform Daybreak Ranger.
this.addAbility(new TransformAbility());
TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(true), TargetController.ANY, false);
this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.instance, TransformAbility.NO_SPELLS_TRANSFORM_RULE));
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.instance, TransformAbility.NO_SPELLS_TRANSFORM_RULE));
}
public DaybreakRanger(final DaybreakRanger card) {

View file

@ -5,7 +5,7 @@ import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
import mage.abilities.condition.common.CitysBlessingCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.constants.SubType;
import mage.abilities.keyword.DeathtouchAbility;
@ -35,7 +35,7 @@ public final class DeadeyeBrawler extends CardImpl {
this.addAbility(new AscendAbility());
// Whenever Deadeye Brawler deals combat damage to a player, if you have the city's blessing, draw a card.
this.addAbility(new ConditionalTriggeredAbility(new DealsCombatDamageToAPlayerTriggeredAbility(
this.addAbility(new ConditionalInterveningIfTriggeredAbility(new DealsCombatDamageToAPlayerTriggeredAbility(
new DrawCardSourceControllerEffect(1), false, false), CitysBlessingCondition.instance,
"Whenever {this} deals combat damage to a player, if you have the city's blessing, draw a card."));

View file

@ -6,7 +6,7 @@ import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.condition.common.RevoltCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -39,7 +39,7 @@ public final class DeadeyeHarpooner extends CardImpl {
this.toughness = new MageInt(2);
// <i>Revolt</i> &mdash; When Deadeye Harpooner enters the battlefield, if a permanent you controlled left the battlefield this turn, destroy target tapped creature an opponent controls.
Ability ability = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(
Ability ability = new ConditionalInterveningIfTriggeredAbility(new EntersBattlefieldTriggeredAbility(
new DestroyTargetEffect(), false), RevoltCondition.instance,
"<i>Revolt</i> &mdash; When {this} enters the battlefield, if a permanent you controlled left"
+ " the battlefield this turn, destroy target tapped creature an opponent controls."

View file

@ -6,7 +6,7 @@ import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.condition.common.RaidCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -30,7 +30,7 @@ public final class DeadeyeRigHauler extends CardImpl {
this.toughness = new MageInt(2);
// <i>Raid</i> When Deadeye Rig-Hauler enters the battlefield, if you attacked with a creature this turn, you may return target creature to its owner's hand.
Ability ability = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect(), true), RaidCondition.instance,
Ability ability = new ConditionalInterveningIfTriggeredAbility(new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect(), true), RaidCondition.instance,
"<i>Raid</i> &mdash; When {this} enters the battlefield, if you attacked with a creature this turn, you may return target creature to its owner's hand.");
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability, new PlayerAttackedWatcher());

View file

@ -6,7 +6,7 @@ import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.condition.common.RaidCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.discard.DiscardTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -30,7 +30,7 @@ public final class DeadeyeTormentor extends CardImpl {
this.toughness = new MageInt(2);
// <i>Raid</i> &mdash; When Deadeye Tormentor enters the battlefield, if you attacked with a creature this turn, target opponent discards a card.
Ability ability = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new DiscardTargetEffect(1)), RaidCondition.instance,
Ability ability = new ConditionalInterveningIfTriggeredAbility(new EntersBattlefieldTriggeredAbility(new DiscardTargetEffect(1)), RaidCondition.instance,
"<i>Raid</i> &mdash; When {this} enters the battlefield, if you attacked with a creature this turn, target opponent discards a card.");
ability.addTarget(new TargetOpponent());
this.addAbility(ability, new PlayerAttackedWatcher());

View file

@ -7,7 +7,7 @@ import mage.abilities.Ability;
import mage.abilities.common.DiesTriggeredAbility;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.condition.common.LastTimeCounterRemovedCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.VanishingSacrificeAbility;
@ -38,7 +38,7 @@ public final class DeadlyGrub extends CardImpl {
this.addAbility(new VanishingUpkeepAbility(3));
this.addAbility(new VanishingSacrificeAbility());
// When Deadly Grub dies, if it had no time counters on it, create a 6/1 green Insect creature token with shroud.
this.addAbility(new ConditionalTriggeredAbility(new DiesTriggeredAbility(new CreateTokenEffect(new DeadlyGrubToken(), 1)),
this.addAbility(new ConditionalInterveningIfTriggeredAbility(new DiesTriggeredAbility(new CreateTokenEffect(new DeadlyGrubToken(), 1)),
LastTimeCounterRemovedCondition.instance, "When {this} dies, if it had no time counters on it, create a 6/1 green Insect creature token with shroud."));
}

View file

@ -4,7 +4,7 @@ package mage.cards.d;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.condition.common.MoreCardsInHandThanOpponentsCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.LoseLifeTargetEffect;
@ -37,7 +37,7 @@ public final class DeathOfAThousandStings extends CardImpl {
this.getSpellAbility().addEffect(effect);
// At the beginning of your upkeep, if you have more cards in hand than each opponent, you may return Death of a Thousand Stings from your graveyard to your hand.
Ability ability = new ConditionalTriggeredAbility(
Ability ability = new ConditionalInterveningIfTriggeredAbility(
new BeginningOfUpkeepTriggeredAbility(Zone.GRAVEYARD,
new ReturnSourceFromGraveyardToHandEffect(),
TargetController.YOU, true),

View file

@ -6,7 +6,7 @@ import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.condition.Condition;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.DoIfCostPaid;
import mage.abilities.effects.common.ReturnSourceFromGraveyardToHandEffect;
@ -35,7 +35,7 @@ public final class DeathSpark extends CardImpl {
this.getSpellAbility().addTarget(new TargetAnyTarget());
// At the beginning of your upkeep, if Death Spark is in your graveyard with a creature card directly above it, you may pay {1}. If you do, return Death Spark to your hand.
this.addAbility(new ConditionalTriggeredAbility(
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
new BeginningOfUpkeepTriggeredAbility(
Zone.GRAVEYARD,
new DoIfCostPaid(new ReturnSourceFromGraveyardToHandEffect(), new GenericManaCost(1)),

View file

@ -7,7 +7,7 @@ import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.condition.Condition;
import mage.abilities.condition.common.CastFromHandSourceCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.DestroyAllEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
@ -42,7 +42,7 @@ public final class DeathbringerRegent extends CardImpl {
this.addAbility(FlyingAbility.getInstance());
// When Deathbringer Regent enters the battlefield, if you cast it from your hand and there are five or more other creatures on the battlefield, destroy all other creatures.
this.addAbility(new ConditionalTriggeredAbility(
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
new EntersBattlefieldTriggeredAbility(new DestroyAllEffect(filter), false),
new DeathbringerRegentCondition(),
"When {this} enters the battlefield, if you cast it from your hand and there are five or more other creatures on the battlefield, destroy all other creatures."),

View file

@ -6,7 +6,7 @@ import mage.MageInt;
import mage.abilities.common.SpellCastAllTriggeredAbility;
import mage.abilities.condition.common.SuspendedCondition;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.counter.RemoveCounterSourceEffect;
import mage.abilities.keyword.CantBeBlockedSourceAbility;
import mage.abilities.keyword.SuspendAbility;
@ -45,7 +45,7 @@ public final class DeepSeaKraken extends CardImpl {
// Suspend 9-{2}{U}
this.addAbility(new SuspendAbility(9, new ManaCostsImpl("{2}{U}"), this));
// Whenever an opponent casts a spell, if Deep-Sea Kraken is suspended, remove a time counter from it.
this.addAbility(new ConditionalTriggeredAbility(
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
new SpellCastAllTriggeredAbility(Zone.EXILED, new RemoveCounterSourceEffect(CounterType.TIME.createInstance()), filter, false, SetTargetPointer.NONE), SuspendedCondition.instance,
"Whenever an opponent casts a spell, if Deep-Sea Kraken is suspended, remove a time counter from it."));
}

View file

@ -40,7 +40,7 @@ public final class DeepwoodLegate extends CardImpl {
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// If an opponent controls a Forest and you control a Swamp, you may cast Deepwood Legate without paying its mana cost.
// If an opponent controls a Forest and you control a Swamp, you may cast this spell without paying its mana cost.
Condition condition = new CompoundCondition("If an opponent controls a Forest and you control a Swamp",
new OpponentControlsPermanentCondition(filterForest),
new PermanentsOnTheBattlefieldCondition(filterSwamp));

View file

@ -7,7 +7,7 @@ import mage.abilities.Ability;
import mage.abilities.TriggeredAbility;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.condition.Condition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.SacrificeSourceEffect;
import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect;
import mage.cards.CardImpl;
@ -34,7 +34,7 @@ public final class DefenseOfTheHeart extends CardImpl {
TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new SacrificeSourceEffect(), TargetController.YOU, false);
ability.addEffect(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(0, 2, new FilterCreatureCard()), false, Outcome.PutLandInPlay));
DefenseOfTheHeartCondition contition = new DefenseOfTheHeartCondition();
this.addAbility(new ConditionalTriggeredAbility(ability, contition, "At the beginning of your upkeep, if an opponent controls three or more creatures, sacrifice {this}, search your library for up to two creature cards, and put those cards onto the battlefield. Then shuffle your library"));
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, contition, "At the beginning of your upkeep, if an opponent controls three or more creatures, sacrifice {this}, search your library for up to two creature cards, and put those cards onto the battlefield. Then shuffle your library"));
}

View file

@ -4,7 +4,7 @@ package mage.cards.d;
import java.util.UUID;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.common.SanctuaryTriggeredAbility;
import mage.abilities.common.SanctuaryInterveningIfTriggeredAbility;
import mage.abilities.effects.common.GainLifeEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -20,7 +20,7 @@ public final class DegaSanctuary extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}");
// At the beginning of your upkeep, if you control a black or red permanent, you gain 2 life. If you control a black permanent and a red permanent, you gain 4 life instead.
Ability ability = new SanctuaryTriggeredAbility(
Ability ability = new SanctuaryInterveningIfTriggeredAbility(
new GainLifeEffect(2), new GainLifeEffect(4), ObjectColor.BLACK, ObjectColor.RED,
"At the beginning of your upkeep, if you control a black or red permanent, you gain 2 life. "
+ "If you control a black permanent and a red permanent, you gain 4 life instead."

View file

@ -5,7 +5,7 @@ import java.util.UUID;
import mage.abilities.TriggeredAbility;
import mage.abilities.common.BeginningOfYourEndStepTriggeredAbility;
import mage.abilities.condition.common.CreatureCountCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -25,7 +25,7 @@ public final class DemonicRising extends CardImpl {
// At the beginning of your end step, if you control exactly one creature, create a 5/5 black Demon creature token with flying.
TriggeredAbility ability = new BeginningOfYourEndStepTriggeredAbility(new CreateTokenEffect(new DemonToken()), false);
this.addAbility(new ConditionalTriggeredAbility(ability, new CreatureCountCondition(1, TargetController.YOU), ruleText));
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, new CreatureCountCondition(1, TargetController.YOU), ruleText));
}
public DemonicRising(final DemonicRising card) {

View file

@ -8,7 +8,7 @@ import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.OrCondition;
import mage.abilities.condition.common.CardsInControllerGraveCondition;
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.combat.CantBlockAttackActivateAttachedEffect;
@ -51,7 +51,7 @@ public final class DesertsHold extends CardImpl {
this.addAbility(ability);
// When Desert's Hold enters the battlefield, if you control a Desert or there is a Desert card in your graveyard, you gain 3 life.
this.addAbility(new ConditionalTriggeredAbility(
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
new EntersBattlefieldTriggeredAbility(new GainLifeEffect(3)),
new OrCondition(
new PermanentsOnTheBattlefieldCondition(new FilterControlledPermanent(filterDesertPermanent)),

Some files were not shown because too many files have changed in this diff Show more