Refactoring subtypes to make Maskwood Nexus work (ready for review) (#7432)

* removed and renamed SubTypeList

* updated subtype test

* refactored Changeling to be an ability that actually does something

* moved isAllCreatureTypes into SubTypes class

* renamed copyTo method to copyFrom

* added removeAllCreatureTypes where usable

* replaced some subtype methods

* replaced some more subtype methods

* replaced subtype mass add/remove methods

* updated more subtype methods

* fixed some errors

* made common shared creature type predicate

* refactored another card involving subtypes

* Added usage of object attribute in subTypes's write operations;

* Refactor: use same param styles in subtype methods

* Refactor: simplified usage of copy appliers;

* Refactor: fixed code usage in CopyApplier

Co-authored-by: Oleg Agafonov <jaydi85@gmail.com>
This commit is contained in:
Evan Kranzler 2021-01-26 08:52:35 -05:00 committed by GitHub
parent 6f42b90305
commit dacf30f4b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
259 changed files with 1857 additions and 1922 deletions

View file

@ -459,7 +459,7 @@ public class BestowTest extends CardTestPlayerBase {
assertType("Nighthowler", CardType.ENCHANTMENT, true);
Permanent nighthowler = getPermanent("Nighthowler");
Assert.assertFalse("The unattached Nighthowler may not have the aura subtype.", nighthowler.getSubtype(currentGame).contains(SubType.AURA));
Assert.assertFalse("The unattached Nighthowler may not have the aura subtype.", nighthowler.hasSubtype(SubType.AURA, currentGame));
}
@Test

View file

@ -140,7 +140,7 @@ public class ChangelingTest extends CardTestPlayerBase {
assertPowerToughness(playerA, "Game-Trail Changeling", 7, 1);
assertNotSubtype("Game-Trail Changeling", SubType.SHAPESHIFTER);
assertAbility(playerA, "Game-Trail Changeling", HasteAbility.getInstance(), false);
assertAbility(playerA, "Game-Trail Changeling", ChangelingAbility.getInstance(), true);
assertAbility(playerA, "Game-Trail Changeling", new ChangelingAbility(), true);
}
@Test
@ -159,6 +159,6 @@ public class ChangelingTest extends CardTestPlayerBase {
assertSubtype("Game-Trail Changeling", SubType.GOBLIN);
assertSubtype("Game-Trail Changeling", SubType.ELF);
assertSubtype("Game-Trail Changeling", SubType.SHAPESHIFTER);
assertAbility(playerB, "Game-Trail Changeling", ChangelingAbility.getInstance(), false);
assertAbility(playerB, "Game-Trail Changeling", new ChangelingAbility(), false);
}
}

View file

@ -10,7 +10,7 @@ public class ChangelingTest extends CardTestPlayerBase {
// Mistform Ultimus is every creature type
private static final String ultimus = "Mistform Ultimus";
// each creature gets +1/+1 for each creature you control that shares a creatureype
// each creature gets +1/+1 for each other creature that shares a creature type with it
private static final String coatOfArms = "Coat of Arms";
// all merfolk get +1/+1
private static final String lordOfAtlantis = "Lord of Atlantis";

View file

@ -226,13 +226,13 @@ public class LandTypeChangingEffectsTest extends CardTestPlayerBase {
int mountainTypes = 0;
int creatures = 0;
for (Permanent permanent : currentGame.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_LAND, playerA.getId(), currentGame)) {
if (permanent.getSubtype(currentGame).contains(SubType.ISLAND)) {
if (permanent.hasSubtype(SubType.ISLAND, currentGame)) {
islandTypes++;
}
if (permanent.getSubtype(currentGame).contains(SubType.MOUNTAIN)) {
if (permanent.hasSubtype(SubType.MOUNTAIN, currentGame)) {
mountainTypes++;
}
if (permanent.getSubtype(currentGame).contains(SubType.SWAMP)) {
if (permanent.hasSubtype(SubType.SWAMP, currentGame)) {
swampTypes++;
}
if (permanent.isCreature()) {

View file

@ -39,45 +39,45 @@ public class SubTypeChangingEffectsTest extends CardTestPlayerBase {
assertPermanentCount(playerA, "Conspiracy", 1);
Permanent silvercoatLion = getPermanent("Silvercoat Lion", playerA);
Assert.assertEquals(false, silvercoatLion.getSubtype(currentGame).contains(SubType.CAT));
Assert.assertEquals(true, silvercoatLion.getSubtype(currentGame).contains(SubType.ORC));
Assert.assertFalse(silvercoatLion.hasSubtype(SubType.CAT, currentGame));
Assert.assertTrue(silvercoatLion.hasSubtype(SubType.ORC, currentGame));
silvercoatLion = getPermanent("Silvercoat Lion", playerB);
Assert.assertEquals(true, silvercoatLion.getSubtype(currentGame).contains(SubType.CAT));
Assert.assertEquals(false, silvercoatLion.getSubtype(currentGame).contains(SubType.ORC));
Assert.assertTrue(silvercoatLion.hasSubtype(SubType.CAT, currentGame));
Assert.assertFalse(silvercoatLion.hasSubtype(SubType.ORC, currentGame));
for (Card card : playerA.getLibrary().getCards(currentGame)) {
if (card.isCreature()) {
Assert.assertEquals(card.getName() + " should have ORC type", true, card.getSubtype(currentGame).contains(SubType.ORC));
Assert.assertEquals(card.getName() + " should not have CAT type", false, card.getSubtype(currentGame).contains(SubType.CAT));
Assert.assertTrue(card.getName() + " should have ORC type", card.hasSubtype(SubType.ORC, currentGame));
Assert.assertFalse(card.getName() + " should not have CAT type", card.hasSubtype(SubType.CAT, currentGame));
}
}
for (Card card : playerB.getLibrary().getCards(currentGame)) {
if (card.isCreature()) {
Assert.assertEquals(card.getName() + " should not have ORC type", false, card.getSubtype(currentGame).contains(SubType.ORC));
Assert.assertEquals(card.getName() + " should have CAT type", true, card.getSubtype(currentGame).contains(SubType.CAT));
Assert.assertFalse(card.getName() + " should not have ORC type", card.hasSubtype(SubType.ORC, currentGame));
Assert.assertTrue(card.getName() + " should have CAT type", card.hasSubtype(SubType.CAT, currentGame));
}
}
for (Card card : playerA.getHand().getCards(currentGame)) {
if (card.isCreature()) {
Assert.assertEquals(card.getName() + " should have ORC type", true, card.getSubtype(currentGame).contains(SubType.ORC));
Assert.assertTrue(card.getName() + " should have ORC type", card.hasSubtype(SubType.ORC, currentGame));
}
}
for (Card card : playerB.getHand().getCards(currentGame)) {
if (card.isCreature()) {
Assert.assertEquals(card.getName() + " should not have ORC type", false, card.getSubtype(currentGame).contains(SubType.ORC));
Assert.assertFalse(card.getName() + " should not have ORC type", card.hasSubtype(SubType.ORC, currentGame));
}
}
for (Card card : playerA.getGraveyard().getCards(currentGame)) {
if (card.isCreature()) {
Assert.assertEquals(card.getName() + " should have ORC type", true, card.getSubtype(currentGame).contains(SubType.ORC));
Assert.assertTrue(card.getName() + " should have ORC type", card.hasSubtype(SubType.ORC, currentGame));
}
}
for (Card card : playerB.getGraveyard().getCards(currentGame)) {
if (card.isCreature()) {
Assert.assertEquals(card.getName() + " should not have ORC type", false, card.getSubtype(currentGame).contains(SubType.ORC));
Assert.assertFalse(card.getName() + " should not have ORC type", card.hasSubtype(SubType.ORC, currentGame));
}
}
@ -118,27 +118,27 @@ public class SubTypeChangingEffectsTest extends CardTestPlayerBase {
assertGraveyardCount(playerB, "Disenchant", 1);
Permanent silvercoatLion = getPermanent("Silvercoat Lion", playerA);
Assert.assertEquals(true, silvercoatLion.getSubtype(currentGame).contains(SubType.CAT));
Assert.assertEquals(false, silvercoatLion.getSubtype(currentGame).contains(SubType.ORC));
Assert.assertTrue(silvercoatLion.hasSubtype(SubType.CAT, currentGame));
Assert.assertFalse(silvercoatLion.hasSubtype(SubType.ORC, currentGame));
for (Card card : playerA.getLibrary().getCards(currentGame)) {
if (card.isCreature()) {
Assert.assertEquals(card.getName() + " should not have ORC type", false, card.getSubtype(currentGame).contains(SubType.ORC));
Assert.assertEquals(card.getName() + " should have CAT type", true, card.getSubtype(currentGame).contains(SubType.CAT));
Assert.assertFalse(card.getName() + " should not have ORC type", card.hasSubtype(SubType.ORC, currentGame));
Assert.assertTrue(card.getName() + " should have CAT type", card.hasSubtype(SubType.CAT, currentGame));
}
}
for (Card card : playerA.getHand().getCards(currentGame)) {
if (card.isCreature()) {
Assert.assertEquals(card.getName() + " should not have ORC type", false, card.getSubtype(currentGame).contains(SubType.ORC));
Assert.assertEquals(card.getName() + " should have CAT type", true, card.getSubtype(currentGame).contains(SubType.CAT));
Assert.assertFalse(card.getName() + " should not have ORC type", card.hasSubtype(SubType.ORC, currentGame));
Assert.assertTrue(card.getName() + " should have CAT type", card.hasSubtype(SubType.CAT, currentGame));
}
}
for (Card card : playerA.getGraveyard().getCards(currentGame)) {
if (card.isCreature()) {
Assert.assertEquals(card.getName() + " should not have ORC type", false, card.getSubtype(currentGame).contains(SubType.ORC));
Assert.assertEquals(card.getName() + " should have CAT type", true, card.getSubtype(currentGame).contains(SubType.CAT));
Assert.assertFalse(card.getName() + " should not have ORC type", card.hasSubtype(SubType.ORC, currentGame));
Assert.assertTrue(card.getName() + " should have CAT type", card.hasSubtype(SubType.CAT, currentGame));
}
}
@ -169,49 +169,49 @@ public class SubTypeChangingEffectsTest extends CardTestPlayerBase {
assertPermanentCount(playerA, "Arcane Adaptation", 1);
Permanent silvercoatLion = getPermanent("Silvercoat Lion", playerA);
Assert.assertEquals(true, silvercoatLion.getSubtype(currentGame).contains(SubType.CAT));
Assert.assertEquals(true, silvercoatLion.getSubtype(currentGame).contains(SubType.ORC));
Assert.assertTrue(silvercoatLion.hasSubtype(SubType.CAT, currentGame));
Assert.assertTrue(silvercoatLion.hasSubtype(SubType.ORC, currentGame));
silvercoatLion = getPermanent("Silvercoat Lion", playerB);
Assert.assertEquals(true, silvercoatLion.getSubtype(currentGame).contains(SubType.CAT));
Assert.assertEquals(false, silvercoatLion.getSubtype(currentGame).contains(SubType.ORC));
Assert.assertTrue(silvercoatLion.hasSubtype(SubType.CAT, currentGame));
Assert.assertFalse(silvercoatLion.hasSubtype(SubType.ORC, currentGame));
for (Card card : playerA.getLibrary().getCards(currentGame)) {
if (card.isCreature()) {
Assert.assertEquals(card.getName() + " should have ORC type", true, card.getSubtype(currentGame).contains(SubType.ORC));
Assert.assertEquals(card.getName() + " should have CAT type", true, card.getSubtype(currentGame).contains(SubType.CAT));
Assert.assertEquals(card.getName() + " should have ORC type", true, card.hasSubtype(SubType.ORC, currentGame));
Assert.assertEquals(card.getName() + " should have CAT type", true, card.hasSubtype(SubType.CAT, currentGame));
}
}
for (Card card : playerB.getLibrary().getCards(currentGame)) {
if (card.isCreature()) {
Assert.assertEquals(card.getName() + " should not have ORC type", false, card.getSubtype(currentGame).contains(SubType.ORC));
Assert.assertEquals(card.getName() + " should have CAT type", true, card.getSubtype(currentGame).contains(SubType.CAT));
Assert.assertEquals(card.getName() + " should not have ORC type", false, card.hasSubtype(SubType.ORC, currentGame));
Assert.assertEquals(card.getName() + " should have CAT type", true, card.hasSubtype(SubType.CAT, currentGame));
}
}
for (Card card : playerA.getHand().getCards(currentGame)) {
if (card.isCreature()) {
Assert.assertEquals(card.getName() + " should have ORC type", true, card.getSubtype(currentGame).contains(SubType.ORC));
Assert.assertEquals(card.getName() + " should have CAT type", true, card.getSubtype(currentGame).contains(SubType.CAT));
Assert.assertEquals(card.getName() + " should have ORC type", true, card.hasSubtype(SubType.ORC, currentGame));
Assert.assertEquals(card.getName() + " should have CAT type", true, card.hasSubtype(SubType.CAT, currentGame));
}
}
for (Card card : playerB.getHand().getCards(currentGame)) {
if (card.isCreature()) {
Assert.assertEquals(card.getName() + " should not have ORC type", false, card.getSubtype(currentGame).contains(SubType.ORC));
Assert.assertEquals(card.getName() + " should have CAT type", true, card.getSubtype(currentGame).contains(SubType.CAT));
Assert.assertEquals(card.getName() + " should not have ORC type", false, card.hasSubtype(SubType.ORC, currentGame));
Assert.assertEquals(card.getName() + " should have CAT type", true, card.hasSubtype(SubType.CAT, currentGame));
}
}
for (Card card : playerA.getGraveyard().getCards(currentGame)) {
if (card.isCreature()) {
Assert.assertEquals(card.getName() + " should have ORC type", true, card.getSubtype(currentGame).contains(SubType.ORC));
Assert.assertEquals(card.getName() + " should have CAT type", true, card.getSubtype(currentGame).contains(SubType.CAT));
Assert.assertEquals(card.getName() + " should have ORC type", true, card.hasSubtype(SubType.ORC, currentGame));
Assert.assertEquals(card.getName() + " should have CAT type", true, card.hasSubtype(SubType.CAT, currentGame));
}
}
for (Card card : playerB.getGraveyard().getCards(currentGame)) {
if (card.isCreature()) {
Assert.assertEquals(card.getName() + " should not have ORC type", false, card.getSubtype(currentGame).contains(SubType.ORC));
Assert.assertEquals(card.getName() + " should have CAT type", true, card.getSubtype(currentGame).contains(SubType.CAT));
Assert.assertEquals(card.getName() + " should not have ORC type", false, card.hasSubtype(SubType.ORC, currentGame));
Assert.assertEquals(card.getName() + " should have CAT type", true, card.hasSubtype(SubType.CAT, currentGame));
}
}
@ -265,35 +265,35 @@ public class SubTypeChangingEffectsTest extends CardTestPlayerBase {
assertGraveyardCount(playerB, "Disenchant", 1);
Permanent silvercoatLion = getPermanent("Silvercoat Lion", playerA);
Assert.assertEquals(true, silvercoatLion.getSubtype(currentGame).contains(SubType.CAT));
Assert.assertEquals(false, silvercoatLion.getSubtype(currentGame).contains(SubType.ORC));
Assert.assertTrue(silvercoatLion.hasSubtype(SubType.CAT, currentGame));
Assert.assertFalse(silvercoatLion.hasSubtype(SubType.ORC, currentGame));
Permanent beast = getPermanent("Beast", playerA);
Assert.assertEquals(true, beast.getSubtype(currentGame).contains(SubType.BEAST));
Assert.assertEquals(false, beast.getSubtype(currentGame).contains(SubType.ORC));
Assert.assertTrue(beast.hasSubtype(SubType.BEAST, currentGame));
Assert.assertFalse(beast.hasSubtype(SubType.ORC, currentGame));
Permanent wurm = getPermanent("Wurm", playerA);
Assert.assertEquals(true, wurm.getSubtype(currentGame).contains(SubType.WURM));
Assert.assertEquals(false, wurm.getSubtype(currentGame).contains(SubType.ORC));
Assert.assertTrue(wurm.hasSubtype(SubType.WURM, currentGame));
Assert.assertFalse(wurm.hasSubtype(SubType.ORC, currentGame));
for (Card card : playerA.getLibrary().getCards(currentGame)) {
if (card.isCreature()) {
Assert.assertEquals(card.getName() + " should not have ORC type", false, card.getSubtype(currentGame).contains(SubType.ORC));
Assert.assertEquals(card.getName() + " should have CAT type", true, card.getSubtype(currentGame).contains(SubType.CAT));
Assert.assertEquals(card.getName() + " should not have ORC type", false, card.hasSubtype(SubType.ORC, currentGame));
Assert.assertEquals(card.getName() + " should have CAT type", true, card.hasSubtype(SubType.CAT, currentGame));
}
}
for (Card card : playerA.getHand().getCards(currentGame)) {
if (card.isCreature()) {
Assert.assertEquals(card.getName() + " should not have ORC type", false, card.getSubtype(currentGame).contains(SubType.ORC));
Assert.assertEquals(card.getName() + " should have CAT type", true, card.getSubtype(currentGame).contains(SubType.CAT));
Assert.assertEquals(card.getName() + " should not have ORC type", false, card.hasSubtype(SubType.ORC, currentGame));
Assert.assertEquals(card.getName() + " should have CAT type", true, card.hasSubtype(SubType.CAT, currentGame));
}
}
for (Card card : playerA.getGraveyard().getCards(currentGame)) {
if (card.isCreature()) {
Assert.assertEquals(card.getName() + " should not have ORC type", false, card.getSubtype(currentGame).contains(SubType.ORC));
Assert.assertEquals(card.getName() + " should have CAT type", true, card.getSubtype(currentGame).contains(SubType.CAT));
Assert.assertEquals(card.getName() + " should not have ORC type", false, card.hasSubtype(SubType.ORC, currentGame));
Assert.assertEquals(card.getName() + " should have CAT type", true, card.hasSubtype(SubType.CAT, currentGame));
}
}
@ -342,4 +342,134 @@ public class SubTypeChangingEffectsTest extends CardTestPlayerBase {
assertType("Gingerbrute", CardType.CREATURE, SubType.DRAGON);
assertNotSubtype("Gingerbrute", SubType.GOLEM);
}
@Test
public void testMaskwoodNexus() {
addCard(Zone.HAND, playerA, "Maskwood Nexus", 1);
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 4);
addCard(Zone.HAND, playerA, "Silvercoat Lion");
addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion");
addCard(Zone.GRAVEYARD, playerA, "Silvercoat Lion");
addCard(Zone.HAND, playerB, "Silvercoat Lion");
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion");
addCard(Zone.GRAVEYARD, playerB, "Silvercoat Lion");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Maskwood Nexus");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerA, "Maskwood Nexus", 1);
Permanent silvercoatLion = getPermanent("Silvercoat Lion", playerA);
Assert.assertTrue(silvercoatLion.hasSubtype(SubType.CAT, currentGame));
Assert.assertTrue(silvercoatLion.hasSubtype(SubType.ORC, currentGame));
silvercoatLion = getPermanent("Silvercoat Lion", playerB);
Assert.assertTrue(silvercoatLion.hasSubtype(SubType.CAT, currentGame));
Assert.assertFalse(silvercoatLion.hasSubtype(SubType.ORC, currentGame));
for (Card card : playerA.getLibrary().getCards(currentGame)) {
if (card.isCreature()) {
Assert.assertTrue(card.getName() + " should have ORC type", card.hasSubtype(SubType.ORC, currentGame));
Assert.assertTrue(card.getName() + " should have CAT type", card.hasSubtype(SubType.CAT, currentGame));
}
}
for (Card card : playerB.getLibrary().getCards(currentGame)) {
if (card.isCreature()) {
Assert.assertFalse(card.getName() + " should not have ORC type", card.hasSubtype(SubType.ORC, currentGame));
Assert.assertTrue(card.getName() + " should have CAT type", card.hasSubtype(SubType.CAT, currentGame));
}
}
for (Card card : playerA.getHand().getCards(currentGame)) {
if (card.isCreature()) {
Assert.assertTrue(card.getName() + " should have ORC type", card.hasSubtype(SubType.ORC, currentGame));
}
}
for (Card card : playerB.getHand().getCards(currentGame)) {
if (card.isCreature()) {
Assert.assertFalse(card.getName() + " should not have ORC type", card.hasSubtype(SubType.ORC, currentGame));
}
}
for (Card card : playerA.getGraveyard().getCards(currentGame)) {
if (card.isCreature()) {
Assert.assertTrue(card.getName() + " should have ORC type", card.hasSubtype(SubType.ORC, currentGame));
}
}
for (Card card : playerB.getGraveyard().getCards(currentGame)) {
if (card.isCreature()) {
Assert.assertFalse(card.getName() + " should not have ORC type", card.hasSubtype(SubType.ORC, currentGame));
}
}
}
@Test
public void testMaskwoodNexus2() {
addCard(Zone.HAND, playerA, "Maskwood Nexus", 1);
addCard(Zone.HAND, playerA, "Shatter", 1);
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 6);
addCard(Zone.HAND, playerA, "Silvercoat Lion");
addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion");
addCard(Zone.GRAVEYARD, playerA, "Silvercoat Lion");
addCard(Zone.HAND, playerB, "Silvercoat Lion");
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion");
addCard(Zone.GRAVEYARD, playerB, "Silvercoat Lion");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Maskwood Nexus");
castSpell(1, PhaseStep.BEGIN_COMBAT, playerA, "Shatter", "Maskwood Nexus");
setStopAt(1, PhaseStep.END_TURN);
execute();
assertGraveyardCount(playerA, "Maskwood Nexus", 1);
Permanent silvercoatLion = getPermanent("Silvercoat Lion", playerA);
Assert.assertTrue(silvercoatLion.hasSubtype(SubType.CAT, currentGame));
Assert.assertFalse(silvercoatLion.hasSubtype(SubType.ORC, currentGame));
silvercoatLion = getPermanent("Silvercoat Lion", playerB);
Assert.assertTrue(silvercoatLion.hasSubtype(SubType.CAT, currentGame));
Assert.assertFalse(silvercoatLion.hasSubtype(SubType.ORC, currentGame));
for (Card card : playerA.getLibrary().getCards(currentGame)) {
if (card.isCreature()) {
Assert.assertFalse(card.getName() + " should not have ORC type", card.hasSubtype(SubType.ORC, currentGame));
Assert.assertTrue(card.getName() + " should have CAT type", card.hasSubtype(SubType.CAT, currentGame));
}
}
for (Card card : playerB.getLibrary().getCards(currentGame)) {
if (card.isCreature()) {
Assert.assertFalse(card.getName() + " should not have ORC type", card.hasSubtype(SubType.ORC, currentGame));
Assert.assertTrue(card.getName() + " should have CAT type", card.hasSubtype(SubType.CAT, currentGame));
}
}
for (Card card : playerA.getHand().getCards(currentGame)) {
if (card.isCreature()) {
Assert.assertFalse(card.getName() + " should not have ORC type", card.hasSubtype(SubType.ORC, currentGame));
}
}
for (Card card : playerB.getHand().getCards(currentGame)) {
if (card.isCreature()) {
Assert.assertFalse(card.getName() + " should not have ORC type", card.hasSubtype(SubType.ORC, currentGame));
}
}
for (Card card : playerA.getGraveyard().getCards(currentGame)) {
if (card.isCreature()) {
Assert.assertFalse(card.getName() + " should not have ORC type", card.hasSubtype(SubType.ORC, currentGame));
}
}
for (Card card : playerB.getGraveyard().getCards(currentGame)) {
if (card.isCreature()) {
Assert.assertFalse(card.getName() + " should not have ORC type", card.hasSubtype(SubType.ORC, currentGame));
}
}
}
}

View file

@ -45,7 +45,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(SubType.GRIFFIN));
Assert.assertTrue(lazav.hasSubtype(SubType.GRIFFIN, currentGame));
Assert.assertTrue("Lazav, Dimir Mastermind must have flying", lazav.getAbilities().contains(FlyingAbility.getInstance()));
}
@ -71,8 +71,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(SubType.OGRE));
Assert.assertTrue(lazav.getSubtype(currentGame).contains(SubType.ROGUE));
Assert.assertTrue(lazav.hasSubtype(SubType.OGRE, currentGame));
Assert.assertTrue(lazav.hasSubtype(SubType.ROGUE, currentGame));
Permanent gutterSkulk = getPermanent("Gutter Skulk", playerA.getId());
Assert.assertTrue("Gutter Skulk should have deathtouch but hasn't", gutterSkulk.getAbilities().contains(DeathtouchAbility.getInstance()));
@ -111,7 +111,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(SubType.SPECTER));
Assert.assertTrue(lazav.hasSubtype(SubType.SPECTER, currentGame));
Assert.assertTrue(lazav.isLegendary());
assertPermanentCount(playerA, "Silvercoat Lion", 1);
@ -141,7 +141,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(SubType.CAT));
Assert.assertTrue(lazav.hasSubtype(SubType.CAT, currentGame));
Assert.assertTrue(lazav.isLegendary());
}
@ -186,7 +186,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(SubType.GRIFFIN)); // no Griffin type
Assert.assertFalse(lazav.hasSubtype(SubType.GRIFFIN, currentGame)); // no Griffin type
Assert.assertFalse("Lazav, Dimir Mastermind must have flying", lazav.getAbilities().contains(FlyingAbility.getInstance()));
@ -222,7 +222,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(SubType.GRIFFIN));
Assert.assertTrue(lazav.hasSubtype(SubType.GRIFFIN, currentGame));
Assert.assertTrue("Lazav, Dimir Mastermind must have flying", lazav.getAbilities().contains(FlyingAbility.getInstance()));
}
}

View file

@ -68,6 +68,7 @@ public class SparkDoubleTest extends CardTestPlayerBase {
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Spark Double");
setChoice(playerA, "Yes");
setChoice(playerA, "Ajani, the Greathearted");
setChoice(playerA, "Ajani, the Greathearted"); // two etb effects (own + copy)
setStrictChooseMode(true);
setStopAt(1, PhaseStep.BEGIN_COMBAT);
@ -119,6 +120,7 @@ public class SparkDoubleTest extends CardTestPlayerBase {
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Spark Double");
setChoice(playerA, "Yes");
setChoice(playerA, "Gideon, Ally of Zendikar");
setChoice(playerA, "Gideon, Ally of Zendikar"); // two etb effects (own + copy)
setStrictChooseMode(true);
setStopAt(1, PhaseStep.END_TURN);

View file

@ -44,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(SubType.GRIFFIN));
Assert.assertTrue(shapeshifter.hasSubtype(SubType.GRIFFIN, currentGame));
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));
}
@ -77,7 +77,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(SubType.SHAPESHIFTER));
Assert.assertTrue(shapeshifter.hasSubtype(SubType.SHAPESHIFTER, currentGame));
Assert.assertTrue("Volrath's Shapeshifter must have {2} : Discard a card", hasShapeshiftersOriginalAbility(shapeshifter));
}
@ -106,7 +106,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(SubType.THRULL));
Assert.assertTrue(shapeshifter.hasSubtype(SubType.THRULL, currentGame));
Assert.assertTrue("Volrath's Shapeshifter must have {2} : Discard a card", hasShapeshiftersOriginalAbility(shapeshifter));
}

View file

@ -249,7 +249,7 @@ public class ModalDoubleFacesCardsTest extends CardTestPlayerBase {
Card card = getHandCards(playerA).get(0);
Assert.assertFalse("must be non land", card.isLand());
Assert.assertTrue("must be creature", card.isCreature());
Assert.assertTrue("must be minotaur", card.getSubtype(currentGame).contains(SubType.MINOTAUR));
Assert.assertTrue("must be minotaur", card.hasSubtype(SubType.MINOTAUR, currentGame));
Assert.assertEquals("power", 4, card.getPower().getValue());
Assert.assertEquals("toughness", 5, card.getToughness().getValue());
}

View file

@ -45,7 +45,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(SubType.SLIVER));
Assert.assertFalse("Sliver Hivelord may not be of subtype Sliver", hivelord.hasSubtype(SubType.SLIVER, currentGame));
}

View file

@ -41,7 +41,7 @@ public class SoulSeparatorTest extends CardTestPlayerBase {
Permanent saToken = getPermanent("Sylvan Advocate", playerA);
Assert.assertTrue(saToken.getAbilities().contains(FlyingAbility.getInstance()));
Assert.assertTrue(saToken.getSubtype(currentGame).contains(SubType.SPIRIT));
Assert.assertTrue(saToken.hasSubtype(SubType.SPIRIT, currentGame));
Assert.assertTrue(saToken.getAbilities().contains(VigilanceAbility.getInstance()));
assertPowerToughness(playerA, "Sylvan Advocate", 1, 1);
}
@ -77,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(SubType.SPIRIT));
Assert.assertTrue(treeToken.hasSubtype(SubType.SPIRIT, currentGame));
Assert.assertTrue(treeToken.getAbilities().contains(DefenderAbility.getInstance()));
assertLife(playerA, 20);

View file

@ -61,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(SubType.MUTANT));
Assert.assertEquals("Fathom Mage has to be a Mutant", true, fathomMage.hasSubtype(SubType.MUTANT, currentGame));
assertHandCount(playerA, 2);
}

View file

@ -1119,7 +1119,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement
Permanent found = getPermanent(cardName);
Assert.assertTrue("(Battlefield) card type not found (" + cardName + ':' + type + ')', found.getCardType().contains(type));
if (subType != null) {
Assert.assertTrue("(Battlefield) card sub-type not equal (" + cardName + ':' + subType.getDescription() + ')', found.getSubtype(currentGame).contains(subType));
Assert.assertTrue("(Battlefield) card sub-type not equal (" + cardName + ':' + subType.getDescription() + ')', found.hasSubtype(subType, currentGame));
}
}