From a63e024ea45d3856ce5581d3d05de4e2d46f6c03 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Fri, 6 Oct 2017 12:29:14 -0400 Subject: [PATCH] initial setup for phasing fix --- .../src/main/java/mage/game/permanent/Permanent.java | 4 ++++ .../main/java/mage/game/permanent/PermanentImpl.java | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/Mage/src/main/java/mage/game/permanent/Permanent.java b/Mage/src/main/java/mage/game/permanent/Permanent.java index fedf9aad48..aaf0b42d13 100644 --- a/Mage/src/main/java/mage/game/permanent/Permanent.java +++ b/Mage/src/main/java/mage/game/permanent/Permanent.java @@ -80,8 +80,12 @@ public interface Permanent extends Card, Controllable { boolean phaseIn(Game game); + boolean phaseIn(Game game, boolean indirectPhase); + boolean phaseOut(Game game); + boolean phaseOut(Game game, boolean indirectPhase); + boolean isMonstrous(); void setMonstrous(boolean value); diff --git a/Mage/src/main/java/mage/game/permanent/PermanentImpl.java b/Mage/src/main/java/mage/game/permanent/PermanentImpl.java index f4bd39bb1a..464cbabb42 100644 --- a/Mage/src/main/java/mage/game/permanent/PermanentImpl.java +++ b/Mage/src/main/java/mage/game/permanent/PermanentImpl.java @@ -89,6 +89,7 @@ public abstract class PermanentImpl extends CardImpl implements Permanent { protected boolean controlledFromStartOfControllerTurn; protected int turnsOnBattlefield; protected boolean phasedIn = true; + protected boolean indirectPhase = false; protected boolean faceDown; protected boolean attacking; protected int blocking; @@ -138,6 +139,7 @@ public abstract class PermanentImpl extends CardImpl implements Permanent { this.controlledFromStartOfControllerTurn = permanent.controlledFromStartOfControllerTurn; this.turnsOnBattlefield = permanent.turnsOnBattlefield; this.phasedIn = permanent.phasedIn; + this.indirectPhase = permanent.indirectPhase; this.faceDown = permanent.faceDown; this.attacking = permanent.attacking; this.blocking = permanent.blocking; @@ -463,6 +465,11 @@ public abstract class PermanentImpl extends CardImpl implements Permanent { @Override public boolean phaseIn(Game game) { + return phaseIn(game, false); + } + + @Override + public boolean phaseIn(Game game, boolean indirectPhase) { if (!phasedIn) { if (!replaceEvent(EventType.PHASE_IN, game)) { this.phasedIn = true; @@ -478,6 +485,11 @@ public abstract class PermanentImpl extends CardImpl implements Permanent { @Override public boolean phaseOut(Game game) { + return phaseOut(game, false); + } + + @Override + public boolean phaseOut(Game game, boolean indirectPhase) { if (phasedIn) { if (!replaceEvent(EventType.PHASE_OUT, game)) { this.phasedIn = false;