diff --git a/Mage.Sets/src/mage/sets/alarareborn/TraceOfAbundance.java b/Mage.Sets/src/mage/sets/alarareborn/TraceOfAbundance.java index 388649436cd..15a6d36f72d 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/TraceOfAbundance.java +++ b/Mage.Sets/src/mage/sets/alarareborn/TraceOfAbundance.java @@ -55,7 +55,7 @@ import mage.target.common.TargetLandPermanent; * @author jeffwadsworth */ public class TraceOfAbundance extends CardImpl { - + private String rule = "Enchanted land has shroud"; public TraceOfAbundance(UUID ownerId) { @@ -63,10 +63,6 @@ public class TraceOfAbundance extends CardImpl { this.expansionSetCode = "ARB"; this.subtype.add("Aura"); - - - - // Enchant land TargetPermanent auraTarget = new TargetLandPermanent(); this.getSpellAbility().addTarget(auraTarget); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/MimicVat.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/MimicVat.java index b194cda67d5..2a24c0196ea 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/MimicVat.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/MimicVat.java @@ -117,11 +117,11 @@ class MimicVatTriggeredAbility extends TriggeredAbilityImpl { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; Permanent permanent = zEvent.getTarget(); - if (permanent != null && - zEvent.getToZone() == Zone.GRAVEYARD && - zEvent.getFromZone() == Zone.BATTLEFIELD && - !(permanent instanceof PermanentToken) && - permanent.getCardType().contains(CardType.CREATURE)) { + if (permanent != null + && zEvent.getToZone() == Zone.GRAVEYARD + && zEvent.getFromZone() == Zone.BATTLEFIELD + && !(permanent instanceof PermanentToken) + && permanent.getCardType().contains(CardType.CREATURE)) { getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId())); return true; @@ -131,7 +131,7 @@ class MimicVatTriggeredAbility extends TriggeredAbilityImpl { @Override public String getRule() { - return "Whenever a nontoken creature dies, you may exile that card. If you do, return each other card exiled with {this} to its owner's graveyard"; + return "Whenever a nontoken creature dies, you may exile that card. If you do, return each other card exiled with {this} to its owner's graveyard."; } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/mana/CryptGhastTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/mana/CryptGhastTest.java new file mode 100644 index 00000000000..623c3b44258 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/mana/CryptGhastTest.java @@ -0,0 +1,103 @@ +/* + * 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 org.mage.test.cards.mana; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class CryptGhastTest extends CardTestPlayerBase { + + @Test + public void TestNormal() { + //Extort (Whenever you cast a spell, you may pay {WB}. If you do, each opponent loses 1 life and you gain that much life.) + // Whenever you tap a Swamp for mana, add {B} to your mana pool (in addition to the mana the land produces). + addCard(Zone.BATTLEFIELD, playerA, "Crypt Ghast", 1); + addCard(Zone.HAND, playerA, "Erebos's Titan", 1); + + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1); + // Swamp Mountain + addCard(Zone.BATTLEFIELD, playerA, "Badlands", 1); + + activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {R} to your mana pool"); + activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {B} to your mana pool"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Erebos's Titan"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "Erebos's Titan", 1); + + } + + /** + * Crypt Ghast was still effective (doubling swamp {B} Mana and providiong + * the option to extort) as if it was on the battlefield after being killed + * with Nin, the Pain Artist controlled by me and then exiled into a Mimic + * Vat controlled by Crypt Ghast's controller. + */ + @Test + public void TestExiled() { + //Extort (Whenever you cast a spell, you may pay {WB}. If you do, each opponent loses 1 life and you gain that much life.) + // Whenever you tap a Swamp for mana, add {B} to your mana pool (in addition to the mana the land produces). + addCard(Zone.BATTLEFIELD, playerA, "Crypt Ghast", 1); + // Imprint - Whenever a nontoken creature dies, you may exile that card. If you do, return each other card exiled with Mimic Vat to its owner's graveyard. + // {3},{T}: Put a token onto the battlefield that's a copy of the exiled card. It gains haste. Exile it at the beginning of the next end step. + addCard(Zone.BATTLEFIELD, playerA, "Mimic Vat", 1); + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1); + // Swamp Mountain + addCard(Zone.BATTLEFIELD, playerA, "Badlands", 1); + addCard(Zone.HAND, playerA, "Erebos's Titan", 1); + + addCard(Zone.BATTLEFIELD, playerB, "Island", 2); + addCard(Zone.BATTLEFIELD, playerB, "Mountain", 2); + // {X}{U}{R},{T}: Nin, the Pain Artist deals X damage to target creature. That creature's controller draws X cards. + addCard(Zone.BATTLEFIELD, playerB, "Nin, the Pain Artist", 1); + + activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "{X}{U}{R},{T}: {this} deals X damage to target creature", "Crypt Ghast"); + setChoice(playerB, "X=2"); + + // Crypt Ghast may no longer give additional mana + activateManaAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {R} to your mana pool"); + activateManaAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {B} to your mana pool"); + castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Erebos's Titan"); + + setStopAt(3, PhaseStep.PRECOMBAT_MAIN); + execute(); + + assertPermanentCount(playerA, "Erebos's Titan", 0); + assertTapped("Nin, the Pain Artist", true); + assertExileCount("Crypt Ghast", 1); + + } +} diff --git a/Mage.Tests/src/test/java/org/mage/test/utils/ManaOptionsTest.java b/Mage.Tests/src/test/java/org/mage/test/utils/ManaOptionsTest.java index 71a7eed710e..b4b40dd99e2 100644 --- a/Mage.Tests/src/test/java/org/mage/test/utils/ManaOptionsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/utils/ManaOptionsTest.java @@ -31,6 +31,7 @@ import mage.abilities.mana.ManaOptions; import mage.constants.PhaseStep; import mage.constants.Zone; import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; import org.mage.test.serverside.base.CardTestPlayerBase; @@ -289,6 +290,24 @@ public class ManaOptionsTest extends CardTestPlayerBase { Assert.assertEquals("{B}{B}{B}", getManaOption(1, manaOptions)); } + @Test + @Ignore // TriggeredManaAbilities not supported yet for getAvailableMana + public void testCryptGhast() { + //Extort (Whenever you cast a spell, you may pay {WB}. If you do, each opponent loses 1 life and you gain that much life.) + // Whenever you tap a Swamp for mana, add {B} to your mana pool (in addition to the mana the land produces). + addCard(Zone.BATTLEFIELD, playerA, "Crypt Ghast", 1); + + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1); + + setStopAt(1, PhaseStep.UPKEEP); + execute(); + + ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame); + + Assert.assertEquals("mana variations don't fit", 1, manaOptions.size()); + Assert.assertEquals("{B}{B}", getManaOption(0, manaOptions)); + } + private String getManaOption(int index, ManaOptions manaOptions) { if (manaOptions.size() < index + 1) { return ""; diff --git a/Mage/src/mage/game/turn/Phase.java b/Mage/src/mage/game/turn/Phase.java index 511d6450cb3..eac4f2308bb 100644 --- a/Mage/src/mage/game/turn/Phase.java +++ b/Mage/src/mage/game/turn/Phase.java @@ -134,7 +134,7 @@ public abstract class Phase implements Serializable { private boolean checkStopOnStepOption(Game game) { if (game.getOptions().stopOnTurn != null && game.getOptions().stopAtStep == getStep().getType()) { - if (game.getOptions().stopOnTurn.equals(game.getState().getTurnNum())) { + if (game.getOptions().stopOnTurn <= game.getState().getTurnNum()) { game.pause(); return true; }