mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
Refactored more subtypes usages to enum
This commit is contained in:
parent
92b999a9b4
commit
3cc178196e
29 changed files with 82 additions and 65 deletions
|
@ -118,7 +118,7 @@ class CultivatorDroneManaCondition extends ManaCondition implements Condition {
|
|||
}
|
||||
}
|
||||
if (costToPay instanceof ManaCost) {
|
||||
return ((ManaCost) costToPay).getText().contains(SubType.{C});
|
||||
return ((ManaCost) costToPay).getText().contains("{C}");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -136,7 +136,7 @@ class GaddockTeegReplacementEffectX extends ContinuousRuleModifyingEffectImpl {
|
|||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
Card card = game.getCard(event.getSourceId());
|
||||
if (card != null && !card.isCreature() && card.getManaCost().getText().contains(SubType.X)) {
|
||||
if (card != null && !card.isCreature() && card.getManaCost().getText().contains("X")) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -158,7 +158,7 @@ class UginPlaneswalkerCardPredicate implements Predicate<Card> {
|
|||
@Override
|
||||
public boolean apply(Card input, Game game) {
|
||||
return input.isPlaneswalker()
|
||||
&& input.getName().contains(SubType.UGIN, THE SPIRIT DRAGON);
|
||||
&& input.getSubtype(game).contains(SubType.UGIN);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -105,7 +105,7 @@ class RiptideShapeshifterEffect extends OneShotEffect {
|
|||
Cards revealedCards = new CardsImpl();
|
||||
while (controller.getLibrary().hasCards()) {
|
||||
Card card = controller.getLibrary().removeFromTop(game);
|
||||
if (card.isCreature() && card.getSubtype(game).contains(choice.getChoice())) {
|
||||
if (card.isCreature() && card.getSubtype(game).contains(SubType.byDescription(choice.getChoice()))) {
|
||||
controller.moveCards(card, Zone.BATTLEFIELD, source, game);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -106,10 +106,10 @@ class RosheenMeandererManaCondition implements Condition {
|
|||
if (AbilityType.SPELL == source.getAbilityType()) {
|
||||
MageObject object = game.getObject(source.getSourceId());
|
||||
return object != null
|
||||
&& object.getManaCost().getText().contains(SubType.X);
|
||||
&& object.getManaCost().getText().contains("X");
|
||||
|
||||
} else {
|
||||
return source.getManaCosts().getText().contains(SubType.X);
|
||||
return source.getManaCosts().getText().contains("X");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -93,7 +93,7 @@ class TallowispAbilityPredicate implements Predicate<MageObject> {
|
|||
for (int i = 0; i < abilities.size(); i++) {
|
||||
if (abilities.get(i) instanceof EnchantAbility) {
|
||||
String enchantText = abilities.get(i).getRule();
|
||||
if (enchantText.startsWith(SubType.ENCHANT) && enchantText.contains(creature)) {
|
||||
if (enchantText.startsWith("Enchant") && enchantText.contains("creature")) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@ package org.mage.test.cards.abilities.keywords;
|
|||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
@ -57,7 +58,7 @@ public class CrewTest extends CardTestPlayerBase {
|
|||
|
||||
assertTappedCount("Silvercoat Lion", true, 2);
|
||||
assertPowerToughness(playerA, "Cultivator's Caravan", 5, 5);
|
||||
assertType("Cultivator's Caravan", CardType.CREATURE, "Vehicle");
|
||||
assertType("Cultivator's Caravan", CardType.CREATURE, SubType.VEHICLE);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -78,7 +79,7 @@ public class CrewTest extends CardTestPlayerBase {
|
|||
assertTappedCount("Speedway Fanatic", true, 1);
|
||||
assertPowerToughness(playerA, "Smuggler's Copter", 3, 3);
|
||||
assertAbility(playerA, "Smuggler's Copter", HasteAbility.getInstance(), true);
|
||||
assertType("Smuggler's Copter", CardType.CREATURE, "Vehicle");
|
||||
assertType("Smuggler's Copter", CardType.CREATURE, SubType.VEHICLE);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -29,6 +29,7 @@ package org.mage.test.cards.continuous;
|
|||
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
@ -57,7 +58,7 @@ public class BecomesCreatureTest extends CardTestPlayerBase {
|
|||
|
||||
assertPermanentCount(playerA, "Chimeric Mass", 1);
|
||||
assertPowerToughness(playerA, "Chimeric Mass", 3, 3);
|
||||
assertType("Chimeric Mass", CardType.CREATURE, "Construct");
|
||||
assertType("Chimeric Mass", CardType.CREATURE, SubType.CONSTRUCT);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@ package org.mage.test.cards.continuous;
|
|||
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.Filter;
|
||||
|
@ -69,7 +70,7 @@ public class DaxosTheReturnedTest extends CardTestPlayerBase {
|
|||
assertPermanentCount(playerA, "Underworld Dreams", 2);
|
||||
assertCounterCount(playerA, CounterType.EXPERIENCE, 2);
|
||||
assertPowerToughness(playerA, "Spirit", 2, 2, Filter.ComparisonScope.All);
|
||||
assertType("Spirit", CardType.ENCHANTMENT, "Spirit");
|
||||
assertType("Spirit", CardType.ENCHANTMENT, SubType.SPIRIT);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ public class LandTypeChangingEffectsTest extends CardTestPlayerBase {
|
|||
|
||||
assertPermanentCount(playerB, "Chromatic Lantern", 1);
|
||||
|
||||
assertType("Canopy Vista", CardType.LAND, "Mountain");
|
||||
assertType("Canopy Vista", CardType.LAND, SubType.MOUNTAIN);
|
||||
assertAbility(playerB, "Canopy Vista", new AnyColorManaAbility(), true);
|
||||
}
|
||||
|
||||
|
@ -99,7 +99,7 @@ public class LandTypeChangingEffectsTest extends CardTestPlayerBase {
|
|||
assertPermanentCount(playerB, "Chromatic Lantern", 1);
|
||||
assertPermanentCount(playerA, "Magus of the Moon", 1);
|
||||
|
||||
assertType("Canopy Vista", CardType.LAND, "Mountain");
|
||||
assertType("Canopy Vista", CardType.LAND, SubType.MOUNTAIN);
|
||||
assertAbility(playerB, "Canopy Vista", new AnyColorManaAbility(), true);
|
||||
}
|
||||
|
||||
|
@ -131,7 +131,7 @@ public class LandTypeChangingEffectsTest extends CardTestPlayerBase {
|
|||
|
||||
assertPermanentCount(playerB, "Forbidding Watchtower", 1);
|
||||
assertCounterCount("Forbidding Watchtower", CounterType.FLOOD, 1);
|
||||
assertType("Forbidding Watchtower", CardType.LAND, "Island");
|
||||
assertType("Forbidding Watchtower", CardType.LAND, SubType.ISLAND);
|
||||
assertPowerToughness(playerB, "Forbidding Watchtower", 1, 5);
|
||||
}
|
||||
|
||||
|
@ -164,11 +164,11 @@ public class LandTypeChangingEffectsTest extends CardTestPlayerBase {
|
|||
|
||||
assertPermanentCount(playerA, bloodmoon, 1);
|
||||
assertPermanentCount(playerA, urborgtoy, 1);
|
||||
assertType(canopyvista, CardType.LAND, "Mountain");
|
||||
assertNotSubtype(canopyvista, "Island");
|
||||
assertNotSubtype(canopyvista, "Swamp");
|
||||
assertType(urborgtoy, CardType.LAND, "Mountain");
|
||||
assertNotSubtype(urborgtoy, "Swamp");
|
||||
assertType(canopyvista, CardType.LAND, SubType.MOUNTAIN);
|
||||
assertNotSubtype(canopyvista, SubType.ISLAND);
|
||||
assertNotSubtype(canopyvista, SubType.SWAMP);
|
||||
assertType(urborgtoy, CardType.LAND, SubType.MOUNTAIN);
|
||||
assertNotSubtype(urborgtoy, SubType.SWAMP);
|
||||
Assert.assertTrue("The mana the land can produce should be [{R}] but it's " + playerB.getManaAvailable(currentGame).toString(), playerB.getManaAvailable(currentGame).toString().equals("[{R}]"));
|
||||
}
|
||||
|
||||
|
@ -197,11 +197,11 @@ public class LandTypeChangingEffectsTest extends CardTestPlayerBase {
|
|||
|
||||
assertPermanentCount(playerA, bloodmoon, 1);
|
||||
assertPermanentCount(playerA, urborgtoy, 1);
|
||||
assertType(canopyvista, CardType.LAND, "Mountain");
|
||||
assertNotSubtype(canopyvista, "Island");
|
||||
assertNotSubtype(canopyvista, "Swamp");
|
||||
assertType(urborgtoy, CardType.LAND, "Mountain");
|
||||
assertNotSubtype(urborgtoy, "Swamp");
|
||||
assertType(canopyvista, CardType.LAND, SubType.MOUNTAIN);
|
||||
assertNotSubtype(canopyvista, SubType.ISLAND);
|
||||
assertNotSubtype(canopyvista, SubType.SWAMP);
|
||||
assertType(urborgtoy, CardType.LAND, SubType.MOUNTAIN);
|
||||
assertNotSubtype(urborgtoy, SubType.SWAMP);
|
||||
Assert.assertTrue("The mana the land can produce should be [{R}] but it's " + playerB.getManaAvailable(currentGame).toString(), playerB.getManaAvailable(currentGame).toString().equals("[{R}]"));
|
||||
}
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@ package org.mage.test.cards.continuous;
|
|||
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.Filter;
|
||||
import org.junit.Ignore;
|
||||
|
@ -53,10 +54,10 @@ public class LayerTests extends CardTestPlayerBase {
|
|||
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
|
||||
execute();
|
||||
|
||||
assertType("Urborg, Tomb of Yawgmoth", CardType.LAND, "Mountain"); // Urborg is a Mountain now
|
||||
assertType("Urborg, Tomb of Yawgmoth", CardType.LAND, SubType.MOUNTAIN); // Urborg is a Mountain now
|
||||
assertPermanentCount(playerA, "Swamp", 0); // no Swamp subtypes on the battlefield
|
||||
assertPermanentCount(playerA, "Plains", 1); // the Plains is not affected by the Urborg
|
||||
assertType("Plains", CardType.LAND, "Plains");
|
||||
assertType("Plains", CardType.LAND, SubType.PLAINS);
|
||||
|
||||
}
|
||||
|
||||
|
@ -111,7 +112,7 @@ public class LayerTests extends CardTestPlayerBase {
|
|||
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
|
||||
execute();
|
||||
|
||||
assertType("Urborg, Tomb of Yawgmoth", CardType.CREATURE, "Swamp"); // Urborg is a creature
|
||||
assertType("Urborg, Tomb of Yawgmoth", CardType.CREATURE, SubType.SWAMP); // Urborg is a creature
|
||||
assertPowerToughness(playerA, "Urborg, Tomb of Yawgmoth", 0, 1); // Urborg is a 0/1 creature
|
||||
|
||||
}
|
||||
|
|
|
@ -31,6 +31,7 @@ import mage.abilities.keyword.LifelinkAbility;
|
|||
import mage.abilities.keyword.TrampleAbility;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.Filter;
|
||||
import org.junit.Test;
|
||||
|
@ -58,8 +59,8 @@ public class WardenOfTheFirstTreeTest extends CardTestPlayerBase {
|
|||
execute();
|
||||
|
||||
assertPowerToughness(playerA, "Warden of the First Tree", 3, 3, Filter.ComparisonScope.Any);
|
||||
assertType("Warden of the First Tree", CardType.CREATURE, "Human");
|
||||
assertType("Warden of the First Tree", CardType.CREATURE, "Warrior");
|
||||
assertType("Warden of the First Tree", CardType.CREATURE, SubType.HUMAN);
|
||||
assertType("Warden of the First Tree", CardType.CREATURE, SubType.WARRIOR);
|
||||
assertAbility(playerA, "Warden of the First Tree", TrampleAbility.getInstance(), false);
|
||||
assertAbility(playerA, "Warden of the First Tree", LifelinkAbility.getInstance(), false);
|
||||
}
|
||||
|
@ -81,9 +82,9 @@ public class WardenOfTheFirstTreeTest extends CardTestPlayerBase {
|
|||
execute();
|
||||
|
||||
assertPowerToughness(playerA, "Warden of the First Tree", 3, 3, Filter.ComparisonScope.Any);
|
||||
assertType("Warden of the First Tree", CardType.CREATURE, "Human");
|
||||
assertType("Warden of the First Tree", CardType.CREATURE, "Spirit");
|
||||
assertType("Warden of the First Tree", CardType.CREATURE, "Warrior");
|
||||
assertType("Warden of the First Tree", CardType.CREATURE, SubType.HUMAN);
|
||||
assertType("Warden of the First Tree", CardType.CREATURE, SubType.SPIRIT);
|
||||
assertType("Warden of the First Tree", CardType.CREATURE, SubType.WARRIOR);
|
||||
assertAbility(playerA, "Warden of the First Tree", TrampleAbility.getInstance(), true);
|
||||
assertAbility(playerA, "Warden of the First Tree", LifelinkAbility.getInstance(), true);
|
||||
}
|
||||
|
@ -107,9 +108,9 @@ public class WardenOfTheFirstTreeTest extends CardTestPlayerBase {
|
|||
execute();
|
||||
|
||||
assertPowerToughness(playerA, "Warden of the First Tree", 8, 8, Filter.ComparisonScope.Any);
|
||||
assertType("Warden of the First Tree", CardType.CREATURE, "Human");
|
||||
assertType("Warden of the First Tree", CardType.CREATURE, "Spirit");
|
||||
assertType("Warden of the First Tree", CardType.CREATURE, "Warrior");
|
||||
assertType("Warden of the First Tree", CardType.CREATURE, SubType.HUMAN);
|
||||
assertType("Warden of the First Tree", CardType.CREATURE, SubType.SPIRIT);
|
||||
assertType("Warden of the First Tree", CardType.CREATURE, SubType.WARRIOR);
|
||||
assertAbility(playerA, "Warden of the First Tree", TrampleAbility.getInstance(), true);
|
||||
assertAbility(playerA, "Warden of the First Tree", LifelinkAbility.getInstance(), true);
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ package org.mage.test.cards.enchantments;
|
|||
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
@ -79,7 +80,7 @@ public class AnimateArtifactTest extends CardTestPlayerBase {
|
|||
|
||||
assertPermanentCount(playerA, "Juggernaut", 1);
|
||||
assertPermanentCount(playerA, "Animate Artifact", 1);
|
||||
assertType("Juggernaut", CardType.CREATURE, "Juggernaut");
|
||||
assertType("Juggernaut", CardType.CREATURE, SubType.JUGGERNAUT);
|
||||
assertPowerToughness(playerA, "Juggernaut", 5, 3);
|
||||
}
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
package org.mage.test.cards.enchantments;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
@ -95,7 +96,7 @@ public class SpreadingSeasTest extends CardTestPlayerBase {
|
|||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Spreading Seas", "Forest");
|
||||
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
|
||||
execute();
|
||||
assertNotSubtype("Forest", "Forest");
|
||||
assertNotSubtype("Forest", SubType.FOREST);
|
||||
}
|
||||
|
||||
|
||||
|
@ -107,7 +108,7 @@ public class SpreadingSeasTest extends CardTestPlayerBase {
|
|||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Spreading Seas", "Urza's Tower");
|
||||
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
|
||||
execute();
|
||||
assertNotSubtype("Urza's Tower", "Urza's");
|
||||
assertNotSubtype("Urza's Tower", "Tower");
|
||||
assertNotSubtype("Urza's Tower", SubType.URZAS);
|
||||
assertNotSubtype("Urza's Tower", SubType.TOWER);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package org.mage.test.cards.planeswalker;
|
|||
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import org.junit.Test;
|
||||
|
@ -61,8 +62,8 @@ public class LilianaTest extends CardTestPlayerBase {
|
|||
assertPermanentCount(playerA, wShepherd, 1);
|
||||
assertPermanentCount(playerB, yOx, 1);
|
||||
assertCounterCount(playerA, liliannaDM, CounterType.LOYALTY, 2);
|
||||
assertType(wShepherd, CardType.CREATURE, "Zombie"); // should have subtype zombie on top of angel type
|
||||
assertType(wShepherd, CardType.CREATURE, "Angel");
|
||||
assertType(wShepherd, CardType.CREATURE, SubType.ZOMBIE); // should have subtype zombie on top of angel type
|
||||
assertType(wShepherd, CardType.CREATURE, SubType.ANGEL);
|
||||
assertTapped(yOx, true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package org.mage.test.cards.single;
|
|||
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.Filter;
|
||||
import org.junit.Test;
|
||||
|
@ -42,7 +43,7 @@ public class WardenOfTheWallTest extends CardTestPlayerBase {
|
|||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 20);
|
||||
assertPowerToughness(playerA, "Warden of the Wall", 2, 3, Filter.ComparisonScope.All);
|
||||
assertType("Warden of the Wall", CardType.CREATURE, "Gargoyle");
|
||||
assertType("Warden of the Wall", CardType.CREATURE, SubType.GARGOYLE);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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("Spirit"));
|
||||
Assert.assertTrue(saToken.getSubtype(currentGame).contains(SubType.SPIRIT));
|
||||
Assert.assertTrue(saToken.getAbilities().contains(VigilanceAbility.getInstance()));
|
||||
assertPowerToughness(playerA, "Sylvan Advocate", 1, 1);
|
||||
}
|
||||
|
|
|
@ -700,11 +700,11 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement
|
|||
* @param type A type to test for
|
||||
* @param subType a subtype to test for
|
||||
*/
|
||||
public void assertType(String cardName, CardType type, String subType) throws AssertionError {
|
||||
public void assertType(String cardName, CardType type, SubType subType) throws AssertionError {
|
||||
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 + ')', found.getSubtype(currentGame).contains(subType));
|
||||
Assert.assertTrue("(Battlefield) card sub-type not equal (" + cardName + ':' + subType.getDescription() + ')', found.getSubtype(currentGame).contains(subType));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -725,10 +725,10 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement
|
|||
* @param cardName Name of the permanent that should be checked.
|
||||
* @param subType a subtype to test for
|
||||
*/
|
||||
public void assertNotSubtype(String cardName, String subType) throws AssertionError {
|
||||
public void assertNotSubtype(String cardName, SubType subType) throws AssertionError {
|
||||
Permanent found = getPermanent(cardName);
|
||||
if (subType != null) {
|
||||
Assert.assertFalse("(Battlefield) card sub-type equal (" + cardName + ':' + subType + ')', found.getSubtype(currentGame).contains(subType));
|
||||
Assert.assertFalse("(Battlefield) card sub-type equal (" + cardName + ':' + subType.getDescription() + ')', found.getSubtype(currentGame).contains(subType));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@ package mage.abilities.common;
|
|||
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
|
@ -57,7 +58,7 @@ public class AuraAttachedTriggeredAbility extends TriggeredAbilityImpl {
|
|||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (event.getTargetId().equals(this.getSourceId())) {
|
||||
Permanent attachment = game.getPermanent(event.getSourceId());
|
||||
if (attachment != null && attachment.getSubtype(game).contains("Aura")) {
|
||||
if (attachment != null && attachment.getSubtype(game).contains(SubType.AURA)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@ import mage.game.Game;
|
|||
import mage.game.permanent.Permanent;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.SubType;
|
||||
|
||||
/**
|
||||
* Describes condition when creature is equipped with more than one Equipment.
|
||||
|
@ -50,7 +51,7 @@ public enum EquippedMultipleSourceCondition implements Condition {
|
|||
if (permanent != null) {
|
||||
for (UUID uuid : permanent.getAttachments()) {
|
||||
Permanent attached = game.getBattlefield().getPermanent(uuid);
|
||||
if (attached != null && attached.getSubtype(game).contains("Equipment")) {
|
||||
if (attached != null && attached.getSubtype(game).contains(SubType.EQUIPMENT)) {
|
||||
countEquipped++;
|
||||
if (countEquipped >= 2) {
|
||||
return true;
|
||||
|
|
|
@ -33,6 +33,7 @@ import mage.game.Game;
|
|||
import mage.game.permanent.Permanent;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.SubType;
|
||||
|
||||
/**
|
||||
* Describes condition when creature is equipped.
|
||||
|
@ -49,7 +50,7 @@ public enum EquippedSourceCondition implements Condition {
|
|||
if (permanent != null) {
|
||||
for (UUID uuid : permanent.getAttachments()) {
|
||||
Permanent attached = game.getBattlefield().getPermanent(uuid);
|
||||
if (attached != null && attached.getSubtype(game).contains("Equipment")) {
|
||||
if (attached != null && attached.getSubtype(game).contains(SubType.EQUIPMENT)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,6 +32,7 @@ import java.util.UUID;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.constants.SubType;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
|
@ -63,7 +64,7 @@ public class AuraAttachedCount implements DynamicValue {
|
|||
List<UUID> attachments = p.getAttachments();
|
||||
for (UUID attachmentId : attachments) {
|
||||
Permanent attached = game.getPermanent(attachmentId);
|
||||
if (attached != null && attached.getSubtype(game).contains("Aura")) {
|
||||
if (attached != null && attached.getSubtype(game).contains(SubType.AURA)) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
|
@ -62,19 +63,19 @@ public class DomainValue implements DynamicValue {
|
|||
}
|
||||
for (Permanent p : game.getBattlefield().getAllActivePermanents(targetPlayer)) {
|
||||
if (p.isLand()) {
|
||||
if (havePlains == 0 && p.getSubtype(game).contains("Plains")) {
|
||||
if (havePlains == 0 && p.getSubtype(game).contains(SubType.PLAINS)) {
|
||||
havePlains = 1;
|
||||
}
|
||||
if (haveIslands == 0 && p.getSubtype(game).contains("Island")) {
|
||||
if (haveIslands == 0 && p.getSubtype(game).contains(SubType.ISLAND)) {
|
||||
haveIslands = 1;
|
||||
}
|
||||
if (haveMountains == 0 && p.getSubtype(game).contains("Mountain")) {
|
||||
if (haveMountains == 0 && p.getSubtype(game).contains(SubType.MOUNTAIN)) {
|
||||
haveMountains = 1;
|
||||
}
|
||||
if (haveSwamps == 0 && p.getSubtype(game).contains("Swamp")) {
|
||||
if (haveSwamps == 0 && p.getSubtype(game).contains(SubType.SWAMP)) {
|
||||
haveSwamps = 1;
|
||||
}
|
||||
if (haveForests == 0 && p.getSubtype(game).contains("Forest")) {
|
||||
if (haveForests == 0 && p.getSubtype(game).contains(SubType.FOREST)) {
|
||||
haveForests = 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,6 +32,7 @@ import java.util.UUID;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.constants.SubType;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
|
@ -63,7 +64,7 @@ public class EquipmentAttachedCount implements DynamicValue {
|
|||
List<UUID> attachments = permanent.getAttachments();
|
||||
for (UUID attachmentId : attachments) {
|
||||
Permanent attached = game.getPermanent(attachmentId);
|
||||
if (attached != null && attached.getSubtype(game).contains("Equipment")) {
|
||||
if (attached != null && attached.getSubtype(game).contains(SubType.EQUIPMENT)) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ public class BecomesCreatureIfVehicleEffect extends ContinuousEffectImpl {
|
|||
Permanent aura = game.getPermanent(source.getSourceId());
|
||||
if (aura != null && aura.getAttachedTo() != null) {
|
||||
Permanent enchanted = game.getPermanent(aura.getAttachedTo());
|
||||
if (enchanted != null && enchanted.getSubtype(game).contains("Vehicle")) {
|
||||
if (enchanted != null && enchanted.getSubtype(game).contains(SubType.VEHICLE)) {
|
||||
enchanted.addCardType(addedType);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,6 +41,7 @@ import mage.cards.Card;
|
|||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SpellAbilityType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.stack.Spell;
|
||||
|
@ -182,7 +183,7 @@ class SpliceOntoArcaneEffect extends SpliceCardEffectImpl {
|
|||
@Override
|
||||
public boolean applies(Ability abilityToModify, Ability source, Game game) {
|
||||
MageObject object = game.getObject(abilityToModify.getSourceId());
|
||||
if (object != null && object.getSubtype(game).contains("Arcane")) {
|
||||
if (object != null && object.getSubtype(game).contains(SubType.ARCANE)) {
|
||||
return spliceSpellCanBeActivated(source, game);
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
package mage.filter.predicate.permanent;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.predicate.Predicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
@ -20,7 +21,7 @@ public class EquippedPredicate implements Predicate<Permanent> {
|
|||
public boolean apply(Permanent input, Game game) {
|
||||
for (UUID attachmentId : input.getAttachments()) {
|
||||
Permanent attachment = game.getPermanent(attachmentId);
|
||||
if (attachment != null && attachment.getSubtype(game).contains("Equipment")) {
|
||||
if (attachment != null && attachment.getSubtype(game).contains(SubType.EQUIPMENT)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1900,9 +1900,9 @@ public abstract class GameImpl implements Game, Serializable {
|
|||
Permanent attachment = getPermanent(attachmentId);
|
||||
if (attachment != null
|
||||
&& (attachment.isCreature()
|
||||
|| !(attachment.getSubtype(this).contains("Aura")
|
||||
|| attachment.getSubtype(this).contains("Equipment")
|
||||
|| attachment.getSubtype(this).contains("Fortification")))) {
|
||||
|| !(attachment.getSubtype(this).contains(SubType.AURA)
|
||||
|| attachment.getSubtype(this).contains(SubType.EQUIPMENT)
|
||||
|| attachment.getSubtype(this).contains(SubType.FORTIFICATION)))) {
|
||||
if (perm.removeAttachment(attachment.getId(), this)) {
|
||||
somethingHappened = true;
|
||||
break;
|
||||
|
|
|
@ -245,7 +245,7 @@ public class Spell extends StackObjImpl implements Card {
|
|||
}
|
||||
counter(null, game);
|
||||
return false;
|
||||
} else if (this.isEnchantment() && this.getSubtype(game).contains("Aura")) {
|
||||
} else if (this.isEnchantment() && this.getSubtype(game).contains(SubType.AURA)) {
|
||||
if (ability.getTargets().stillLegal(ability, game)) {
|
||||
updateOptionalCosts(0);
|
||||
boolean bestow = ability instanceof BestowAbility;
|
||||
|
|
Loading…
Reference in a new issue