diff --git a/src/main/java/forge/AllZone.java b/src/main/java/forge/AllZone.java index 3a371e58ee5..2cc5b2921db 100644 --- a/src/main/java/forge/AllZone.java +++ b/src/main/java/forge/AllZone.java @@ -61,10 +61,8 @@ public final class AllZone implements NewConstants { /** * Match State for challenges are stored in a QuestMatchState class instance. - * - * @deprecated Variable 'matchState' must be private and have accessor methods. */ - public static QuestMatchState matchState = new QuestMatchState(); + private static QuestMatchState matchState = new QuestMatchState(); //initialized at Runtime since it has to be the last object constructed @@ -424,7 +422,7 @@ public final class AllZone implements NewConstants { * @param c a {@link forge.Card} object. * @return a {@link forge.PlayerZone} object. */ - public static PlayerZone getZone(final Card c) { + public static PlayerZone getZoneOf(final Card c) { final FGameState gameState = Singletons.getModel().getGameState(); if (gameState == null) { return null; } diff --git a/src/main/java/forge/AllZoneUtil.java b/src/main/java/forge/AllZoneUtil.java index de90eece16d..3d4998d8fd3 100644 --- a/src/main/java/forge/AllZoneUtil.java +++ b/src/main/java/forge/AllZoneUtil.java @@ -282,7 +282,7 @@ public final class AllZoneUtil { * @return a {@link forge.Card} object. */ public static Card getCardState(final Card card) { - PlayerZone zone = AllZone.getZone(card); + PlayerZone zone = AllZone.getZoneOf(card); //for tokens if (zone == null) { return null; diff --git a/src/main/java/forge/CombatUtil.java b/src/main/java/forge/CombatUtil.java index 52164d0ac31..5f37fedbcc5 100644 --- a/src/main/java/forge/CombatUtil.java +++ b/src/main/java/forge/CombatUtil.java @@ -2090,7 +2090,7 @@ public class CombatUtil { Enchantment = CardFactoryUtil.AI_getBestEnchantment(enchantments, attacker, false); } if (Enchantment != null && AllZoneUtil.isCardInPlay(attacker)) { - GameAction.changeZone(AllZone.getZone(Enchantment), + GameAction.changeZone(AllZone.getZoneOf(Enchantment), Enchantment.getOwner().getZone(Constant.Zone.Battlefield), Enchantment); Enchantment.enchantEntity(attacker); } diff --git a/src/main/java/forge/DefaultPlayerZone.java b/src/main/java/forge/DefaultPlayerZone.java index ff106c1a52b..7e630cc4335 100644 --- a/src/main/java/forge/DefaultPlayerZone.java +++ b/src/main/java/forge/DefaultPlayerZone.java @@ -48,8 +48,8 @@ public class DefaultPlayerZone extends PlayerZone implements java.io.Serializabl //Immutable cards are usually emblems,effects and the mana pool and we don't want to log those. if (!c.isImmutable()) { cardsAddedThisTurn.add(c); - if (AllZone.getZone(c) != null) { - cardsAddedThisTurnSource.add(AllZone.getZone(c).getZoneType()); + if (AllZone.getZoneOf(c) != null) { + cardsAddedThisTurnSource.add(AllZone.getZoneOf(c).getZoneType()); } else { cardsAddedThisTurnSource.add(null); } @@ -119,8 +119,8 @@ public class DefaultPlayerZone extends PlayerZone implements java.io.Serializabl //Immutable cards are usually emblems,effects and the mana pool and we don't want to log those. if (!c.isImmutable()) { cardsAddedThisTurn.add(c); - if (AllZone.getZone(c) != null) { - cardsAddedThisTurnSource.add(AllZone.getZone(c).getZoneType()); + if (AllZone.getZoneOf(c) != null) { + cardsAddedThisTurnSource.add(AllZone.getZoneOf(c).getZoneType()); } else { cardsAddedThisTurnSource.add(null); } @@ -150,8 +150,8 @@ public class DefaultPlayerZone extends PlayerZone implements java.io.Serializabl //Immutable cards are usually emblems,effects and the mana pool and we don't want to log those. if (!c.isImmutable()) { cardsAddedThisTurn.add(c); - if (AllZone.getZone(c) != null) { - cardsAddedThisTurnSource.add(AllZone.getZone(c).getZoneType()); + if (AllZone.getZoneOf(c) != null) { + cardsAddedThisTurnSource.add(AllZone.getZoneOf(c).getZoneType()); } else { cardsAddedThisTurnSource.add(null); } diff --git a/src/main/java/forge/GameAction.java b/src/main/java/forge/GameAction.java index de76d21591e..a7b3767adc4 100644 --- a/src/main/java/forge/GameAction.java +++ b/src/main/java/forge/GameAction.java @@ -174,7 +174,7 @@ public class GameAction { public final Card moveTo(final PlayerZone zone, Card c) { // Ideally move to should never be called without a prevZone // Remove card from Current Zone, if it has one - PlayerZone prev = AllZone.getZone(c); + PlayerZone prev = AllZone.getZoneOf(c); //String prevName = prev != null ? prev.getZoneName() : ""; if (c.hasKeyword("If CARDNAME would leave the battlefield, exile it instead of putting it anywhere else.") @@ -251,7 +251,7 @@ public class GameAction { */ public final void controllerChangeZoneCorrection(final Card c) { System.out.println("Correcting zone for " + c.toString()); - PlayerZone oldBattlefield = AllZone.getZone(c); + PlayerZone oldBattlefield = AllZone.getZoneOf(c); PlayerZone newBattlefield = c.getController().getZone(oldBattlefield.getZoneType()); if (oldBattlefield == null || newBattlefield == null) { @@ -292,7 +292,7 @@ public class GameAction { * @return a {@link forge.Card} object. */ public final Card moveToGraveyard(Card c) { - final PlayerZone origZone = AllZone.getZone(c); + final PlayerZone origZone = AllZone.getZoneOf(c); final PlayerZone grave = c.getOwner().getZone(Constant.Zone.Graveyard); if (AllZoneUtil.isCardInPlay("Leyline of the Void", c.getOwner().getOpponent())) { @@ -444,7 +444,7 @@ public class GameAction { * @return a {@link forge.Card} object. */ public final Card moveToLibrary(Card c, int libPosition) { - PlayerZone p = AllZone.getZone(c); + PlayerZone p = AllZone.getZoneOf(c); PlayerZone library = c.getOwner().getZone(Constant.Zone.Library); if (c.hasKeyword("If CARDNAME would leave the battlefield, exile it instead of putting it anywhere else.")) { @@ -1009,7 +1009,7 @@ public class GameAction { @Override public void resolve() { - if (AllZone.getZone(persistCard).is(Constant.Zone.Graveyard)) { + if (AllZone.getZoneOf(persistCard).is(Constant.Zone.Graveyard)) { PlayerZone ownerPlay = persistCard.getOwner().getZone(Constant.Zone.Battlefield); Card card = moveTo(ownerPlay, persistCard); card.addCounter(Counters.M1M1, 1); @@ -1557,7 +1557,7 @@ public class GameAction { Player human = AllZone.getHumanPlayer(); if (c.isLand() && human.canPlayLand()) { - PlayerZone zone = AllZone.getZone(c); + PlayerZone zone = AllZone.getZoneOf(c); if (zone.is(Constant.Zone.Hand) || (!zone.is(Constant.Zone.Battlefield)) && c.hasKeyword("May be played")) diff --git a/src/main/java/forge/GameActionUtil.java b/src/main/java/forge/GameActionUtil.java index bfca7864160..9b3b7e73238 100644 --- a/src/main/java/forge/GameActionUtil.java +++ b/src/main/java/forge/GameActionUtil.java @@ -2366,7 +2366,7 @@ public final class GameActionUtil { for (int i = 0; i < all.size(); i++) { Card c = all.get(i); if (c.getName().equals(cardName) && !c.isFaceDown()) { - zone.add(AllZone.getZone(c)); + zone.add(AllZone.getZoneOf(c)); } } diff --git a/src/main/java/forge/MagicStack.java b/src/main/java/forge/MagicStack.java index 533c0f24ed6..e1efeedde51 100644 --- a/src/main/java/forge/MagicStack.java +++ b/src/main/java/forge/MagicStack.java @@ -135,7 +135,7 @@ public class MagicStack extends MyObservable { // if the ability is a spell, but not a copied spell and its not already on the stack zone, move there if (ability.isSpell()) { Card source = ability.getSourceCard(); - if (!source.isCopiedSpell() && !AllZone.getZone(source).is(Constant.Zone.Stack)) { + if (!source.isCopiedSpell() && !AllZone.getZoneOf(source).is(Constant.Zone.Stack)) { AllZone.getGameAction().moveToStack(source); } } @@ -859,7 +859,7 @@ public class MagicStack extends MyObservable { // If Spell and still on the Stack then let it goto the graveyard or replace its own movement else if (!source.isCopiedSpell() && (source.isInstant() || source.isSorcery() || fizzle) - && AllZone.getZone(source).is(Constant.Zone.Stack)) + && AllZone.getZoneOf(source).is(Constant.Zone.Stack)) { if (source.getReplaceMoveToGraveyard().size() == 0) { AllZone.getGameAction().moveToGraveyard(source); diff --git a/src/main/java/forge/Upkeep.java b/src/main/java/forge/Upkeep.java index e4bc9e1e0ba..dfd421b8428 100644 --- a/src/main/java/forge/Upkeep.java +++ b/src/main/java/forge/Upkeep.java @@ -801,7 +801,7 @@ public class Upkeep implements java.io.Serializable { private static final long serialVersionUID = 4820011440853920644L; public void resolve() { - if (AllZone.getZone(c).is(Constant.Zone.Battlefield)) { + if (AllZone.getZoneOf(c).is(Constant.Zone.Battlefield)) { StringBuilder cost = new StringBuilder(); cost.append("Pay cost for ").append(c).append("\r\n"); GameActionUtil.payManaDuringAbilityResolve(cost.toString(), noPay.getManaCost(), Command.Blank, Command.Blank); @@ -2599,7 +2599,7 @@ public class Upkeep implements java.io.Serializable { c.setCloneOrigin(null); //5 - PlayerZone play = AllZone.getZone(c); + PlayerZone play = AllZone.getZoneOf(c); play.remove(c); play.add(newCopy); diff --git a/src/main/java/forge/card/abilityFactory/AbilityFactory_ChangeZone.java b/src/main/java/forge/card/abilityFactory/AbilityFactory_ChangeZone.java index 71214197185..10cbd21f84f 100644 --- a/src/main/java/forge/card/abilityFactory/AbilityFactory_ChangeZone.java +++ b/src/main/java/forge/card/abilityFactory/AbilityFactory_ChangeZone.java @@ -1496,7 +1496,7 @@ public final class AbilityFactory_ChangeZone { if (tgtCards.size() != 0) { for (Card tgtC : tgtCards) { - PlayerZone originZone = AllZone.getZone(tgtC); + PlayerZone originZone = AllZone.getZoneOf(tgtC); // if Target isn't in the expected Zone, continue if (originZone == null || !originZone.is(origin)) { continue; diff --git a/src/main/java/forge/card/abilityFactory/AbilityFactory_Counters.java b/src/main/java/forge/card/abilityFactory/AbilityFactory_Counters.java index 971f5b2f615..35158c2e15d 100644 --- a/src/main/java/forge/card/abilityFactory/AbilityFactory_Counters.java +++ b/src/main/java/forge/card/abilityFactory/AbilityFactory_Counters.java @@ -223,7 +223,7 @@ public class AbilityFactory_Counters { return false; } } else { // "put counter on this" - PlayerZone pZone = AllZone.getZone(source); + PlayerZone pZone = AllZone.getZoneOf(source); // Don't activate Curse abilities on my cards and non-curse abilites on my opponents if (!pZone.getPlayer().equals(player)) { return false; @@ -590,7 +590,7 @@ public class AbilityFactory_Counters { for (Card tgtCard : tgtCards) { if (tgt == null || CardFactoryUtil.canTarget(card, tgtCard)) { - if (AllZone.getZone(tgtCard).is(Constant.Zone.Battlefield)) { + if (AllZone.getZoneOf(tgtCard).is(Constant.Zone.Battlefield)) { tgtCard.addCounter(Counters.valueOf(type), counterAmount); } else { @@ -918,7 +918,7 @@ public class AbilityFactory_Counters { for (Card tgtCard : tgtCards) { if (tgt == null || CardFactoryUtil.canTarget(card, tgtCard)) { - PlayerZone zone = AllZone.getZone(tgtCard); + PlayerZone zone = AllZone.getZoneOf(tgtCard); if (zone.is(Constant.Zone.Battlefield) || zone.is(Constant.Zone.Exile)) { if (params.containsKey("UpTo") && sa.getActivatingPlayer().isHuman()) { @@ -1533,7 +1533,7 @@ public class AbilityFactory_Counters { } for (Card tgtCard : cards) { - if (AllZone.getZone(tgtCard).is(Constant.Zone.Battlefield)) { + if (AllZone.getZoneOf(tgtCard).is(Constant.Zone.Battlefield)) { tgtCard.addCounter(Counters.valueOf(type), counterAmount); } else { diff --git a/src/main/java/forge/card/abilityFactory/AbilityFactory_Sacrifice.java b/src/main/java/forge/card/abilityFactory/AbilityFactory_Sacrifice.java index eb377b34b05..13c88978e5e 100644 --- a/src/main/java/forge/card/abilityFactory/AbilityFactory_Sacrifice.java +++ b/src/main/java/forge/card/abilityFactory/AbilityFactory_Sacrifice.java @@ -352,13 +352,13 @@ public class AbilityFactory_Sacrifice { msg = "Sacrifice a " + msg; if (valid.equals("Self")) { - if (AllZone.getZone(sa.getSourceCard()).is(Constant.Zone.Battlefield)) + if (AllZone.getZoneOf(sa.getSourceCard()).is(Constant.Zone.Battlefield)) AllZone.getGameAction().sacrifice(sa.getSourceCard()); } //TODO - maybe this can be done smarter... else if (valid.equals("Card.AttachedBy")) { Card toSac = sa.getSourceCard().getEnchantingCard(); - if (AllZone.getZone(sa.getSourceCard()).is(Constant.Zone.Battlefield) && AllZoneUtil.isCardInPlay(toSac)) { + if (AllZone.getZoneOf(sa.getSourceCard()).is(Constant.Zone.Battlefield) && AllZoneUtil.isCardInPlay(toSac)) { AllZone.getGameAction().sacrifice(toSac); } } else if (valid.equals("TriggeredCard")) { diff --git a/src/main/java/forge/card/cardFactory/AbstractCardFactory.java b/src/main/java/forge/card/cardFactory/AbstractCardFactory.java index cfae45f3afd..b019584e4ec 100644 --- a/src/main/java/forge/card/cardFactory/AbstractCardFactory.java +++ b/src/main/java/forge/card/cardFactory/AbstractCardFactory.java @@ -807,7 +807,7 @@ public abstract class AbstractCardFactory implements NewConstants, CardFactoryIn @Override public boolean canPlay() { - return (AllZone.getZone(card).is(Constant.Zone.Battlefield)); + return (AllZone.getZoneOf(card).is(Constant.Zone.Battlefield)); } //canPlay() }; //SpellAbility ability1 @@ -1808,7 +1808,7 @@ public abstract class AbstractCardFactory implements NewConstants, CardFactoryIn AllZone.getTriggerHandler().removeAllFromCard(cloned[0]); Card orig = cfact.getCard(card.getName(), card.getController()); - PlayerZone dest = AllZone.getZone(card.getCurrentlyCloningCard()); + PlayerZone dest = AllZone.getZoneOf(card.getCurrentlyCloningCard()); AllZone.getGameAction().moveTo(dest, orig); dest.remove(card.getCurrentlyCloningCard()); diff --git a/src/main/java/forge/card/cardFactory/CardFactoryUtil.java b/src/main/java/forge/card/cardFactory/CardFactoryUtil.java index f792f1a3fd9..56b31bcbe34 100644 --- a/src/main/java/forge/card/cardFactory/CardFactoryUtil.java +++ b/src/main/java/forge/card/cardFactory/CardFactoryUtil.java @@ -1384,7 +1384,7 @@ public class CardFactoryUtil { // An animated artifact equipmemt can't equip a creature @Override public boolean canPlay() { - return AllZone.getZone(sourceCard).is(Constant.Zone.Battlefield) && !sourceCard.isCreature() + return AllZone.getZoneOf(sourceCard).is(Constant.Zone.Battlefield) && !sourceCard.isCreature() && Phase.canCastSorcery(sourceCard.getController()); } @@ -2315,7 +2315,7 @@ public class CardFactoryUtil { */ public static boolean isTargetStillValid(final SpellAbility ability, final Card target) { - if (AllZone.getZone(target) == null) { + if (AllZone.getZoneOf(target) == null) { return false; // for tokens that disappeared } @@ -2332,13 +2332,13 @@ public class CardFactoryUtil { // Check if the target is in the zone it needs to be in to be // targeted - if (!AllZone.getZone(target).is(tgt.getZone())) { + if (!AllZone.getZoneOf(target).is(tgt.getZone())) { return false; } } else { // If an Aura's target is removed before it resolves, the Aura // fizzles - if (source.isAura() && !AllZone.getZone(target).is(Constant.Zone.Battlefield)) { + if (source.isAura() && !AllZone.getZoneOf(target).is(Constant.Zone.Battlefield)) { return false; } } @@ -2395,7 +2395,7 @@ public class CardFactoryUtil { return false; } - PlayerZone zone = AllZone.getZone(target); + PlayerZone zone = AllZone.getZoneOf(target); // if zone is null, it means its on the stack if (zone == null || !zone.is(Constant.Zone.Battlefield)) { // targets not in play, can normally be targeted @@ -2648,7 +2648,7 @@ public class CardFactoryUtil { * @return a boolean. */ public static boolean activateFromExternalZones(final Card c, final Player player) { - PlayerZone zone = AllZone.getZone(c); + PlayerZone zone = AllZone.getZoneOf(c); if (zone.is(Constant.Zone.Graveyard)) { if (c.hasFlashback() || c.hasUnearth()) { return true; @@ -2661,7 +2661,7 @@ public class CardFactoryUtil { } for (SpellAbility sa : c.getSpellAbility()) { - if (AllZone.getZone(c).is(sa.getRestrictions().getZone())) { + if (AllZone.getZoneOf(c).is(sa.getRestrictions().getZone())) { return true; } diff --git a/src/main/java/forge/card/cardFactory/CardFactory_Auras.java b/src/main/java/forge/card/cardFactory/CardFactory_Auras.java index 9b2a55ec397..f73d41e3682 100644 --- a/src/main/java/forge/card/cardFactory/CardFactory_Auras.java +++ b/src/main/java/forge/card/cardFactory/CardFactory_Auras.java @@ -507,7 +507,7 @@ class CardFactory_Auras { } Card animated = targetC[0]; - PlayerZone grave = AllZone.getZone(animated); + PlayerZone grave = AllZone.getZoneOf(animated); if (!grave.is(Constant.Zone.Graveyard)) { // Animated Creature got removed before ability resolved diff --git a/src/main/java/forge/card/cardFactory/CardFactory_Creatures.java b/src/main/java/forge/card/cardFactory/CardFactory_Creatures.java index b7d0c89f4a1..e8b1606e961 100644 --- a/src/main/java/forge/card/cardFactory/CardFactory_Creatures.java +++ b/src/main/java/forge/card/cardFactory/CardFactory_Creatures.java @@ -357,7 +357,7 @@ public class CardFactory_Creatures { @Override public boolean canPlayAI() { int reqHand = 1; - if (AllZone.getZone(card).is(Constant.Zone.Hand)) + if (AllZone.getZoneOf(card).is(Constant.Zone.Hand)) reqHand++; // Don't play if it would sacrifice as soon as it comes into play @@ -509,7 +509,7 @@ public class CardFactory_Creatures { @Override public boolean canPlayAI() { Object o = getArt.execute(); - return (o != null) && AllZone.getZone(getSourceCard()).is(Constant.Zone.Hand); + return (o != null) && AllZone.getZoneOf(getSourceCard()).is(Constant.Zone.Hand); } }); card.addComesIntoPlayCommand(intoPlay); @@ -811,7 +811,7 @@ public class CardFactory_Creatures { AllZone.getStack().addSimultaneousStackEntry(new Ability(card, "0", "Adarkar Valkyrie - Return " + target[0] + " from graveyard to the battlefield") { @Override public void resolve() { - PlayerZone grave = AllZone.getZone(target[0]); + PlayerZone grave = AllZone.getZoneOf(target[0]); //checks to see if card is still in the graveyard if (grave != null && AllZoneUtil.isCardInZone(grave, target[0])) { @@ -2779,7 +2779,7 @@ public class CardFactory_Creatures { AllZone.getTriggerHandler().removeAllFromCard(cloned[0]); Card orig = cfact.getCard(card.getName(), card.getController()); - PlayerZone dest = AllZone.getZone(card.getCurrentlyCloningCard()); + PlayerZone dest = AllZone.getZoneOf(card.getCurrentlyCloningCard()); AllZone.getGameAction().moveTo(dest, orig); dest.remove(card.getCurrentlyCloningCard()); @@ -3064,7 +3064,7 @@ public class CardFactory_Creatures { final SpellAbility awaken = new Ability(card, "0") { @Override public void resolve() { - if (!AllZone.getZone(card).is(Zone.Battlefield) || getTarget().getTargetCards().size() == 0) + if (!AllZone.getZoneOf(card).is(Zone.Battlefield) || getTarget().getTargetCards().size() == 0) return; final Card c = getTarget().getTargetCards().get(0); String[] types = {"Creature", "Treefolk"}; diff --git a/src/main/java/forge/card/cardFactory/CardFactory_Equipment.java b/src/main/java/forge/card/cardFactory/CardFactory_Equipment.java index f3f66be397d..3a5fa6a8c6e 100644 --- a/src/main/java/forge/card/cardFactory/CardFactory_Equipment.java +++ b/src/main/java/forge/card/cardFactory/CardFactory_Equipment.java @@ -185,7 +185,7 @@ class CardFactory_Equipment { //not changed @Override public boolean canPlay() { - return AllZone.getZone(card).is(Constant.Zone.Battlefield) + return AllZone.getZoneOf(card).is(Constant.Zone.Battlefield) && Phase.canCastSorcery(card.getController()) && super.canPlay(); } diff --git a/src/main/java/forge/card/cardFactory/CardFactory_Planeswalkers.java b/src/main/java/forge/card/cardFactory/CardFactory_Planeswalkers.java index 0b1f7c4aaa8..b4d70ea8f48 100644 --- a/src/main/java/forge/card/cardFactory/CardFactory_Planeswalkers.java +++ b/src/main/java/forge/card/cardFactory/CardFactory_Planeswalkers.java @@ -78,7 +78,7 @@ public class CardFactory_Planeswalkers { public boolean canPlay() { return 0 < card.getCounters(Counters.LOYALTY) - && AllZone.getZone(card).is(Constant.Zone.Battlefield) + && AllZone.getZoneOf(card).is(Constant.Zone.Battlefield) && turn[0] != AllZone.getPhase().getTurn() && Phase.canCastSorcery(card.getController()); @@ -119,7 +119,7 @@ public class CardFactory_Planeswalkers { @Override public boolean canPlay() { return 8 <= card.getCounters(Counters.LOYALTY) - && AllZone.getZone(card).is(Constant.Zone.Battlefield) + && AllZone.getZoneOf(card).is(Constant.Zone.Battlefield) && turn[0] != AllZone.getPhase().getTurn() && Phase.canCastSorcery(card.getController()); }//canPlay() @@ -162,7 +162,7 @@ public class CardFactory_Planeswalkers { @Override public boolean canPlay() { return 0 < card.getCounters(Counters.LOYALTY) - && AllZone.getZone(card).is(Constant.Zone.Battlefield) + && AllZone.getZoneOf(card).is(Constant.Zone.Battlefield) && turn[0] != AllZone.getPhase().getTurn() && Phase.canCastSorcery(card.getController()); }//canPlay() @@ -237,7 +237,7 @@ public class CardFactory_Planeswalkers { public boolean canPlay() { return 0 < card.getCounters(Counters.LOYALTY) - && AllZone.getZone(card).is(Constant.Zone.Battlefield) + && AllZone.getZoneOf(card).is(Constant.Zone.Battlefield) && turn[0] != AllZone.getPhase().getTurn() && Phase.canCastSorcery(card.getController()); @@ -276,7 +276,7 @@ public class CardFactory_Planeswalkers { @Override public boolean canPlay() { return 6 <= card.getCounters(Counters.LOYALTY) - && AllZone.getZone(card).is(Constant.Zone.Battlefield) + && AllZone.getZoneOf(card).is(Constant.Zone.Battlefield) && turn[0] != AllZone.getPhase().getTurn() && Phase.canCastSorcery(card.getController()); }//canPlay() @@ -327,7 +327,7 @@ public class CardFactory_Planeswalkers { @Override public boolean canPlay() { return 0 < card.getCounters(Counters.LOYALTY) - && AllZone.getZone(card).is(Constant.Zone.Battlefield) + && AllZone.getZoneOf(card).is(Constant.Zone.Battlefield) && turn[0] != AllZone.getPhase().getTurn() && Phase.canCastSorcery(card.getController()); }//canPlay() @@ -402,7 +402,7 @@ public class CardFactory_Planeswalkers { if (AllZone.getStack().peekInstance(i).getSourceCard().equals(card)) return false; } - return AllZone.getZone(card).is(Constant.Zone.Battlefield) + return AllZone.getZoneOf(card).is(Constant.Zone.Battlefield) && turn[0] != AllZone.getPhase().getTurn() && Phase.canCastSorcery(card.getController()); } @@ -473,7 +473,7 @@ public class CardFactory_Planeswalkers { if (AllZone.getStack().peekInstance(i).getSourceCard().equals(card)) return false; } - return AllZone.getZone(card).is(Constant.Zone.Battlefield) + return AllZone.getZoneOf(card).is(Constant.Zone.Battlefield) && turn[0] != AllZone.getPhase().getTurn() && Phase.canCastSorcery(card.getController()); } @@ -554,7 +554,7 @@ public class CardFactory_Planeswalkers { if (AllZone.getStack().peekInstance(i).getSourceCard().equals(card)) return false; } - return AllZone.getZone(card).is(Constant.Zone.Battlefield) + return AllZone.getZoneOf(card).is(Constant.Zone.Battlefield) && turn[0] != AllZone.getPhase().getTurn() && 7 < card.getCounters(Counters.LOYALTY) && Phase.canCastSorcery(card.getController()); @@ -687,7 +687,7 @@ public class CardFactory_Planeswalkers { @Override public boolean canPlay() { - return AllZone.getZone(card).is(Constant.Zone.Battlefield) + return AllZone.getZoneOf(card).is(Constant.Zone.Battlefield) && turn[0] != AllZone.getPhase().getTurn() && Phase.canCastSorcery(card.getController()); }//canPlay() @@ -777,7 +777,7 @@ public class CardFactory_Planeswalkers { if (AllZone.getStack().peekInstance(i).getSourceCard().equals(card)) return false; } - return AllZone.getZone(card).is(Constant.Zone.Battlefield) + return AllZone.getZoneOf(card).is(Constant.Zone.Battlefield) && turn[0] != AllZone.getPhase().getTurn() && Phase.canCastSorcery(card.getController()); } @@ -868,7 +868,7 @@ public class CardFactory_Planeswalkers { @Override public boolean canPlay() { - return AllZone.getZone(card).is(Constant.Zone.Battlefield) + return AllZone.getZoneOf(card).is(Constant.Zone.Battlefield) && turn[0] != AllZone.getPhase().getTurn() && card.getCounters(Counters.LOYALTY) >= 5 && Phase.canCastSorcery(card.getController()); @@ -952,7 +952,7 @@ public class CardFactory_Planeswalkers { @Override public boolean canPlay() { - return AllZone.getZone(card).is(Constant.Zone.Battlefield) + return AllZone.getZoneOf(card).is(Constant.Zone.Battlefield) && turn[0] != AllZone.getPhase().getTurn() && Phase.canCastSorcery(card.getController()); }//canPlay() @@ -1008,7 +1008,7 @@ public class CardFactory_Planeswalkers { @Override public boolean canPlay() { - return AllZone.getZone(card).is(Constant.Zone.Battlefield) + return AllZone.getZoneOf(card).is(Constant.Zone.Battlefield) && turn[0] != AllZone.getPhase().getTurn() && Phase.canCastSorcery(card.getController()); }//canPlay() @@ -1044,7 +1044,7 @@ public class CardFactory_Planeswalkers { @Override public boolean canPlay() { return card.getCounters(Counters.LOYALTY) >= 1 - && AllZone.getZone(card).is(Constant.Zone.Battlefield) + && AllZone.getZoneOf(card).is(Constant.Zone.Battlefield) && turn[0] != AllZone.getPhase().getTurn() && Phase.canCastSorcery(card.getController()); } @@ -1089,7 +1089,7 @@ public class CardFactory_Planeswalkers { @Override public boolean canPlay() { return card.getCounters(Counters.LOYALTY) >= 12 - && AllZone.getZone(card).is(Constant.Zone.Battlefield) + && AllZone.getZoneOf(card).is(Constant.Zone.Battlefield) && turn[0] != AllZone.getPhase().getTurn() && Phase.canCastSorcery(card.getController()); } @@ -1154,7 +1154,7 @@ public class CardFactory_Planeswalkers { public boolean canPlay() { //looks like standard Planeswalker stuff... //maybe should check if library is empty, or 1 card? - return AllZone.getZone(card).is(Constant.Zone.Battlefield) + return AllZone.getZoneOf(card).is(Constant.Zone.Battlefield) && turn[0] != AllZone.getPhase().getTurn() && Phase.canCastSorcery(card.getController()); }//canPlay() @@ -1213,7 +1213,7 @@ public class CardFactory_Planeswalkers { @Override public boolean canPlay() { - return AllZone.getZone(card).is(Constant.Zone.Battlefield) + return AllZone.getZoneOf(card).is(Constant.Zone.Battlefield) && card.getCounters(Counters.LOYALTY) >= 2 && turn[0] != AllZone.getPhase().getTurn() && Phase.canCastSorcery(card.getController()); @@ -1256,7 +1256,7 @@ public class CardFactory_Planeswalkers { @Override public boolean canPlay() { - return AllZone.getZone(card).is(Constant.Zone.Battlefield) + return AllZone.getZoneOf(card).is(Constant.Zone.Battlefield) && card.getCounters(Counters.LOYALTY) >= 4 && turn[0] != AllZone.getPhase().getTurn() && Phase.canCastSorcery(card.getController()); @@ -1315,7 +1315,7 @@ public class CardFactory_Planeswalkers { public boolean canPlay() { return 0 < card.getCounters(Counters.LOYALTY) - && AllZone.getZone(card).is(Constant.Zone.Battlefield) + && AllZone.getZoneOf(card).is(Constant.Zone.Battlefield) && turn[0] != AllZone.getPhase().getTurn() && Phase.canCastSorcery(card.getController()); @@ -1353,7 +1353,7 @@ public class CardFactory_Planeswalkers { @Override public boolean canPlay() { return 5 <= card.getCounters(Counters.LOYALTY) - && AllZone.getZone(card).is(Constant.Zone.Battlefield) + && AllZone.getZoneOf(card).is(Constant.Zone.Battlefield) && turn[0] != AllZone.getPhase().getTurn() && Phase.canCastSorcery(card.getController()); }//canPlay() @@ -1460,7 +1460,7 @@ public class CardFactory_Planeswalkers { @Override public boolean canPlay() { return 0 < card.getCounters(Counters.LOYALTY) - && AllZone.getZone(card).is(Constant.Zone.Battlefield) + && AllZone.getZoneOf(card).is(Constant.Zone.Battlefield) && turn[0] != AllZone.getPhase().getTurn() && Phase.canCastSorcery(card.getController()); }//canPlay() @@ -1570,7 +1570,7 @@ public class CardFactory_Planeswalkers { if (AllZone.getStack().peekInstance(i).getSourceCard().equals(card)) return false; } return 0 < card.getCounters(Counters.LOYALTY) - && AllZone.getZone(card).is(Constant.Zone.Battlefield) + && AllZone.getZoneOf(card).is(Constant.Zone.Battlefield) && turn[0] != AllZone.getPhase().getTurn() && Phase.canCastSorcery(card.getController()); }//canPlay() @@ -1629,7 +1629,7 @@ public class CardFactory_Planeswalkers { @Override public boolean canPlay() { - return AllZone.getZone(card).is(Constant.Zone.Battlefield) + return AllZone.getZoneOf(card).is(Constant.Zone.Battlefield) && turn[0] != AllZone.getPhase().getTurn() && card.getCounters(Counters.LOYALTY) >= 1 && Phase.canCastSorcery(card.getController()); @@ -1686,7 +1686,7 @@ public class CardFactory_Planeswalkers { @Override public boolean canPlay() { return 8 <= card.getCounters(Counters.LOYALTY) - && AllZone.getZone(card).is(Constant.Zone.Battlefield) + && AllZone.getZoneOf(card).is(Constant.Zone.Battlefield) && turn[0] != AllZone.getPhase().getTurn() && Phase.canCastSorcery(card.getController()); }//canPlay() diff --git a/src/main/java/forge/card/cardFactory/CardFactory_Sorceries.java b/src/main/java/forge/card/cardFactory/CardFactory_Sorceries.java index e0916582aff..04564f0ef5d 100644 --- a/src/main/java/forge/card/cardFactory/CardFactory_Sorceries.java +++ b/src/main/java/forge/card/cardFactory/CardFactory_Sorceries.java @@ -201,7 +201,7 @@ public class CardFactory_Sorceries { int i = 0; for (Card target : creatures) { if (AllZoneUtil.isCardInPlay(target)) { - orig.add(i, AllZone.getZone(target)); + orig.add(i, AllZone.getZoneOf(target)); controllerEOT.add(i, target.getController()); targets.add(i, target); diff --git a/src/main/java/forge/card/cost/CostDiscard.java b/src/main/java/forge/card/cost/CostDiscard.java index 5483fc52549..e99dd91733d 100644 --- a/src/main/java/forge/card/cost/CostDiscard.java +++ b/src/main/java/forge/card/cost/CostDiscard.java @@ -67,7 +67,7 @@ public class CostDiscard extends CostPartWithList { Integer amount = convertAmount(); if (getThis()) { - if (!AllZone.getZone(source).is(Constant.Zone.Hand)) + if (!AllZone.getZoneOf(source).is(Constant.Zone.Hand)) return false; } else if (type.equals("Hand")) { // this will always work diff --git a/src/main/java/forge/card/cost/CostReveal.java b/src/main/java/forge/card/cost/CostReveal.java index 13bf79738ef..addbb8470b9 100644 --- a/src/main/java/forge/card/cost/CostReveal.java +++ b/src/main/java/forge/card/cost/CostReveal.java @@ -28,7 +28,7 @@ public class CostReveal extends CostPartWithList { Integer amount = convertAmount(); if (getThis()) { - if (!AllZone.getZone(source).is(Constant.Zone.Hand)) + if (!AllZone.getZoneOf(source).is(Constant.Zone.Hand)) return false; } else { handList = handList.getValidCards(type.split(";"), activator, source); diff --git a/src/main/java/forge/card/spellability/SpellAbility_Requirements.java b/src/main/java/forge/card/spellability/SpellAbility_Requirements.java index c59f66827f4..669ba222b51 100644 --- a/src/main/java/forge/card/spellability/SpellAbility_Requirements.java +++ b/src/main/java/forge/card/spellability/SpellAbility_Requirements.java @@ -74,7 +74,7 @@ public class SpellAbility_Requirements { if (!ability.getSourceCard().isCopiedSpell()) { Card c = ability.getSourceCard(); - fromZone = AllZone.getZone(c); + fromZone = AllZone.getZoneOf(c); AllZone.getGameAction().moveToStack(c); } } diff --git a/src/main/java/forge/card/spellability/SpellAbility_Restriction.java b/src/main/java/forge/card/spellability/SpellAbility_Restriction.java index f4e9f470b79..b5b4fd49d3a 100644 --- a/src/main/java/forge/card/spellability/SpellAbility_Restriction.java +++ b/src/main/java/forge/card/spellability/SpellAbility_Restriction.java @@ -136,7 +136,7 @@ public class SpellAbility_Restriction extends SpellAbility_Variables { * @return a boolean. */ public boolean canPlay(Card c, SpellAbility sa) { - if (!AllZone.getZone(c).is(zone)) + if (!AllZone.getZoneOf(c).is(zone)) return false; Player activator = sa.getActivatingPlayer(); diff --git a/src/main/java/forge/card/spellability/Spell_Permanent.java b/src/main/java/forge/card/spellability/Spell_Permanent.java index b528d75c891..2fcdd5c541f 100644 --- a/src/main/java/forge/card/spellability/Spell_Permanent.java +++ b/src/main/java/forge/card/spellability/Spell_Permanent.java @@ -240,7 +240,7 @@ public class Spell_Permanent extends Spell { if (o == null) return false; CardList cl = (CardList) championGetCreature.execute(); - if ((o == null) || !(cl.size() > 0) || !AllZone.getZone(getSourceCard()).is(Constant.Zone.Hand)) + if ((o == null) || !(cl.size() > 0) || !AllZone.getZoneOf(getSourceCard()).is(Constant.Zone.Hand)) return false; } diff --git a/src/main/java/forge/card/staticAbility/StaticAbility.java b/src/main/java/forge/card/staticAbility/StaticAbility.java index dceb119ec43..4da697790a5 100644 --- a/src/main/java/forge/card/staticAbility/StaticAbility.java +++ b/src/main/java/forge/card/staticAbility/StaticAbility.java @@ -160,7 +160,7 @@ public class StaticAbility { if (mapParams.containsKey("EffectZone")) effectZone = Zone.smartValueOf(mapParams.get("EffectZone")); - if( effectZone != null && !AllZone.getZone(hostCard).getZoneType().equals(effectZone)) + if( effectZone != null && !AllZone.getZoneOf(hostCard).getZoneType().equals(effectZone)) return false; if(mapParams.containsKey("Threshold") && !controller.hasThreshold()) diff --git a/src/main/java/forge/card/trigger/Trigger.java b/src/main/java/forge/card/trigger/Trigger.java index 692ec6bff62..6a1bf017754 100644 --- a/src/main/java/forge/card/trigger/Trigger.java +++ b/src/main/java/forge/card/trigger/Trigger.java @@ -225,10 +225,10 @@ public abstract class Trigger { for (String s : mapParams.get("TriggerZones").split(",")) { triggerZones.add(Zone.smartValueOf(s)); } - if (AllZone.getZone(hostCard) == null) { + if (AllZone.getZoneOf(hostCard) == null) { return false; } - if (!triggerZones.contains(AllZone.getZone(hostCard).getZoneType())) { + if (!triggerZones.contains(AllZone.getZoneOf(hostCard).getZoneType())) { return false; } }