mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
move function AllZone.GameAction.isCardExiled(Card c) to AllZoneUtil and made static
This commit is contained in:
@@ -347,6 +347,9 @@ public class AllZoneUtil {
|
|||||||
return cards;
|
return cards;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isCardExiled(Card c) {
|
||||||
|
return getCardsInExile().contains(c);
|
||||||
|
}
|
||||||
|
|
||||||
///Check if a certain card is in play
|
///Check if a certain card is in play
|
||||||
|
|
||||||
|
|||||||
@@ -580,7 +580,7 @@ public class Card extends MyObservable {
|
|||||||
if(hasVanish && AllZone.GameAction.isCardInPlay(this))
|
if(hasVanish && AllZone.GameAction.isCardInPlay(this))
|
||||||
AllZone.GameAction.sacrifice(this);
|
AllZone.GameAction.sacrifice(this);
|
||||||
|
|
||||||
if(hasSuspend() && AllZone.GameAction.isCardExiled(this))
|
if(hasSuspend() && AllZoneUtil.isCardExiled(this))
|
||||||
{
|
{
|
||||||
final Card c = this;
|
final Card c = this;
|
||||||
|
|
||||||
|
|||||||
@@ -337,7 +337,7 @@ public class GameAction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Card exile(Card c) {
|
public Card exile(Card c) {
|
||||||
if(AllZone.GameAction.isCardExiled(c)) return c;
|
if(AllZoneUtil.isCardExiled(c)) return c;
|
||||||
|
|
||||||
PlayerZone removed = AllZone.getZone(Constant.Zone.Exile, c.getOwner());
|
PlayerZone removed = AllZone.getZone(Constant.Zone.Exile, c.getOwner());
|
||||||
|
|
||||||
@@ -2183,11 +2183,6 @@ public class GameAction {
|
|||||||
|| AllZoneUtil.isCardInZone(AllZone.Human_Graveyard, c);
|
|| AllZoneUtil.isCardInZone(AllZone.Human_Graveyard, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isCardExiled(Card c) {
|
|
||||||
return AllZoneUtil.isCardInZone(AllZone.Computer_Exile, c)
|
|
||||||
|| AllZoneUtil.isCardInZone(AllZone.Human_Exile, c);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* prompts Human to see if a target player's library should be shuffled. This should
|
* prompts Human to see if a target player's library should be shuffled. This should
|
||||||
* only be called when the choice is made by the Human (target can be either), then
|
* only be called when the choice is made by the Human (target can be either), then
|
||||||
|
|||||||
@@ -1498,7 +1498,7 @@ public class GameActionUtil {
|
|||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
|
|
||||||
if(AllZone.GameAction.isCardExiled(eve) && eve.getCounters(Counters.SCREAM) > 0) {
|
if(AllZoneUtil.isCardExiled(eve) && eve.getCounters(Counters.SCREAM) > 0) {
|
||||||
eve.subtractCounter(Counters.SCREAM, 1);
|
eve.subtractCounter(Counters.SCREAM, 1);
|
||||||
|
|
||||||
if(eve.getCounters(Counters.SCREAM) == 0) {
|
if(eve.getCounters(Counters.SCREAM) == 0) {
|
||||||
@@ -1520,7 +1520,7 @@ public class GameActionUtil {
|
|||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append(eve.getName()).append(" - remove a scream counter and return creatures to the battlefield.");
|
sb.append(eve.getName()).append(" - remove a scream counter and return creatures to the battlefield.");
|
||||||
hallow.setStackDescription(sb.toString());
|
hallow.setStackDescription(sb.toString());
|
||||||
if(AllZone.GameAction.isCardExiled(eve)) {
|
if(AllZoneUtil.isCardExiled(eve)) {
|
||||||
AllZone.Stack.addSimultaneousStackEntry(hallow);
|
AllZone.Stack.addSimultaneousStackEntry(hallow);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1241,7 +1241,7 @@ public class CardFactory implements NewConstants {
|
|||||||
|
|
||||||
public void execute() {
|
public void execute() {
|
||||||
Object o = enchantment.getTargetCard();
|
Object o = enchantment.getTargetCard();
|
||||||
if(o == null || ((Card) o).isToken() || !AllZone.GameAction.isCardExiled((Card) o)) return;
|
if(o == null || ((Card) o).isToken() || !AllZoneUtil.isCardExiled((Card) o)) return;
|
||||||
|
|
||||||
SpellAbility ability = new Ability(card, "0") {
|
SpellAbility ability = new Ability(card, "0") {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -959,7 +959,7 @@ public class CardFactory_Creatures {
|
|||||||
//System.out.println(abilityComes.getTargetCard().getName());
|
//System.out.println(abilityComes.getTargetCard().getName());
|
||||||
Object o = abilityComes.getTargetCard();
|
Object o = abilityComes.getTargetCard();
|
||||||
|
|
||||||
if(o == null || ((Card) o).isToken() || !AllZone.GameAction.isCardExiled((Card) o)) return;
|
if(o == null || ((Card) o).isToken() || !AllZoneUtil.isCardExiled((Card) o)) return;
|
||||||
|
|
||||||
SpellAbility ability = new Ability(card, "0") {
|
SpellAbility ability = new Ability(card, "0") {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1631,7 +1631,7 @@ class CardFactory_Planeswalkers {
|
|||||||
private static final long serialVersionUID = -947355314271308770L;
|
private static final long serialVersionUID = -947355314271308770L;
|
||||||
|
|
||||||
public void execute() {
|
public void execute() {
|
||||||
if(AllZone.GameAction.isCardExiled(c)) {
|
if(AllZoneUtil.isCardExiled(c)) {
|
||||||
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, c.getOwner());
|
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, c.getOwner());
|
||||||
AllZone.GameAction.moveTo(play, AllZoneUtil.getCardState(c));
|
AllZone.GameAction.moveTo(play, AllZoneUtil.getCardState(c));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3995,7 +3995,7 @@ public class CardFactory_Sorceries {
|
|||||||
|
|
||||||
public void execute() {
|
public void execute() {
|
||||||
//when this is in exile, and on the stack, this must get called again...
|
//when this is in exile, and on the stack, this must get called again...
|
||||||
if(!AllZone.GameAction.isCardExiled(card)) {
|
if(!AllZoneUtil.isCardExiled(card)) {
|
||||||
AllZone.GameAction.exile(card);
|
AllZone.GameAction.exile(card);
|
||||||
card.addCounter(Counters.SCREAM, 2);
|
card.addCounter(Counters.SCREAM, 2);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ public class Spell_Permanent extends Spell {
|
|||||||
//System.out.println(abilityComes.getTargetCard().getName());
|
//System.out.println(abilityComes.getTargetCard().getName());
|
||||||
Object o = championAbilityComes.getTargetCard();
|
Object o = championAbilityComes.getTargetCard();
|
||||||
|
|
||||||
if(o == null || ((Card) o).isToken() || !AllZone.GameAction.isCardExiled((Card) o)) return;
|
if(o == null || ((Card) o).isToken() || !AllZoneUtil.isCardExiled((Card) o)) return;
|
||||||
|
|
||||||
SpellAbility ability = new Ability(getSourceCard(), "0") {
|
SpellAbility ability = new Ability(getSourceCard(), "0") {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user