This commit is contained in:
fireshoes 2016-10-17 23:45:47 -05:00
parent b733f911f7
commit 89dd981075
287 changed files with 3420 additions and 2315 deletions

View file

@ -20,8 +20,8 @@ public class CloudshiftTest extends CardTestPlayerBase {
/**
* Tests that casting Cloudshift makes targeting spell fizzling
*
* Cloudshift
* Exile target creature you control, then return that card to the battlefield under your control.
* Cloudshift Exile target creature you control, then return that card to
* the battlefield under your control.
*/
@Test
public void testSpellFizzle() {
@ -43,8 +43,10 @@ public class CloudshiftTest extends CardTestPlayerBase {
}
/**
* Tests that copy effect is discarded and Clone can enter as a copy of another creature.
* Also tests that copy two creature won't 'collect' abilities, after 'Cloudshift' effect Clone should enter as a copy of another creature.
* Tests that copy effect is discarded and Clone can enter as a copy of
* another creature. Also tests that copy two creature won't 'collect'
* abilities, after 'Cloudshift' effect Clone should enter as a copy of
* another creature.
*/
@Test
public void testCopyEffectDiscarded() {
@ -77,7 +79,7 @@ public class CloudshiftTest extends CardTestPlayerBase {
addCard(Zone.BATTLEFIELD, playerA, "Plains", 4);
addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion");
addCard(Zone.BATTLEFIELD, playerA, "Bonesplitter");
// Exile target creature you control, then return that card to the battlefield under your control.
addCard(Zone.HAND, playerA, "Cloudshift");
@ -92,14 +94,14 @@ public class CloudshiftTest extends CardTestPlayerBase {
assertLife(playerA, 20);
Assert.assertTrue(silvercoatLion.getAttachments().isEmpty());
Assert.assertTrue("Bonesplitter must not be connected to Silvercoat Lion",bonesplitter.getAttachedTo() == null);
Assert.assertEquals("Silvercoat Lion's power without equipment has to be 2",2, silvercoatLion.getPower().getValue());
Assert.assertEquals("Silvercoat Lion's toughness has to be 2",2, silvercoatLion.getToughness().getValue());
Assert.assertTrue("Bonesplitter must not be connected to Silvercoat Lion", bonesplitter.getAttachedTo() == null);
Assert.assertEquals("Silvercoat Lion's power without equipment has to be 2", 2, silvercoatLion.getPower().getValue());
Assert.assertEquals("Silvercoat Lion's toughness has to be 2", 2, silvercoatLion.getToughness().getValue());
}
/**
* Tests that casting Cloudshift makes creature able to block again
* if it before was targeted with can't block effect
* Tests that casting Cloudshift makes creature able to block again if it
* before was targeted with can't block effect
*
*/
@Test
@ -129,7 +131,6 @@ public class CloudshiftTest extends CardTestPlayerBase {
assertPermanentCount(playerB, "Fervent Cathar", 0);
assertPermanentCount(playerA, "Timberland Guide", 0);
}
@Test
@ -146,20 +147,20 @@ public class CloudshiftTest extends CardTestPlayerBase {
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Grizzly Bears");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Giant Growth", "Grizzly Bears", "you gain life equal to that creature's toughness");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cloudshift", "Grizzly Bears", null, "you gain life equal to that creature's toughness");
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertLife(playerA, 27); // 5 from the first with Giant Growth + 2 from the second bear.
}
/*
I had a Stoneforge Mystic equipped with a Umesawa's Jitte. I activated Jitte 4 times to make
Stoneforge Mystic 9/10. My opponent put into play a Flickerwisp with his Aether Vial and
targeted my Stoneforge Mystic. At the end of my turn, Stoneforge Mystic came back as a 9/10,
before going down to 1/2 normally once my turn ended.
*/
*/
@Test
public void testDontApplyEffectToNewInstanceOfPreviousEquipedPermanent() {
addCard(Zone.BATTLEFIELD, playerA, "Plains", 4);
@ -168,11 +169,11 @@ public class CloudshiftTest extends CardTestPlayerBase {
// Exile target creature you control, then return that card to the battlefield under your control.
addCard(Zone.HAND, playerA, "Cloudshift");
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Equip {2}", "Silvercoat Lion");
attack(3, playerA, "Silvercoat Lion");
activateAbility(3, PhaseStep.END_COMBAT, playerA, "Remove a charge counter from {this}: Choose one &mdash;<br>&bull Equipped creature gets");
setModeChoice(playerA, "1");
castSpell(3, PhaseStep.END_COMBAT, playerA, "Cloudshift", "Silvercoat Lion", "Remove a charge counter from");
@ -186,31 +187,30 @@ public class CloudshiftTest extends CardTestPlayerBase {
assertLife(playerA, 20);
assertLife(playerB, 18);
assertCounterCount("Umezawa's Jitte", CounterType.CHARGE, 1);
assertPermanentCount(playerA,"Silvercoat Lion", 1);
assertGraveyardCount(playerA,"Cloudshift", 1);
assertPermanentCount(playerA, "Silvercoat Lion", 1);
assertGraveyardCount(playerA, "Cloudshift", 1);
Assert.assertTrue(silvercoatLion.getAttachments().isEmpty());
Assert.assertTrue("Umezawa must not be connected to Silvercoat Lion",Umezawa.getAttachedTo() == null);
Assert.assertTrue("Umezawa must not be connected to Silvercoat Lion", Umezawa.getAttachedTo() == null);
assertPowerToughness(playerA, "Silvercoat Lion", 2, 2);
}
@Test
public void testDontApplyEffectToNewInstanceOfPreviousEquipedPermanentFlickerwisp() {
addCard(Zone.BATTLEFIELD, playerA, "Plains", 4);
addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion");
addCard(Zone.BATTLEFIELD, playerA, "Umezawa's Jitte");
addCard(Zone.BATTLEFIELD, playerB, "Plains", 3);
// Flying
// When Flickerwisp enters the battlefield, exile another target permanent. Return that
// card to the battlefield under its owner's control at the beginning of the next end step.
addCard(Zone.HAND, playerB, "Flickerwisp");
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Equip {2}", "Silvercoat Lion");
attack(3, playerA, "Silvercoat Lion");
activateAbility(4, PhaseStep.DRAW, playerA, "Remove a charge counter from {this}: Choose one &mdash;<br>&bull Equipped creature gets");
setModeChoice(playerA, "1");
castSpell(4, PhaseStep.PRECOMBAT_MAIN, playerB, "Flickerwisp");
@ -225,19 +225,21 @@ public class CloudshiftTest extends CardTestPlayerBase {
assertLife(playerA, 20);
assertLife(playerB, 18);
assertCounterCount("Umezawa's Jitte", CounterType.CHARGE, 1);
assertPermanentCount(playerA,"Silvercoat Lion", 1);
assertPermanentCount(playerB,"Flickerwisp", 1);
assertPermanentCount(playerA, "Silvercoat Lion", 1);
assertPermanentCount(playerB, "Flickerwisp", 1);
Assert.assertTrue(silvercoatLion.getAttachments().isEmpty());
Assert.assertTrue("Umezawa must not be connected to Silvercoat Lion",Umezawa.getAttachedTo() == null);
Assert.assertTrue("Umezawa must not be connected to Silvercoat Lion", Umezawa.getAttachedTo() == null);
assertPowerToughness(playerA, "Silvercoat Lion", 2, 2);
}
/**
* Test that if I cast cloudshift and it goes to the stack and another instant spell exiles the
* target creature as response, cloudshift does not bring back that creature from exile because it's
* a complete other object (400.7).
* 400.7g allows Cloudshift to bring it back only if it was exiled by cloudshift itself.
*
* Test that if I cast cloudshift and it goes to the stack and another
* instant spell exiles the target creature as response, cloudshift does not
* bring back that creature from exile because it's a complete other object
* (400.7). 400.7g allows Cloudshift to bring it back only if it was exiled
* by cloudshift itself.
*
*/
@Test
public void testReturnIfExiledByAnotherSpell() {
@ -245,88 +247,123 @@ public class CloudshiftTest extends CardTestPlayerBase {
addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion");
addCard(Zone.HAND, playerA, "Cloudshift");
addCard(Zone.BATTLEFIELD, playerB, "Plains");
// Exile target creature. Its controller gains life equal to its power.
addCard(Zone.HAND, playerB, "Swords to Plowshares");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cloudshift", "Silvercoat Lion");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Swords to Plowshares", "Silvercoat Lion", "Cloudshift");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertGraveyardCount(playerA, "Cloudshift", 1);
assertGraveyardCount(playerB, "Swords to Plowshares", 1);
assertLife(playerA, 22);
assertLife(playerB, 20);
assertPermanentCount(playerA,"Silvercoat Lion", 0);
assertPermanentCount(playerA, "Silvercoat Lion", 0);
assertExileCount("Silvercoat Lion", 1);
}
}
/**
* Test that if a creature returns from cloudshift it returns
* under the control of the controller of Cloudshift.
* Test that if a creature returns from cloudshift it returns under the
* control of the controller of Cloudshift.
*/
@Test
public void testReturnOfOwnerIsAnotherPlayer() {
addCard(Zone.BATTLEFIELD, playerA, "Plains",3);
addCard(Zone.BATTLEFIELD, playerA, "Mountain",3);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 3);
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3);
// Gain control of target creature until end of turn. Untap that creature. It gains haste until end of turn.
addCard(Zone.HAND, playerA, "Act of Treason");
addCard(Zone.HAND, playerA, "Cloudshift");
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Act of Treason", "Silvercoat Lion");
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Cloudshift", "Silvercoat Lion");
setStopAt(2, PhaseStep.PRECOMBAT_MAIN);
execute();
assertGraveyardCount(playerA, "Cloudshift", 1);
assertGraveyardCount(playerA, "Act of Treason", 1);
assertPermanentCount(playerA,"Silvercoat Lion", 1);
assertPermanentCount(playerB,"Silvercoat Lion", 0);
}
/**
* Test that if a creature returns from Conjurer's Closet it returns
* under the control of the controller of Conjurer's Closet.
assertPermanentCount(playerA, "Silvercoat Lion", 1);
assertPermanentCount(playerB, "Silvercoat Lion", 0);
}
/**
* Test that if a creature returns from Conjurer's Closet it returns under
* the control of the controller of Conjurer's Closet.
*/
@Test
public void testReturnOfOwnerIsAnotherPlayerConjurersCloset() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain",3);
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3);
// Gain control of target creature until end of turn. Untap that creature. It gains haste until end of turn.
addCard(Zone.HAND, playerA, "Act of Treason");
// At the beginning of your end step, you may exile target creature you control, then return that card to the battlefield under your control
addCard(Zone.BATTLEFIELD, playerA, "Conjurer's Closet");
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Act of Treason", "Silvercoat Lion");
addTarget(playerA, "Silvercoat Lion");
setStopAt(2, PhaseStep.PRECOMBAT_MAIN);
execute();
assertPermanentCount(playerA,"Conjurer's Closet", 1);
assertPermanentCount(playerA, "Conjurer's Closet", 1);
assertGraveyardCount(playerA, "Act of Treason", 1);
assertPermanentCount(playerA,"Silvercoat Lion", 1);
assertPermanentCount(playerB,"Silvercoat Lion", 0);
}
assertPermanentCount(playerA, "Silvercoat Lion", 1);
assertPermanentCount(playerB, "Silvercoat Lion", 0);
}
/**
* During a game i play a Flickerwisp main step who targets something and a
* second Flickerwisp who targets the first . End step : the first
* Flickerwisp return at the battlefield and target a Courser of Kruphix,
* normally she's return on the battlefield at the next end step (here end
* step of my opponent) but she's returned on the battlefield immediatly
*
* 8/1/2008 The exiled card will return to the battlefield at the beginning
* of the end step even if Flickerwisp is no longer on the battlefield.
* 8/1/2008 If the permanent that returns to the battlefield has any
* abilities that trigger at the beginning of the end step, those abilities
* wont trigger that turn.
*/
@Test
public void testDoubleFlickerwisp() {
addCard(Zone.BATTLEFIELD, playerA, "Plains", 6);
// Flying
// When Flickerwisp enters the battlefield, exile another target permanent.
// Return that card to the battlefield under its owner's control at the beginning of the next end step.
addCard(Zone.HAND, playerA, "Flickerwisp", 2); // Creature {1}{W}{W}
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion");
addCard(Zone.BATTLEFIELD, playerB, "Courser of Kruphix");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Flickerwisp");
addTarget(playerA, "Silvercoat Lion");
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Flickerwisp");
addTarget(playerA, "Flickerwisp");
addTarget(playerA, "Courser of Kruphix");
setStopAt(2, PhaseStep.PRECOMBAT_MAIN);
execute();
assertPermanentCount(playerA, "Flickerwisp", 2);
assertPermanentCount(playerB, "Silvercoat Lion", 1);
assertPermanentCount(playerB, "Courser of Kruphix", 0);
assertExileCount("Courser of Kruphix", 1);
}
}

View file

@ -0,0 +1,66 @@
/*
* 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.abilities.keywords;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author LevelX2
*/
public class EmergeTest extends CardTestPlayerBase {
/**
* Wretched Gryff is bugged. I could not use its Emerge ability. Clicking on
* the card did not give me the interaction menu.
*/
@Test
public void testCastWithEmerge() {
addCard(Zone.BATTLEFIELD, playerA, "Island", 4);
// Emerge {5}{U} (You may cast this spell by sacrificing a creature and paying the emerge cost reduced by that creature's converted mana cost.)
// When you cast Wretched Gryff, draw a card.
// Flying
addCard(Zone.HAND, playerA, "Wretched Gryff"); // Creature
addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Wretched Gryff with emerge");
setChoice(playerA, "Silvercoat Lion");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertGraveyardCount(playerA, "Silvercoat Lion", 1);
assertPermanentCount(playerA, "Wretched Gryff", 1);
}
}

View file

@ -31,6 +31,7 @@ import mage.abilities.mana.AnyColorManaAbility;
import mage.constants.CardType;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import mage.counters.CounterType;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
@ -38,7 +39,7 @@ import org.mage.test.serverside.base.CardTestPlayerBase;
*
* @author LevelX2
*/
public class LandTypeChangingEffects extends CardTestPlayerBase {
public class LandTypeChangingEffectsTest extends CardTestPlayerBase {
/**
*
@ -97,4 +98,37 @@ public class LandTypeChangingEffects extends CardTestPlayerBase {
assertAbility(playerB, "Canopy Vista", new AnyColorManaAbility(), true);
}
/**
* Currently, a land hit by Aquitect's Will loses all of its other
* abilities, making it a cheap Spreading Seas. It should function like
* Urborg, Tomb of Yawgmoth, not Spreading Seas or Blood Moon.
*/
@Test
public void testLandDoesNotLooseOtherAbilities() {
// Put a flood counter on target land.
// That land is an Island in addition to its other types for as long as it has a flood counter on it.
// If you control a Merfolk, draw a card.
addCard(Zone.HAND, playerA, "Aquitect's Will");// Tribal Sorcery{U}
addCard(Zone.BATTLEFIELD, playerA, "Island", 1);
// Forbidding Watchtower enters the battlefield tapped.
// {T}: Add {W} to your mana pool.
// {1}{W}: Forbidding Watchtower becomes a 1/5 white Soldier creature until end of turn. It's still a land.
addCard(Zone.BATTLEFIELD, playerB, "Forbidding Watchtower", 1);
addCard(Zone.BATTLEFIELD, playerB, "Plains", 2);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Aquitect's Will", "Forbidding Watchtower");
activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "{1}{W}:");
setStopAt(2, PhaseStep.BEGIN_COMBAT);
execute();
assertGraveyardCount(playerA, "Aquitect's Will", 1);
assertPermanentCount(playerB, "Forbidding Watchtower", 1);
assertCounterCount("Forbidding Watchtower", CounterType.FLOOD, 1);
assertType("Forbidding Watchtower", CardType.LAND, "Island");
assertPowerToughness(playerB, "Forbidding Watchtower", 1, 5);
}
}

View file

@ -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 org.mage.test.cards.control;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author LevelX2
*/
public class GontiLordOfLuxuryEffectTest extends CardTestPlayerBase {
/**
* Returning to your hand a creature you own but is controlled by an
* opponent doesn't let you replay it. Happened after I Aether Tradewinded
* my Rashmi that an opponent cast with Gonti, Lord of Luxury (the exile
* part could have something to do with this?). Then on my turn I couldn't
* replay it.
*/
@Test
public void testCanBeCastAgain() {
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 8);
// Deathtouch
// When Gonti, Lord of Luxury enters the battlefield, look at the top four cards of target opponent's library, exile one of them face down,
// then put the rest on the bottom of that library in a random order. For as long as that card remains exiled,
// you may look at it, you may cast it, and you may spend mana as though it were mana of any type to cast it.
addCard(Zone.HAND, playerA, "Gonti, Lord of Luxury", 1); // Creature {2}{B}{B}
addCard(Zone.LIBRARY, playerB, "Rashmi, Eternities Crafter"); // Creature {2}{G}{U}
skipInitShuffling();
addCard(Zone.BATTLEFIELD, playerB, "Island", 2);
addCard(Zone.BATTLEFIELD, playerB, "Forest", 2);
// Return target permanent you control and target permanent you don't control to their owners' hands.
addCard(Zone.HAND, playerB, "Aether Tradewinds", 1); // Intant {2}{U}
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Gonti, Lord of Luxury");
addTarget(playerA, playerB);
setChoice(playerA, "Rashmi, Eternities Crafter");
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Rashmi, Eternities Crafter");
castSpell(1, PhaseStep.END_TURN, playerB, "Aether Tradewinds", "Silvercoat Lion^Rashmi, Eternities Crafter");
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Rashmi, Eternities Crafter");
setStopAt(2, PhaseStep.BEGIN_COMBAT);
execute();
assertGraveyardCount(playerB, "Aether Tradewinds", 1);
assertHandCount(playerB, "Silvercoat Lion", 1);
assertHandCount(playerB, "Rashmi, Eternities Crafter", 0);
assertPermanentCount(playerB, "Rashmi, Eternities Crafter", 1);
}
}

View file

@ -7,7 +7,9 @@ import mage.cards.Card;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.NamePredicate;
import mage.game.permanent.Permanent;
import org.apache.log4j.Logger;
import org.junit.Assert;
import org.junit.Test;
@ -101,7 +103,6 @@ public class CloneTest extends CardTestPlayerBase {
// copy Nightmare test, check that the P/T setting effect ends
// if the clone leaves battlefield
@Test
public void testCopyNightmare() {
addCard(Zone.BATTLEFIELD, playerA, "Island", 5);
@ -141,10 +142,63 @@ public class CloneTest extends CardTestPlayerBase {
for (ContinuousEffectsList effectsList : currentGame.getContinuousEffects().allEffectsLists) {
Iterator it = effectsList.iterator();
while (it.hasNext()) {
ContinuousEffect effect = (ContinuousEffect) it.next();
Logger.getLogger(CloneTest.class).debug("- " + effect.toString());
ContinuousEffect effect = (ContinuousEffect) it.next();
Logger.getLogger(CloneTest.class).debug("- " + effect.toString());
}
}
}
/**
* When I Clone a creature, and I try to use Vesuvan Doppelganger to my
* cloned creature, The Vesuvan disappears and the creature is not created.
*/
@Test
public void testCloneAndVesuvanDoppelganger() {
addCard(Zone.BATTLEFIELD, playerA, "Island", 5);
// You may have Clone enter the battlefield as a copy of any creature on the battlefield.
addCard(Zone.HAND, playerA, "Clone"); // Creature {3}{U}
// You may have Vesuvan Doppelganger enter the battlefield as a copy of any creature on the battlefield
// except it doesn't copy that creature's color and it gains "At the beginning of your upkeep,
// you may have this creature become a copy of target creature except it doesn't copy that creature's color.
// If you do, this creature gains this ability."
addCard(Zone.HAND, playerA, "Vesuvan Doppelganger"); // Creature {3}{U}{U}
addCard(Zone.BATTLEFIELD, playerB, "Island", 2);
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1);
// {2}, {T} , Sacrifice a creature: Draw a card.
addCard(Zone.BATTLEFIELD, playerB, "Phyrexian Vault", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Clone");
setChoice(playerA, "Silvercoat Lion");
activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "{2}");
castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Vesuvan Doppelganger");
setChoice(playerA, "Silvercoat Lion");
setStopAt(3, PhaseStep.BEGIN_COMBAT);
execute();
assertGraveyardCount(playerB, "Silvercoat Lion", 1);
assertGraveyardCount(playerA, "Vesuvan Doppelganger", 0);
assertPermanentCount(playerA, "Silvercoat Lion", 2);
assertPermanentCount(playerB, "Silvercoat Lion", 0);
assertHandCount(playerB, 2);
boolean whiteLion = false;
boolean blueLion = false;
for (Permanent permanent : currentGame.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), playerA.getId(), currentGame)) {
if (permanent.getColor(currentGame).isWhite()) {
whiteLion = true;
}
if (permanent.getColor(currentGame).isBlue()) {
blueLion = true;
}
}
Assert.assertTrue("There should be a white and a blue Silvercoat Lion be on the battlefield", blueLion && whiteLion);
}
}

View file

@ -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 org.mage.test.rollback;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author LevelX2
*/
public class NewCreaturesAreRemovedTest extends CardTestPlayerBase {
/**
* I was playing with a Tamiyo's Journal in the battlefield.
*
* During my turn I rollbacked. The clue generated by Tamiyo's Journal
* stayed on battlefield and when my turn started again, it re-investigated
* for another one.
*
*/
@Test
public void testTamiyosJournal() {
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 5);
// At the beginning of your upkeep, investigate (Put a colorless Clue artifact token onto the battlefield with \"{2}, Sacrifice this artifact: Draw a card.\").
// {T}, Sacrifice three Clues: Search your library for a card and put that card into your hand. Then shuffle your library.
addCard(Zone.HAND, playerA, "Tamiyo's Journal"); // Artifact {5}
addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 3);
addCard(Zone.BATTLEFIELD, playerB, "Pillarfield Ox", 3);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tamiyo's Journal");
// As Port Town enters the battlefield, you may reveal a Plains or Island card from your hand. If you don't, Port Town enters the battlefield tapped.
// {T}: Add {W} or {U} to your mana pool.
addCard(Zone.HAND, playerA, "Port Town"); // Land
addCard(Zone.HAND, playerA, "Island"); // Land
attack(2, playerB, "Pillarfield Ox");
attack(3, playerA, "Silvercoat Lion");
attack(4, playerB, "Pillarfield Ox");
attack(5, playerA, "Silvercoat Lion");
attack(6, playerB, "Pillarfield Ox");
playLand(7, PhaseStep.PRECOMBAT_MAIN, playerA, "Port Town");
attack(7, playerA, "Silvercoat Lion");
setStopAt(7, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertLife(playerA, 14);
assertLife(playerB, 14);
assertPermanentCount(playerA, "Port Town", 1);
assertTapped("Port Town", false);
assertPermanentCount(playerA, "Clue", 3);
}
@Test
public void testTamiyosJournalAndRollback() {
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 5);
// At the beginning of your upkeep, investigate (Put a colorless Clue artifact token onto the battlefield with \"{2}, Sacrifice this artifact: Draw a card.\").
// {T}, Sacrifice three Clues: Search your library for a card and put that card into your hand. Then shuffle your library.
addCard(Zone.HAND, playerA, "Tamiyo's Journal"); // Artifact {5}
// As Port Town enters the battlefield, you may reveal a Plains or Island card from your hand. If you don't, Port Town enters the battlefield tapped.
// {T}: Add {W} or {U} to your mana pool.
addCard(Zone.HAND, playerA, "Port Town"); // Land
addCard(Zone.HAND, playerA, "Island"); // Land
addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 3);
addCard(Zone.BATTLEFIELD, playerB, "Pillarfield Ox", 3);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tamiyo's Journal");
attack(2, playerB, "Pillarfield Ox");
attack(3, playerA, "Silvercoat Lion");
rollbackTurns(3, PhaseStep.END_TURN, playerA, 0);
attack(4, playerB, "Pillarfield Ox");
attack(5, playerA, "Silvercoat Lion");
rollbackTurns(5, PhaseStep.END_TURN, playerA, 0);
attack(6, playerB, "Pillarfield Ox");
playLand(7, PhaseStep.PRECOMBAT_MAIN, playerA, "Port Town");
attack(7, playerA, "Silvercoat Lion");
rollbackTurns(7, PhaseStep.END_TURN, playerA, 0);
setStopAt(7, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertPermanentCount(playerA, "Port Town", 1);
assertTapped("Port Town", false);
assertPermanentCount(playerA, "Clue", 3);
assertLife(playerA, 14);
assertLife(playerB, 14);
}
}

View file

@ -0,0 +1,94 @@
/*
* 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.rollback;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author LevelX2
*/
public class StateValuesTest extends CardTestPlayerBase {
@Test
public void testDragonWhelpActivatedFourTimes() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4);
// Flying
// {R}: Dragon Whelp gets +1/+0 until end of turn. If this ability has been activated four or more times this turn, sacrifice Dragon Whelp at the beginning of the next end step.
addCard(Zone.BATTLEFIELD, playerA, "Dragon Whelp", 1); // 2/3
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{R}: ");
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{R}: ");
attack(1, playerA, "Dragon Whelp");
activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "{R}: ");
activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "{R}: ");
attack(3, playerA, "Dragon Whelp");
rollbackTurns(3, PhaseStep.BEGIN_COMBAT, playerA, 0);
setStopAt(4, PhaseStep.UPKEEP);
execute();
assertLife(playerA, 20);
assertLife(playerB, 12);
assertPermanentCount(playerA, "Dragon Whelp", 1);
assertGraveyardCount(playerA, "Dragon Whelp", 0);
}
@Test
public void testBriarbridgePatrol() {
// Whenever Briarbridge Patrol deals damage to one or more creatures, investigate (Put a colorless Clue artifact token onto the battlefield with "2, Sacrifice this artifact: Draw a card.").
// At the beginning of each end step, if you sacrificed three or more Clues this turn, you may put a creature card from your hand onto the battlefield.
addCard(Zone.BATTLEFIELD, playerA, "Briarbridge Patrol", 1); // 3/3
addCard(Zone.BATTLEFIELD, playerB, "Pillarfield Ox", 1); // 2/2
attack(1, playerA, "Briarbridge Patrol");
block(1, playerB, "Pillarfield Ox", "Briarbridge Patrol");
attack(3, playerA, "Briarbridge Patrol");
block(3, playerB, "Pillarfield Ox", "Briarbridge Patrol");
rollbackTurns(3, PhaseStep.POSTCOMBAT_MAIN, playerA, 0);
setStopAt(3, PhaseStep.END_TURN);
execute();
assertLife(playerA, 20);
assertLife(playerB, 20);
assertPermanentCount(playerA, "Clue", 2);
}
}

View file

@ -0,0 +1,99 @@
/*
* 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.rollback;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author LevelX2
*/
public class TransformTest extends CardTestPlayerBase {
/**
*
*/
@Test
public void testTransform() {
addCard(Zone.BATTLEFIELD, playerA, "Plains", 5);
// First strike, lifelink
// At the beginning of the end step, if you gained 3 or more life this turn, transform Lone Rider.
// BACK: It That Rides as One
// Creature 4/4 First strike, lifelink
addCard(Zone.HAND, playerA, "Lone Rider"); // Creature {1}{W} 1/1
// When Venerable Monk enters the battlefield, you gain 2 life.
addCard(Zone.HAND, playerA, "Venerable Monk"); // Creature {2}{W} 2/2
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lone Rider");
castSpell(3, PhaseStep.POSTCOMBAT_MAIN, playerA, "Venerable Monk");
attack(3, playerA, "Lone Rider");
setStopAt(4, PhaseStep.PRECOMBAT_MAIN);
execute();
assertLife(playerA, 23);
assertLife(playerB, 19);
assertPermanentCount(playerA, "Venerable Monk", 1);
assertPermanentCount(playerA, "It That Rides as One", 1);
}
@Test
public void testRollbackWithTransform() {
addCard(Zone.BATTLEFIELD, playerA, "Plains", 5);
// First strike, lifelink
// At the beginning of the end step, if you gained 3 or more life this turn, transform Lone Rider.
// BACK: It That Rides as One
// Creature 4/4 First strike, lifelink
addCard(Zone.HAND, playerA, "Lone Rider"); // Creature {1}{W} 1/1
// When Venerable Monk enters the battlefield, you gain 2 life.
addCard(Zone.HAND, playerA, "Venerable Monk"); // Creature {2}{W} 2/2
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lone Rider");
castSpell(3, PhaseStep.POSTCOMBAT_MAIN, playerA, "Venerable Monk");
attack(3, playerA, "Lone Rider");
rollbackTurns(3, PhaseStep.END_TURN, playerA, 0);
setStopAt(4, PhaseStep.PRECOMBAT_MAIN);
execute();
assertLife(playerA, 23);
assertLife(playerB, 19);
assertPermanentCount(playerA, "Venerable Monk", 1);
assertPermanentCount(playerA, "It That Rides as One", 1);
}
}