diff --git a/Mage.Server/src/main/java/mage/server/Main.java b/Mage.Server/src/main/java/mage/server/Main.java index 8f11e4593e5..3209f263ae3 100644 --- a/Mage.Server/src/main/java/mage/server/Main.java +++ b/Mage.Server/src/main/java/mage/server/Main.java @@ -149,6 +149,7 @@ public class Main { server = new MageTransporterServer(serverLocator, new MageServerImpl(adminPassword, testMode), MageServer.class.getName(), new MageServerInvocationHandler()); server.start(); logger.info("Started MAGE server - listening on " + connection.toString()); + if (testMode) { logger.info("MAGE server running in test mode"); } diff --git a/Mage.Sets/src/mage/sets/alarareborn/VengefulRebirth.java b/Mage.Sets/src/mage/sets/alarareborn/VengefulRebirth.java index 3f729184a7c..3314ba84966 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/VengefulRebirth.java +++ b/Mage.Sets/src/mage/sets/alarareborn/VengefulRebirth.java @@ -35,7 +35,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.ExileSpellEffect; +import mage.abilities.effects.postresolve.ExileSpellEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.game.Game; diff --git a/Mage.Sets/src/mage/sets/avacynrestored/TemporalMastery.java b/Mage.Sets/src/mage/sets/avacynrestored/TemporalMastery.java index 6047b5c50bd..15fd7a5a88f 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/TemporalMastery.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/TemporalMastery.java @@ -30,7 +30,7 @@ package mage.sets.avacynrestored; import mage.constants.CardType; import mage.constants.Rarity; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.common.ExileSpellEffect; +import mage.abilities.effects.postresolve.ExileSpellEffect; import mage.abilities.effects.common.turn.AddExtraTurnControllerEffect; import mage.abilities.keyword.MiracleAbility; import mage.cards.CardImpl; diff --git a/Mage.Sets/src/mage/sets/fifthedition/Recall.java b/Mage.Sets/src/mage/sets/fifthedition/Recall.java index 31793865e2c..2056b4426b8 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/Recall.java +++ b/Mage.Sets/src/mage/sets/fifthedition/Recall.java @@ -30,7 +30,7 @@ package mage.sets.fifthedition; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.ExileSpellEffect; +import mage.abilities.effects.postresolve.ExileSpellEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.constants.CardType; diff --git a/Mage.Sets/src/mage/sets/invasion/Restock.java b/Mage.Sets/src/mage/sets/invasion/Restock.java index 34670333b98..d220e0ac5ed 100644 --- a/Mage.Sets/src/mage/sets/invasion/Restock.java +++ b/Mage.Sets/src/mage/sets/invasion/Restock.java @@ -29,7 +29,7 @@ package mage.sets.invasion; import java.util.UUID; import mage.abilities.effects.Effect; -import mage.abilities.effects.common.ExileSpellEffect; +import mage.abilities.effects.postresolve.ExileSpellEffect; import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; diff --git a/Mage.Sets/src/mage/sets/journeyintonyx/PullFromTheDeep.java b/Mage.Sets/src/mage/sets/journeyintonyx/PullFromTheDeep.java index 2b4b9b0834a..7e0699fe525 100644 --- a/Mage.Sets/src/mage/sets/journeyintonyx/PullFromTheDeep.java +++ b/Mage.Sets/src/mage/sets/journeyintonyx/PullFromTheDeep.java @@ -29,7 +29,7 @@ package mage.sets.journeyintonyx; import java.util.UUID; import mage.abilities.effects.Effect; -import mage.abilities.effects.common.ExileSpellEffect; +import mage.abilities.effects.postresolve.ExileSpellEffect; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; diff --git a/Mage.Sets/src/mage/sets/journeyintonyx/WorstFears.java b/Mage.Sets/src/mage/sets/journeyintonyx/WorstFears.java index b5ea6bf9a01..409000fde97 100644 --- a/Mage.Sets/src/mage/sets/journeyintonyx/WorstFears.java +++ b/Mage.Sets/src/mage/sets/journeyintonyx/WorstFears.java @@ -28,7 +28,7 @@ package mage.sets.journeyintonyx; import java.util.UUID; -import mage.abilities.effects.common.ExileSpellEffect; +import mage.abilities.effects.postresolve.ExileSpellEffect; import mage.abilities.effects.common.turn.ControlTargetPlayerNextTurnEffect; import mage.cards.CardImpl; import mage.constants.CardType; diff --git a/Mage.Sets/src/mage/sets/magic2011/TimeReversal.java b/Mage.Sets/src/mage/sets/magic2011/TimeReversal.java index c002ef0f591..ce1ff14d334 100644 --- a/Mage.Sets/src/mage/sets/magic2011/TimeReversal.java +++ b/Mage.Sets/src/mage/sets/magic2011/TimeReversal.java @@ -34,7 +34,7 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.ExileSpellEffect; +import mage.abilities.effects.postresolve.ExileSpellEffect; import mage.cards.CardImpl; import mage.game.Game; import mage.players.Player; diff --git a/Mage.Sets/src/mage/sets/magic2013/Spelltwine.java b/Mage.Sets/src/mage/sets/magic2013/Spelltwine.java index 2d01272a56b..1a9563078cb 100644 --- a/Mage.Sets/src/mage/sets/magic2013/Spelltwine.java +++ b/Mage.Sets/src/mage/sets/magic2013/Spelltwine.java @@ -33,7 +33,7 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.ExileSpellEffect; +import mage.abilities.effects.postresolve.ExileSpellEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.filter.FilterCard; diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/PraetorsCounsel.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/PraetorsCounsel.java index b723fdd3609..ff34ee05376 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/PraetorsCounsel.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/PraetorsCounsel.java @@ -34,7 +34,7 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.ExileSpellEffect; +import mage.abilities.effects.postresolve.ExileSpellEffect; import mage.abilities.effects.common.continious.MaximumHandSizeControllerEffect; import mage.abilities.effects.common.continious.MaximumHandSizeControllerEffect.HandSizeModification; import mage.cards.Card; diff --git a/Mage.Sets/src/mage/sets/morningtide/ReleaseTheAnts.java b/Mage.Sets/src/mage/sets/morningtide/ReleaseTheAnts.java new file mode 100644 index 00000000000..46ace6ce11f --- /dev/null +++ b/Mage.Sets/src/mage/sets/morningtide/ReleaseTheAnts.java @@ -0,0 +1,64 @@ +/* + * 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.morningtide; + +import java.util.UUID; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.postresolve.ClashWinReturnToHandSpellEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author LevelX2 + */ +public class ReleaseTheAnts extends CardImpl { + + public ReleaseTheAnts(UUID ownerId) { + super(ownerId, 98, "Release the Ants", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{R}"); + this.expansionSetCode = "MOR"; + + this.color.setRed(true); + + // Release the Ants deals 1 damage to target creature or player. Clash with an opponent. If you win, return Release the Ants to its owner's hand. + this.getSpellAbility().addEffect(new DamageTargetEffect(1)); + this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); + this.getSpellAbility().addEffect(ClashWinReturnToHandSpellEffect.getInstance()); + } + + public ReleaseTheAnts(final ReleaseTheAnts card) { + super(card); + } + + @Override + public ReleaseTheAnts copy() { + return new ReleaseTheAnts(this); + } +} diff --git a/Mage.Sets/src/mage/sets/morningtide/TitansRevenge.java b/Mage.Sets/src/mage/sets/morningtide/TitansRevenge.java index 9d4771546fc..8aaacacbfdb 100644 --- a/Mage.Sets/src/mage/sets/morningtide/TitansRevenge.java +++ b/Mage.Sets/src/mage/sets/morningtide/TitansRevenge.java @@ -32,14 +32,13 @@ import java.util.UUID; import mage.abilities.Ability; import mage.abilities.MageSingleton; import mage.abilities.dynamicvalue.common.ManacostVariableValue; -import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.PostResolveEffect; import mage.abilities.effects.common.ClashEffect; import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.postresolve.ClashWinReturnToHandSpellEffect; 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.game.Game; @@ -60,9 +59,8 @@ public class TitansRevenge extends CardImpl { // Titan's Revenge deals X damage to target creature or player. Clash with an opponent. If you win, return Titan's Revenge to its owner's hand. this.getSpellAbility().addEffect(new DamageTargetEffect(new ManacostVariableValue())); - this.getSpellAbility().addEffect(TitansRevengeReturnToHandSpellEffect.getInstance()); - this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); + this.getSpellAbility().addEffect(ClashWinReturnToHandSpellEffect.getInstance()); } public TitansRevenge(final TitansRevenge card) { @@ -74,42 +72,3 @@ public class TitansRevenge extends CardImpl { return new TitansRevenge(this); } } - -class TitansRevengeReturnToHandSpellEffect extends PostResolveEffect implements MageSingleton { - private static final TitansRevengeReturnToHandSpellEffect fINSTANCE = new TitansRevengeReturnToHandSpellEffect(); - - private Object readResolve() throws ObjectStreamException { - return fINSTANCE; - } - - private TitansRevengeReturnToHandSpellEffect() { - staticText = "Clash with an opponent. If you win, return {this} to its owner's hand"; - } - - public static TitansRevengeReturnToHandSpellEffect getInstance() { - return fINSTANCE; - } - - @Override - public boolean apply(Game game, Ability source) { - return true; - } - - @Override - public TitansRevengeReturnToHandSpellEffect copy() { - return fINSTANCE; - } - - @Override - public boolean isActive(Ability source, Game game) { - return ClashEffect.getInstance().apply(game, source); - } - - @Override - public void postResolve(Card card, Ability source, UUID controllerId, Game game) { - Player controller = game.getPlayer(controllerId); - if (controller != null) { - controller.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.STACK); - } - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/returntoravnica/TreasuredFind.java b/Mage.Sets/src/mage/sets/returntoravnica/TreasuredFind.java index ebe5537d2f3..f8b49e374e5 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/TreasuredFind.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/TreasuredFind.java @@ -30,7 +30,7 @@ package mage.sets.returntoravnica; import java.util.UUID; import mage.constants.CardType; import mage.constants.Rarity; -import mage.abilities.effects.common.ExileSpellEffect; +import mage.abilities.effects.postresolve.ExileSpellEffect; import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect; import mage.cards.CardImpl; import mage.target.common.TargetCardInYourGraveyard; diff --git a/Mage.Sets/src/mage/sets/torment/NostalgicDreams.java b/Mage.Sets/src/mage/sets/torment/NostalgicDreams.java index 6845c3fcce5..0caba305765 100644 --- a/Mage.Sets/src/mage/sets/torment/NostalgicDreams.java +++ b/Mage.Sets/src/mage/sets/torment/NostalgicDreams.java @@ -31,7 +31,7 @@ import mage.abilities.Ability; import mage.abilities.costs.common.DiscardXTargetCost; import mage.abilities.dynamicvalue.common.GetXValue; import mage.abilities.effects.Effect; -import mage.abilities.effects.common.ExileSpellEffect; +import mage.abilities.effects.postresolve.ExileSpellEffect; import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; diff --git a/Mage.Sets/src/mage/sets/urzassaga/IllGottenGains.java b/Mage.Sets/src/mage/sets/urzassaga/IllGottenGains.java index da67c82e8e5..76a259f1de3 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/IllGottenGains.java +++ b/Mage.Sets/src/mage/sets/urzassaga/IllGottenGains.java @@ -30,7 +30,7 @@ package mage.sets.urzassaga; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.ExileSpellEffect; +import mage.abilities.effects.postresolve.ExileSpellEffect; import mage.abilities.effects.common.discard.DiscardHandAllEffect; import mage.cards.Card; import mage.cards.CardImpl; diff --git a/Mage.Sets/src/mage/sets/urzassaga/TimeSpiral.java b/Mage.Sets/src/mage/sets/urzassaga/TimeSpiral.java index 4df9b51e862..ff7a1333e97 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/TimeSpiral.java +++ b/Mage.Sets/src/mage/sets/urzassaga/TimeSpiral.java @@ -33,7 +33,7 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.ExileSpellEffect; +import mage.abilities.effects.postresolve.ExileSpellEffect; import mage.abilities.effects.common.UntapLandsEffect; import mage.cards.CardImpl; import mage.game.Game; diff --git a/Mage/src/mage/abilities/effects/postresolve/ClashWinReturnToHandSpellEffect.java b/Mage/src/mage/abilities/effects/postresolve/ClashWinReturnToHandSpellEffect.java new file mode 100644 index 00000000000..403ac61035f --- /dev/null +++ b/Mage/src/mage/abilities/effects/postresolve/ClashWinReturnToHandSpellEffect.java @@ -0,0 +1,83 @@ +/* + * 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.abilities.effects.postresolve; + +import java.io.ObjectStreamException; +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.MageSingleton; +import mage.abilities.effects.PostResolveEffect; +import mage.abilities.effects.common.ClashEffect; +import mage.cards.Card; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author LevelX2 + */ +public class ClashWinReturnToHandSpellEffect extends PostResolveEffect implements MageSingleton { + + private static final ClashWinReturnToHandSpellEffect fINSTANCE = new ClashWinReturnToHandSpellEffect(); + + private Object readResolve() throws ObjectStreamException { + return fINSTANCE; + } + + private ClashWinReturnToHandSpellEffect() { + staticText = "Clash with an opponent. If you win, return {this} to its owner's hand"; + } + + public static ClashWinReturnToHandSpellEffect getInstance() { + return fINSTANCE; + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public ClashWinReturnToHandSpellEffect copy() { + return fINSTANCE; + } + + @Override + public boolean isActive(Ability source, Game game) { + return ClashEffect.getInstance().apply(game, source); + } + + @Override + public void postResolve(Card card, Ability source, UUID controllerId, Game game) { + Player controller = game.getPlayer(controllerId); + if (controller != null) { + controller.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.STACK); + } + } +} diff --git a/Mage/src/mage/abilities/effects/common/ExileSpellEffect.java b/Mage/src/mage/abilities/effects/postresolve/ExileSpellEffect.java similarity index 98% rename from Mage/src/mage/abilities/effects/common/ExileSpellEffect.java rename to Mage/src/mage/abilities/effects/postresolve/ExileSpellEffect.java index 92dbe3d8f89..0ef3a9d9a6c 100644 --- a/Mage/src/mage/abilities/effects/common/ExileSpellEffect.java +++ b/Mage/src/mage/abilities/effects/postresolve/ExileSpellEffect.java @@ -26,7 +26,7 @@ * or implied, of BetaSteward_at_googlemail.com. */ -package mage.abilities.effects.common; +package mage.abilities.effects.postresolve; import mage.abilities.Ability; import mage.abilities.MageSingleton;