initial setup for phasing fix

This commit is contained in:
Evan Kranzler 2017-10-06 12:29:14 -04:00
parent 17b7de4e87
commit a63e024ea4
2 changed files with 16 additions and 0 deletions

View file

@ -80,8 +80,12 @@ public interface Permanent extends Card, Controllable {
boolean phaseIn(Game game); boolean phaseIn(Game game);
boolean phaseIn(Game game, boolean indirectPhase);
boolean phaseOut(Game game); boolean phaseOut(Game game);
boolean phaseOut(Game game, boolean indirectPhase);
boolean isMonstrous(); boolean isMonstrous();
void setMonstrous(boolean value); void setMonstrous(boolean value);

View file

@ -89,6 +89,7 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
protected boolean controlledFromStartOfControllerTurn; protected boolean controlledFromStartOfControllerTurn;
protected int turnsOnBattlefield; protected int turnsOnBattlefield;
protected boolean phasedIn = true; protected boolean phasedIn = true;
protected boolean indirectPhase = false;
protected boolean faceDown; protected boolean faceDown;
protected boolean attacking; protected boolean attacking;
protected int blocking; protected int blocking;
@ -138,6 +139,7 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
this.controlledFromStartOfControllerTurn = permanent.controlledFromStartOfControllerTurn; this.controlledFromStartOfControllerTurn = permanent.controlledFromStartOfControllerTurn;
this.turnsOnBattlefield = permanent.turnsOnBattlefield; this.turnsOnBattlefield = permanent.turnsOnBattlefield;
this.phasedIn = permanent.phasedIn; this.phasedIn = permanent.phasedIn;
this.indirectPhase = permanent.indirectPhase;
this.faceDown = permanent.faceDown; this.faceDown = permanent.faceDown;
this.attacking = permanent.attacking; this.attacking = permanent.attacking;
this.blocking = permanent.blocking; this.blocking = permanent.blocking;
@ -463,6 +465,11 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
@Override @Override
public boolean phaseIn(Game game) { public boolean phaseIn(Game game) {
return phaseIn(game, false);
}
@Override
public boolean phaseIn(Game game, boolean indirectPhase) {
if (!phasedIn) { if (!phasedIn) {
if (!replaceEvent(EventType.PHASE_IN, game)) { if (!replaceEvent(EventType.PHASE_IN, game)) {
this.phasedIn = true; this.phasedIn = true;
@ -478,6 +485,11 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
@Override @Override
public boolean phaseOut(Game game) { public boolean phaseOut(Game game) {
return phaseOut(game, false);
}
@Override
public boolean phaseOut(Game game, boolean indirectPhase) {
if (phasedIn) { if (phasedIn) {
if (!replaceEvent(EventType.PHASE_OUT, game)) { if (!replaceEvent(EventType.PHASE_OUT, game)) {
this.phasedIn = false; this.phasedIn = false;