Refactored more subtypes usages to enum

This commit is contained in:
Evan Kranzler 2017-09-08 10:26:03 -04:00
parent 252c941b4f
commit 92b999a9b4
56 changed files with 325 additions and 308 deletions

View file

@ -1,129 +1,129 @@
/*
* 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.copy;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import mage.counters.CounterType;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author LevelX2
*/
public class IdentityThiefTest extends CardTestPlayerBase {
/**
* This is probably a narrow case of a wider problem base. Identity Thief
* copied Molten Sentry and died immediately (should have been either a 5/2
* or a 2/5, whatever the original Molten Sentry was).
*/
@Test
public void testCopyCreature() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4);
// As Molten Sentry enters the battlefield, flip a coin. If the coin comes up heads, Molten Sentry enters the battlefield as a 5/2 creature with haste.
// If it comes up tails, Molten Sentry enters the battlefield as a 2/5 creature with defender.
addCard(Zone.HAND, playerA, "Molten Sentry"); // {3}{R}
// Whenever Identity Thief attacks, you may exile another target nontoken creature.
// If you do, Identity Thief becomes a copy of that creature until end of turn.
// Return the exiled card to the battlefield under its owner's control at the beginning of the next end step.
addCard(Zone.BATTLEFIELD, playerB, "Identity Thief"); // {2}{U}{U}
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Molten Sentry");
attack(2, playerB, "Identity Thief");
addTarget(playerB, "Molten Sentry");
setStopAt(2, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertExileCount(playerA, 1);
assertExileCount("Molten Sentry", 1);
assertPermanentCount(playerB, "Identity Thief", 0);
assertPermanentCount(playerB, "Molten Sentry", 1);
}
@Test
public void testCopyPrimalClay() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4);
// As Primal Clay enters the battlefield, it becomes your choice of a 3/3 artifact creature, a 2/2 artifact creature with flying, or a 1/6 Wall artifact creature with defender in addition to its other types.
addCard(Zone.HAND, playerA, "Primal Clay"); // {4}
// Whenever Identity Thief attacks, you may exile another target nontoken creature.
// If you do, Identity Thief becomes a copy of that creature until end of turn.
// Return the exiled card to the battlefield under its owner's control at the beginning of the next end step.
addCard(Zone.BATTLEFIELD, playerB, "Identity Thief"); // {2}{U}{U}
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Primal Clay");
attack(2, playerB, "Identity Thief");
addTarget(playerB, "Primal Clay");
setStopAt(2, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertExileCount(playerA, 1);
assertExileCount("Primal Clay", 1);
assertPermanentCount(playerB, "Identity Thief", 0);
assertPermanentCount(playerB, "Primal Clay", 1);
}
@Test
public void testShouldNotCopyP1P1Counters() {
addCard(Zone.BATTLEFIELD, playerA, "Sylvan Advocate", 1); // {1}{G} 2/3 vigilance
addCard(Zone.BATTLEFIELD, playerA, "Forest", 1);
addCard(Zone.HAND, playerA, "Battlegrowth"); // {G} instant - Put a +1/+1 counter on target creature.
// Whenever Identity Thief attacks, you may exile another target nontoken creature.
// If you do, Identity Thief becomes a copy of that creature until end of turn.
// Return the exiled card to the battlefield under its owner's control at the beginning of the next end step.
addCard(Zone.BATTLEFIELD, playerB, "Identity Thief"); // {2}{U}{U}
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Battlegrowth");
addTarget(playerA, "Sylvan Advocate");
attack(2, playerB, "Identity Thief");
addTarget(playerB, "Sylvan Advocate");
setStopAt(2, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertExileCount(playerA, 1);
assertExileCount("Sylvan Advocate", 1);
assertGraveyardCount(playerA, "Battlegrowth", 1);
assertPermanentCount(playerB, "Identity Thief", 0);
assertPermanentCount(playerB, "Sylvan Advocate", 1);
assertCounterCount(playerB, "Sylvan Advocate", CounterType.P1P1, 0);
assertPowerToughness(playerB, "Sylvan Advocate", 2, 3); // finds it with 3 power 4 toughness
}
}
/*
* 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.copy;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import mage.counters.CounterType;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author LevelX2
*/
public class IdentityThiefTest extends CardTestPlayerBase {
/**
* This is probably a narrow case of a wider problem base. Identity Thief
* copied Molten Sentry and died immediately (should have been either a 5/2
* or a 2/5, whatever the original Molten Sentry was).
*/
@Test
public void testCopyCreature() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4);
// As Molten Sentry enters the battlefield, flip a coin. If the coin comes up heads, Molten Sentry enters the battlefield as a 5/2 creature with haste.
// If it comes up tails, Molten Sentry enters the battlefield as a 2/5 creature with defender.
addCard(Zone.HAND, playerA, "Molten Sentry"); // {3}{R}
// Whenever Identity Thief attacks, you may exile another target nontoken creature.
// If you do, Identity Thief becomes a copy of that creature until end of turn.
// Return the exiled card to the battlefield under its owner's control at the beginning of the next end step.
addCard(Zone.BATTLEFIELD, playerB, "Identity Thief"); // {2}{U}{U}
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Molten Sentry");
attack(2, playerB, "Identity Thief");
addTarget(playerB, "Molten Sentry");
setStopAt(2, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertExileCount(playerA, 1);
assertExileCount("Molten Sentry", 1);
assertPermanentCount(playerB, "Identity Thief", 0);
assertPermanentCount(playerB, "Molten Sentry", 1);
}
@Test
public void testCopyPrimalClay() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4);
// As Primal Clay enters the battlefield, it becomes your choice of a 3/3 artifact creature, a 2/2 artifact creature with flying, or a 1/6 Wall artifact creature with defender in addition to its other types.
addCard(Zone.HAND, playerA, "Primal Clay"); // {4}
// Whenever Identity Thief attacks, you may exile another target nontoken creature.
// If you do, Identity Thief becomes a copy of that creature until end of turn.
// Return the exiled card to the battlefield under its owner's control at the beginning of the next end step.
addCard(Zone.BATTLEFIELD, playerB, "Identity Thief"); // {2}{U}{U}
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Primal Clay");
attack(2, playerB, "Identity Thief");
addTarget(playerB, "Primal Clay");
setStopAt(2, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertExileCount(playerA, 1);
assertExileCount("Primal Clay", 1);
assertPermanentCount(playerB, "Identity Thief", 0);
assertPermanentCount(playerB, "Primal Clay", 1);
}
@Test
public void testShouldNotCopyP1P1Counters() {
addCard(Zone.BATTLEFIELD, playerA, "Sylvan Advocate", 1); // {1}{G} 2/3 vigilance
addCard(Zone.BATTLEFIELD, playerA, "Forest", 1);
addCard(Zone.HAND, playerA, "Battlegrowth"); // {G} instant - Put a +1/+1 counter on target creature.
// Whenever Identity Thief attacks, you may exile another target nontoken creature.
// If you do, Identity Thief becomes a copy of that creature until end of turn.
// Return the exiled card to the battlefield under its owner's control at the beginning of the next end step.
addCard(Zone.BATTLEFIELD, playerB, "Identity Thief"); // {2}{U}{U}
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Battlegrowth");
addTarget(playerA, "Sylvan Advocate");
attack(2, playerB, "Identity Thief");
addTarget(playerB, "Sylvan Advocate");
setStopAt(2, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertExileCount(playerA, 1);
assertExileCount("Sylvan Advocate", 1);
assertGraveyardCount(playerA, "Battlegrowth", 1);
assertPermanentCount(playerB, "Identity Thief", 0);
assertPermanentCount(playerB, "Sylvan Advocate", 1);
assertCounterCount(playerB, "Sylvan Advocate", CounterType.P1P1, 0);
assertPowerToughness(playerB, "Sylvan Advocate", 2, 3); // finds it with 3 power 4 toughness
}
}

View file

@ -1,6 +1,7 @@
package org.mage.test.cards.copy;
import mage.abilities.keyword.DeathtouchAbility;
import mage.constants.SubType;
import mage.abilities.keyword.FlyingAbility;
import mage.constants.PhaseStep;
import mage.constants.Zone;
@ -48,7 +49,7 @@ public class LazavDimirMastermindTest extends CardTestPlayerBase {
assertPowerToughness(playerA, "Lazav, Dimir Mastermind", 3, 2);
Permanent lazav = getPermanent("Lazav, Dimir Mastermind", playerA.getId());
Assert.assertTrue(lazav.getSubtype(currentGame).contains("Griffin"));
Assert.assertTrue(lazav.getSubtype(currentGame).contains(SubType.GRIFFIN));
Assert.assertTrue("Lazav, Dimir Mastermind must have flying",lazav.getAbilities().contains(FlyingAbility.getInstance()));
}
@ -74,8 +75,8 @@ public class LazavDimirMastermindTest extends CardTestPlayerBase {
assertPermanentCount(playerA, "Lazav, Dimir Mastermind", 1);
assertPowerToughness(playerA, "Lazav, Dimir Mastermind", 3, 3);
Permanent lazav = getPermanent("Lazav, Dimir Mastermind", playerA.getId());
Assert.assertTrue(lazav.getSubtype(currentGame).contains("Ogre"));
Assert.assertTrue(lazav.getSubtype(currentGame).contains("Rogue"));
Assert.assertTrue(lazav.getSubtype(currentGame).contains(SubType.OGRE));
Assert.assertTrue(lazav.getSubtype(currentGame).contains(SubType.ROGUE));
Permanent gutterSkulk = getPermanent("Gutter Skulk", playerA.getId());
Assert.assertTrue("Gutter Skulk should have deathtouch but hasn't", gutterSkulk.getAbilities().contains(DeathtouchAbility.getInstance()));
@ -116,7 +117,7 @@ public class LazavDimirMastermindTest extends CardTestPlayerBase {
Permanent lazav = getPermanent("Lazav, Dimir Mastermind", playerA.getId());
Assert.assertTrue(lazav.getAbilities().contains(FlyingAbility.getInstance()));
Assert.assertTrue(lazav.getSubtype(currentGame).contains("Specter"));
Assert.assertTrue(lazav.getSubtype(currentGame).contains(SubType.SPECTER));
Assert.assertTrue(lazav.isLegendary());
assertPermanentCount(playerA, "Silvercoat Lion", 1);
@ -146,7 +147,7 @@ public class LazavDimirMastermindTest extends CardTestPlayerBase {
assertPowerToughness(playerA, "Lazav, Dimir Mastermind", 2, 2);
Permanent lazav = getPermanent("Lazav, Dimir Mastermind", playerA.getId());
Assert.assertTrue(lazav.getSubtype(currentGame).contains("Cat"));
Assert.assertTrue(lazav.getSubtype(currentGame).contains(SubType.CAT));
Assert.assertTrue(lazav.isLegendary());
}
@ -190,7 +191,7 @@ public class LazavDimirMastermindTest extends CardTestPlayerBase {
assertPermanentCount(playerA, "Lazav, Dimir Mastermind", 1);
assertPowerToughness(playerA, "Lazav, Dimir Mastermind", 3, 3);
Permanent lazav = getPermanent("Lazav, Dimir Mastermind", playerA.getId());
Assert.assertFalse(lazav.getSubtype(currentGame).contains("Griffin")); // no Griffin type
Assert.assertFalse(lazav.getSubtype(currentGame).contains(SubType.GRIFFIN)); // no Griffin type
Assert.assertFalse("Lazav, Dimir Mastermind must have flying",lazav.getAbilities().contains(FlyingAbility.getInstance()));
@ -226,7 +227,7 @@ public class LazavDimirMastermindTest extends CardTestPlayerBase {
assertPowerToughness(playerA, "Lazav, Dimir Mastermind", 3, 2);
Permanent lazav = getPermanent("Lazav, Dimir Mastermind", playerA.getId());
Assert.assertTrue(lazav.getSubtype(currentGame).contains("Griffin"));
Assert.assertTrue(lazav.getSubtype(currentGame).contains(SubType.GRIFFIN));
Assert.assertTrue("Lazav, Dimir Mastermind must have flying",lazav.getAbilities().contains(FlyingAbility.getInstance()));
}
}

View file

@ -1,114 +1,114 @@
/*
* 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.copy;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author LevelX2
*/
public class MimicVatTest extends CardTestPlayerBase {
/**
* All the clone type cards that may enter as a copy of something don't work
* correctly with Mimic Vat. The only one I found that works (the token
* being able to clone something) is Phyrexian Metamorph. Phyrexian
* Metamorph is implemented differently than the rest of similar functioning
* cards, ie. Clone, Phantasmal Image, Body Double, Clever Impersonator.
* Also The copy ability on Phyrexian Metamorph is optional but it is forced
* in game
*/
@Test
public void TestClone() {
addCard(Zone.BATTLEFIELD, playerA, "Island", 6);
// 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}: Create a tokenonto 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); // Artifact {3}
// {2}, {T}, Sacrifice a creature: Draw a card.
addCard(Zone.BATTLEFIELD, playerA, "Phyrexian Vault", 1);
// You may have Clone enter the battlefield as a copy of any creature on the battlefield.
addCard(Zone.HAND, playerA, "Clone", 1);// Creature {3}{U}
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Clone");
setChoice(playerA, "Silvercoat Lion");
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2},{T}, Sacrifice a creature");
setChoice(playerA, "Yes");
activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "{3},{T}: Create a token");
setChoice(playerA, "Silvercoat Lion");
setStopAt(3, PhaseStep.BEGIN_COMBAT);
execute();
assertExileCount("Clone", 1);
assertPermanentCount(playerB, "Silvercoat Lion", 1);
assertPermanentCount(playerA, "Silvercoat Lion", 1);
}
@Test
public void TestPhyrexianMetamorph() {
addCard(Zone.BATTLEFIELD, playerA, "Island", 6);
// 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}: Create a token that's a copy of a card exiled with Mimic Vat. It gains haste. Exile it at the beginning of the next end step.
addCard(Zone.BATTLEFIELD, playerA, "Mimic Vat", 1); // Artifact {3}
// {2}, {T}, Sacrifice a creature: Draw a card.
addCard(Zone.BATTLEFIELD, playerA, "Phyrexian Vault", 1);
// You may have Phyrexian Metamorph enter the battlefield as a copy of any artifact or creature on the battlefield, except it's an artifact in addition to its other types.
addCard(Zone.HAND, playerA, "Phyrexian Metamorph", 1);// Creature {3}{U/P}
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Phyrexian Metamorph");
setChoice(playerA, "Yes");
setChoice(playerA, "Silvercoat Lion");
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2},{T}, Sacrifice a creature");
setChoice(playerA, "Yes");
activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "{3},{T}: Create a token that's a copy of a card exiled with ");
setChoice(playerA, "Yes");
setChoice(playerA, "Silvercoat Lion");
setStopAt(3, PhaseStep.BEGIN_COMBAT);
execute();
assertExileCount("Phyrexian Metamorph", 1);
assertPermanentCount(playerB, "Silvercoat Lion", 1);
assertPermanentCount(playerA, "Silvercoat Lion", 1);
}
}
/*
* 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.copy;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author LevelX2
*/
public class MimicVatTest extends CardTestPlayerBase {
/**
* All the clone type cards that may enter as a copy of something don't work
* correctly with Mimic Vat. The only one I found that works (the token
* being able to clone something) is Phyrexian Metamorph. Phyrexian
* Metamorph is implemented differently than the rest of similar functioning
* cards, ie. Clone, Phantasmal Image, Body Double, Clever Impersonator.
* Also The copy ability on Phyrexian Metamorph is optional but it is forced
* in game
*/
@Test
public void TestClone() {
addCard(Zone.BATTLEFIELD, playerA, "Island", 6);
// 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}: Create a tokenonto 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); // Artifact {3}
// {2}, {T}, Sacrifice a creature: Draw a card.
addCard(Zone.BATTLEFIELD, playerA, "Phyrexian Vault", 1);
// You may have Clone enter the battlefield as a copy of any creature on the battlefield.
addCard(Zone.HAND, playerA, "Clone", 1);// Creature {3}{U}
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Clone");
setChoice(playerA, "Silvercoat Lion");
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2},{T}, Sacrifice a creature");
setChoice(playerA, "Yes");
activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "{3},{T}: Create a token");
setChoice(playerA, "Silvercoat Lion");
setStopAt(3, PhaseStep.BEGIN_COMBAT);
execute();
assertExileCount("Clone", 1);
assertPermanentCount(playerB, "Silvercoat Lion", 1);
assertPermanentCount(playerA, "Silvercoat Lion", 1);
}
@Test
public void TestPhyrexianMetamorph() {
addCard(Zone.BATTLEFIELD, playerA, "Island", 6);
// 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}: Create a token that's a copy of a card exiled with Mimic Vat. It gains haste. Exile it at the beginning of the next end step.
addCard(Zone.BATTLEFIELD, playerA, "Mimic Vat", 1); // Artifact {3}
// {2}, {T}, Sacrifice a creature: Draw a card.
addCard(Zone.BATTLEFIELD, playerA, "Phyrexian Vault", 1);
// You may have Phyrexian Metamorph enter the battlefield as a copy of any artifact or creature on the battlefield, except it's an artifact in addition to its other types.
addCard(Zone.HAND, playerA, "Phyrexian Metamorph", 1);// Creature {3}{U/P}
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Phyrexian Metamorph");
setChoice(playerA, "Yes");
setChoice(playerA, "Silvercoat Lion");
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2},{T}, Sacrifice a creature");
setChoice(playerA, "Yes");
activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "{3},{T}: Create a token that's a copy of a card exiled with ");
setChoice(playerA, "Yes");
setChoice(playerA, "Silvercoat Lion");
setStopAt(3, PhaseStep.BEGIN_COMBAT);
execute();
assertExileCount("Phyrexian Metamorph", 1);
assertPermanentCount(playerB, "Silvercoat Lion", 1);
assertPermanentCount(playerA, "Silvercoat Lion", 1);
}
}

View file

@ -1,6 +1,7 @@
package org.mage.test.cards.copy;
import mage.abilities.Ability;
import mage.constants.SubType;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.discard.DiscardControllerEffect;
@ -43,7 +44,7 @@ public class VolrathsShapshifterTest extends CardTestPlayerBase {
assertPowerToughness(playerA, "Assault Griffin", 3, 2);
Permanent shapeshifter = getPermanent("Assault Griffin", playerA.getId());
Assert.assertTrue(shapeshifter.getSubtype(currentGame).contains("Griffin"));
Assert.assertTrue(shapeshifter.getSubtype(currentGame).contains(SubType.GRIFFIN));
Assert.assertTrue("Volrath's Shapeshifter must have flying", shapeshifter.getAbilities().contains(FlyingAbility.getInstance()));
Assert.assertTrue("Volrath's Shapeshifter must have {2} : Discard a card", hasShapeshiftersOriginalAbility(shapeshifter));
}
@ -73,7 +74,7 @@ public class VolrathsShapshifterTest extends CardTestPlayerBase {
assertPowerToughness(playerA, "Volrath's Shapeshifter", 0, 1);
Permanent shapeshifter = getPermanent("Volrath's Shapeshifter", playerA.getId());
Assert.assertTrue(shapeshifter.getSubtype(currentGame).contains("Shapeshifter"));
Assert.assertTrue(shapeshifter.getSubtype(currentGame).contains(SubType.SHAPESHIFTER));
Assert.assertTrue("Volrath's Shapeshifter must have {2} : Discard a card", hasShapeshiftersOriginalAbility(shapeshifter));
}
@ -100,7 +101,7 @@ public class VolrathsShapshifterTest extends CardTestPlayerBase {
assertPowerToughness(playerA, "Dutiful Thrull", 1, 1);
Permanent shapeshifter = getPermanent("Dutiful Thrull", playerA.getId());
Assert.assertTrue(shapeshifter.getSubtype(currentGame).contains("Thrull"));
Assert.assertTrue(shapeshifter.getSubtype(currentGame).contains(SubType.THRULL));
Assert.assertTrue("Volrath's Shapeshifter must have {2} : Discard a card", hasShapeshiftersOriginalAbility(shapeshifter));

View file

@ -29,6 +29,7 @@ package org.mage.test.cards.enchantments;
import mage.abilities.keyword.IndestructibleAbility;
import mage.constants.PhaseStep;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.game.permanent.Permanent;
import org.junit.Assert;
@ -70,7 +71,7 @@ public class LignifyTest extends CardTestPlayerBase {
Permanent hivelord = getPermanent("Sliver Hivelord", playerB);
Assert.assertFalse("Sliver Hivelord may not be of subtype Sliver", hivelord.getSubtype(currentGame).contains("Sliver"));
Assert.assertFalse("Sliver Hivelord may not be of subtype Sliver", hivelord.getSubtype(currentGame).contains(SubType.SLIVER));
}

View file

@ -4,6 +4,7 @@ import mage.abilities.keyword.DefenderAbility;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.VigilanceAbility;
import mage.constants.PhaseStep;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.game.permanent.Permanent;
import org.junit.Assert;
@ -76,7 +77,7 @@ public class SoulSeparatorTest extends CardTestPlayerBase {
Permanent treeToken = getPermanent("Tree of Perdition", playerA);
Assert.assertTrue(treeToken.getAbilities().contains(FlyingAbility.getInstance()));
Assert.assertTrue(treeToken.getSubtype(currentGame).contains("Spirit"));
Assert.assertTrue(treeToken.getSubtype(currentGame).contains(SubType.SPIRIT));
Assert.assertTrue(treeToken.getAbilities().contains(DefenderAbility.getInstance()));
assertLife(playerA, 20);

View file

@ -1,6 +1,7 @@
package org.mage.test.cards.triggers;
import mage.constants.PhaseStep;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.game.permanent.Permanent;
import org.junit.Assert;
@ -60,7 +61,7 @@ public class FathomMageTest extends CardTestPlayerBase {
assertPowerToughness(playerA, "Fathom Mage", 3, 3);
Permanent fathomMage = getPermanent("Fathom Mage", playerA);
Assert.assertEquals("Fathom Mage has to be a Mutant", true, fathomMage.getSubtype(currentGame).contains("Mutant"));
Assert.assertEquals("Fathom Mage has to be a Mutant", true, fathomMage.getSubtype(currentGame).contains(SubType.MUTANT));
assertHandCount(playerA, 2);
}