diff --git a/src/forge/AbilityFactory_DealDamage.java b/src/forge/AbilityFactory_DealDamage.java index ab13d1b4d2c..2bb8f3855db 100644 --- a/src/forge/AbilityFactory_DealDamage.java +++ b/src/forge/AbilityFactory_DealDamage.java @@ -173,8 +173,8 @@ public class AbilityFactory_DealDamage { // TODO handle proper calculation of X values based on Cost - // todo(sol): this should only happen during Humans EOT or if Stuffy is going to die - if(AF.getHostCard().getName().equals("Stuffy Doll")) { + // todo(sol): this should also happen if Stuffy is going to die + if(AF.getHostCard().getName().equals("Stuffy Doll") && AllZone.Phase.is(Constant.Phase.End_Of_Turn, AllZone.HumanPlayer)) { return true; } diff --git a/src/forge/GameActionUtil.java b/src/forge/GameActionUtil.java index 23190da71ce..42d6fabb80b 100644 --- a/src/forge/GameActionUtil.java +++ b/src/forge/GameActionUtil.java @@ -156,9 +156,6 @@ public class GameActionUtil { // experimental, AI abuse aluren AllZone.Stack.unfreezeStack(); - - if (AllZone.Stack.size() == 0 && !AllZone.Display.stopAtPhase(player, Constant.Phase.Upkeep)) - AllZone.Phase.setNeedToNextPhase(true); } public static void executeDrawStepEffects() { @@ -174,9 +171,7 @@ public class GameActionUtil { draw_Overbeing_of_Myth(player); draw_Mana_Vault(player); draw_Sylvan_Library(player); - AllZone.Stack.unfreezeStack(); - if (AllZone.Stack.size() == 0 && !AllZone.Display.stopAtPhase(player, Constant.Phase.Draw)) - AllZone.Phase.setNeedToNextPhase(true); + AllZone.Stack.unfreezeStack(); } public static void executeTapSideEffects(Card c) { diff --git a/src/forge/GuiDisplay3.java b/src/forge/GuiDisplay3.java index da038bbce03..02599d67f39 100644 --- a/src/forge/GuiDisplay3.java +++ b/src/forge/GuiDisplay3.java @@ -1050,7 +1050,7 @@ public class GuiDisplay3 extends JFrame implements CardContainer, Display, NewCo else if (phase.equals(Constant.Phase.Combat_End)) return cbHumanEndCombat.isSelected(); } - return false; + return true; } public boolean loadPrefs(){ diff --git a/src/forge/GuiDisplay4.java b/src/forge/GuiDisplay4.java index 252ffeb380d..aca0f9154eb 100644 --- a/src/forge/GuiDisplay4.java +++ b/src/forge/GuiDisplay4.java @@ -1038,7 +1038,7 @@ public class GuiDisplay4 extends JFrame implements CardContainer, Display, NewCo else if (phase.equals(Constant.Phase.Combat_End)) return cbHumanEndCombat.isSelected(); } - return false; + return true; } public boolean loadPrefs(){ diff --git a/src/forge/InputControl.java b/src/forge/InputControl.java index 051439977a2..4063c21b8f0 100644 --- a/src/forge/InputControl.java +++ b/src/forge/InputControl.java @@ -122,8 +122,9 @@ public class InputControl extends MyObservable implements java.io.Serializable { } else if(phase.equals(Constant.Phase.End_Of_Turn)){ - if (priority.isComputer()){ - // AI passes priority in his end of turn phase to player automatically + if (priority.isComputer() && playerTurn.isComputer()){ + // this section may not be needed + // AI passes priority in his end of turn phase to player automatically AllZone.Phase.passPriority(); return null; } @@ -138,7 +139,14 @@ public class InputControl extends MyObservable implements java.io.Serializable { // Special phases handled above, everything else is handled simply by priority if (priority.isHuman()){ - return new Input_PassPriority(); + boolean skip = AllZone.Phase.doSkipPhase(); + AllZone.Phase.setSkipPhase(false); + if(AllZone.Stack.size() == 0 && !AllZone.Display.stopAtPhase(playerTurn, phase) && skip) { + AllZone.Phase.passPriority(); + return null; + } + else + return new Input_PassPriority(); } else if (playerTurn.isComputer()) diff --git a/src/forge/Phase.java b/src/forge/Phase.java index 0a5b68f09b7..93f28e84905 100644 --- a/src/forge/Phase.java +++ b/src/forge/Phase.java @@ -85,6 +85,15 @@ public class Phase extends MyObservable bPhaseEffects = b; } + private boolean bSkipPhase = true; + public boolean doSkipPhase() { + return bSkipPhase; + } + + public void setSkipPhase(boolean b) { + bSkipPhase = b; + } + private boolean bCombat = false; public boolean inCombat() { return bCombat; @@ -152,6 +161,7 @@ public class Phase extends MyObservable // Handle effects that happen at the beginning of phases final String phase = AllZone.Phase.getPhase(); final Player turn = AllZone.Phase.getPlayerTurn(); + AllZone.Phase.setSkipPhase(true); if(phase.equals(Constant.Phase.Untap)) { PhaseUtil.handleUntap(); @@ -188,12 +198,7 @@ public class Phase extends MyObservable } else if(phase.equals(Constant.Phase.Combat_Begin)){ - if (AllZone.Display.stopAtPhase(turn, phase)){ - PhaseUtil.verifyCombat(); - } - else { - this.setNeedToNextPhase(true); - } + PhaseUtil.verifyCombat(); } else if (phase.equals(Constant.Phase.Combat_Declare_Attackers_InstantAbility)){ @@ -267,17 +272,11 @@ public class Phase extends MyObservable runParams.put("Phase", phase); runParams.put("Player", getPlayerTurn()); AllZone.TriggerHandler.runTrigger("Phase", runParams); - - if(AllZone.Stack.size() == 0 && !AllZone.Display.stopAtPhase(turn, phase)) - AllZone.Phase.setNeedToNextPhase(true); } } else if(phase.equals(Constant.Phase.End_Of_Turn)) { AllZone.EndOfTurn.executeAt(); - // todo: when we have a bar for selecting which phases to stop at, we will check that instead of display.stop - if(AllZone.Stack.size() == 0 && !AllZone.Display.stopAtPhase(turn, phase)) - AllZone.Phase.setNeedToNextPhase(true); } else if(phase.equals(Constant.Phase.Cleanup)){ @@ -292,8 +291,7 @@ public class Phase extends MyObservable //This line fixes Combat Damage triggers not going off when they should AllZone.Stack.unfreezeStack(); - - + resetPriority(); }