diff --git a/Mage.Sets/src/mage/cards/p/ParadiseMantle.java b/Mage.Sets/src/mage/cards/p/ParadiseMantle.java index 877aad3125..15f2d5c71f 100644 --- a/Mage.Sets/src/mage/cards/p/ParadiseMantle.java +++ b/Mage.Sets/src/mage/cards/p/ParadiseMantle.java @@ -27,7 +27,7 @@ public final class ParadiseMantle extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{0}"); this.subtype.add(SubType.EQUIPMENT); - // Equipped creature has "{tap}: Add one mana of any color." + // Equipped creature has "{T}: Add one mana of any color." this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(new AnyColorManaAbility(new TapSourceCost()), AttachmentType.EQUIPMENT, Duration.WhileOnBattlefield))); // Equip {1} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/ManifestTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/ManifestTest.java index 07e2c95045..6451651901 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/ManifestTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/ManifestTest.java @@ -482,4 +482,56 @@ public class ManifestTest extends CardTestPlayerBase { assertHandCount(playerB, "Mountain", 1); } + + @Test + public void test_ManifestSorceryAndBlinkIt() { + + addCard(Zone.BATTLEFIELD, playerB, "Swamp", 1); + addCard(Zone.BATTLEFIELD, playerB, "Plains", 2); + + // {1}{B}, {T}, Sacrifice another creature: Manifest the top card of your library. + addCard(Zone.BATTLEFIELD, playerB, "Qarsi High Priest", 1); + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); + + // Exile target creature you control, then return that card to the battlefield under your control. + addCard(Zone.HAND, playerB, "Cloudshift", 1); //Instant {W} + + + // Devoid + // Flying + // At the beginning of your upkeep, sacrifice a creature + // Whenever you sacrifice a creature, draw a card. + addCard(Zone.LIBRARY, playerB, "Mountain", 1); + addCard(Zone.LIBRARY, playerB, "Lightning Bolt", 1); + addCard(Zone.LIBRARY, playerB, "Mountain", 1); + + skipInitShuffling(); + + activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "{1}{B}, {T}, Sacrifice another creature"); + setChoice(playerB, "Silvercoat Lion"); + + waitStackResolved(2, PhaseStep.PRECOMBAT_MAIN, playerB); + + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Cloudshift", EmptyNames.FACE_DOWN_CREATURE.toString()); + + setStrictChooseMode(true); + setStopAt(2, PhaseStep.END_TURN); + execute(); + assertAllCommandsUsed(); + + // no life gain + assertLife(playerA, 20); + assertLife(playerB, 20); + + assertPermanentCount(playerB, "Qarsi High Priest", 1); + + assertGraveyardCount(playerB, "Silvercoat Lion", 1); + assertGraveyardCount(playerB, "Cloudshift", 1); + + assertPermanentCount(playerB, "Lightning Bolt", 0); + assertExileCount(playerB, "Lightning Bolt", 1); + + assertHandCount(playerB, "Mountain", 1); + + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/mana/TappedForManaRelatedTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/mana/TappedForManaRelatedTest.java index 5df540ecf5..1dfecf6823 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/mana/TappedForManaRelatedTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/mana/TappedForManaRelatedTest.java @@ -4,6 +4,7 @@ import mage.abilities.mana.ManaOptions; import mage.constants.PhaseStep; import mage.constants.Zone; import mage.counters.CounterType; +import mage.game.permanent.Permanent; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; @@ -309,5 +310,35 @@ public class TappedForManaRelatedTest extends CardTestPlayerBase { Assert.assertEquals("mana variations don't fit", 1, manaOptions.size()); assertManaOptions("{B}{B}{B}{B}{B}", manaOptions); } - + + @Test + public void TestParadiseMantle() { + setStrictChooseMode(true); + + // Equipped creature has "{T}: Add one mana of any color." + // Equip {1} + addCard(Zone.BATTLEFIELD, playerA, "Paradise Mantle", 1); // Creature {1}{B} 1/2 + + // Flying; + // {2}, {untap}: Add one mana of any color. + addCard(Zone.BATTLEFIELD, playerA, "Pili-Pala", 1); // Artifact Creature (1/1) + + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1); + + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Equip"); + addTarget(playerA, "Pili-Pala"); // Select a creature you control + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertAllCommandsUsed(); + + Permanent pp = getPermanent("Pili-Pala"); + Assert.assertTrue("Pili-Pala has 1 attachment", pp.getAttachments().size() == 1); + + ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame); + Assert.assertEquals("mana variations don't fit", 1, manaOptions.size()); + assertManaOptions("{Any}", manaOptions); + } + } diff --git a/Mage/src/main/java/mage/game/ZonesHandler.java b/Mage/src/main/java/mage/game/ZonesHandler.java index 1964e08b47..9c3b8775c8 100644 --- a/Mage/src/main/java/mage/game/ZonesHandler.java +++ b/Mage/src/main/java/mage/game/ZonesHandler.java @@ -19,6 +19,7 @@ import mage.players.Player; import mage.target.TargetCard; import java.util.*; +import mage.abilities.keyword.TransformAbility; /** * Created by samuelsandeen on 9/6/16. @@ -53,7 +54,7 @@ public final class ZonesHandler { public static List moveCards(List zoneChangeInfos, Game game) { // Handle Unmelded Meld Cards - for (ListIterator itr = zoneChangeInfos.listIterator(); itr.hasNext(); ) { + for (ListIterator itr = zoneChangeInfos.listIterator(); itr.hasNext();) { ZoneChangeInfo info = itr.next(); MeldCard card = game.getMeldCard(info.event.getTargetId()); // Copies should be handled as normal cards. @@ -202,7 +203,7 @@ public final class ZonesHandler { if (info instanceof ZoneChangeInfo.Unmelded) { ZoneChangeInfo.Unmelded unmelded = (ZoneChangeInfo.Unmelded) info; MeldCard meld = game.getMeldCard(info.event.getTargetId()); - for (Iterator itr = unmelded.subInfo.iterator(); itr.hasNext(); ) { + for (Iterator itr = unmelded.subInfo.iterator(); itr.hasNext();) { ZoneChangeInfo subInfo = itr.next(); if (!maybeRemoveFromSourceZone(subInfo, game)) { itr.remove(); @@ -230,6 +231,12 @@ public final class ZonesHandler { boolean success = false; if (info.faceDown) { card.setFaceDown(true, game); + } else if (info.event.getToZone().equals(Zone.BATTLEFIELD)) { + if (!card.isPermanent() + && (!card.isTransformable() || Boolean.FALSE.equals(game.getState().getValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + card.getId())))) { + // Non permanents (Instants, Sorceries, ... stay in the zone they are if an abilty/effect tries to move it to the battlefield + return false; + } } if (!game.replaceEvent(event)) { Zone fromZone = event.getFromZone();