mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
matchState is no longer public and deprecated for that
renamed function finding card's current zone getZone(card) to getZoneOf(card)
This commit is contained in:
@@ -61,10 +61,8 @@ public final class AllZone implements NewConstants {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Match State for challenges are stored in a <code>QuestMatchState</code> class instance.
|
* Match State for challenges are stored in a <code>QuestMatchState</code> 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
|
//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.
|
* @param c a {@link forge.Card} object.
|
||||||
* @return a {@link forge.PlayerZone} 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();
|
final FGameState gameState = Singletons.getModel().getGameState();
|
||||||
if (gameState == null) { return null; }
|
if (gameState == null) { return null; }
|
||||||
|
|
||||||
|
|||||||
@@ -282,7 +282,7 @@ public final class AllZoneUtil {
|
|||||||
* @return a {@link forge.Card} object.
|
* @return a {@link forge.Card} object.
|
||||||
*/
|
*/
|
||||||
public static Card getCardState(final Card card) {
|
public static Card getCardState(final Card card) {
|
||||||
PlayerZone zone = AllZone.getZone(card);
|
PlayerZone zone = AllZone.getZoneOf(card);
|
||||||
//for tokens
|
//for tokens
|
||||||
if (zone == null) {
|
if (zone == null) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -2090,7 +2090,7 @@ public class CombatUtil {
|
|||||||
Enchantment = CardFactoryUtil.AI_getBestEnchantment(enchantments, attacker, false);
|
Enchantment = CardFactoryUtil.AI_getBestEnchantment(enchantments, attacker, false);
|
||||||
}
|
}
|
||||||
if (Enchantment != null && AllZoneUtil.isCardInPlay(attacker)) {
|
if (Enchantment != null && AllZoneUtil.isCardInPlay(attacker)) {
|
||||||
GameAction.changeZone(AllZone.getZone(Enchantment),
|
GameAction.changeZone(AllZone.getZoneOf(Enchantment),
|
||||||
Enchantment.getOwner().getZone(Constant.Zone.Battlefield), Enchantment);
|
Enchantment.getOwner().getZone(Constant.Zone.Battlefield), Enchantment);
|
||||||
Enchantment.enchantEntity(attacker);
|
Enchantment.enchantEntity(attacker);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.
|
//Immutable cards are usually emblems,effects and the mana pool and we don't want to log those.
|
||||||
if (!c.isImmutable()) {
|
if (!c.isImmutable()) {
|
||||||
cardsAddedThisTurn.add(c);
|
cardsAddedThisTurn.add(c);
|
||||||
if (AllZone.getZone(c) != null) {
|
if (AllZone.getZoneOf(c) != null) {
|
||||||
cardsAddedThisTurnSource.add(AllZone.getZone(c).getZoneType());
|
cardsAddedThisTurnSource.add(AllZone.getZoneOf(c).getZoneType());
|
||||||
} else {
|
} else {
|
||||||
cardsAddedThisTurnSource.add(null);
|
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.
|
//Immutable cards are usually emblems,effects and the mana pool and we don't want to log those.
|
||||||
if (!c.isImmutable()) {
|
if (!c.isImmutable()) {
|
||||||
cardsAddedThisTurn.add(c);
|
cardsAddedThisTurn.add(c);
|
||||||
if (AllZone.getZone(c) != null) {
|
if (AllZone.getZoneOf(c) != null) {
|
||||||
cardsAddedThisTurnSource.add(AllZone.getZone(c).getZoneType());
|
cardsAddedThisTurnSource.add(AllZone.getZoneOf(c).getZoneType());
|
||||||
} else {
|
} else {
|
||||||
cardsAddedThisTurnSource.add(null);
|
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.
|
//Immutable cards are usually emblems,effects and the mana pool and we don't want to log those.
|
||||||
if (!c.isImmutable()) {
|
if (!c.isImmutable()) {
|
||||||
cardsAddedThisTurn.add(c);
|
cardsAddedThisTurn.add(c);
|
||||||
if (AllZone.getZone(c) != null) {
|
if (AllZone.getZoneOf(c) != null) {
|
||||||
cardsAddedThisTurnSource.add(AllZone.getZone(c).getZoneType());
|
cardsAddedThisTurnSource.add(AllZone.getZoneOf(c).getZoneType());
|
||||||
} else {
|
} else {
|
||||||
cardsAddedThisTurnSource.add(null);
|
cardsAddedThisTurnSource.add(null);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ public class GameAction {
|
|||||||
public final Card moveTo(final PlayerZone zone, Card c) {
|
public final Card moveTo(final PlayerZone zone, Card c) {
|
||||||
// Ideally move to should never be called without a prevZone
|
// Ideally move to should never be called without a prevZone
|
||||||
// Remove card from Current Zone, if it has one
|
// 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() : "";
|
//String prevName = prev != null ? prev.getZoneName() : "";
|
||||||
|
|
||||||
if (c.hasKeyword("If CARDNAME would leave the battlefield, exile it instead of putting it anywhere else.")
|
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) {
|
public final void controllerChangeZoneCorrection(final Card c) {
|
||||||
System.out.println("Correcting zone for " + c.toString());
|
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());
|
PlayerZone newBattlefield = c.getController().getZone(oldBattlefield.getZoneType());
|
||||||
|
|
||||||
if (oldBattlefield == null || newBattlefield == null) {
|
if (oldBattlefield == null || newBattlefield == null) {
|
||||||
@@ -292,7 +292,7 @@ public class GameAction {
|
|||||||
* @return a {@link forge.Card} object.
|
* @return a {@link forge.Card} object.
|
||||||
*/
|
*/
|
||||||
public final Card moveToGraveyard(Card c) {
|
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);
|
final PlayerZone grave = c.getOwner().getZone(Constant.Zone.Graveyard);
|
||||||
|
|
||||||
if (AllZoneUtil.isCardInPlay("Leyline of the Void", c.getOwner().getOpponent())) {
|
if (AllZoneUtil.isCardInPlay("Leyline of the Void", c.getOwner().getOpponent())) {
|
||||||
@@ -444,7 +444,7 @@ public class GameAction {
|
|||||||
* @return a {@link forge.Card} object.
|
* @return a {@link forge.Card} object.
|
||||||
*/
|
*/
|
||||||
public final Card moveToLibrary(Card c, int libPosition) {
|
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);
|
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.")) {
|
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
|
@Override
|
||||||
public void resolve() {
|
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);
|
PlayerZone ownerPlay = persistCard.getOwner().getZone(Constant.Zone.Battlefield);
|
||||||
Card card = moveTo(ownerPlay, persistCard);
|
Card card = moveTo(ownerPlay, persistCard);
|
||||||
card.addCounter(Counters.M1M1, 1);
|
card.addCounter(Counters.M1M1, 1);
|
||||||
@@ -1557,7 +1557,7 @@ public class GameAction {
|
|||||||
Player human = AllZone.getHumanPlayer();
|
Player human = AllZone.getHumanPlayer();
|
||||||
|
|
||||||
if (c.isLand() && human.canPlayLand()) {
|
if (c.isLand() && human.canPlayLand()) {
|
||||||
PlayerZone zone = AllZone.getZone(c);
|
PlayerZone zone = AllZone.getZoneOf(c);
|
||||||
|
|
||||||
if (zone.is(Constant.Zone.Hand)
|
if (zone.is(Constant.Zone.Hand)
|
||||||
|| (!zone.is(Constant.Zone.Battlefield)) && c.hasKeyword("May be played"))
|
|| (!zone.is(Constant.Zone.Battlefield)) && c.hasKeyword("May be played"))
|
||||||
|
|||||||
@@ -2366,7 +2366,7 @@ public final class GameActionUtil {
|
|||||||
for (int i = 0; i < all.size(); i++) {
|
for (int i = 0; i < all.size(); i++) {
|
||||||
Card c = all.get(i);
|
Card c = all.get(i);
|
||||||
if (c.getName().equals(cardName) && !c.isFaceDown()) {
|
if (c.getName().equals(cardName) && !c.isFaceDown()) {
|
||||||
zone.add(AllZone.getZone(c));
|
zone.add(AllZone.getZoneOf(c));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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 the ability is a spell, but not a copied spell and its not already on the stack zone, move there
|
||||||
if (ability.isSpell()) {
|
if (ability.isSpell()) {
|
||||||
Card source = ability.getSourceCard();
|
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);
|
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
|
// 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)
|
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) {
|
if (source.getReplaceMoveToGraveyard().size() == 0) {
|
||||||
AllZone.getGameAction().moveToGraveyard(source);
|
AllZone.getGameAction().moveToGraveyard(source);
|
||||||
|
|||||||
@@ -801,7 +801,7 @@ public class Upkeep implements java.io.Serializable {
|
|||||||
private static final long serialVersionUID = 4820011440853920644L;
|
private static final long serialVersionUID = 4820011440853920644L;
|
||||||
|
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
if (AllZone.getZone(c).is(Constant.Zone.Battlefield)) {
|
if (AllZone.getZoneOf(c).is(Constant.Zone.Battlefield)) {
|
||||||
StringBuilder cost = new StringBuilder();
|
StringBuilder cost = new StringBuilder();
|
||||||
cost.append("Pay cost for ").append(c).append("\r\n");
|
cost.append("Pay cost for ").append(c).append("\r\n");
|
||||||
GameActionUtil.payManaDuringAbilityResolve(cost.toString(), noPay.getManaCost(), Command.Blank, Command.Blank);
|
GameActionUtil.payManaDuringAbilityResolve(cost.toString(), noPay.getManaCost(), Command.Blank, Command.Blank);
|
||||||
@@ -2599,7 +2599,7 @@ public class Upkeep implements java.io.Serializable {
|
|||||||
c.setCloneOrigin(null);
|
c.setCloneOrigin(null);
|
||||||
|
|
||||||
//5
|
//5
|
||||||
PlayerZone play = AllZone.getZone(c);
|
PlayerZone play = AllZone.getZoneOf(c);
|
||||||
play.remove(c);
|
play.remove(c);
|
||||||
|
|
||||||
play.add(newCopy);
|
play.add(newCopy);
|
||||||
|
|||||||
@@ -1496,7 +1496,7 @@ public final class AbilityFactory_ChangeZone {
|
|||||||
|
|
||||||
if (tgtCards.size() != 0) {
|
if (tgtCards.size() != 0) {
|
||||||
for (Card tgtC : tgtCards) {
|
for (Card tgtC : tgtCards) {
|
||||||
PlayerZone originZone = AllZone.getZone(tgtC);
|
PlayerZone originZone = AllZone.getZoneOf(tgtC);
|
||||||
// if Target isn't in the expected Zone, continue
|
// if Target isn't in the expected Zone, continue
|
||||||
if (originZone == null || !originZone.is(origin)) {
|
if (originZone == null || !originZone.is(origin)) {
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -223,7 +223,7 @@ public class AbilityFactory_Counters {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else { // "put counter on this"
|
} 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
|
// Don't activate Curse abilities on my cards and non-curse abilites on my opponents
|
||||||
if (!pZone.getPlayer().equals(player)) {
|
if (!pZone.getPlayer().equals(player)) {
|
||||||
return false;
|
return false;
|
||||||
@@ -590,7 +590,7 @@ public class AbilityFactory_Counters {
|
|||||||
|
|
||||||
for (Card tgtCard : tgtCards) {
|
for (Card tgtCard : tgtCards) {
|
||||||
if (tgt == null || CardFactoryUtil.canTarget(card, tgtCard)) {
|
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);
|
tgtCard.addCounter(Counters.valueOf(type), counterAmount);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -918,7 +918,7 @@ public class AbilityFactory_Counters {
|
|||||||
|
|
||||||
for (Card tgtCard : tgtCards) {
|
for (Card tgtCard : tgtCards) {
|
||||||
if (tgt == null || CardFactoryUtil.canTarget(card, tgtCard)) {
|
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 (zone.is(Constant.Zone.Battlefield) || zone.is(Constant.Zone.Exile)) {
|
||||||
if (params.containsKey("UpTo") && sa.getActivatingPlayer().isHuman()) {
|
if (params.containsKey("UpTo") && sa.getActivatingPlayer().isHuman()) {
|
||||||
@@ -1533,7 +1533,7 @@ public class AbilityFactory_Counters {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (Card tgtCard : cards) {
|
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);
|
tgtCard.addCounter(Counters.valueOf(type), counterAmount);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -352,13 +352,13 @@ public class AbilityFactory_Sacrifice {
|
|||||||
msg = "Sacrifice a " + msg;
|
msg = "Sacrifice a " + msg;
|
||||||
|
|
||||||
if (valid.equals("Self")) {
|
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());
|
AllZone.getGameAction().sacrifice(sa.getSourceCard());
|
||||||
}
|
}
|
||||||
//TODO - maybe this can be done smarter...
|
//TODO - maybe this can be done smarter...
|
||||||
else if (valid.equals("Card.AttachedBy")) {
|
else if (valid.equals("Card.AttachedBy")) {
|
||||||
Card toSac = sa.getSourceCard().getEnchantingCard();
|
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);
|
AllZone.getGameAction().sacrifice(toSac);
|
||||||
}
|
}
|
||||||
} else if (valid.equals("TriggeredCard")) {
|
} else if (valid.equals("TriggeredCard")) {
|
||||||
|
|||||||
@@ -807,7 +807,7 @@ public abstract class AbstractCardFactory implements NewConstants, CardFactoryIn
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlay() {
|
public boolean canPlay() {
|
||||||
return (AllZone.getZone(card).is(Constant.Zone.Battlefield));
|
return (AllZone.getZoneOf(card).is(Constant.Zone.Battlefield));
|
||||||
} //canPlay()
|
} //canPlay()
|
||||||
}; //SpellAbility ability1
|
}; //SpellAbility ability1
|
||||||
|
|
||||||
@@ -1808,7 +1808,7 @@ public abstract class AbstractCardFactory implements NewConstants, CardFactoryIn
|
|||||||
AllZone.getTriggerHandler().removeAllFromCard(cloned[0]);
|
AllZone.getTriggerHandler().removeAllFromCard(cloned[0]);
|
||||||
|
|
||||||
Card orig = cfact.getCard(card.getName(), card.getController());
|
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);
|
AllZone.getGameAction().moveTo(dest, orig);
|
||||||
dest.remove(card.getCurrentlyCloningCard());
|
dest.remove(card.getCurrentlyCloningCard());
|
||||||
|
|
||||||
|
|||||||
@@ -1384,7 +1384,7 @@ public class CardFactoryUtil {
|
|||||||
// An animated artifact equipmemt can't equip a creature
|
// An animated artifact equipmemt can't equip a creature
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlay() {
|
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());
|
&& Phase.canCastSorcery(sourceCard.getController());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2315,7 +2315,7 @@ public class CardFactoryUtil {
|
|||||||
*/
|
*/
|
||||||
public static boolean isTargetStillValid(final SpellAbility ability, final Card target) {
|
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
|
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
|
// Check if the target is in the zone it needs to be in to be
|
||||||
// targeted
|
// targeted
|
||||||
if (!AllZone.getZone(target).is(tgt.getZone())) {
|
if (!AllZone.getZoneOf(target).is(tgt.getZone())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// If an Aura's target is removed before it resolves, the Aura
|
// If an Aura's target is removed before it resolves, the Aura
|
||||||
// fizzles
|
// fizzles
|
||||||
if (source.isAura() && !AllZone.getZone(target).is(Constant.Zone.Battlefield)) {
|
if (source.isAura() && !AllZone.getZoneOf(target).is(Constant.Zone.Battlefield)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2395,7 +2395,7 @@ public class CardFactoryUtil {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
PlayerZone zone = AllZone.getZone(target);
|
PlayerZone zone = AllZone.getZoneOf(target);
|
||||||
// if zone is null, it means its on the stack
|
// if zone is null, it means its on the stack
|
||||||
if (zone == null || !zone.is(Constant.Zone.Battlefield)) {
|
if (zone == null || !zone.is(Constant.Zone.Battlefield)) {
|
||||||
// targets not in play, can normally be targeted
|
// targets not in play, can normally be targeted
|
||||||
@@ -2648,7 +2648,7 @@ public class CardFactoryUtil {
|
|||||||
* @return a boolean.
|
* @return a boolean.
|
||||||
*/
|
*/
|
||||||
public static boolean activateFromExternalZones(final Card c, final Player player) {
|
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 (zone.is(Constant.Zone.Graveyard)) {
|
||||||
if (c.hasFlashback() || c.hasUnearth()) {
|
if (c.hasFlashback() || c.hasUnearth()) {
|
||||||
return true;
|
return true;
|
||||||
@@ -2661,7 +2661,7 @@ public class CardFactoryUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (SpellAbility sa : c.getSpellAbility()) {
|
for (SpellAbility sa : c.getSpellAbility()) {
|
||||||
if (AllZone.getZone(c).is(sa.getRestrictions().getZone())) {
|
if (AllZone.getZoneOf(c).is(sa.getRestrictions().getZone())) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -507,7 +507,7 @@ class CardFactory_Auras {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Card animated = targetC[0];
|
Card animated = targetC[0];
|
||||||
PlayerZone grave = AllZone.getZone(animated);
|
PlayerZone grave = AllZone.getZoneOf(animated);
|
||||||
|
|
||||||
if (!grave.is(Constant.Zone.Graveyard)) {
|
if (!grave.is(Constant.Zone.Graveyard)) {
|
||||||
// Animated Creature got removed before ability resolved
|
// Animated Creature got removed before ability resolved
|
||||||
|
|||||||
@@ -357,7 +357,7 @@ public class CardFactory_Creatures {
|
|||||||
@Override
|
@Override
|
||||||
public boolean canPlayAI() {
|
public boolean canPlayAI() {
|
||||||
int reqHand = 1;
|
int reqHand = 1;
|
||||||
if (AllZone.getZone(card).is(Constant.Zone.Hand))
|
if (AllZone.getZoneOf(card).is(Constant.Zone.Hand))
|
||||||
reqHand++;
|
reqHand++;
|
||||||
|
|
||||||
// Don't play if it would sacrifice as soon as it comes into play
|
// Don't play if it would sacrifice as soon as it comes into play
|
||||||
@@ -509,7 +509,7 @@ public class CardFactory_Creatures {
|
|||||||
@Override
|
@Override
|
||||||
public boolean canPlayAI() {
|
public boolean canPlayAI() {
|
||||||
Object o = getArt.execute();
|
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);
|
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") {
|
AllZone.getStack().addSimultaneousStackEntry(new Ability(card, "0", "Adarkar Valkyrie - Return " + target[0] + " from graveyard to the battlefield") {
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
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
|
//checks to see if card is still in the graveyard
|
||||||
|
|
||||||
if (grave != null && AllZoneUtil.isCardInZone(grave, target[0])) {
|
if (grave != null && AllZoneUtil.isCardInZone(grave, target[0])) {
|
||||||
@@ -2779,7 +2779,7 @@ public class CardFactory_Creatures {
|
|||||||
AllZone.getTriggerHandler().removeAllFromCard(cloned[0]);
|
AllZone.getTriggerHandler().removeAllFromCard(cloned[0]);
|
||||||
|
|
||||||
Card orig = cfact.getCard(card.getName(), card.getController());
|
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);
|
AllZone.getGameAction().moveTo(dest, orig);
|
||||||
dest.remove(card.getCurrentlyCloningCard());
|
dest.remove(card.getCurrentlyCloningCard());
|
||||||
|
|
||||||
@@ -3064,7 +3064,7 @@ public class CardFactory_Creatures {
|
|||||||
final SpellAbility awaken = new Ability(card, "0") {
|
final SpellAbility awaken = new Ability(card, "0") {
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
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;
|
return;
|
||||||
final Card c = getTarget().getTargetCards().get(0);
|
final Card c = getTarget().getTargetCards().get(0);
|
||||||
String[] types = {"Creature", "Treefolk"};
|
String[] types = {"Creature", "Treefolk"};
|
||||||
|
|||||||
@@ -185,7 +185,7 @@ class CardFactory_Equipment {
|
|||||||
//not changed
|
//not changed
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlay() {
|
public boolean canPlay() {
|
||||||
return AllZone.getZone(card).is(Constant.Zone.Battlefield)
|
return AllZone.getZoneOf(card).is(Constant.Zone.Battlefield)
|
||||||
&& Phase.canCastSorcery(card.getController())
|
&& Phase.canCastSorcery(card.getController())
|
||||||
&& super.canPlay();
|
&& super.canPlay();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ public class CardFactory_Planeswalkers {
|
|||||||
public boolean canPlay() {
|
public boolean canPlay() {
|
||||||
|
|
||||||
return 0 < card.getCounters(Counters.LOYALTY)
|
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()
|
&& turn[0] != AllZone.getPhase().getTurn()
|
||||||
&& Phase.canCastSorcery(card.getController());
|
&& Phase.canCastSorcery(card.getController());
|
||||||
|
|
||||||
@@ -119,7 +119,7 @@ public class CardFactory_Planeswalkers {
|
|||||||
@Override
|
@Override
|
||||||
public boolean canPlay() {
|
public boolean canPlay() {
|
||||||
return 8 <= card.getCounters(Counters.LOYALTY)
|
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()
|
&& turn[0] != AllZone.getPhase().getTurn()
|
||||||
&& Phase.canCastSorcery(card.getController());
|
&& Phase.canCastSorcery(card.getController());
|
||||||
}//canPlay()
|
}//canPlay()
|
||||||
@@ -162,7 +162,7 @@ public class CardFactory_Planeswalkers {
|
|||||||
@Override
|
@Override
|
||||||
public boolean canPlay() {
|
public boolean canPlay() {
|
||||||
return 0 < card.getCounters(Counters.LOYALTY)
|
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()
|
&& turn[0] != AllZone.getPhase().getTurn()
|
||||||
&& Phase.canCastSorcery(card.getController());
|
&& Phase.canCastSorcery(card.getController());
|
||||||
}//canPlay()
|
}//canPlay()
|
||||||
@@ -237,7 +237,7 @@ public class CardFactory_Planeswalkers {
|
|||||||
public boolean canPlay() {
|
public boolean canPlay() {
|
||||||
|
|
||||||
return 0 < card.getCounters(Counters.LOYALTY)
|
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()
|
&& turn[0] != AllZone.getPhase().getTurn()
|
||||||
&& Phase.canCastSorcery(card.getController());
|
&& Phase.canCastSorcery(card.getController());
|
||||||
|
|
||||||
@@ -276,7 +276,7 @@ public class CardFactory_Planeswalkers {
|
|||||||
@Override
|
@Override
|
||||||
public boolean canPlay() {
|
public boolean canPlay() {
|
||||||
return 6 <= card.getCounters(Counters.LOYALTY)
|
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()
|
&& turn[0] != AllZone.getPhase().getTurn()
|
||||||
&& Phase.canCastSorcery(card.getController());
|
&& Phase.canCastSorcery(card.getController());
|
||||||
}//canPlay()
|
}//canPlay()
|
||||||
@@ -327,7 +327,7 @@ public class CardFactory_Planeswalkers {
|
|||||||
@Override
|
@Override
|
||||||
public boolean canPlay() {
|
public boolean canPlay() {
|
||||||
return 0 < card.getCounters(Counters.LOYALTY)
|
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()
|
&& turn[0] != AllZone.getPhase().getTurn()
|
||||||
&& Phase.canCastSorcery(card.getController());
|
&& Phase.canCastSorcery(card.getController());
|
||||||
}//canPlay()
|
}//canPlay()
|
||||||
@@ -402,7 +402,7 @@ public class CardFactory_Planeswalkers {
|
|||||||
if (AllZone.getStack().peekInstance(i).getSourceCard().equals(card)) return false;
|
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()
|
&& turn[0] != AllZone.getPhase().getTurn()
|
||||||
&& Phase.canCastSorcery(card.getController());
|
&& Phase.canCastSorcery(card.getController());
|
||||||
}
|
}
|
||||||
@@ -473,7 +473,7 @@ public class CardFactory_Planeswalkers {
|
|||||||
if (AllZone.getStack().peekInstance(i).getSourceCard().equals(card)) return false;
|
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()
|
&& turn[0] != AllZone.getPhase().getTurn()
|
||||||
&& Phase.canCastSorcery(card.getController());
|
&& Phase.canCastSorcery(card.getController());
|
||||||
}
|
}
|
||||||
@@ -554,7 +554,7 @@ public class CardFactory_Planeswalkers {
|
|||||||
if (AllZone.getStack().peekInstance(i).getSourceCard().equals(card)) return false;
|
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()
|
&& turn[0] != AllZone.getPhase().getTurn()
|
||||||
&& 7 < card.getCounters(Counters.LOYALTY)
|
&& 7 < card.getCounters(Counters.LOYALTY)
|
||||||
&& Phase.canCastSorcery(card.getController());
|
&& Phase.canCastSorcery(card.getController());
|
||||||
@@ -687,7 +687,7 @@ public class CardFactory_Planeswalkers {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlay() {
|
public boolean canPlay() {
|
||||||
return AllZone.getZone(card).is(Constant.Zone.Battlefield)
|
return AllZone.getZoneOf(card).is(Constant.Zone.Battlefield)
|
||||||
&& turn[0] != AllZone.getPhase().getTurn()
|
&& turn[0] != AllZone.getPhase().getTurn()
|
||||||
&& Phase.canCastSorcery(card.getController());
|
&& Phase.canCastSorcery(card.getController());
|
||||||
}//canPlay()
|
}//canPlay()
|
||||||
@@ -777,7 +777,7 @@ public class CardFactory_Planeswalkers {
|
|||||||
if (AllZone.getStack().peekInstance(i).getSourceCard().equals(card)) return false;
|
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()
|
&& turn[0] != AllZone.getPhase().getTurn()
|
||||||
&& Phase.canCastSorcery(card.getController());
|
&& Phase.canCastSorcery(card.getController());
|
||||||
}
|
}
|
||||||
@@ -868,7 +868,7 @@ public class CardFactory_Planeswalkers {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlay() {
|
public boolean canPlay() {
|
||||||
return AllZone.getZone(card).is(Constant.Zone.Battlefield)
|
return AllZone.getZoneOf(card).is(Constant.Zone.Battlefield)
|
||||||
&& turn[0] != AllZone.getPhase().getTurn()
|
&& turn[0] != AllZone.getPhase().getTurn()
|
||||||
&& card.getCounters(Counters.LOYALTY) >= 5
|
&& card.getCounters(Counters.LOYALTY) >= 5
|
||||||
&& Phase.canCastSorcery(card.getController());
|
&& Phase.canCastSorcery(card.getController());
|
||||||
@@ -952,7 +952,7 @@ public class CardFactory_Planeswalkers {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlay() {
|
public boolean canPlay() {
|
||||||
return AllZone.getZone(card).is(Constant.Zone.Battlefield)
|
return AllZone.getZoneOf(card).is(Constant.Zone.Battlefield)
|
||||||
&& turn[0] != AllZone.getPhase().getTurn()
|
&& turn[0] != AllZone.getPhase().getTurn()
|
||||||
&& Phase.canCastSorcery(card.getController());
|
&& Phase.canCastSorcery(card.getController());
|
||||||
}//canPlay()
|
}//canPlay()
|
||||||
@@ -1008,7 +1008,7 @@ public class CardFactory_Planeswalkers {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlay() {
|
public boolean canPlay() {
|
||||||
return AllZone.getZone(card).is(Constant.Zone.Battlefield)
|
return AllZone.getZoneOf(card).is(Constant.Zone.Battlefield)
|
||||||
&& turn[0] != AllZone.getPhase().getTurn()
|
&& turn[0] != AllZone.getPhase().getTurn()
|
||||||
&& Phase.canCastSorcery(card.getController());
|
&& Phase.canCastSorcery(card.getController());
|
||||||
}//canPlay()
|
}//canPlay()
|
||||||
@@ -1044,7 +1044,7 @@ public class CardFactory_Planeswalkers {
|
|||||||
@Override
|
@Override
|
||||||
public boolean canPlay() {
|
public boolean canPlay() {
|
||||||
return card.getCounters(Counters.LOYALTY) >= 1
|
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()
|
&& turn[0] != AllZone.getPhase().getTurn()
|
||||||
&& Phase.canCastSorcery(card.getController());
|
&& Phase.canCastSorcery(card.getController());
|
||||||
}
|
}
|
||||||
@@ -1089,7 +1089,7 @@ public class CardFactory_Planeswalkers {
|
|||||||
@Override
|
@Override
|
||||||
public boolean canPlay() {
|
public boolean canPlay() {
|
||||||
return card.getCounters(Counters.LOYALTY) >= 12
|
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()
|
&& turn[0] != AllZone.getPhase().getTurn()
|
||||||
&& Phase.canCastSorcery(card.getController());
|
&& Phase.canCastSorcery(card.getController());
|
||||||
}
|
}
|
||||||
@@ -1154,7 +1154,7 @@ public class CardFactory_Planeswalkers {
|
|||||||
public boolean canPlay() {
|
public boolean canPlay() {
|
||||||
//looks like standard Planeswalker stuff...
|
//looks like standard Planeswalker stuff...
|
||||||
//maybe should check if library is empty, or 1 card?
|
//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()
|
&& turn[0] != AllZone.getPhase().getTurn()
|
||||||
&& Phase.canCastSorcery(card.getController());
|
&& Phase.canCastSorcery(card.getController());
|
||||||
}//canPlay()
|
}//canPlay()
|
||||||
@@ -1213,7 +1213,7 @@ public class CardFactory_Planeswalkers {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlay() {
|
public boolean canPlay() {
|
||||||
return AllZone.getZone(card).is(Constant.Zone.Battlefield)
|
return AllZone.getZoneOf(card).is(Constant.Zone.Battlefield)
|
||||||
&& card.getCounters(Counters.LOYALTY) >= 2
|
&& card.getCounters(Counters.LOYALTY) >= 2
|
||||||
&& turn[0] != AllZone.getPhase().getTurn()
|
&& turn[0] != AllZone.getPhase().getTurn()
|
||||||
&& Phase.canCastSorcery(card.getController());
|
&& Phase.canCastSorcery(card.getController());
|
||||||
@@ -1256,7 +1256,7 @@ public class CardFactory_Planeswalkers {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlay() {
|
public boolean canPlay() {
|
||||||
return AllZone.getZone(card).is(Constant.Zone.Battlefield)
|
return AllZone.getZoneOf(card).is(Constant.Zone.Battlefield)
|
||||||
&& card.getCounters(Counters.LOYALTY) >= 4
|
&& card.getCounters(Counters.LOYALTY) >= 4
|
||||||
&& turn[0] != AllZone.getPhase().getTurn()
|
&& turn[0] != AllZone.getPhase().getTurn()
|
||||||
&& Phase.canCastSorcery(card.getController());
|
&& Phase.canCastSorcery(card.getController());
|
||||||
@@ -1315,7 +1315,7 @@ public class CardFactory_Planeswalkers {
|
|||||||
public boolean canPlay() {
|
public boolean canPlay() {
|
||||||
|
|
||||||
return 0 < card.getCounters(Counters.LOYALTY)
|
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()
|
&& turn[0] != AllZone.getPhase().getTurn()
|
||||||
&& Phase.canCastSorcery(card.getController());
|
&& Phase.canCastSorcery(card.getController());
|
||||||
|
|
||||||
@@ -1353,7 +1353,7 @@ public class CardFactory_Planeswalkers {
|
|||||||
@Override
|
@Override
|
||||||
public boolean canPlay() {
|
public boolean canPlay() {
|
||||||
return 5 <= card.getCounters(Counters.LOYALTY)
|
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()
|
&& turn[0] != AllZone.getPhase().getTurn()
|
||||||
&& Phase.canCastSorcery(card.getController());
|
&& Phase.canCastSorcery(card.getController());
|
||||||
}//canPlay()
|
}//canPlay()
|
||||||
@@ -1460,7 +1460,7 @@ public class CardFactory_Planeswalkers {
|
|||||||
@Override
|
@Override
|
||||||
public boolean canPlay() {
|
public boolean canPlay() {
|
||||||
return 0 < card.getCounters(Counters.LOYALTY)
|
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()
|
&& turn[0] != AllZone.getPhase().getTurn()
|
||||||
&& Phase.canCastSorcery(card.getController());
|
&& Phase.canCastSorcery(card.getController());
|
||||||
}//canPlay()
|
}//canPlay()
|
||||||
@@ -1570,7 +1570,7 @@ public class CardFactory_Planeswalkers {
|
|||||||
if (AllZone.getStack().peekInstance(i).getSourceCard().equals(card)) return false;
|
if (AllZone.getStack().peekInstance(i).getSourceCard().equals(card)) return false;
|
||||||
}
|
}
|
||||||
return 0 < card.getCounters(Counters.LOYALTY)
|
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()
|
&& turn[0] != AllZone.getPhase().getTurn()
|
||||||
&& Phase.canCastSorcery(card.getController());
|
&& Phase.canCastSorcery(card.getController());
|
||||||
}//canPlay()
|
}//canPlay()
|
||||||
@@ -1629,7 +1629,7 @@ public class CardFactory_Planeswalkers {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlay() {
|
public boolean canPlay() {
|
||||||
return AllZone.getZone(card).is(Constant.Zone.Battlefield)
|
return AllZone.getZoneOf(card).is(Constant.Zone.Battlefield)
|
||||||
&& turn[0] != AllZone.getPhase().getTurn()
|
&& turn[0] != AllZone.getPhase().getTurn()
|
||||||
&& card.getCounters(Counters.LOYALTY) >= 1
|
&& card.getCounters(Counters.LOYALTY) >= 1
|
||||||
&& Phase.canCastSorcery(card.getController());
|
&& Phase.canCastSorcery(card.getController());
|
||||||
@@ -1686,7 +1686,7 @@ public class CardFactory_Planeswalkers {
|
|||||||
@Override
|
@Override
|
||||||
public boolean canPlay() {
|
public boolean canPlay() {
|
||||||
return 8 <= card.getCounters(Counters.LOYALTY)
|
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()
|
&& turn[0] != AllZone.getPhase().getTurn()
|
||||||
&& Phase.canCastSorcery(card.getController());
|
&& Phase.canCastSorcery(card.getController());
|
||||||
}//canPlay()
|
}//canPlay()
|
||||||
|
|||||||
@@ -201,7 +201,7 @@ public class CardFactory_Sorceries {
|
|||||||
int i = 0;
|
int i = 0;
|
||||||
for (Card target : creatures) {
|
for (Card target : creatures) {
|
||||||
if (AllZoneUtil.isCardInPlay(target)) {
|
if (AllZoneUtil.isCardInPlay(target)) {
|
||||||
orig.add(i, AllZone.getZone(target));
|
orig.add(i, AllZone.getZoneOf(target));
|
||||||
controllerEOT.add(i, target.getController());
|
controllerEOT.add(i, target.getController());
|
||||||
targets.add(i, target);
|
targets.add(i, target);
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ public class CostDiscard extends CostPartWithList {
|
|||||||
Integer amount = convertAmount();
|
Integer amount = convertAmount();
|
||||||
|
|
||||||
if (getThis()) {
|
if (getThis()) {
|
||||||
if (!AllZone.getZone(source).is(Constant.Zone.Hand))
|
if (!AllZone.getZoneOf(source).is(Constant.Zone.Hand))
|
||||||
return false;
|
return false;
|
||||||
} else if (type.equals("Hand")) {
|
} else if (type.equals("Hand")) {
|
||||||
// this will always work
|
// this will always work
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ public class CostReveal extends CostPartWithList {
|
|||||||
Integer amount = convertAmount();
|
Integer amount = convertAmount();
|
||||||
|
|
||||||
if (getThis()) {
|
if (getThis()) {
|
||||||
if (!AllZone.getZone(source).is(Constant.Zone.Hand))
|
if (!AllZone.getZoneOf(source).is(Constant.Zone.Hand))
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
handList = handList.getValidCards(type.split(";"), activator, source);
|
handList = handList.getValidCards(type.split(";"), activator, source);
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ public class SpellAbility_Requirements {
|
|||||||
if (!ability.getSourceCard().isCopiedSpell()) {
|
if (!ability.getSourceCard().isCopiedSpell()) {
|
||||||
Card c = ability.getSourceCard();
|
Card c = ability.getSourceCard();
|
||||||
|
|
||||||
fromZone = AllZone.getZone(c);
|
fromZone = AllZone.getZoneOf(c);
|
||||||
AllZone.getGameAction().moveToStack(c);
|
AllZone.getGameAction().moveToStack(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ public class SpellAbility_Restriction extends SpellAbility_Variables {
|
|||||||
* @return a boolean.
|
* @return a boolean.
|
||||||
*/
|
*/
|
||||||
public boolean canPlay(Card c, SpellAbility sa) {
|
public boolean canPlay(Card c, SpellAbility sa) {
|
||||||
if (!AllZone.getZone(c).is(zone))
|
if (!AllZone.getZoneOf(c).is(zone))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Player activator = sa.getActivatingPlayer();
|
Player activator = sa.getActivatingPlayer();
|
||||||
|
|||||||
@@ -240,7 +240,7 @@ public class Spell_Permanent extends Spell {
|
|||||||
if (o == null) return false;
|
if (o == null) return false;
|
||||||
|
|
||||||
CardList cl = (CardList) championGetCreature.execute();
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ public class StaticAbility {
|
|||||||
if (mapParams.containsKey("EffectZone"))
|
if (mapParams.containsKey("EffectZone"))
|
||||||
effectZone = Zone.smartValueOf(mapParams.get("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;
|
return false;
|
||||||
|
|
||||||
if(mapParams.containsKey("Threshold") && !controller.hasThreshold())
|
if(mapParams.containsKey("Threshold") && !controller.hasThreshold())
|
||||||
|
|||||||
@@ -225,10 +225,10 @@ public abstract class Trigger {
|
|||||||
for (String s : mapParams.get("TriggerZones").split(",")) {
|
for (String s : mapParams.get("TriggerZones").split(",")) {
|
||||||
triggerZones.add(Zone.smartValueOf(s));
|
triggerZones.add(Zone.smartValueOf(s));
|
||||||
}
|
}
|
||||||
if (AllZone.getZone(hostCard) == null) {
|
if (AllZone.getZoneOf(hostCard) == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!triggerZones.contains(AllZone.getZone(hostCard).getZoneType())) {
|
if (!triggerZones.contains(AllZone.getZoneOf(hostCard).getZoneType())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user