diff --git a/Mage.Client/src/main/java/org/mage/card/arcane/CardPanel.java b/Mage.Client/src/main/java/org/mage/card/arcane/CardPanel.java
index edded940b7..10d6111754 100644
--- a/Mage.Client/src/main/java/org/mage/card/arcane/CardPanel.java
+++ b/Mage.Client/src/main/java/org/mage/card/arcane/CardPanel.java
@@ -210,7 +210,7 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
counterPanel.add(minusCounterLabel);
loyaltyCounterLabel = new JLabel("");
- loyaltyCounterLabel.setToolTipText("Loyalty");
+ loyaltyCounterLabel.setToolTipText("loyalty");
counterPanel.add(loyaltyCounterLabel);
otherCounterLabel = new JLabel("");
@@ -860,7 +860,7 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
}
minusCounterLabel.setVisible(true);
break;
- case "Loyalty":
+ case "loyalty":
if (counterView.getCount() != loyaltyCounter) {
loyaltyCounter = counterView.getCount();
loyaltyCounterLabel.setIcon(getCounterImageWithAmount(loyaltyCounter, ImageManagerImpl.getInstance().getCounterImageViolet(), cardWidth));
diff --git a/Mage.Common/src/mage/view/CardView.java b/Mage.Common/src/mage/view/CardView.java
index 6463a56376..350d4d2266 100644
--- a/Mage.Common/src/mage/view/CardView.java
+++ b/Mage.Common/src/mage/view/CardView.java
@@ -326,6 +326,7 @@ public class CardView extends SimpleCardView {
public CardView(EmblemView emblem) {
this(true);
+ this.id = emblem.getId();
this.mageObjectType = MageObjectType.EMBLEM;
this.name = emblem.getName();
this.displayName = name;
diff --git a/Mage.Sets/src/mage/sets/alarareborn/SlaveOfBolas.java b/Mage.Sets/src/mage/sets/alarareborn/SlaveOfBolas.java
index befd78ca81..dd612c01ff 100644
--- a/Mage.Sets/src/mage/sets/alarareborn/SlaveOfBolas.java
+++ b/Mage.Sets/src/mage/sets/alarareborn/SlaveOfBolas.java
@@ -30,7 +30,7 @@ package mage.sets.alarareborn;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.SacrificeTargetEffect;
import mage.abilities.effects.common.UntapTargetEffect;
@@ -98,7 +98,7 @@ class SlaveOfBolasEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice this");
sacrificeEffect.setTargetPointer(new FixedTarget(source.getFirstTarget()));
- DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(sacrificeEffect);
+ DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage.Sets/src/mage/sets/avacynrestored/ThatcherRevolt.java b/Mage.Sets/src/mage/sets/avacynrestored/ThatcherRevolt.java
index 45bb71a34c..7b39f75c0b 100644
--- a/Mage.Sets/src/mage/sets/avacynrestored/ThatcherRevolt.java
+++ b/Mage.Sets/src/mage/sets/avacynrestored/ThatcherRevolt.java
@@ -35,7 +35,7 @@ import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.SacrificeTargetEffect;
import mage.abilities.keyword.HasteAbility;
@@ -94,7 +94,7 @@ class ThatcherRevoltEffect extends OneShotEffect {
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice this token");
sacrificeEffect.setTargetPointer(new FixedTarget(token.getLastAddedToken()));
- DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(sacrificeEffect);
+ DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/GoryosVengeance.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/GoryosVengeance.java
index 5240760c21..12e0943c83 100644
--- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/GoryosVengeance.java
+++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/GoryosVengeance.java
@@ -30,7 +30,7 @@ package mage.sets.betrayersofkamigawa;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
@@ -122,7 +122,7 @@ class GoryosVengeanceEffect extends OneShotEffect {
// Exile it at end of turn
Effect exileEffect = new ExileTargetEffect(new StringBuilder("Exile ").append(permanent.getName()).append(" at the beginning of the next end step").toString());
exileEffect.setTargetPointer(new FixedTarget(card.getId()));
- DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(exileEffect);
+ DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/ShireiShizosCaretaker.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/ShireiShizosCaretaker.java
index d94650927f..44a9737505 100644
--- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/ShireiShizosCaretaker.java
+++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/ShireiShizosCaretaker.java
@@ -32,7 +32,7 @@ import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.TriggeredAbilityImpl;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ReturnToBattlefieldUnderYourControlTargetEffect;
@@ -128,7 +128,7 @@ class ShireiShizosCaretakerEffect extends OneShotEffect {
ShireiShizosCaretakerEffect(UUID shireiId) {
super(Outcome.PutCreatureInPlay);
- this.staticText = "you may return that card to the battlefield at the beginning of the next end step if Shirei, Shizo's Caretaker is still on the battlefield.";
+ this.staticText = "you may return that card to the battlefield at the beginning of the next end step if {this} is still on the battlefield.";
this.shireiId = shireiId;
}
@@ -147,8 +147,8 @@ class ShireiShizosCaretakerEffect extends OneShotEffect {
Card card = game.getCard(this.getTargetPointer().getFirst(game, source));
if (card != null) {
Effect effect = new ShireiShizosCaretakerReturnEffect(shireiId);
- effect.setText("return that card to the battlefield if Shirei, Shizo's Caretaker is still on the battlefield");
- DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(effect);
+ effect.setText("return that card to the battlefield if {this} is still on the battlefield");
+ DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.getEffects().get(0).setTargetPointer(new FixedTarget(card.getId()));
diff --git a/Mage.Sets/src/mage/sets/bornofthegods/FelhideSpiritbinder.java b/Mage.Sets/src/mage/sets/bornofthegods/FelhideSpiritbinder.java
index 40688b384b..be55ceb44c 100644
--- a/Mage.Sets/src/mage/sets/bornofthegods/FelhideSpiritbinder.java
+++ b/Mage.Sets/src/mage/sets/bornofthegods/FelhideSpiritbinder.java
@@ -31,7 +31,7 @@ import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DoIfCostPaid;
@@ -112,7 +112,7 @@ class FelhideSpiritbinderEffect extends OneShotEffect {
if (effect.apply(game, source) && effect.getAddedPermanent() != null) {
ExileTargetEffect exileEffect = new ExileTargetEffect();
exileEffect.setTargetPointer(new FixedTarget(effect.getAddedPermanent().getId()));
- DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(exileEffect);
+ DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/HikariTwilightGuardian.java b/Mage.Sets/src/mage/sets/championsofkamigawa/HikariTwilightGuardian.java
index 79e579fe0e..419aab8370 100644
--- a/Mage.Sets/src/mage/sets/championsofkamigawa/HikariTwilightGuardian.java
+++ b/Mage.Sets/src/mage/sets/championsofkamigawa/HikariTwilightGuardian.java
@@ -35,7 +35,7 @@ import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SpellCastControllerTriggeredAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ReturnFromExileEffect;
import mage.abilities.keyword.FlyingAbility;
@@ -99,7 +99,7 @@ class HikariTwilightGuardianEffect extends OneShotEffect {
if (permanent != null) {
if (permanent.moveToExile(source.getSourceId(), "Hikari, Twilight Guardian", source.getSourceId(), game)) {
//create delayed triggered ability
- AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(
+ AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(
new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD));
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/JunkyoBell.java b/Mage.Sets/src/mage/sets/championsofkamigawa/JunkyoBell.java
index c3c1018e88..7bded96111 100644
--- a/Mage.Sets/src/mage/sets/championsofkamigawa/JunkyoBell.java
+++ b/Mage.Sets/src/mage/sets/championsofkamigawa/JunkyoBell.java
@@ -35,7 +35,7 @@ import mage.constants.Rarity;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.SacrificeTargetEffect;
@@ -100,7 +100,7 @@ private class JunkyoBellSacrificeEffect extends OneShotEffect {
if (creature != null) {
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice boosted " + creature.getName());
sacrificeEffect.setTargetPointer(new FixedTarget(source.getFirstTarget()));
- DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(sacrificeEffect);
+ DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
@@ -108,5 +108,5 @@ private class JunkyoBellSacrificeEffect extends OneShotEffect {
}
return false;
}
-}
+ }
}
\ No newline at end of file
diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/KikiJikiMirrorBreaker.java b/Mage.Sets/src/mage/sets/championsofkamigawa/KikiJikiMirrorBreaker.java
index 308fb3f40c..2423ec0350 100644
--- a/Mage.Sets/src/mage/sets/championsofkamigawa/KikiJikiMirrorBreaker.java
+++ b/Mage.Sets/src/mage/sets/championsofkamigawa/KikiJikiMirrorBreaker.java
@@ -36,7 +36,7 @@ import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.SacrificeTargetEffect;
@@ -128,7 +128,7 @@ class KikiJikiMirrorBreakerEffect extends OneShotEffect {
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect();
sacrificeEffect.setText("Sacrifice the token at the beginning of the next end step");
sacrificeEffect.setTargetPointer(new FixedTarget(token.getLastAddedToken()));
- DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(sacrificeEffect);
+ DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/OtherworldlyJourney.java b/Mage.Sets/src/mage/sets/championsofkamigawa/OtherworldlyJourney.java
index c9f1372360..1812949d4a 100644
--- a/Mage.Sets/src/mage/sets/championsofkamigawa/OtherworldlyJourney.java
+++ b/Mage.Sets/src/mage/sets/championsofkamigawa/OtherworldlyJourney.java
@@ -33,7 +33,7 @@ import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.abilities.Ability;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ReturnFromExileEffect;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
@@ -95,7 +95,7 @@ class OtherworldlyJourneyEffect extends OneShotEffect {
// only if permanent is in exile (tokens would be stop to exist)
if (exile != null && !exile.isEmpty()) {
//create delayed triggered ability
- AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(
+ AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(
new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD, "return that card to the battlefield under its owner's control with a +1/+1 counter on it"));
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/ThroughTheBreach.java b/Mage.Sets/src/mage/sets/championsofkamigawa/ThroughTheBreach.java
index 4addeceeb5..cd290881d2 100644
--- a/Mage.Sets/src/mage/sets/championsofkamigawa/ThroughTheBreach.java
+++ b/Mage.Sets/src/mage/sets/championsofkamigawa/ThroughTheBreach.java
@@ -30,7 +30,7 @@ package mage.sets.championsofkamigawa;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.OneShotEffect;
@@ -116,7 +116,7 @@ class ThroughTheBreachEffect extends OneShotEffect {
game.addEffect(effect, source);
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice " + card.getName());
sacrificeEffect.setTargetPointer(new FixedTarget(card.getId()));
- DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(sacrificeEffect);
+ DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage.Sets/src/mage/sets/commander/TrenchGorger.java b/Mage.Sets/src/mage/sets/commander/TrenchGorger.java
new file mode 100644
index 0000000000..1af69078fa
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/commander/TrenchGorger.java
@@ -0,0 +1,115 @@
+/*
+ * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this list of
+ * conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ * of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of BetaSteward_at_googlemail.com.
+ */
+package mage.sets.commander;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.Ability;
+import mage.abilities.common.EntersBattlefieldTriggeredAbility;
+import mage.abilities.effects.OneShotEffect;
+import mage.abilities.effects.common.continious.SetPowerToughnessSourceEffect;
+import mage.abilities.keyword.TrampleAbility;
+import mage.cards.Card;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+import mage.filter.common.FilterLandCard;
+import mage.game.Game;
+import mage.players.Player;
+import mage.target.common.TargetCardInLibrary;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class TrenchGorger extends CardImpl {
+
+ public TrenchGorger(UUID ownerId) {
+ super(ownerId, 65, "Trench Gorger", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{6}{U}{U}");
+ this.expansionSetCode = "CMD";
+ this.subtype.add("Leviathan");
+
+ this.color.setBlue(true);
+ this.power = new MageInt(6);
+ this.toughness = new MageInt(6);
+
+ // Trample
+ this.addAbility(TrampleAbility.getInstance());
+ // When Trench Gorger enters the battlefield, you may search your library for any number of land cards, exile them, then shuffle your library. If you do, Trench Gorger's power and toughness each become equal to the number of cards exiled this way.
+ this.addAbility(new EntersBattlefieldTriggeredAbility(new TrenchGorgerEffect(), true));
+
+ }
+
+ public TrenchGorger(final TrenchGorger card) {
+ super(card);
+ }
+
+ @Override
+ public TrenchGorger copy() {
+ return new TrenchGorger(this);
+ }
+}
+
+class TrenchGorgerEffect extends OneShotEffect {
+
+ public TrenchGorgerEffect() {
+ super(Outcome.BoostCreature);
+ this.staticText = "you may search your library for any number of land cards, exile them, then shuffle your library. If you do, {this}'s power and toughness each become equal to the number of cards exiled this way";
+ }
+
+ public TrenchGorgerEffect(final TrenchGorgerEffect effect) {
+ super(effect);
+ }
+
+ @Override
+ public TrenchGorgerEffect copy() {
+ return new TrenchGorgerEffect(this);
+ }
+
+ @Override
+ public boolean apply(Game game, Ability source) {
+ Player controller = game.getPlayer(source.getControllerId());
+ if (controller != null) {
+ TargetCardInLibrary target = new TargetCardInLibrary(0, Integer.MAX_VALUE, new FilterLandCard("any number of land cards"));
+ target.choose(outcome, controller.getId(), controller.getId(), game);
+ int count = 0;
+ for (UUID cardId: target.getTargets()) {
+ Card card = game.getCard(cardId);
+ controller.moveCardToExileWithInfo(card, null, "", source.getSourceId(), game, Zone.LIBRARY);
+ count++;
+ }
+ controller.shuffleLibrary(game);
+ game.addEffect(new SetPowerToughnessSourceEffect(count, count, Duration.EndOfGame), source);
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/commander2013/Flickerform.java b/Mage.Sets/src/mage/sets/commander2013/Flickerform.java
index 5d3605e1c4..a4b8defd95 100644
--- a/Mage.Sets/src/mage/sets/commander2013/Flickerform.java
+++ b/Mage.Sets/src/mage/sets/commander2013/Flickerform.java
@@ -30,7 +30,7 @@ package mage.sets.commander2013;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.AttachEffect;
@@ -132,7 +132,7 @@ class FlickerformEffect extends OneShotEffect {
if (!(enchantedCreature instanceof Token)) {
// At the beginning of the next end step, return that card to the battlefield under its owner's control.
// If you do, return the other cards exiled this way to the battlefield under their owners' control attached to that creature
- AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(
+ AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(
new FlickerformReturnEffect(enchantedCreature.getId(), exileZoneId));
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
diff --git a/Mage.Sets/src/mage/sets/commander2013/RoonOfTheHiddenRealm.java b/Mage.Sets/src/mage/sets/commander2013/RoonOfTheHiddenRealm.java
index fa7744a63f..6b5931f084 100644
--- a/Mage.Sets/src/mage/sets/commander2013/RoonOfTheHiddenRealm.java
+++ b/Mage.Sets/src/mage/sets/commander2013/RoonOfTheHiddenRealm.java
@@ -32,7 +32,7 @@ import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.OneShotEffect;
@@ -126,7 +126,7 @@ class RoonOfTheHiddenRealmEffect extends OneShotEffect {
UUID exileId = UUID.randomUUID();
if (controller.moveCardToExileWithInfo(permanent, exileId, sourceObject.getName(), source.getSourceId(), game, Zone.BATTLEFIELD)) {
if (card != null) {
- AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(new ReturnFromExileEffect(exileId, Zone.BATTLEFIELD));
+ AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnFromExileEffect(exileId, Zone.BATTLEFIELD));
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(card.getOwnerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage.Sets/src/mage/sets/commander2014/AEtherSnap.java b/Mage.Sets/src/mage/sets/commander2014/AEtherSnap.java
new file mode 100644
index 0000000000..c1f9d5c582
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/commander2014/AEtherSnap.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this list of
+ * conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ * of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of BetaSteward_at_googlemail.com.
+ */
+package mage.sets.commander2014;
+
+import java.util.UUID;
+import mage.abilities.Ability;
+import mage.abilities.effects.OneShotEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+import mage.counters.Counter;
+import mage.counters.Counters;
+import mage.filter.FilterPermanent;
+import mage.game.Game;
+import mage.game.permanent.Permanent;
+import mage.game.permanent.PermanentToken;
+import mage.players.Player;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class AEtherSnap extends CardImpl {
+
+ public AEtherSnap(UUID ownerId) {
+ super(ownerId, 133, "AEther Snap", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{B}{B}");
+ this.expansionSetCode = "C14";
+
+ this.color.setBlack(true);
+
+ // Remove all counters from all permanents and exile all tokens.
+ this.getSpellAbility().addEffect(new AEtherSnapEffect());
+ }
+
+ public AEtherSnap(final AEtherSnap card) {
+ super(card);
+ }
+
+ @Override
+ public AEtherSnap copy() {
+ return new AEtherSnap(this);
+ }
+}
+
+class AEtherSnapEffect extends OneShotEffect {
+
+ public AEtherSnapEffect() {
+ super(Outcome.Benefit);
+ this.staticText = "Remove all counters from all permanents and exile all tokens";
+ }
+
+ public AEtherSnapEffect(final AEtherSnapEffect effect) {
+ super(effect);
+ }
+
+ @Override
+ public AEtherSnapEffect copy() {
+ return new AEtherSnapEffect(this);
+ }
+
+ @Override
+ public boolean apply(Game game, Ability source) {
+ Player controller = game.getPlayer(source.getControllerId());
+ if (controller != null) {
+ for (Permanent permanent :game.getBattlefield().getActivePermanents(new FilterPermanent(), controller.getId(), source.getSourceId(), game)) {
+ if (permanent instanceof PermanentToken) {
+ controller.moveCardToExileWithInfo(permanent, null, "", source.getSourceId(), game, Zone.BATTLEFIELD);
+ } else if (!permanent.getCounters().isEmpty()){
+ Counters counters = permanent.getCounters().copy();
+ for (Counter counter: counters.values()) {
+ permanent.getCounters().removeCounter(counter.getName(), counter.getCount());
+ }
+ }
+ }
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/commander2014/DarettiScrapSavant.java b/Mage.Sets/src/mage/sets/commander2014/DarettiScrapSavant.java
new file mode 100644
index 0000000000..3cce5fed00
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/commander2014/DarettiScrapSavant.java
@@ -0,0 +1,257 @@
+/*
+ * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this list of
+ * conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ * of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of BetaSteward_at_googlemail.com.
+ */
+package mage.sets.commander2014;
+
+import java.util.UUID;
+import mage.abilities.Ability;
+import mage.abilities.DelayedTriggeredAbility;
+import mage.abilities.LoyaltyAbility;
+import mage.abilities.TriggeredAbilityImpl;
+import mage.abilities.common.CanBeYourCommanderAbility;
+import mage.abilities.common.EntersBattlefieldAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
+import mage.abilities.effects.Effect;
+import mage.abilities.effects.OneShotEffect;
+import mage.abilities.effects.common.GetEmblemEffect;
+import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
+import mage.abilities.effects.common.counter.AddCountersSourceEffect;
+import mage.cards.Card;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+import mage.counters.CounterType;
+import mage.filter.FilterCard;
+import mage.filter.common.FilterArtifactCard;
+import mage.filter.common.FilterControlledArtifactPermanent;
+import mage.game.Game;
+import mage.game.command.Emblem;
+import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
+import mage.game.events.ZoneChangeEvent;
+import mage.game.permanent.Permanent;
+import mage.players.Player;
+import mage.target.Target;
+import mage.target.common.TargetCardInYourGraveyard;
+import mage.target.common.TargetControlledPermanent;
+import mage.target.common.TargetDiscard;
+import mage.target.targetpointer.FixedTarget;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class DarettiScrapSavant extends CardImpl {
+
+ public DarettiScrapSavant(UUID ownerId) {
+ super(ownerId, 33, "Daretti, Scrap Savant", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{3}{R}");
+ this.expansionSetCode = "C14";
+ this.subtype.add("Daretti");
+
+ this.color.setRed(true);
+
+ this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false));
+
+ // +2: Discard up to two cards, then draw that many cards.
+ this.addAbility(new LoyaltyAbility(new DarettiDiscardDrawEffect(), 2));
+
+ // -2: Sacrifice an artifact. If you do, return target artifact card from your graveyard to the battlefield.
+ LoyaltyAbility loyaltyAbility = new LoyaltyAbility(new DarettiSacrificeEffect(), -2);
+ loyaltyAbility.addTarget(new TargetCardInYourGraveyard(new FilterArtifactCard("artifact card from your graveyard")));
+ this.addAbility(loyaltyAbility);
+
+ // -10: You get an emblem with "Whenever an artifact is put into your graveyard from the battlefield, return that card to the battlefield at the beginning of the next end step."
+ this.addAbility(new LoyaltyAbility(new GetEmblemEffect(new DarettiScrapSavantEmblem()), -10));
+
+ // Daretti, Scrap Savant can be your commander.
+ this.addAbility(CanBeYourCommanderAbility.getInstance());
+ }
+
+ public DarettiScrapSavant(final DarettiScrapSavant card) {
+ super(card);
+ }
+
+ @Override
+ public DarettiScrapSavant copy() {
+ return new DarettiScrapSavant(this);
+ }
+}
+
+class DarettiDiscardDrawEffect extends OneShotEffect {
+
+ public DarettiDiscardDrawEffect() {
+ super(Outcome.Detriment);
+ this.staticText = "Discard up to two cards, then draw that many cards";
+ }
+
+ public DarettiDiscardDrawEffect(final DarettiDiscardDrawEffect effect) {
+ super(effect);
+ }
+
+ @Override
+ public DarettiDiscardDrawEffect copy() {
+ return new DarettiDiscardDrawEffect(this);
+ }
+
+ @Override
+ public boolean apply(Game game, Ability source) {
+ Player controller = game.getPlayer(source.getControllerId());
+ if (controller != null) {
+ TargetDiscard target = new TargetDiscard(0, 2, new FilterCard(), controller.getId());
+ target.choose(outcome, controller.getId(), source.getSourceId(), game);
+ int count = 0;
+ for (UUID cardId: target.getTargets()) {
+ Card card = game.getCard(cardId);
+ if (card != null) {
+ controller.discard(card, source, game);
+ count++;
+ }
+ }
+ controller.drawCards(count, game);
+ return true;
+ }
+ return false;
+ }
+}
+
+class DarettiSacrificeEffect extends OneShotEffect {
+
+ public DarettiSacrificeEffect() {
+ super(Outcome.PutCardInPlay);
+ this.staticText = "Sacrifice an artifact. If you do, return target artifact card from your graveyard to the battlefield";
+ }
+
+ public DarettiSacrificeEffect(final DarettiSacrificeEffect effect) {
+ super(effect);
+ }
+
+ @Override
+ public DarettiSacrificeEffect copy() {
+ return new DarettiSacrificeEffect(this);
+ }
+
+ @Override
+ public boolean apply(Game game, Ability source) {
+ Player controller = game.getPlayer(source.getControllerId());
+ if (controller != null) {
+ Target target = new TargetControlledPermanent(1,1,new FilterControlledArtifactPermanent(), true);
+ if (target.canChoose(source.getSourceId(), controller.getId(), game) &&
+ controller.chooseTarget(outcome, target, source, game)) {
+ Permanent artifact = game.getPermanent(target.getFirstTarget());
+ if (artifact != null && artifact.sacrifice(source.getSourceId(), game)) {
+ Card card = game.getCard(getTargetPointer().getFirst(game, source));
+ if (card != null) {
+ return controller.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId());
+ }
+ }
+ }
+ return true;
+ }
+ return false;
+ }
+}
+
+class DarettiScrapSavantEmblem extends Emblem {
+ // You get an emblem with "Whenever an artifact is put into your graveyard from the battlefield, return that card to the battlefield at the beginning of the next end step."
+ public DarettiScrapSavantEmblem() {
+ this.setName("EMBLEM: Daretti, Scrap Savant");
+ this.getAbilities().add(new DarettiScrapSavantTriggeredAbility());
+ }
+}
+
+class DarettiScrapSavantTriggeredAbility extends TriggeredAbilityImpl {
+
+ DarettiScrapSavantTriggeredAbility() {
+ super(Zone.COMMAND, new DarettiScrapSavantEffect(), false);
+ }
+
+ DarettiScrapSavantTriggeredAbility(final DarettiScrapSavantTriggeredAbility ability) {
+ super(ability);
+ }
+
+ @Override
+ public DarettiScrapSavantTriggeredAbility copy() {
+ return new DarettiScrapSavantTriggeredAbility(this);
+ }
+
+ @Override
+ public boolean checkTrigger(GameEvent event, Game game) {
+ if (event.getType() == EventType.ZONE_CHANGE) {
+ ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
+ if (zEvent.getToZone() == Zone.GRAVEYARD &&
+ zEvent.getFromZone() == Zone.BATTLEFIELD &&
+ zEvent.getTarget().getCardType().contains(CardType.ARTIFACT) &&
+ zEvent.getTarget().getOwnerId().equals(this.controllerId)) {
+ for (Effect effect : this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(zEvent.getTargetId()));
+ }
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public String getRule() {
+ return "Whenever an artifact is put into your graveyard from the battlefield, " + super.getRule();
+ }
+}
+
+class DarettiScrapSavantEffect extends OneShotEffect {
+
+ DarettiScrapSavantEffect() {
+ super(Outcome.PutCardInPlay);
+ this.staticText = "return that card to the battlefield at the beginning of the next end step";
+ }
+
+ DarettiScrapSavantEffect(final DarettiScrapSavantEffect effect) {
+ super(effect);
+ }
+
+ @Override
+ public DarettiScrapSavantEffect copy() {
+ return new DarettiScrapSavantEffect(this);
+ }
+
+ @Override
+ public boolean apply(Game game, Ability source) {
+ Card card = game.getCard(getTargetPointer().getFirst(game, source));
+ if (card != null) {
+ Effect effect = new ReturnFromGraveyardToBattlefieldTargetEffect();
+ effect.setTargetPointer(new FixedTarget(card.getId()));
+ effect.setText("return that card to the battlefield at the beginning of the next end step");
+ DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect);
+ delayedAbility.setSourceId(source.getSourceId());
+ delayedAbility.setControllerId(source.getControllerId());
+ game.addDelayedTriggeredAbility(delayedAbility);
+ return true;
+ }
+ return false;
+ }
+}
\ No newline at end of file
diff --git a/Mage.Sets/src/mage/sets/commander2014/DregsOfSorrow.java b/Mage.Sets/src/mage/sets/commander2014/DregsOfSorrow.java
new file mode 100644
index 0000000000..a847944e43
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/commander2014/DregsOfSorrow.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this list of
+ * conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ * of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of BetaSteward_at_googlemail.com.
+ */
+package mage.sets.commander2014;
+
+import java.util.UUID;
+import mage.ObjectColor;
+import mage.abilities.Ability;
+import mage.abilities.SpellAbility;
+import mage.abilities.dynamicvalue.DynamicValue;
+import mage.abilities.dynamicvalue.common.ManacostVariableValue;
+import mage.abilities.effects.common.DestroyTargetEffect;
+import mage.abilities.effects.common.DrawCardSourceControllerEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.filter.common.FilterCreaturePermanent;
+import mage.filter.predicate.Predicates;
+import mage.filter.predicate.mageobject.ColorPredicate;
+import mage.game.Game;
+import mage.target.common.TargetCreaturePermanent;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class DregsOfSorrow extends CardImpl {
+
+ private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creatures");
+
+ static {
+ filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK)));
+ }
+
+ public DregsOfSorrow(UUID ownerId) {
+ super(ownerId, 143, "Dregs of Sorrow", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{X}{4}{B}");
+ this.expansionSetCode = "C14";
+
+ this.color.setBlack(true);
+
+ // Destroy X target nonblack creatures. Draw X cards.
+ this.getSpellAbility().addEffect(new DestroyTargetEffect("Destroy X target nonblack creatures"));
+ this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(new ManacostVariableValue()));
+ this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
+ }
+
+ @Override
+ public void adjustTargets(Ability ability, Game game) {
+ if (ability instanceof SpellAbility) {
+ ability.getTargets().clear();
+ int xValue = ability.getManaCostsToPay().getX();
+ ability.addTarget(new TargetCreaturePermanent(xValue, xValue, filter, false));
+ }
+ }
+
+
+ public DregsOfSorrow(final DregsOfSorrow card) {
+ super(card);
+ }
+
+ @Override
+ public DregsOfSorrow copy() {
+ return new DregsOfSorrow(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/commander2014/FleshCarver.java b/Mage.Sets/src/mage/sets/commander2014/FleshCarver.java
new file mode 100644
index 0000000000..05fa0c1b86
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/commander2014/FleshCarver.java
@@ -0,0 +1,173 @@
+/*
+ * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this list of
+ * conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ * of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of BetaSteward_at_googlemail.com.
+ */
+package mage.sets.commander2014;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.Ability;
+import mage.abilities.common.DiesTriggeredAbility;
+import mage.abilities.common.SimpleActivatedAbility;
+import mage.abilities.costs.common.SacrificeTargetCost;
+import mage.abilities.costs.mana.ManaCostsImpl;
+import mage.abilities.effects.Effect;
+import mage.abilities.effects.OneShotEffect;
+import mage.abilities.effects.common.CreateTokenEffect;
+import mage.abilities.effects.common.counter.AddCountersSourceEffect;
+import mage.abilities.keyword.IntimidateAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+import mage.counters.CounterType;
+import mage.filter.common.FilterControlledCreaturePermanent;
+import mage.filter.predicate.permanent.AnotherPredicate;
+import mage.game.Game;
+import mage.game.events.GameEvent;
+import mage.game.permanent.Permanent;
+import mage.game.permanent.token.Token;
+import mage.players.Player;
+import mage.target.common.TargetControlledPermanent;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class FleshCarver extends CardImpl {
+
+ private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("another creature");
+
+ static {
+ filter.add(new AnotherPredicate());
+ }
+
+ public FleshCarver(UUID ownerId) {
+ super(ownerId, 22, "Flesh Carver", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}");
+ this.expansionSetCode = "C14";
+ this.subtype.add("Human");
+ this.subtype.add("Wizard");
+
+ this.color.setBlack(true);
+ this.power = new MageInt(2);
+ this.toughness = new MageInt(2);
+
+ // Intimidate
+ this.addAbility(IntimidateAbility.getInstance());
+ // {1}{B}, Sacrifice another creature: Put two +1/+1 counters on Flesh Carver.
+ Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), new ManaCostsImpl("{1}{B}"));
+ ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter)));
+ this.addAbility(ability);
+
+ // When Flesh Carver dies, put an X/X black Horror creature token onto the battlefield, where X is Flesh Carver's power.
+ this.addAbility(new FleshCarverAbility());
+ }
+
+ public FleshCarver(final FleshCarver card) {
+ super(card);
+ }
+
+ @Override
+ public FleshCarver copy() {
+ return new FleshCarver(this);
+ }
+}
+
+class FleshCarverAbility extends DiesTriggeredAbility {
+ public FleshCarverAbility() {
+ super(new FleshCarverEffect(), false);
+ }
+
+ public FleshCarverAbility(final FleshCarverAbility ability) {
+ super(ability);
+ }
+
+ @Override
+ public FleshCarverAbility copy() {
+ return new FleshCarverAbility(this);
+ }
+
+ @Override
+ public boolean checkTrigger(GameEvent event, Game game) {
+ if (super.checkTrigger(event, game)) {
+ Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
+ if (permanent !=null) {
+ for (Effect effect :this.getEffects()) {
+ effect.setValue("power", permanent.getPower().getValue());
+ }
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public String getRule() {
+ return "When Flesh Carver dies, " + super.getRule();
+ }
+}
+
+class FleshCarverEffect extends OneShotEffect {
+
+ public FleshCarverEffect() {
+ super(Outcome.DestroyPermanent);
+ staticText = "put an X/X black Horror creature token onto the battlefield, where X is {this}'s power";
+ }
+
+ public FleshCarverEffect(FleshCarverEffect ability) {
+ super(ability);
+ }
+
+ @Override
+ public boolean apply(Game game, Ability source) {
+ Player controller = game.getPlayer(source.getControllerId());
+ if (controller != null) {
+ int xValue = (Integer) getValue("power");
+ return new CreateTokenEffect(new FleshCarverHorrorToken(xValue)).apply(game, source);
+ }
+ return false;
+ }
+
+ @Override
+ public FleshCarverEffect copy() {
+ return new FleshCarverEffect(this);
+ }
+
+}
+
+class FleshCarverHorrorToken extends Token {
+
+ public FleshCarverHorrorToken(int xValue) {
+ super("Horror", "X/X black Horror creature token");
+ cardType.add(CardType.CREATURE);
+ color.setBlack(true);
+ subtype.add("Horror");
+ power = new MageInt(xValue);
+ toughness = new MageInt(xValue);
+
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/commander2014/MagusOfTheCoffers.java b/Mage.Sets/src/mage/sets/commander2014/MagusOfTheCoffers.java
new file mode 100644
index 0000000000..63d1f525a8
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/commander2014/MagusOfTheCoffers.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this list of
+ * conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ * of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of BetaSteward_at_googlemail.com.
+ */
+package mage.sets.commander2014;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.Mana;
+import mage.abilities.Ability;
+import mage.abilities.costs.common.TapSourceCost;
+import mage.abilities.costs.mana.GenericManaCost;
+import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
+import mage.abilities.effects.common.DynamicManaEffect;
+import mage.abilities.mana.SimpleManaAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+import mage.filter.common.FilterControlledPermanent;
+import mage.filter.predicate.mageobject.SubtypePredicate;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class MagusOfTheCoffers extends CardImpl {
+
+ private static final FilterControlledPermanent filter = new FilterControlledPermanent("Swamp you control");
+
+ static {
+ filter.add(new SubtypePredicate("Swamp"));
+ }
+
+ public MagusOfTheCoffers(UUID ownerId) {
+ super(ownerId, 148, "Magus of the Coffers", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{B}");
+ this.expansionSetCode = "C14";
+ this.subtype.add("Human");
+ this.subtype.add("Wizard");
+
+ this.color.setBlack(true);
+ this.power = new MageInt(4);
+ this.toughness = new MageInt(4);
+
+ // {2}, {T}: Add {B} to your mana pool for each Swamp you control.
+ Ability ability = new SimpleManaAbility(Zone.BATTLEFIELD,
+ new DynamicManaEffect(Mana.BlackMana, new PermanentsOnBattlefieldCount(filter)),
+ new GenericManaCost(2));
+ ability.addCost(new TapSourceCost());
+ this.addAbility(ability);
+ }
+
+ public MagusOfTheCoffers(final MagusOfTheCoffers card) {
+ super(card);
+ }
+
+ @Override
+ public MagusOfTheCoffers copy() {
+ return new MagusOfTheCoffers(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/commander2014/MaliciousAffliction.java b/Mage.Sets/src/mage/sets/commander2014/MaliciousAffliction.java
new file mode 100644
index 0000000000..424debd887
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/commander2014/MaliciousAffliction.java
@@ -0,0 +1,136 @@
+/*
+ * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this list of
+ * conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ * of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of BetaSteward_at_googlemail.com.
+ */
+package mage.sets.commander2014;
+
+import java.util.UUID;
+import mage.ObjectColor;
+import mage.abilities.Ability;
+import mage.abilities.DelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility;
+import mage.abilities.condition.LockedInCondition;
+import mage.abilities.condition.common.MorbidCondition;
+import mage.abilities.decorator.ConditionalTriggeredAbility;
+import mage.abilities.effects.Effect;
+import mage.abilities.effects.OneShotEffect;
+import mage.abilities.effects.common.CastSourceTriggeredAbility;
+import mage.abilities.effects.common.DestroyTargetEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.filter.common.FilterCreaturePermanent;
+import mage.filter.predicate.Predicates;
+import mage.filter.predicate.mageobject.ColorPredicate;
+import mage.game.Game;
+import mage.game.stack.Spell;
+import mage.game.stack.StackObject;
+import mage.players.Player;
+import mage.target.common.TargetCreaturePermanent;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class MaliciousAffliction extends CardImpl {
+
+ private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creatures");
+
+ static {
+ filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK)));
+ }
+
+ public MaliciousAffliction(UUID ownerId) {
+ super(ownerId, 25, "Malicious Affliction", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{B}{B}");
+ this.expansionSetCode = "C14";
+
+ this.color.setBlack(true);
+
+ // Morbid - When you cast Malicious Affliction, if a creature died this turn, you may copy Malicious Affliction and may choose a new target for the copy.
+ Ability ability = new ConditionalTriggeredAbility(
+ new CastSourceTriggeredAbility(new CopySourceSpellEffect(), true),
+ new LockedInCondition(MorbidCondition.getInstance()),
+ "Morbid - When you cast {this}, if a creature died this turn, you may copy {this} and may choose a new target for the copy");
+ ability.setRuleAtTheTop(true);
+ this.addAbility(ability);
+
+ // Destroy target nonblack creature.
+ this.getSpellAbility().addEffect(new DestroyTargetEffect());
+ this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
+ }
+
+ public MaliciousAffliction(final MaliciousAffliction card) {
+ super(card);
+ }
+
+ @Override
+ public MaliciousAffliction copy() {
+ return new MaliciousAffliction(this);
+ }
+}
+
+class CopySourceSpellEffect extends OneShotEffect {
+
+ final String rule = "copy {this} and may choose a new target for the copy";
+
+ public CopySourceSpellEffect() {
+ super(Outcome.Benefit);
+ staticText = rule;
+ }
+
+ public CopySourceSpellEffect(final CopySourceSpellEffect effect) {
+ super(effect);
+ }
+
+ @Override
+ public boolean apply(Game game, Ability source) {
+ Player controller = game.getPlayer(source.getControllerId());
+ if (controller != null) {
+ Spell spell = game.getStack().getSpell(source.getSourceId());
+ if (spell != null) {
+ Spell spellCopy = spell.copySpell();
+ spellCopy.setCopiedSpell(true);
+ spellCopy.setControllerId(source.getControllerId());
+ game.getStack().push(spellCopy);
+ spellCopy.chooseNewTargets(game, controller.getId());
+ String activateMessage = spellCopy.getActivatedMessage(game);
+ if (activateMessage.startsWith(" casts ")) {
+ activateMessage = activateMessage.substring(6);
+ }
+ game.informPlayers(controller.getName() + " copies " + activateMessage);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public CopySourceSpellEffect copy() {
+ return new CopySourceSpellEffect(this);
+ }
+}
\ No newline at end of file
diff --git a/Mage.Sets/src/mage/sets/commander2014/NecromanticSelection.java b/Mage.Sets/src/mage/sets/commander2014/NecromanticSelection.java
new file mode 100644
index 0000000000..37863737b6
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/commander2014/NecromanticSelection.java
@@ -0,0 +1,191 @@
+/*
+ * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this list of
+ * conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ * of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of BetaSteward_at_googlemail.com.
+ */
+package mage.sets.commander2014;
+
+import java.util.ArrayList;
+import java.util.UUID;
+import mage.MageObject;
+import mage.abilities.Ability;
+import mage.abilities.effects.ContinuousEffect;
+import mage.abilities.effects.ContinuousEffectImpl;
+import mage.abilities.effects.OneShotEffect;
+import mage.abilities.effects.postresolve.ExileSpellEffect;
+import mage.cards.Card;
+import mage.cards.CardImpl;
+import mage.cards.Cards;
+import mage.cards.CardsImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Layer;
+import static mage.constants.Layer.ColorChangingEffects_5;
+import static mage.constants.Layer.TypeChangingEffects_4;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.SubLayer;
+import mage.constants.Zone;
+import mage.filter.FilterCard;
+import mage.filter.common.FilterCreatureCard;
+import mage.filter.common.FilterCreaturePermanent;
+import mage.filter.predicate.Predicate;
+import mage.filter.predicate.Predicates;
+import mage.filter.predicate.mageobject.CardIdPredicate;
+import mage.game.Game;
+import mage.game.permanent.Permanent;
+import mage.players.Player;
+import mage.target.Target;
+import mage.target.common.TargetCardInGraveyard;
+import mage.target.targetpointer.FixedTarget;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class NecromanticSelection extends CardImpl {
+
+ public NecromanticSelection(UUID ownerId) {
+ super(ownerId, 26, "Necromantic Selection", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{4}{B}{B}{B}");
+ this.expansionSetCode = "C14";
+
+ this.color.setBlack(true);
+
+ // Destroy all creatures, then return a creature card put into a graveyard this way to the battlefield under your control. It's a black Zombie in addition to its other colors and types. Exile Necromantic Selection.
+ this.getSpellAbility().addEffect(new NecromanticSelectionEffect());
+ this.getSpellAbility().addEffect(ExileSpellEffect.getInstance());
+
+ }
+
+ public NecromanticSelection(final NecromanticSelection card) {
+ super(card);
+ }
+
+ @Override
+ public NecromanticSelection copy() {
+ return new NecromanticSelection(this);
+ }
+}
+
+class NecromanticSelectionEffect extends OneShotEffect {
+
+ public NecromanticSelectionEffect() {
+ super(Outcome.DestroyPermanent);
+ this.staticText = "Destroy all creatures, then return a creature card put into a graveyard this way to the battlefield under your control. It's a black Zombie in addition to its other colors and types";
+ }
+
+ public NecromanticSelectionEffect(final NecromanticSelectionEffect effect) {
+ super(effect);
+ }
+
+ @Override
+ public NecromanticSelectionEffect copy() {
+ return new NecromanticSelectionEffect(this);
+ }
+
+ @Override
+ public boolean apply(Game game, Ability source) {
+ Player controller = game.getPlayer(source.getControllerId());
+ MageObject sourceObject = game.getObject(source.getSourceId());
+ if (sourceObject != null && controller != null) {
+ Cards cards = new CardsImpl();
+ for(Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), controller.getId(), source.getSourceId(), game)) {
+ cards.add(permanent);
+ controller.moveCardToGraveyardWithInfo(permanent, source.getSourceId(), game, Zone.BATTLEFIELD);
+ }
+ FilterCard filter = new FilterCreatureCard("creature card put into a graveyard with " + sourceObject.getLogName());
+ ArrayList> cardIdPredicates = new ArrayList<>();
+ for(UUID cardId: cards) {
+ cardIdPredicates.add(new CardIdPredicate(cardId));
+ }
+ filter.add(Predicates.or(cardIdPredicates));
+ Target target = new TargetCardInGraveyard(filter);
+ if (controller.chooseTarget(outcome, target, source, game)) {
+ Card card = game.getCard(target.getFirstTarget());
+ if (card != null) {
+ controller.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId());
+ ContinuousEffect effect = new NecromanticSelectionContinuousEffect();
+ effect.setTargetPointer(new FixedTarget(card.getId()));
+ game.addEffect(effect, source);
+ }
+ }
+ return true;
+ }
+ return false;
+ }
+}
+
+class NecromanticSelectionContinuousEffect extends ContinuousEffectImpl {
+
+ public NecromanticSelectionContinuousEffect() {
+ super(Duration.Custom, Outcome.Neutral);
+ staticText = "It's a black Zombie in addition to its other colors and types";
+ }
+
+ public NecromanticSelectionContinuousEffect(final NecromanticSelectionContinuousEffect effect) {
+ super(effect);
+ }
+
+ @Override
+ public NecromanticSelectionContinuousEffect copy() {
+ return new NecromanticSelectionContinuousEffect(this);
+ }
+
+ @Override
+ public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
+ Permanent creature = game.getPermanent(targetPointer.getFirst(game, source));
+ if (creature != null) {
+ switch (layer) {
+ case TypeChangingEffects_4:
+ if (sublayer == SubLayer.NA) {
+ if (!creature.getSubtype().contains("Zombie")) {
+ creature.getSubtype().add("Zombie");
+ }
+ }
+ break;
+ case ColorChangingEffects_5:
+ if (sublayer == SubLayer.NA) {
+ creature.getColor().setBlack(true);
+ }
+ break;
+ }
+ return true;
+ } else {
+ this.used = true;
+ }
+ return false;
+ }
+
+ @Override
+ public boolean apply(Game game, Ability source) {
+ return false;
+ }
+
+ @Override
+ public boolean hasLayer(Layer layer) {
+ return layer == Layer.ColorChangingEffects_5 || layer == Layer.TypeChangingEffects_4;
+ }
+
+}
diff --git a/Mage.Sets/src/mage/sets/commander2014/ObNixilisOfTheBlackOath.java b/Mage.Sets/src/mage/sets/commander2014/ObNixilisOfTheBlackOath.java
new file mode 100644
index 0000000000..2f4821a622
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/commander2014/ObNixilisOfTheBlackOath.java
@@ -0,0 +1,164 @@
+/*
+ * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this list of
+ * conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ * of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of BetaSteward_at_googlemail.com.
+ */
+package mage.sets.commander2014;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.Ability;
+import mage.abilities.LoyaltyAbility;
+import mage.abilities.common.CanBeYourCommanderAbility;
+import mage.abilities.common.EntersBattlefieldAbility;
+import mage.abilities.common.SimpleActivatedAbility;
+import mage.abilities.costs.common.SacrificeTargetCost;
+import mage.abilities.costs.mana.ManaCostsImpl;
+import mage.abilities.dynamicvalue.DynamicValue;
+import mage.abilities.dynamicvalue.common.SacrificeCostCreaturesPower;
+import mage.abilities.effects.Effect;
+import mage.abilities.effects.OneShotEffect;
+import mage.abilities.effects.common.CreateTokenEffect;
+import mage.abilities.effects.common.DrawCardSourceControllerEffect;
+import mage.abilities.effects.common.GainLifeEffect;
+import mage.abilities.effects.common.GetEmblemEffect;
+import mage.abilities.effects.common.LoseLifeSourceControllerEffect;
+import mage.abilities.effects.common.counter.AddCountersSourceEffect;
+import mage.abilities.keyword.FlyingAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+import mage.counters.CounterType;
+import mage.game.Game;
+import mage.game.command.Emblem;
+import mage.game.permanent.token.Token;
+import mage.players.Player;
+import mage.target.common.TargetControlledCreaturePermanent;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class ObNixilisOfTheBlackOath extends CardImpl {
+
+ public ObNixilisOfTheBlackOath(UUID ownerId) {
+ super(ownerId, 27, "Ob Nixilis of the Black Oath", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{3}{B}{B}");
+ this.expansionSetCode = "C14";
+ this.subtype.add("Nixilis");
+
+ this.color.setBlack(true);
+
+ this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false));
+
+ // +2: Each opponent loses 1 life. You gain life equal to the life lost this way.
+ this.addAbility(new LoyaltyAbility(new ObNixilisOfTheBlackOathEffect1(), 2));
+
+ // -2: Put a 5/5 black Demon creature token with flying onto the battlefield. You lose 2 life.
+ LoyaltyAbility loyaltyAbility = new LoyaltyAbility(new CreateTokenEffect(new ObNixilisDemonToken()), -2);
+ loyaltyAbility.addEffect(new LoseLifeSourceControllerEffect(2));
+ this.addAbility(loyaltyAbility);
+
+ // -8: You get an emblem with "{1}{B}, Sacrifice a creature: You gain X life and draw X cards, where X is the sacrificed creature's power."
+ this.addAbility(new LoyaltyAbility(new GetEmblemEffect(new ObNixilisOfTheBlackOathEmblem()), -8));
+
+ // Ob Nixilis of the Black Oath can be your commander.
+ this.addAbility(CanBeYourCommanderAbility.getInstance());
+ }
+
+ public ObNixilisOfTheBlackOath(final ObNixilisOfTheBlackOath card) {
+ super(card);
+ }
+
+ @Override
+ public ObNixilisOfTheBlackOath copy() {
+ return new ObNixilisOfTheBlackOath(this);
+ }
+}
+
+class ObNixilisOfTheBlackOathEffect1 extends OneShotEffect {
+
+ public ObNixilisOfTheBlackOathEffect1() {
+ super(Outcome.Damage);
+ staticText = "Each opponent loses 1 life. You gain life equal to the life lost this way";
+ }
+
+ public ObNixilisOfTheBlackOathEffect1(final ObNixilisOfTheBlackOathEffect1 effect) {
+ super(effect);
+ }
+
+ @Override
+ public boolean apply(Game game, Ability source) {
+ Player controller = game.getPlayer(source.getControllerId());
+ if (controller != null) {
+ int damage = 0;
+ for (UUID opponentId: game.getOpponents(source.getControllerId())) {
+ damage += game.getPlayer(opponentId).damage(1, source.getSourceId(), game, false, true);
+ }
+ controller.gainLife(damage, game);
+ return true;
+
+ }
+ return false;
+ }
+
+ @Override
+ public ObNixilisOfTheBlackOathEffect1 copy() {
+ return new ObNixilisOfTheBlackOathEffect1(this);
+ }
+
+}
+
+class ObNixilisDemonToken extends Token {
+
+ ObNixilisDemonToken() {
+ super("Demon", "5/5 black Demon creature token with flying");
+ cardType.add(CardType.CREATURE);
+ subtype.add("Demon");
+
+ color.setBlack(true);
+ power = new MageInt(5);
+ toughness = new MageInt(5);
+
+ addAbility(FlyingAbility.getInstance());
+ }
+}
+
+class ObNixilisOfTheBlackOathEmblem extends Emblem {
+ // You get an emblem with "{1}{B}, Sacrifice a creature: You gain X life and draw X cards, where X is the sacrificed creature's power."
+ public ObNixilisOfTheBlackOathEmblem() {
+ this.setName("EMBLEM: Ob Nixilis of the Black Oath");
+ DynamicValue xValue = new SacrificeCostCreaturesPower();
+ Effect effect = new GainLifeEffect(xValue);
+ effect.setText("You gain X life");
+ Ability ability = new SimpleActivatedAbility(Zone.COMMAND, effect, new ManaCostsImpl("{1}{B}"));
+ ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent()));
+ effect = new DrawCardSourceControllerEffect(xValue);
+ effect.setText("and draw X cards, where X is the sacrificed creature's power");
+ ability.addEffect(effect);
+ this.getAbilities().add(ability);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/commander2014/PromiseOfPower.java b/Mage.Sets/src/mage/sets/commander2014/PromiseOfPower.java
new file mode 100644
index 0000000000..ee2c496b0d
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/commander2014/PromiseOfPower.java
@@ -0,0 +1,131 @@
+/*
+ * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this list of
+ * conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ * of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of BetaSteward_at_googlemail.com.
+ */
+package mage.sets.commander2014;
+
+import java.util.UUID;
+import static javafx.scene.paint.Color.color;
+import mage.MageInt;
+import mage.abilities.Ability;
+import mage.abilities.Mode;
+import mage.abilities.effects.Effect;
+import mage.abilities.effects.OneShotEffect;
+import mage.abilities.effects.common.CreateTokenEffect;
+import mage.abilities.effects.common.DrawCardSourceControllerEffect;
+import mage.abilities.effects.common.LoseLifeSourceControllerEffect;
+import mage.abilities.keyword.EntwineAbility;
+import mage.abilities.keyword.FlyingAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.game.Game;
+import mage.game.permanent.token.Token;
+import mage.players.Player;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class PromiseOfPower extends CardImpl {
+
+ public PromiseOfPower(UUID ownerId) {
+ super(ownerId, 157, "Promise of Power", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{B}{B}{B}");
+ this.expansionSetCode = "C14";
+
+ this.color.setBlack(true);
+
+ // Choose one -
+ this.getSpellAbility().getModes().setMinModes(1);
+ this.getSpellAbility().getModes().setMaxModes(1);
+
+ // - You draw five cards and you lose 5 life.
+ Effect effect = new DrawCardSourceControllerEffect(5);
+ effect.setText("You draw five cards");
+ this.getSpellAbility().addEffect(effect);
+ effect = new LoseLifeSourceControllerEffect(5);
+ effect.setText("and you lose 5 life");
+ this.getSpellAbility().addEffect(effect);
+
+ // - Put an X/X black Demon creature token with flying onto the battlefield, where X is the number of cards in your hand as the token enters the battlefield.
+ Mode mode = new Mode();
+ mode.getEffects().add(new PromiseOfPowerEffect());
+ this.getSpellAbility().getModes().addMode(mode);
+
+ // Entwine {4}
+ this.addAbility(new EntwineAbility("{4}"));
+ }
+
+ public PromiseOfPower(final PromiseOfPower card) {
+ super(card);
+ }
+
+ @Override
+ public PromiseOfPower copy() {
+ return new PromiseOfPower(this);
+ }
+}
+
+class PromiseOfPowerEffect extends OneShotEffect {
+
+ public PromiseOfPowerEffect() {
+ super(Outcome.DestroyPermanent);
+ staticText = "Put an X/X black Demon creature token with flying onto the battlefield, where X is the number of cards in your hand as the token enters the battlefield";
+ }
+
+ public PromiseOfPowerEffect(PromiseOfPowerEffect ability) {
+ super(ability);
+ }
+
+ @Override
+ public boolean apply(Game game, Ability source) {
+ Player controller = game.getPlayer(source.getControllerId());
+ if (controller != null) {
+ return new CreateTokenEffect(new PromiseOfPowerHorrorToken(controller.getHand().size())).apply(game, source);
+ }
+ return false;
+ }
+
+ @Override
+ public PromiseOfPowerEffect copy() {
+ return new PromiseOfPowerEffect(this);
+ }
+
+}
+class PromiseOfPowerHorrorToken extends Token {
+
+ public PromiseOfPowerHorrorToken(int xValue) {
+ super("Horror", "X/X black Horror creature token with flying");
+ cardType.add(CardType.CREATURE);
+ color.setBlack(true);
+ subtype.add("Horror");
+ power = new MageInt(xValue);
+ toughness = new MageInt(xValue);
+
+ addAbility(FlyingAbility.getInstance());
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/commander2014/SpoilsOfBlood.java b/Mage.Sets/src/mage/sets/commander2014/SpoilsOfBlood.java
new file mode 100644
index 0000000000..919b9d6aec
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/commander2014/SpoilsOfBlood.java
@@ -0,0 +1,154 @@
+/*
+ * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this list of
+ * conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ * of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of BetaSteward_at_googlemail.com.
+ */
+package mage.sets.commander2014;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.MageObject;
+import mage.abilities.Ability;
+import mage.abilities.effects.OneShotEffect;
+import mage.abilities.effects.common.CreateTokenEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.WatcherScope;
+import mage.constants.Zone;
+import mage.game.Game;
+import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
+import mage.game.events.ZoneChangeEvent;
+import mage.game.permanent.token.Token;
+import mage.players.Player;
+import mage.watchers.Watcher;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class SpoilsOfBlood extends CardImpl {
+
+ public SpoilsOfBlood(UUID ownerId) {
+ super(ownerId, 30, "Spoils of Blood", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{B}");
+ this.expansionSetCode = "C14";
+
+ this.color.setBlack(true);
+
+ // Put an X/X black Horror creature token onto the battlefield, where X is the number of creatures that died this turn.
+ this.getSpellAbility().addEffect(new SpoilsOfBloodEffect());
+ this.addWatcher(new CreaturesDiedThisTurnWatcher());
+ }
+
+ public SpoilsOfBlood(final SpoilsOfBlood card) {
+ super(card);
+ }
+
+ @Override
+ public SpoilsOfBlood copy() {
+ return new SpoilsOfBlood(this);
+ }
+}
+
+class SpoilsOfBloodEffect extends OneShotEffect {
+
+ public SpoilsOfBloodEffect() {
+ super(Outcome.DestroyPermanent);
+ staticText = "Put an X/X black Horror creature token onto the battlefield, where X is the number of creatures that died this turn";
+ }
+
+ public SpoilsOfBloodEffect(SpoilsOfBloodEffect ability) {
+ super(ability);
+ }
+
+ @Override
+ public boolean apply(Game game, Ability source) {
+ Player controller = game.getPlayer(source.getControllerId());
+ if (controller != null) {
+ CreaturesDiedThisTurnWatcher watcher = (CreaturesDiedThisTurnWatcher) game.getState().getWatchers().get("CreaturesDied");
+ if (watcher != null) {
+ new CreateTokenEffect(new SpoilsOfBloodHorrorToken(watcher.creaturesDiedThisTurn)).apply(game, source);
+ }
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public SpoilsOfBloodEffect copy() {
+ return new SpoilsOfBloodEffect(this);
+ }
+
+}
+
+
+class CreaturesDiedThisTurnWatcher extends Watcher {
+
+ public int creaturesDiedThisTurn = 0;
+
+ public CreaturesDiedThisTurnWatcher() {
+ super("CreaturesDied", WatcherScope.GAME);
+ }
+
+ public CreaturesDiedThisTurnWatcher(final CreaturesDiedThisTurnWatcher watcher) {
+ super(watcher);
+ }
+
+ @Override
+ public CreaturesDiedThisTurnWatcher copy() {
+ return new CreaturesDiedThisTurnWatcher(this);
+ }
+
+ @Override
+ public void watch(GameEvent event, Game game) {
+ if (event.getType() == EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).isDiesEvent()) {
+ MageObject mageObject = game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
+ if (mageObject != null && mageObject.getCardType().contains(CardType.CREATURE)) {
+ creaturesDiedThisTurn++;
+ }
+ }
+ }
+
+ @Override
+ public void reset() {
+ super.reset();
+ creaturesDiedThisTurn = 0;
+ }
+
+}
+
+class SpoilsOfBloodHorrorToken extends Token {
+
+ public SpoilsOfBloodHorrorToken(int xValue) {
+ super("Horror", "X/X black Horror creature token");
+ cardType.add(CardType.CREATURE);
+ color.setBlack(true);
+ subtype.add("Horror");
+ power = new MageInt(xValue);
+ toughness = new MageInt(xValue);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/commander2014/WakeTheDead.java b/Mage.Sets/src/mage/sets/commander2014/WakeTheDead.java
new file mode 100644
index 0000000000..a3f3656a79
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/commander2014/WakeTheDead.java
@@ -0,0 +1,178 @@
+/*
+ * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this list of
+ * conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ * of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of BetaSteward_at_googlemail.com.
+ */
+package mage.sets.commander2014;
+
+import java.util.UUID;
+import mage.abilities.Ability;
+import mage.abilities.DelayedTriggeredAbility;
+import mage.abilities.SpellAbility;
+import mage.abilities.common.SimpleStaticAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
+import mage.abilities.dynamicvalue.common.GetXValue;
+import mage.abilities.effects.ContinuousRuleModifiyingEffectImpl;
+import mage.abilities.effects.Effect;
+import mage.abilities.effects.OneShotEffect;
+import mage.abilities.effects.common.SacrificeTargetEffect;
+import mage.cards.Card;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.TurnPhase;
+import mage.constants.Zone;
+import mage.filter.common.FilterCreatureCard;
+import mage.game.Game;
+import mage.game.events.GameEvent;
+import mage.game.permanent.Permanent;
+import mage.players.Player;
+import mage.target.common.TargetCardInYourGraveyard;
+import mage.target.targetpointer.FixedTarget;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class WakeTheDead extends CardImpl {
+
+ public WakeTheDead(UUID ownerId) {
+ super(ownerId, 31, "Wake the Dead", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{X}{B}{B}");
+ this.expansionSetCode = "C14";
+
+ this.color.setBlack(true);
+
+ // Cast Wake the Dead only during combat on an opponent's turn.
+ Ability ability = new SimpleStaticAbility(Zone.ALL, new WakeTheDeadEffect());
+ ability.setRuleAtTheTop(true);
+ this.addAbility(ability);
+
+ // Return X target creature cards from your graveyard to the battlefield. Sacrifice those creatures at the beginning of the next end step.
+ this.getSpellAbility().addEffect(new WakeTheDeadReturnFromGraveyardToBattlefieldTargetEffect());
+ this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(0,Integer.MAX_VALUE, new FilterCreatureCard("creature cards from your graveyard")));
+ }
+
+ @Override
+ public void adjustTargets(Ability ability, Game game) {
+ if (ability instanceof SpellAbility) {
+ for (Effect effect : ability.getEffects()) {
+ if (effect instanceof WakeTheDeadReturnFromGraveyardToBattlefieldTargetEffect) {
+ int xValue = new GetXValue().calculate(game, ability, null);
+ ability.getTargets().clear();
+ ability.addTarget(new TargetCardInYourGraveyard(xValue,xValue, new FilterCreatureCard("creature cards from your graveyard")));
+ }
+ }
+ }
+ }
+
+ public WakeTheDead(final WakeTheDead card) {
+ super(card);
+ }
+
+ @Override
+ public WakeTheDead copy() {
+ return new WakeTheDead(this);
+ }
+}
+
+class WakeTheDeadEffect extends ContinuousRuleModifiyingEffectImpl {
+
+ WakeTheDeadEffect() {
+ super(Duration.EndOfGame, Outcome.Detriment);
+ staticText = "Cast {this} only during combat on an opponent's turn";
+ }
+
+ WakeTheDeadEffect(final WakeTheDeadEffect effect) {
+ super(effect);
+ }
+
+ @Override
+ public boolean applies(GameEvent event, Ability source, Game game) {
+ if (event.getType().equals(GameEvent.EventType.CAST_SPELL) && event.getSourceId().equals(source.getSourceId())) {
+ if (game.getPhase().getType().equals(TurnPhase.COMBAT)) {
+ return !game.getOpponents(source.getControllerId()).contains(game.getActivePlayerId());
+ }
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public boolean apply(Game game, Ability source) {
+ return true;
+ }
+
+ @Override
+ public WakeTheDeadEffect copy() {
+ return new WakeTheDeadEffect(this);
+ }
+}
+
+class WakeTheDeadReturnFromGraveyardToBattlefieldTargetEffect extends OneShotEffect {
+
+ public WakeTheDeadReturnFromGraveyardToBattlefieldTargetEffect() {
+ super(Outcome.PutCreatureInPlay);
+ this.staticText = "Return X target creature cards from your graveyard to the battlefield. Sacrifice those creatures at the beginning of the next end step";
+ }
+
+ public WakeTheDeadReturnFromGraveyardToBattlefieldTargetEffect(final WakeTheDeadReturnFromGraveyardToBattlefieldTargetEffect effect) {
+ super(effect);
+ }
+
+ @Override
+ public WakeTheDeadReturnFromGraveyardToBattlefieldTargetEffect copy() {
+ return new WakeTheDeadReturnFromGraveyardToBattlefieldTargetEffect(this);
+ }
+
+ @Override
+ public boolean apply(Game game, Ability source) {
+ Player player = game.getPlayer(source.getControllerId());
+ if (player != null) {
+ for (UUID targetId : getTargetPointer().getTargets(game, source)) {
+ Card card = game.getCard(targetId);
+ if (card != null) {
+ if (player.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId(), false)) {
+ Permanent permanent = game.getPermanent(source.getSourceId());
+ if (permanent != null) {
+ permanent.changeControllerId(source.getControllerId(), game);
+ Effect effect = new SacrificeTargetEffect("Sacrifice those creatures at the beginning of the next end step");
+ effect.setTargetPointer(new FixedTarget(permanent.getId()));
+ DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect);
+ delayedAbility.setSourceId(source.getSourceId());
+ delayedAbility.setControllerId(source.getControllerId());
+ game.addDelayedTriggeredAbility(delayedAbility);
+ }
+
+ }
+ }
+ }
+ return true;
+ }
+ return false;
+ }
+
+}
diff --git a/Mage.Sets/src/mage/sets/conflux/BrackwaterElemental.java b/Mage.Sets/src/mage/sets/conflux/BrackwaterElemental.java
index de8afcd0c4..8db4bce6e3 100644
--- a/Mage.Sets/src/mage/sets/conflux/BrackwaterElemental.java
+++ b/Mage.Sets/src/mage/sets/conflux/BrackwaterElemental.java
@@ -32,7 +32,7 @@ import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.common.AttacksOrBlocksTriggeredAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.SacrificeTargetEffect;
@@ -98,7 +98,7 @@ class BrackwaterElementalSacrificeEffect extends OneShotEffect {
if (sourcePermanent != null) {
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice {this}");
sacrificeEffect.setTargetPointer(new FixedTarget(sourcePermanent.getId()));
- DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(sacrificeEffect);
+ DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage.Sets/src/mage/sets/darkascension/LoyalCathar.java b/Mage.Sets/src/mage/sets/darkascension/LoyalCathar.java
index 244d951a7d..ebdcd669fb 100644
--- a/Mage.Sets/src/mage/sets/darkascension/LoyalCathar.java
+++ b/Mage.Sets/src/mage/sets/darkascension/LoyalCathar.java
@@ -34,7 +34,7 @@ import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DiesTriggeredAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.TransformAbility;
import mage.abilities.keyword.VigilanceAbility;
@@ -97,7 +97,7 @@ class LoyalCatharEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
//create delayed triggered ability
- AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(new ReturnLoyalCatharEffect(source.getSourceId()));
+ AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnLoyalCatharEffect(source.getSourceId()));
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage.Sets/src/mage/sets/darkascension/Seance.java b/Mage.Sets/src/mage/sets/darkascension/Seance.java
index da407f3cf2..596c5d304c 100644
--- a/Mage.Sets/src/mage/sets/darkascension/Seance.java
+++ b/Mage.Sets/src/mage/sets/darkascension/Seance.java
@@ -31,7 +31,7 @@ import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.cards.Card;
@@ -109,7 +109,7 @@ class SeanceEffect extends OneShotEffect {
ExileTargetEffect exileEffect = new ExileTargetEffect();
exileEffect.setTargetPointer(new FixedTarget(token.getLastAddedToken()));
- DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(exileEffect);
+ DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage.Sets/src/mage/sets/darkascension/SuddenDisappearance.java b/Mage.Sets/src/mage/sets/darkascension/SuddenDisappearance.java
index 24adcc833d..b8c6e656bb 100644
--- a/Mage.Sets/src/mage/sets/darkascension/SuddenDisappearance.java
+++ b/Mage.Sets/src/mage/sets/darkascension/SuddenDisappearance.java
@@ -30,7 +30,7 @@ package mage.sets.darkascension;
import java.util.List;
import java.util.UUID;
import mage.abilities.Ability;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ReturnFromExileEffect;
import mage.cards.CardImpl;
@@ -94,7 +94,7 @@ class SuddenDisappearanceEffect extends OneShotEffect {
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, source.getFirstTarget(), game)) {
controller.moveCardToExileWithInfo(permanent, source.getSourceId(), "Sudden Disappearance", source.getSourceId(), game, Zone.BATTLEFIELD);
}
- AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD));
+ AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD));
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage.Sets/src/mage/sets/darksteel/AEtherSnap.java b/Mage.Sets/src/mage/sets/darksteel/AEtherSnap.java
new file mode 100644
index 0000000000..981a2fb18e
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/darksteel/AEtherSnap.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this list of
+ * conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ * of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of BetaSteward_at_googlemail.com.
+ */
+package mage.sets.darksteel;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class AEtherSnap extends mage.sets.commander2014.AEtherSnap {
+
+ public AEtherSnap(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 37;
+ this.expansionSetCode = "DST";
+ }
+
+ public AEtherSnap(final AEtherSnap card) {
+ super(card);
+ }
+
+ @Override
+ public AEtherSnap copy() {
+ return new AEtherSnap(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/divinevsdemonic/PromiseOfPower.java b/Mage.Sets/src/mage/sets/divinevsdemonic/PromiseOfPower.java
new file mode 100644
index 0000000000..54694e4bf4
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/divinevsdemonic/PromiseOfPower.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this list of
+ * conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ * of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of BetaSteward_at_googlemail.com.
+ */
+package mage.sets.divinevsdemonic;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class PromiseOfPower extends mage.sets.commander2014.PromiseOfPower {
+
+ public PromiseOfPower(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 54;
+ this.expansionSetCode = "DDC";
+ }
+
+ public PromiseOfPower(final PromiseOfPower card) {
+ super(card);
+ }
+
+ @Override
+ public PromiseOfPower copy() {
+ return new PromiseOfPower(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/AEtherling.java b/Mage.Sets/src/mage/sets/dragonsmaze/AEtherling.java
index 431695ea70..f22253778b 100644
--- a/Mage.Sets/src/mage/sets/dragonsmaze/AEtherling.java
+++ b/Mage.Sets/src/mage/sets/dragonsmaze/AEtherling.java
@@ -37,7 +37,7 @@ import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ReturnFromExileEffect;
@@ -103,7 +103,7 @@ class AEherlingRemovingEffect extends OneShotEffect {
if (permanent != null) {
if (permanent.moveToExile(source.getSourceId(), "AEherling Exile", source.getSourceId(), game)) {
//create delayed triggered ability
- AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(
+ AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(
new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD));
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
diff --git a/Mage.Sets/src/mage/sets/eventide/Flickerwisp.java b/Mage.Sets/src/mage/sets/eventide/Flickerwisp.java
index c194f4bcf5..be2ddca79f 100644
--- a/Mage.Sets/src/mage/sets/eventide/Flickerwisp.java
+++ b/Mage.Sets/src/mage/sets/eventide/Flickerwisp.java
@@ -35,7 +35,7 @@ import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ReturnFromExileEffect;
import mage.abilities.keyword.FlyingAbility;
@@ -104,7 +104,7 @@ class FlickerwispEffect extends OneShotEffect {
if (controller != null && permanent != null && sourcePermanent != null) {
if (controller.moveCardToExileWithInfo(permanent, source.getSourceId(), sourcePermanent.getName(), source.getSourceId(), game, Zone.BATTLEFIELD)) {
//create delayed triggered ability
- AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD, false));
+ AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD, false));
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage.Sets/src/mage/sets/fifthdawn/EndlessWhispers.java b/Mage.Sets/src/mage/sets/fifthdawn/EndlessWhispers.java
index 0f4687aabe..784bfea505 100644
--- a/Mage.Sets/src/mage/sets/fifthdawn/EndlessWhispers.java
+++ b/Mage.Sets/src/mage/sets/fifthdawn/EndlessWhispers.java
@@ -32,7 +32,7 @@ import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.common.DiesTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
@@ -62,7 +62,7 @@ public class EndlessWhispers extends CardImpl {
this.color.setBlack(true);
// Each creature has "When this creature dies, choose target opponent. That player puts this card from its owner's graveyard onto the battlefield under his or her control at the beginning of the next end step."
- DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(new ReturnSourceToBattlefieldEffect());
+ DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnSourceToBattlefieldEffect());
Effect effect = new CreateDelayedTriggeredAbilityEffect(delayedAbility, true);
effect.setText("choose target opponent. That player puts this card from its owner's graveyard onto the battlefield under his or her control at the beginning of the next end step");
Ability gainAbility = new DiesTriggeredAbility(effect);
diff --git a/Mage.Sets/src/mage/sets/gatecrash/Voidwalk.java b/Mage.Sets/src/mage/sets/gatecrash/Voidwalk.java
index aa0b2dda21..34252a333f 100644
--- a/Mage.Sets/src/mage/sets/gatecrash/Voidwalk.java
+++ b/Mage.Sets/src/mage/sets/gatecrash/Voidwalk.java
@@ -32,7 +32,7 @@ import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.abilities.Ability;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CipherEffect;
import mage.abilities.effects.common.ReturnFromExileEffect;
@@ -95,7 +95,7 @@ class VoidwalkEffect extends OneShotEffect {
if (permanent != null) {
if (permanent.moveToExile(source.getSourceId(), "Voidwalk", source.getSourceId(), game)) {
if (card != null) {
- AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD));
+ AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD));
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(card.getOwnerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage.Sets/src/mage/sets/guildpact/GhostCouncilOfOrzhova.java b/Mage.Sets/src/mage/sets/guildpact/GhostCouncilOfOrzhova.java
index cc25f76cc4..c65f236ef7 100644
--- a/Mage.Sets/src/mage/sets/guildpact/GhostCouncilOfOrzhova.java
+++ b/Mage.Sets/src/mage/sets/guildpact/GhostCouncilOfOrzhova.java
@@ -37,7 +37,7 @@ import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.OneShotEffect;
@@ -136,7 +136,7 @@ class GhostCouncilOfOrzhovaRemovingEffect extends OneShotEffect {
if (permanent != null) {
if (controller.moveCardToExileWithInfo(permanent, source.getSourceId(), permanent.getName(), source.getSourceId(), game, Zone.BATTLEFIELD)) {
//create delayed triggered ability
- AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(
+ AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(
new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD));
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
diff --git a/Mage.Sets/src/mage/sets/guildpact/Ghostway.java b/Mage.Sets/src/mage/sets/guildpact/Ghostway.java
index 26dca31697..f85db2c749 100644
--- a/Mage.Sets/src/mage/sets/guildpact/Ghostway.java
+++ b/Mage.Sets/src/mage/sets/guildpact/Ghostway.java
@@ -31,7 +31,7 @@ import java.util.UUID;
import mage.constants.*;
import mage.abilities.Ability;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ReturnFromExileEffect;
import mage.cards.CardImpl;
@@ -92,7 +92,7 @@ class GhostwayEffect extends OneShotEffect {
for (Permanent creature : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) {
if (creature != null) {
if (creature.moveToExile(source.getSourceId(), "Ghostway Exile", source.getSourceId(), game)) {
- AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD, true));
+ AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD, true));
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage.Sets/src/mage/sets/iceage/Necropotence.java b/Mage.Sets/src/mage/sets/iceage/Necropotence.java
index 73d1bd1883..ecd1b1e338 100644
--- a/Mage.Sets/src/mage/sets/iceage/Necropotence.java
+++ b/Mage.Sets/src/mage/sets/iceage/Necropotence.java
@@ -33,7 +33,7 @@ import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.costs.common.PayLifeCost;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
@@ -141,7 +141,7 @@ class NecropotenceEffect extends OneShotEffect {
Effect returnToHandeffect = new ReturnToHandTargetEffect();
returnToHandeffect.setText("put that face down card into your hand");
returnToHandeffect.setTargetPointer(new FixedTarget(card.getId()));
- DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(returnToHandeffect, TargetController.YOU);
+ DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(returnToHandeffect, TargetController.YOU);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage.Sets/src/mage/sets/invasion/SpinalEmbrace.java b/Mage.Sets/src/mage/sets/invasion/SpinalEmbrace.java
index 70e0f08f07..98767d555c 100644
--- a/Mage.Sets/src/mage/sets/invasion/SpinalEmbrace.java
+++ b/Mage.Sets/src/mage/sets/invasion/SpinalEmbrace.java
@@ -31,7 +31,7 @@ import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.ContinuousRuleModifiyingEffectImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
@@ -146,7 +146,7 @@ class SpinalEmbraceAddDelayedEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
SpinalEmbraceSacrificeEffect sacrificeEffect = new SpinalEmbraceSacrificeEffect();
sacrificeEffect.setTargetPointer(new FixedTarget(source.getFirstTarget()));
- DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(sacrificeEffect);
+ DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage.Sets/src/mage/sets/journeyintonyx/BearerOfTheHeavens.java b/Mage.Sets/src/mage/sets/journeyintonyx/BearerOfTheHeavens.java
index 618ac7555f..fadcaf64a9 100644
--- a/Mage.Sets/src/mage/sets/journeyintonyx/BearerOfTheHeavens.java
+++ b/Mage.Sets/src/mage/sets/journeyintonyx/BearerOfTheHeavens.java
@@ -31,7 +31,7 @@ import java.util.UUID;
import mage.MageInt;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.common.DiesTriggeredAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
import mage.abilities.effects.common.DestroyAllEffect;
@@ -56,7 +56,7 @@ public class BearerOfTheHeavens extends CardImpl {
this.toughness = new MageInt(10);
// When Bearer of the Heavens dies, destroy all permanents at the beginning of the next end step.
- DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(new DestroyAllEffect(new FilterPermanent("permanents")));
+ DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new DestroyAllEffect(new FilterPermanent("permanents")));
Effect effect = new CreateDelayedTriggeredAbilityEffect(delayedAbility);
effect.setText("destroy all permanents at the beginning of the next end step");
this.addAbility(new DiesTriggeredAbility(effect, false));
diff --git a/Mage.Sets/src/mage/sets/journeyintonyx/Skybind.java b/Mage.Sets/src/mage/sets/journeyintonyx/Skybind.java
index 5d8033f26d..9a085fafeb 100644
--- a/Mage.Sets/src/mage/sets/journeyintonyx/Skybind.java
+++ b/Mage.Sets/src/mage/sets/journeyintonyx/Skybind.java
@@ -30,7 +30,7 @@ package mage.sets.journeyintonyx;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.abilityword.ConstellationAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ReturnFromExileEffect;
import mage.cards.CardImpl;
@@ -97,7 +97,7 @@ class SkybindEffect extends OneShotEffect {
if (permanent != null && sourcePermanent != null) {
if (permanent.moveToExile(source.getSourceId(), sourcePermanent.getName(), source.getSourceId(), game)) {
//create delayed triggered ability
- AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD));
+ AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD));
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage.Sets/src/mage/sets/journeyintonyx/Twinflame.java b/Mage.Sets/src/mage/sets/journeyintonyx/Twinflame.java
index acf954642a..5e3ce74b97 100644
--- a/Mage.Sets/src/mage/sets/journeyintonyx/Twinflame.java
+++ b/Mage.Sets/src/mage/sets/journeyintonyx/Twinflame.java
@@ -31,7 +31,7 @@ import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.abilityword.StriveAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.abilities.keyword.HasteAbility;
@@ -109,7 +109,7 @@ class TwinflameCopyEffect extends OneShotEffect {
ExileTargetEffect exileEffect = new ExileTargetEffect();
exileEffect.setTargetPointer(new FixedTarget(token.getLastAddedToken()));
- DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(exileEffect);
+ DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage.Sets/src/mage/sets/khansoftarkir/KheruLichLord.java b/Mage.Sets/src/mage/sets/khansoftarkir/KheruLichLord.java
index 6291ad4995..371372235b 100644
--- a/Mage.Sets/src/mage/sets/khansoftarkir/KheruLichLord.java
+++ b/Mage.Sets/src/mage/sets/khansoftarkir/KheruLichLord.java
@@ -32,7 +32,7 @@ import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.OneShotEffect;
@@ -138,7 +138,7 @@ class KheruLichLordEffect extends OneShotEffect {
ExileTargetEffect exileEffect = new ExileTargetEffect();
exileEffect.setTargetPointer(new FixedTarget(permanent.getId()));
- DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(exileEffect);
+ DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage.Sets/src/mage/sets/limitedalpha/Berserk.java b/Mage.Sets/src/mage/sets/limitedalpha/Berserk.java
index ea8567ea0a..8ae72097d7 100644
--- a/Mage.Sets/src/mage/sets/limitedalpha/Berserk.java
+++ b/Mage.Sets/src/mage/sets/limitedalpha/Berserk.java
@@ -30,7 +30,7 @@ package mage.sets.limitedalpha;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.dynamicvalue.common.TargetPermanentPowerCount;
import mage.abilities.effects.ContinuousRuleModifiyingEffectImpl;
@@ -172,7 +172,7 @@ class BerserkDestroyEffect extends OneShotEffect {
//create delayed triggered ability
Effect effect = new BerserkDelayedDestroyEffect();
effect.setTargetPointer(new FixedTarget(this.getTargetPointer().getFirst(game, source)));
- AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(effect);
+ AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage.Sets/src/mage/sets/magic2010/DragonWhelp.java b/Mage.Sets/src/mage/sets/magic2010/DragonWhelp.java
index c10d67a05b..441dd0207f 100644
--- a/Mage.Sets/src/mage/sets/magic2010/DragonWhelp.java
+++ b/Mage.Sets/src/mage/sets/magic2010/DragonWhelp.java
@@ -37,7 +37,7 @@ import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continious.BoostSourceEffect;
@@ -100,7 +100,7 @@ class DragonWhelpEffect extends OneShotEffect {
Integer amount = (Integer) game.getState().getValue(source.getSourceId().toString() + "DragonWhelp");
if (amount == null) {
amount = 0;
- DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(new DragonWhelpDelayedEffect());
+ DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new DragonWhelpDelayedEffect());
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage.Sets/src/mage/sets/magic2010/StoneGiant.java b/Mage.Sets/src/mage/sets/magic2010/StoneGiant.java
index b59518935b..212984c2ff 100644
--- a/Mage.Sets/src/mage/sets/magic2010/StoneGiant.java
+++ b/Mage.Sets/src/mage/sets/magic2010/StoneGiant.java
@@ -36,7 +36,7 @@ import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
@@ -131,7 +131,7 @@ class StoneGiantEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
DestroyTargetEffect effect = new DestroyTargetEffect();
effect.setTargetPointer(new FixedTarget(source.getFirstTarget()));
- AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(effect);
+ AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage.Sets/src/mage/sets/magic2011/MystifyingMaze.java b/Mage.Sets/src/mage/sets/magic2011/MystifyingMaze.java
index e920ef1b2a..7012e05c29 100644
--- a/Mage.Sets/src/mage/sets/magic2011/MystifyingMaze.java
+++ b/Mage.Sets/src/mage/sets/magic2011/MystifyingMaze.java
@@ -36,7 +36,7 @@ import mage.constants.TargetController;
import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
@@ -98,7 +98,7 @@ class MystifyingMazeEffect extends OneShotEffect {
if (permanent != null) {
if (permanent.moveToExile(source.getSourceId(), "Mystifying Maze Exile", source.getSourceId(), game)) {
//create delayed triggered ability
- AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD, true));
+ AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD, true));
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/HornOfPlenty.java b/Mage.Sets/src/mage/sets/mercadianmasques/HornOfPlenty.java
index f1d7c6ab8e..49db673214 100644
--- a/Mage.Sets/src/mage/sets/mercadianmasques/HornOfPlenty.java
+++ b/Mage.Sets/src/mage/sets/mercadianmasques/HornOfPlenty.java
@@ -30,7 +30,7 @@ package mage.sets.mercadianmasques;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SpellCastAllTriggeredAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.costs.Cost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.Effect;
@@ -101,7 +101,7 @@ class HornOfPlentyEffect extends OneShotEffect {
if (cost.pay(source, game, source.getSourceId(), caster.getId(), false)) {
Effect effect = new DrawCardTargetEffect(1);
effect.setTargetPointer(new FixedTarget(caster.getId()));
- return new CreateDelayedTriggeredAbilityEffect(new AtEndOfTurnDelayedTriggeredAbility(effect, TargetController.ANY)).apply(game, source);
+ return new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect, TargetController.ANY)).apply(game, source);
}
}
return true;
diff --git a/Mage.Sets/src/mage/sets/mirage/ShallowGrave.java b/Mage.Sets/src/mage/sets/mirage/ShallowGrave.java
index 95d9f24b0d..9825e56d87 100644
--- a/Mage.Sets/src/mage/sets/mirage/ShallowGrave.java
+++ b/Mage.Sets/src/mage/sets/mirage/ShallowGrave.java
@@ -30,7 +30,7 @@ package mage.sets.mirage;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ExileTargetEffect;
@@ -110,7 +110,7 @@ class ShallowGraveEffect extends OneShotEffect {
// Exile it at end of turn
ExileTargetEffect exileEffect = new ExileTargetEffect(null,"",Zone.BATTLEFIELD);
exileEffect.setTargetPointer(fixedTarget);
- DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(exileEffect);
+ DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage.Sets/src/mage/sets/mirrodin/PromiseOfPower.java b/Mage.Sets/src/mage/sets/mirrodin/PromiseOfPower.java
new file mode 100644
index 0000000000..80706a2622
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/mirrodin/PromiseOfPower.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this list of
+ * conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ * of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of BetaSteward_at_googlemail.com.
+ */
+package mage.sets.mirrodin;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class PromiseOfPower extends mage.sets.commander2014.PromiseOfPower {
+
+ public PromiseOfPower(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 74;
+ this.expansionSetCode = "MRD";
+ }
+
+ public PromiseOfPower(final PromiseOfPower card) {
+ super(card);
+ }
+
+ @Override
+ public PromiseOfPower copy() {
+ return new PromiseOfPower(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/GruesomeEncore.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/GruesomeEncore.java
index e5b914851d..ea5b92c162 100644
--- a/Mage.Sets/src/mage/sets/mirrodinbesieged/GruesomeEncore.java
+++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/GruesomeEncore.java
@@ -35,7 +35,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.abilities.effects.common.ExileTargetEffect;
@@ -103,7 +103,7 @@ class GruesomeEncoreEffect extends OneShotEffect {
ExileTargetEffect exileEffect = new ExileTargetEffect();
exileEffect.setTargetPointer(new FixedTarget(card.getId()));
- DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(exileEffect);
+ DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage.Sets/src/mage/sets/newphyrexia/PostmortemLunge.java b/Mage.Sets/src/mage/sets/newphyrexia/PostmortemLunge.java
index 5961efd53b..f563f9b5de 100644
--- a/Mage.Sets/src/mage/sets/newphyrexia/PostmortemLunge.java
+++ b/Mage.Sets/src/mage/sets/newphyrexia/PostmortemLunge.java
@@ -34,7 +34,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.abilities.keyword.HasteAbility;
@@ -115,7 +115,7 @@ class PostmortemLungeEffect extends OneShotEffect {
ExileTargetEffect exileEffect = new ExileTargetEffect();
exileEffect.setTargetPointer(new FixedTarget(card.getId()));
- DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(exileEffect);
+ DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage.Sets/src/mage/sets/onslaught/AstralSlide.java b/Mage.Sets/src/mage/sets/onslaught/AstralSlide.java
index b18643abe5..3548a919a2 100644
--- a/Mage.Sets/src/mage/sets/onslaught/AstralSlide.java
+++ b/Mage.Sets/src/mage/sets/onslaught/AstralSlide.java
@@ -31,7 +31,7 @@ import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.CycleAllTriggeredAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ReturnFromExileEffect;
import mage.cards.CardImpl;
@@ -94,7 +94,7 @@ class AstralSlideEffect extends OneShotEffect {
UUID exileId = UUID.randomUUID();
if (controller.moveCardToExileWithInfo(permanent, exileId, sourceObject.getLogName(), source.getSourceId(), game, Zone.BATTLEFIELD)) {
//create delayed triggered ability
- AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(new ReturnFromExileEffect(exileId, Zone.BATTLEFIELD, false));
+ AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnFromExileEffect(exileId, Zone.BATTLEFIELD, false));
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage.Sets/src/mage/sets/planarchaos/FatalFrenzy.java b/Mage.Sets/src/mage/sets/planarchaos/FatalFrenzy.java
index 752afb725b..ee7c260f52 100644
--- a/Mage.Sets/src/mage/sets/planarchaos/FatalFrenzy.java
+++ b/Mage.Sets/src/mage/sets/planarchaos/FatalFrenzy.java
@@ -34,7 +34,7 @@ import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.dynamicvalue.common.TargetPermanentPowerCount;
import mage.abilities.effects.OneShotEffect;
@@ -97,7 +97,7 @@ class FatalFrenzyEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice this");
sacrificeEffect.setTargetPointer(new FixedTarget(source.getFirstTarget()));
- DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(sacrificeEffect);
+ DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage.Sets/src/mage/sets/planarchaos/MagusOfTheCoffers.java b/Mage.Sets/src/mage/sets/planarchaos/MagusOfTheCoffers.java
new file mode 100644
index 0000000000..4fb66179e4
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/planarchaos/MagusOfTheCoffers.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this list of
+ * conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ * of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of BetaSteward_at_googlemail.com.
+ */
+package mage.sets.planarchaos;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class MagusOfTheCoffers extends mage.sets.commander2014.MagusOfTheCoffers {
+
+ public MagusOfTheCoffers(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 73;
+ this.expansionSetCode = "PLC";
+ }
+
+ public MagusOfTheCoffers(final MagusOfTheCoffers card) {
+ super(card);
+ }
+
+ @Override
+ public MagusOfTheCoffers copy() {
+ return new MagusOfTheCoffers(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/returntoravnica/GraveBetrayal.java b/Mage.Sets/src/mage/sets/returntoravnica/GraveBetrayal.java
index 8c853ce4da..d6995045c5 100644
--- a/Mage.Sets/src/mage/sets/returntoravnica/GraveBetrayal.java
+++ b/Mage.Sets/src/mage/sets/returntoravnica/GraveBetrayal.java
@@ -37,7 +37,7 @@ import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.TriggeredAbilityImpl;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.Effect;
@@ -111,7 +111,7 @@ class GraveBetrayalTriggeredAbility extends TriggeredAbilityImpl {
Integer zoneChanges = new Integer(card.getZoneChangeCounter());
effect.setValue("zoneChanges", zoneChanges);
- DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(effect);
+ DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect);
delayedAbility.setSourceId(this.getSourceId());
delayedAbility.setControllerId(this.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/SplinterTwin.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/SplinterTwin.java
index 7a139f7bb0..1464819c65 100644
--- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/SplinterTwin.java
+++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/SplinterTwin.java
@@ -37,7 +37,7 @@ import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.AttachEffect;
@@ -116,7 +116,7 @@ class SplinterTwinEffect extends OneShotEffect {
ExileTargetEffect exileEffect = new ExileTargetEffect();
exileEffect.setTargetPointer(new FixedTarget(token.getLastAddedToken()));
- DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(exileEffect);
+ DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/FootstepsOfTheGoryo.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/FootstepsOfTheGoryo.java
index 6d4a3d644b..f2f8409739 100644
--- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/FootstepsOfTheGoryo.java
+++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/FootstepsOfTheGoryo.java
@@ -31,7 +31,7 @@ import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
@@ -107,7 +107,7 @@ class FootstepsOfTheGoryoEffect extends OneShotEffect {
// Sacrifice it at end of turn
Effect sacrificeEffect = new SacrificeTargetEffect("Sacrifice that creature at the beginning of next end step");
sacrificeEffect.setTargetPointer(new FixedTarget(card.getId()));
- DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(sacrificeEffect);
+ DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/IdeasUnbound.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/IdeasUnbound.java
index 061c0096e4..b7bb713870 100644
--- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/IdeasUnbound.java
+++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/IdeasUnbound.java
@@ -30,7 +30,7 @@ package mage.sets.saviorsofkamigawa;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
import mage.abilities.effects.common.discard.DiscardControllerEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
@@ -51,7 +51,7 @@ public class IdeasUnbound extends CardImpl {
// Draw three cards. Discard three cards at the beginning of the next end step.
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(3));
- this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(new AtEndOfTurnDelayedTriggeredAbility(new DiscardControllerEffect(3))));
+ this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new DiscardControllerEffect(3))));
}
public IdeasUnbound(final IdeasUnbound card) {
diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/WineOfBloodAndIron.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/WineOfBloodAndIron.java
index d8d214fa74..0b6cf6023f 100644
--- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/WineOfBloodAndIron.java
+++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/WineOfBloodAndIron.java
@@ -36,7 +36,7 @@ import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.dynamicvalue.common.TargetPermanentPowerCount;
@@ -97,7 +97,7 @@ class WineOfBloodAndIronEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice this");
sacrificeEffect.setTargetPointer(new FixedTarget(source.getSourceId()));
- DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(sacrificeEffect);
+ DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/ArgentSphinx.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/ArgentSphinx.java
index d8d99200d2..ea105ab27b 100644
--- a/Mage.Sets/src/mage/sets/scarsofmirrodin/ArgentSphinx.java
+++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/ArgentSphinx.java
@@ -36,7 +36,7 @@ import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.costs.common.MetalcraftCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
@@ -96,7 +96,7 @@ class ArgentSphinxEffect extends OneShotEffect {
if (permanent != null) {
if (permanent.moveToExile(source.getSourceId(), "Argent Sphinx Exile", source.getSourceId(), game)) {
//create delayed triggered ability
- AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD));
+ AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD));
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/GlimmerpointStag.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/GlimmerpointStag.java
index d217f280cc..da6fd757f4 100644
--- a/Mage.Sets/src/mage/sets/scarsofmirrodin/GlimmerpointStag.java
+++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/GlimmerpointStag.java
@@ -34,7 +34,7 @@ import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ReturnFromExileEffect;
import mage.abilities.keyword.VigilanceAbility;
@@ -97,7 +97,7 @@ class GlimmerpointStagEffect extends OneShotEffect {
if (permanent != null) {
if (permanent.moveToExile(source.getSourceId(), "Glimmerpoint Stag Exile", source.getSourceId(), game)) {
//create delayed triggered ability
- AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD));
+ AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD));
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/MimicVat.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/MimicVat.java
index 94404503ca..bab4616778 100644
--- a/Mage.Sets/src/mage/sets/scarsofmirrodin/MimicVat.java
+++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/MimicVat.java
@@ -33,7 +33,7 @@ import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleActivatedAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.OneShotEffect;
@@ -205,7 +205,7 @@ class MimicVatCreateTokenEffect extends OneShotEffect {
ExileTargetEffect exileEffect = new ExileTargetEffect();
exileEffect.setTargetPointer(new FixedTarget(token.getLastAddedToken()));
- DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(exileEffect);
+ DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/VenserTheSojourner.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/VenserTheSojourner.java
index a2700c78e3..745f360097 100644
--- a/Mage.Sets/src/mage/sets/scarsofmirrodin/VenserTheSojourner.java
+++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/VenserTheSojourner.java
@@ -39,7 +39,7 @@ import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.EntersBattlefieldAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ExileTargetEffect;
@@ -133,7 +133,7 @@ class VenserTheSojournerEffect extends OneShotEffect {
if (permanent != null) {
if (controller.moveCardToExileWithInfo(permanent, source.getSourceId(), sourceObject.getLogName(), source.getSourceId(), game, Zone.BATTLEFIELD)) {
//create delayed triggered ability
- AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD));
+ AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD));
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage.Sets/src/mage/sets/seventhedition/DregsOfSorrow.java b/Mage.Sets/src/mage/sets/seventhedition/DregsOfSorrow.java
new file mode 100644
index 0000000000..99e35ed47b
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/seventhedition/DregsOfSorrow.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this list of
+ * conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ * of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of BetaSteward_at_googlemail.com.
+ */
+package mage.sets.seventhedition;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class DregsOfSorrow extends mage.sets.commander2014.DregsOfSorrow {
+
+ public DregsOfSorrow(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 129;
+ this.expansionSetCode = "7ED";
+ }
+
+ public DregsOfSorrow(final DregsOfSorrow card) {
+ super(card);
+ }
+
+ @Override
+ public DregsOfSorrow copy() {
+ return new DregsOfSorrow(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/shadowmoor/ElementalMastery.java b/Mage.Sets/src/mage/sets/shadowmoor/ElementalMastery.java
index f35e5119d5..7b78836e73 100644
--- a/Mage.Sets/src/mage/sets/shadowmoor/ElementalMastery.java
+++ b/Mage.Sets/src/mage/sets/shadowmoor/ElementalMastery.java
@@ -33,7 +33,7 @@ import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.AttachEffect;
@@ -116,7 +116,7 @@ class ElementalMasteryEffect extends OneShotEffect {
token.putOntoBattlefield(1, game, creatureAttached.getId(), creatureAttached.getControllerId());
ExileTargetEffect exileEffect = new ExileTargetEffect("exile the token");
exileEffect.setTargetPointer(new FixedTarget(token.getLastAddedToken()));
- DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(exileEffect);
+ DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect);
delayedAbility.setSourceId(creatureAttached.getId());
delayedAbility.setControllerId(creatureAttached.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage.Sets/src/mage/sets/shadowmoor/MistmeadowWitch.java b/Mage.Sets/src/mage/sets/shadowmoor/MistmeadowWitch.java
index fba7cd992e..7b270c0393 100644
--- a/Mage.Sets/src/mage/sets/shadowmoor/MistmeadowWitch.java
+++ b/Mage.Sets/src/mage/sets/shadowmoor/MistmeadowWitch.java
@@ -35,7 +35,7 @@ import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
@@ -96,7 +96,7 @@ class MistmeadowWitchEffect extends OneShotEffect {
if (permanent != null) {
if (permanent.moveToExile(source.getSourceId(), "Mistmeadow Witch Exile", source.getSourceId(), game)) {
//create delayed triggered ability
- AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD));
+ AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD));
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage.Sets/src/mage/sets/shadowmoor/PuppeteerClique.java b/Mage.Sets/src/mage/sets/shadowmoor/PuppeteerClique.java
index beac380fe5..be7a6ef97e 100644
--- a/Mage.Sets/src/mage/sets/shadowmoor/PuppeteerClique.java
+++ b/Mage.Sets/src/mage/sets/shadowmoor/PuppeteerClique.java
@@ -32,7 +32,7 @@ import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ExileTargetEffect;
@@ -127,7 +127,7 @@ class PuppeteerCliqueEffect extends OneShotEffect {
game.addEffect(hasteEffect, source);
ExileTargetEffect exileEffect = new ExileTargetEffect(new StringBuilder("exile ").append(permanent.getName()).toString());
exileEffect.setTargetPointer(new FixedTarget(card.getId()));
- DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(exileEffect, TargetController.YOU);
+ DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect, TargetController.YOU);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage.Sets/src/mage/sets/tempest/CorpseDance.java b/Mage.Sets/src/mage/sets/tempest/CorpseDance.java
index 42aec6adab..4dee471bb7 100644
--- a/Mage.Sets/src/mage/sets/tempest/CorpseDance.java
+++ b/Mage.Sets/src/mage/sets/tempest/CorpseDance.java
@@ -30,7 +30,7 @@ package mage.sets.tempest;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ExileTargetEffect;
@@ -113,7 +113,7 @@ class CorpseDanceEffect extends OneShotEffect {
// Exile it at end of turn
ExileTargetEffect exileEffect = new ExileTargetEffect(null,"",Zone.BATTLEFIELD);
exileEffect.setTargetPointer(fixedTarget);
- DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(exileEffect);
+ DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage.Sets/src/mage/sets/tempest/DregsOfSorrow.java b/Mage.Sets/src/mage/sets/tempest/DregsOfSorrow.java
new file mode 100644
index 0000000000..5205d9c078
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/tempest/DregsOfSorrow.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this list of
+ * conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ * of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of BetaSteward_at_googlemail.com.
+ */
+package mage.sets.tempest;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class DregsOfSorrow extends mage.sets.commander2014.DregsOfSorrow {
+
+ public DregsOfSorrow(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 25;
+ this.expansionSetCode = "TMP";
+ }
+
+ public DregsOfSorrow(final DregsOfSorrow card) {
+ super(card);
+ }
+
+ @Override
+ public DregsOfSorrow copy() {
+ return new DregsOfSorrow(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/theros/GiftOfImmortality.java b/Mage.Sets/src/mage/sets/theros/GiftOfImmortality.java
index 9b4f78f983..87c5ce397d 100644
--- a/Mage.Sets/src/mage/sets/theros/GiftOfImmortality.java
+++ b/Mage.Sets/src/mage/sets/theros/GiftOfImmortality.java
@@ -30,7 +30,7 @@ package mage.sets.theros;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.DiesAttachedTriggeredAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.AttachEffect;
@@ -110,7 +110,7 @@ class GiftOfImmortalityEffect extends OneShotEffect {
//create delayed triggered ability
Effect effect = new GiftOfImmortalityReturnEnchantmentEffect();
effect.setTargetPointer(new FixedTarget(card.getId()));
- AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(effect);
+ AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage.Sets/src/mage/sets/theros/WhipOfErebos.java b/Mage.Sets/src/mage/sets/theros/WhipOfErebos.java
index b80e7eaa57..ef7c1e92a2 100644
--- a/Mage.Sets/src/mage/sets/theros/WhipOfErebos.java
+++ b/Mage.Sets/src/mage/sets/theros/WhipOfErebos.java
@@ -32,7 +32,7 @@ import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.common.ActivateAsSorceryActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.ContinuousEffect;
@@ -125,7 +125,7 @@ class WhipOfErebosEffect extends OneShotEffect {
// Exile at begin of next end step
ExileTargetEffect exileEffect = new ExileTargetEffect(null, null, Zone.BATTLEFIELD);
exileEffect.setTargetPointer(new FixedTarget(card.getId()));
- DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(exileEffect);
+ DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage.Sets/src/mage/sets/timespiral/NorinTheWary.java b/Mage.Sets/src/mage/sets/timespiral/NorinTheWary.java
index 7ad2e4f682..e5332cc667 100644
--- a/Mage.Sets/src/mage/sets/timespiral/NorinTheWary.java
+++ b/Mage.Sets/src/mage/sets/timespiral/NorinTheWary.java
@@ -31,7 +31,7 @@ import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ReturnFromExileEffect;
import mage.cards.CardImpl;
@@ -128,7 +128,7 @@ class NorinTheWaryRemovingEffect extends OneShotEffect {
if (permanent != null) {
if (controller.moveCardToExileWithInfo(permanent, source.getSourceId(), permanent.getName(), source.getSourceId(), game, Zone.BATTLEFIELD)) {
//create delayed triggered ability
- AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(
+ AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(
new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD));
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
diff --git a/Mage.Sets/src/mage/sets/urzassaga/SneakAttack.java b/Mage.Sets/src/mage/sets/urzassaga/SneakAttack.java
index 6767068a27..bd6b590b79 100644
--- a/Mage.Sets/src/mage/sets/urzassaga/SneakAttack.java
+++ b/Mage.Sets/src/mage/sets/urzassaga/SneakAttack.java
@@ -31,7 +31,7 @@ import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.OneShotEffect;
@@ -113,7 +113,7 @@ class SneakAttackEffect extends OneShotEffect {
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice " + card.getName());
sacrificeEffect.setTargetPointer(new FixedTarget(card.getId()));
- DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(sacrificeEffect);
+ DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage.Sets/src/mage/sets/venservskoth/GalepowderMage.java b/Mage.Sets/src/mage/sets/venservskoth/GalepowderMage.java
index c75cda64f5..ff751ded72 100644
--- a/Mage.Sets/src/mage/sets/venservskoth/GalepowderMage.java
+++ b/Mage.Sets/src/mage/sets/venservskoth/GalepowderMage.java
@@ -32,7 +32,7 @@ import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.AttacksTriggeredAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ReturnFromExileEffect;
import mage.abilities.keyword.FlyingAbility;
@@ -117,7 +117,7 @@ class GalepowderMageEffect extends OneShotEffect {
UUID exileId = UUID.randomUUID();
if (controller.moveCardToExileWithInfo(permanent, exileId, sourceObject.getName(), source.getSourceId(), game, Zone.BATTLEFIELD)) {
if (card != null) {
- AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(new ReturnFromExileEffect(exileId, Zone.BATTLEFIELD));
+ AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnFromExileEffect(exileId, Zone.BATTLEFIELD));
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(card.getOwnerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage.Sets/src/mage/sets/vintagemasters/MarchesaTheBlackRose.java b/Mage.Sets/src/mage/sets/vintagemasters/MarchesaTheBlackRose.java
index 8847fa63a7..7d2b36473f 100644
--- a/Mage.Sets/src/mage/sets/vintagemasters/MarchesaTheBlackRose.java
+++ b/Mage.Sets/src/mage/sets/vintagemasters/MarchesaTheBlackRose.java
@@ -33,7 +33,7 @@ import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleStaticAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ReturnToBattlefieldUnderYourControlTargetEffect;
@@ -157,7 +157,7 @@ class MarchesaTheBlackRoseEffect extends OneShotEffect {
if (card != null) {
Effect effect = new ReturnToBattlefieldUnderYourControlTargetEffect();
effect.setText("return that card to the battlefield under your control at the beginning of the next end step");
- DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(effect);
+ DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.getEffects().get(0).setTargetPointer(new FixedTarget(card.getId()));
diff --git a/Mage.Sets/src/mage/sets/visions/DragonMask.java b/Mage.Sets/src/mage/sets/visions/DragonMask.java
index 1b3a7d7108..1f605274f5 100644
--- a/Mage.Sets/src/mage/sets/visions/DragonMask.java
+++ b/Mage.Sets/src/mage/sets/visions/DragonMask.java
@@ -30,7 +30,7 @@ package mage.sets.visions;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.Effect;
@@ -58,7 +58,7 @@ public class DragonMask extends CardImpl {
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(2, 2, Duration.EndOfTurn), new GenericManaCost(3));
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetControlledCreaturePermanent());
- Effect returnEffect = new CreateDelayedTriggeredAbilityEffect(new AtEndOfTurnDelayedTriggeredAbility(new ReturnToHandTargetEffect()));
+ Effect returnEffect = new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnToHandTargetEffect()));
returnEffect.setText("Return it to its owner's hand at the beginning of the next end step");
ability.addEffect(returnEffect);
this.addAbility(ability);
diff --git a/Mage.Sets/src/mage/sets/worldwake/NemesisTrap.java b/Mage.Sets/src/mage/sets/worldwake/NemesisTrap.java
index 3dcee36c39..d7cf93bb71 100644
--- a/Mage.Sets/src/mage/sets/worldwake/NemesisTrap.java
+++ b/Mage.Sets/src/mage/sets/worldwake/NemesisTrap.java
@@ -33,7 +33,7 @@ import mage.ObjectColor;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.abilities.Ability;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
import mage.abilities.costs.AlternativeCostSourceAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
@@ -116,7 +116,7 @@ class NemesisTrapEffect extends OneShotEffect {
EmptyToken token = new EmptyToken();
CardUtil.copyTo(token).from(targetedCreature);
token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
- token.addAbility(new AtEndOfTurnDelayedTriggeredAbility(new ExileSourceEffect()));
+ token.addAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ExileSourceEffect()));
return true;
}
return false;
diff --git a/Mage.Sets/src/mage/sets/worldwake/StoneIdolTrap.java b/Mage.Sets/src/mage/sets/worldwake/StoneIdolTrap.java
index 1c3c8e5610..76fd05cace 100644
--- a/Mage.Sets/src/mage/sets/worldwake/StoneIdolTrap.java
+++ b/Mage.Sets/src/mage/sets/worldwake/StoneIdolTrap.java
@@ -33,7 +33,7 @@ import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.SpellAbility;
import mage.abilities.common.SimpleStaticAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.common.cost.CostModificationEffectImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ExileTargetEffect;
@@ -143,7 +143,7 @@ class StoneIdolTrapEffect extends OneShotEffect {
token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
ExileTargetEffect exileEffect = new ExileTargetEffect("exile the token");
exileEffect.setTargetPointer(new FixedTarget(token.getLastAddedToken()));
- DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(exileEffect, TargetController.YOU);
+ DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect, TargetController.YOU);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage.Sets/src/mage/sets/zendikar/ElementalAppeal.java b/Mage.Sets/src/mage/sets/zendikar/ElementalAppeal.java
index db943986f9..5fd32ee5f7 100644
--- a/Mage.Sets/src/mage/sets/zendikar/ElementalAppeal.java
+++ b/Mage.Sets/src/mage/sets/zendikar/ElementalAppeal.java
@@ -34,7 +34,7 @@ import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.condition.LockedInCondition;
import mage.abilities.condition.common.KickedCondition;
import mage.abilities.decorator.ConditionalContinousEffect;
@@ -106,7 +106,7 @@ class ElementalAppealEffect extends OneShotEffect {
ExileTargetEffect exileEffect = new ExileTargetEffect();
exileEffect.setTargetPointer(fixedTarget);
- DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(exileEffect);
+ DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage.Sets/src/mage/sets/zendikar/ZektarShrineExpedition.java b/Mage.Sets/src/mage/sets/zendikar/ZektarShrineExpedition.java
index 15fce65f4b..b053aa500c 100644
--- a/Mage.Sets/src/mage/sets/zendikar/ZektarShrineExpedition.java
+++ b/Mage.Sets/src/mage/sets/zendikar/ZektarShrineExpedition.java
@@ -38,7 +38,7 @@ import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.common.LandfallAbility;
import mage.abilities.common.SimpleActivatedAbility;
-import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
+import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.costs.common.RemoveCountersSourceCost;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.effects.OneShotEffect;
@@ -105,7 +105,7 @@ class ZektarShrineExpeditionEffect extends OneShotEffect {
ExileTargetEffect exileEffect = new ExileTargetEffect();
exileEffect.setTargetPointer(new FixedTarget(token.getLastAddedToken()));
- DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(exileEffect);
+ DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
diff --git a/Mage/src/mage/abilities/common/delayed/AtEndOfTurnDelayedTriggeredAbility.java b/Mage/src/mage/abilities/common/delayed/AtTheBeginOfNextEndStepDelayedTriggeredAbility.java
similarity index 88%
rename from Mage/src/mage/abilities/common/delayed/AtEndOfTurnDelayedTriggeredAbility.java
rename to Mage/src/mage/abilities/common/delayed/AtTheBeginOfNextEndStepDelayedTriggeredAbility.java
index 9aea59b06c..a077520d3b 100644
--- a/Mage/src/mage/abilities/common/delayed/AtEndOfTurnDelayedTriggeredAbility.java
+++ b/Mage/src/mage/abilities/common/delayed/AtTheBeginOfNextEndStepDelayedTriggeredAbility.java
@@ -39,20 +39,20 @@ import mage.game.permanent.Permanent;
*
* @author North
*/
-public class AtEndOfTurnDelayedTriggeredAbility extends DelayedTriggeredAbility {
+public class AtTheBeginOfNextEndStepDelayedTriggeredAbility extends DelayedTriggeredAbility {
private TargetController targetController;
- public AtEndOfTurnDelayedTriggeredAbility(Effect effect) {
+ public AtTheBeginOfNextEndStepDelayedTriggeredAbility(Effect effect) {
this(effect, TargetController.ANY);
}
- public AtEndOfTurnDelayedTriggeredAbility(Effect effect, TargetController targetController) {
+ public AtTheBeginOfNextEndStepDelayedTriggeredAbility(Effect effect, TargetController targetController) {
super(effect);
this.targetController = targetController;
}
- public AtEndOfTurnDelayedTriggeredAbility(AtEndOfTurnDelayedTriggeredAbility ability) {
+ public AtTheBeginOfNextEndStepDelayedTriggeredAbility(AtTheBeginOfNextEndStepDelayedTriggeredAbility ability) {
super(ability);
this.targetController = ability.targetController;
}
@@ -86,8 +86,8 @@ public class AtEndOfTurnDelayedTriggeredAbility extends DelayedTriggeredAbility
}
@Override
- public AtEndOfTurnDelayedTriggeredAbility copy() {
- return new AtEndOfTurnDelayedTriggeredAbility(this);
+ public AtTheBeginOfNextEndStepDelayedTriggeredAbility copy() {
+ return new AtTheBeginOfNextEndStepDelayedTriggeredAbility(this);
}
@Override
diff --git a/Mage/src/mage/abilities/effects/common/ReturnFromGraveyardToBattlefieldTargetEffect.java b/Mage/src/mage/abilities/effects/common/ReturnFromGraveyardToBattlefieldTargetEffect.java
index 3133e4c0ce..bd532f9b50 100644
--- a/Mage/src/mage/abilities/effects/common/ReturnFromGraveyardToBattlefieldTargetEffect.java
+++ b/Mage/src/mage/abilities/effects/common/ReturnFromGraveyardToBattlefieldTargetEffect.java
@@ -95,7 +95,7 @@ public class ReturnFromGraveyardToBattlefieldTargetEffect extends OneShotEffect
}
StringBuilder sb = new StringBuilder();
Target target = mode.getTargets().get(0);
- sb.append("Return ");
+ sb.append("return ");
if (target.getMaxNumberOfTargets() > 1) {
if (target.getMaxNumberOfTargets() != target.getNumberOfTargets()) {
sb.append("up to ");
diff --git a/Mage/src/mage/game/GameImpl.java b/Mage/src/mage/game/GameImpl.java
index 215d983e33..74186ca8b6 100644
--- a/Mage/src/mage/game/GameImpl.java
+++ b/Mage/src/mage/game/GameImpl.java
@@ -969,6 +969,7 @@ public abstract class GameImpl implements Game, Serializable {
@Override
public void end() {
if (!state.isGameOver()) {
+ logger.debug("END of gameId: " + this.getId());
endTime = new Date();
state.endGame();
for (Player player: state.getPlayers().values()) {
diff --git a/Mage/src/mage/game/GameState.java b/Mage/src/mage/game/GameState.java
index 3bbda24453..d763658636 100644
--- a/Mage/src/mage/game/GameState.java
+++ b/Mage/src/mage/game/GameState.java
@@ -585,6 +585,7 @@ public class GameState implements Serializable, Copyable {
public void addCommandObject(CommandObject commandObject) {
getCommand().add(commandObject);
+ setZone(commandObject.getId(), Zone.COMMAND);
for (Ability ability: commandObject.getAbilities()) {
addAbility(ability, commandObject);
}
diff --git a/Mage/src/mage/players/PlayerImpl.java b/Mage/src/mage/players/PlayerImpl.java
index 05740b763a..23ac369c40 100644
--- a/Mage/src/mage/players/PlayerImpl.java
+++ b/Mage/src/mage/players/PlayerImpl.java
@@ -81,6 +81,7 @@ import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.cards.SplitCard;
import mage.cards.decks.Deck;
+import mage.constants.AbilityType;
import mage.constants.AsThoughEffectType;
import mage.constants.CardType;
import mage.constants.ManaType;
@@ -104,6 +105,7 @@ import mage.game.ExileZone;
import mage.game.Game;
import mage.game.Table;
import mage.game.combat.CombatGroup;
+import mage.game.command.CommandObject;
import mage.game.command.Commander;
import mage.game.events.DamagePlayerEvent;
import mage.game.events.DamagedPlayerEvent;
@@ -615,7 +617,10 @@ public abstract class PlayerImpl implements Player, Serializable {
@Override
public int drawCards(int num, Game game) {
- return game.doAction(new MageDrawAction(this, num, null));
+ if (num > 0) {
+ return game.doAction(new MageDrawAction(this, num, null));
+ }
+ return 0;
}
@Override
@@ -2228,18 +2233,29 @@ public abstract class PlayerImpl implements Player, Serializable {
}
}
}
- // get cast commander if available
- if (!(this.getCommanderId() == null)) {
- Zone zone = game.getState().getZone(this.getCommanderId());
- if (zone != null && zone.equals(Zone.COMMAND)) {
- MageObject object = game.getObject(this.getCommanderId());
- if (object != null) {
- for (ActivatedAbility ability : ((Commander) object).getAbilities().getActivatedAbilities(Zone.COMMAND)) {
- if (canPlay(ability, availableMana, object, game)) {
- playableActivated.put(ability.toString(), ability);
- }
- }
+// // get cast commander if available
+// if (!(this.getCommanderId() == null)) {
+// Zone zone = game.getState().getZone(this.getCommanderId());
+// if (zone != null && zone.equals(Zone.COMMAND)) {
+// MageObject object = game.getObject(this.getCommanderId());
+// if (object != null) {
+// for (ActivatedAbility ability : ((Commander) object).getAbilities().getActivatedAbilities(Zone.COMMAND)) {
+// if (canPlay(ability, availableMana, object, game)) {
+// playableActivated.put(ability.toString(), ability);
+// }
+// }
+// }
+// }
+// }
+ // activated abilities from objects in the command zone
+ for (CommandObject commandObject: game.getState().getCommand()) {
+ for (ActivatedAbility ability: commandObject.getAbilities().getActivatedAbilities(Zone.COMMAND)) {
+ if (ability.getControllerId().equals(getId())
+ && ability.getAbilityType().equals(AbilityType.ACTIVATED)
+ && canPlay(ability, availableMana, game.getObject(ability.getSourceId()), game)) {
+ playableActivated.put(ability.toString(), ability);
}
+
}
}
playable.addAll(playableActivated.values());