diff --git a/Mage.Common/src/main/java/mage/view/GameView.java b/Mage.Common/src/main/java/mage/view/GameView.java index f52d49163f6..84a2abbf959 100644 --- a/Mage.Common/src/main/java/mage/view/GameView.java +++ b/Mage.Common/src/main/java/mage/view/GameView.java @@ -164,8 +164,8 @@ public class GameView implements Serializable { companion.add(new RevealedView(name, state.getCompanion().get(name), game)); } } - this.phase = state.getTurn().getPhaseType(); - this.step = state.getTurn().getStepType(); + this.phase = state.getTurnPhaseType(); + this.step = state.getTurnStepType(); this.turn = state.getTurnNum(); this.activePlayerId = state.getActivePlayerId(); if (state.getActivePlayerId() != null) { diff --git a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ComputerPlayer6.java b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ComputerPlayer6.java index 19b668adf1e..42a00000c2e 100644 --- a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ComputerPlayer6.java +++ b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ComputerPlayer6.java @@ -248,7 +248,7 @@ public class ComputerPlayer6 extends ComputerPlayer /*implements Player*/ { } val = minimaxAB(node, depth - 1, alpha, beta); } else { - logger.trace("Add Action -- alpha: " + alpha + " beta: " + beta + " depth:" + depth + " step:" + game.getTurn().getStepType() + " for player:" + game.getPlayer(game.getActivePlayerId()).getName()); + logger.trace("Add Action -- alpha: " + alpha + " beta: " + beta + " depth:" + depth + " step:" + game.getTurnStepType() + " for player:" + game.getPlayer(game.getActivePlayerId()).getName()); if (allPassed(game)) { if (!game.getStack().isEmpty()) { resolve(node, depth, game); @@ -291,7 +291,7 @@ public class ComputerPlayer6 extends ComputerPlayer /*implements Player*/ { } } node.setScore(val); - logger.trace("returning -- score: " + val + " depth:" + depth + " step:" + game.getTurn().getStepType() + " for player:" + game.getPlayer(node.getPlayerId()).getName()); + logger.trace("returning -- score: " + val + " depth:" + depth + " step:" + game.getTurnStepType() + " for player:" + game.getPlayer(node.getPlayerId()).getName()); return val; } diff --git a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ComputerPlayer7.java b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ComputerPlayer7.java index dd8ee09aa40..6173a8df632 100644 --- a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ComputerPlayer7.java +++ b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ComputerPlayer7.java @@ -45,10 +45,10 @@ public class ComputerPlayer7 extends ComputerPlayer6 { logger.info("======================= Turn: " + game.getTurnNum() + " [" + game.getPlayer(game.getActivePlayerId()).getName() + "] ========================================="); } logState(game); - logger.debug("Priority -- Step: " + (game.getTurn().getStepType() + " ").substring(0, 25) + " ActivePlayer-" + game.getPlayer(game.getActivePlayerId()).getName() + " PriorityPlayer-" + name); + logger.debug("Priority -- Step: " + (game.getTurnStepType() + " ").substring(0, 25) + " ActivePlayer-" + game.getPlayer(game.getActivePlayerId()).getName() + " PriorityPlayer-" + name); game.getState().setPriorityPlayerId(playerId); game.firePriorityEvent(playerId); - switch (game.getTurn().getStepType()) { + switch (game.getTurnStepType()) { case UPKEEP: case DRAW: pass(game); diff --git a/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java b/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java index 0725a028f66..e62d33a7373 100644 --- a/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java +++ b/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java @@ -1266,7 +1266,7 @@ public class ComputerPlayer extends PlayerImpl implements Player { if (game.isMainPhase() && game.getStack().isEmpty()) { playLand(game); } - switch (game.getTurn().getStepType()) { + switch (game.getTurnStepType()) { case UPKEEP: findPlayables(game); break; @@ -1331,7 +1331,7 @@ public class ComputerPlayer extends PlayerImpl implements Player { } } else { //respond to opponent events - switch (game.getTurn().getStepType()) { + switch (game.getTurnStepType()) { case UPKEEP: findPlayables(game); break; diff --git a/Mage.Server.Plugins/Mage.Player.AIMCTS/src/mage/player/ai/ComputerPlayerMCTS.java b/Mage.Server.Plugins/Mage.Player.AIMCTS/src/mage/player/ai/ComputerPlayerMCTS.java index b9eba1c9e1e..e34da5d762a 100644 --- a/Mage.Server.Plugins/Mage.Player.AIMCTS/src/mage/player/ai/ComputerPlayerMCTS.java +++ b/Mage.Server.Plugins/Mage.Player.AIMCTS/src/mage/player/ai/ComputerPlayerMCTS.java @@ -61,7 +61,7 @@ public class ComputerPlayerMCTS extends ComputerPlayer implements Player { @Override public boolean priority(Game game) { - if (game.getStep().getType() == PhaseStep.UPKEEP) { + if (game.getTurnStepType() == PhaseStep.UPKEEP) { if (!lastPhase.equals(game.getTurn().getValue(game.getTurnNum()))) { logList(game.getTurn().getValue(game.getTurnNum()) + name + " hand: ", new ArrayList(hand.getCards(game))); lastPhase = game.getTurn().getValue(game.getTurnNum()); @@ -236,7 +236,7 @@ public class ComputerPlayerMCTS extends ComputerPlayer implements Player { if (root.getNumChildren() > 0) nodeSizeRatio = root.getVisits() / root.getNumChildren(); // logger.info("Ratio: " + nodeSizeRatio); - PhaseStep curStep = game.getStep().getType(); + PhaseStep curStep = game.getTurnStepType(); if (action == NextAction.SELECT_ATTACKERS || action == NextAction.SELECT_BLOCKERS) { if (nodeSizeRatio < THINK_MIN_RATIO) { thinkTime = maxThinkTime; diff --git a/Mage.Server.Plugins/Mage.Player.AIMCTS/src/mage/player/ai/MCTSNode.java b/Mage.Server.Plugins/Mage.Player.AIMCTS/src/mage/player/ai/MCTSNode.java index 7fbd3a7da12..467ca4ea562 100644 --- a/Mage.Server.Plugins/Mage.Player.AIMCTS/src/mage/player/ai/MCTSNode.java +++ b/Mage.Server.Plugins/Mage.Player.AIMCTS/src/mage/player/ai/MCTSNode.java @@ -89,7 +89,7 @@ public class MCTSNode { if (game.getStep().getStepPart() == StepPart.PRIORITY) { playerId = game.getPriorityPlayerId(); } else { - if (game.getStep().getType() == PhaseStep.DECLARE_BLOCKERS) { + if (game.getTurnStepType() == PhaseStep.DECLARE_BLOCKERS) { playerId = game.getCombat().getDefenders().iterator().next(); } else { playerId = game.getActivePlayerId(); @@ -129,7 +129,7 @@ public class MCTSNode { } switch (player.getNextAction()) { case PRIORITY: -// logger.info("Priority for player:" + player.getName() + " turn: " + game.getTurnNum() + " phase: " + game.getPhase().getType() + " step: " + game.getStep().getType()); +// logger.info("Priority for player:" + player.getName() + " turn: " + game.getTurnNum() + " phase: " + game.getTurnPhaseType() + " step: " + game.getTurnStepType()); List abilities; if (!USE_ACTION_CACHE) abilities = player.getPlayableOptions(game); diff --git a/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java b/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java index b49eef285df..0a283cd4ba7 100644 --- a/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java +++ b/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java @@ -1022,7 +1022,7 @@ public class HumanPlayer extends PlayerImpl { boolean quickStop = false; if (isGameUnderControl()) { // TODO: remove to enable quick stop for controlling player // if was attacked - always stop BEFORE blocker step (to cast extra spells) - if (game.getTurn().getStepType() == PhaseStep.DECLARE_ATTACKERS + if (game.getTurnStepType() == PhaseStep.DECLARE_ATTACKERS && game.getCombat().getPlayerDefenders(game).contains(playerId)) { FilterCreatureForCombatBlock filter = filterCreatureForCombatBlock.copy(); filter.add(new ControllerIdPredicate(playerId)); @@ -1044,7 +1044,7 @@ public class HumanPlayer extends PlayerImpl { } if (passedUntilEndStepBeforeMyTurn) { - if (game.getTurn().getStepType() != PhaseStep.END_TURN) { + if (game.getTurnStepType() != PhaseStep.END_TURN) { // other step if (passWithManaPoolCheck(game)) { return false; @@ -1080,8 +1080,8 @@ public class HumanPlayer extends PlayerImpl { } if (passedUntilNextMain) { - if (game.getTurn().getStepType() == PhaseStep.POSTCOMBAT_MAIN - || game.getTurn().getStepType() == PhaseStep.PRECOMBAT_MAIN) { + if (game.getTurnStepType() == PhaseStep.POSTCOMBAT_MAIN + || game.getTurnStepType() == PhaseStep.PRECOMBAT_MAIN) { // it's main step if (!skippedAtLeastOnce || (!playerId.equals(game.getActivePlayerId()) @@ -1103,7 +1103,7 @@ public class HumanPlayer extends PlayerImpl { } if (passedUntilEndOfTurn) { - if (game.getTurn().getStepType() == PhaseStep.END_TURN) { + if (game.getTurnStepType() == PhaseStep.END_TURN) { // it's end of turn step if (!skippedAtLeastOnce || (playerId.equals(game.getActivePlayerId()) @@ -1271,16 +1271,16 @@ public class HumanPlayer extends PlayerImpl { try { if (playerId.equals(game.getActivePlayerId())) { - return !controllingPlayer.getUserData().getUserSkipPrioritySteps().getYourTurn().isPhaseStepSet(game.getStep().getType()); + return !controllingPlayer.getUserData().getUserSkipPrioritySteps().getYourTurn().isPhaseStepSet(game.getTurnStepType()); } else { - return !controllingPlayer.getUserData().getUserSkipPrioritySteps().getOpponentTurn().isPhaseStepSet(game.getStep().getType()); + return !controllingPlayer.getUserData().getUserSkipPrioritySteps().getOpponentTurn().isPhaseStepSet(game.getTurnStepType()); } } catch (NullPointerException ex) { if (controllingPlayer.getUserData() != null) { if (controllingPlayer.getUserData().getUserSkipPrioritySteps() != null) { if (game.getStep() != null) { - if (game.getStep().getType() == null) { - logger.error("game.getStep().getType() == null"); + if (game.getTurnStepType() == null) { + logger.error("game.getTurnStepType() == null"); } } else { logger.error("game.getStep() == null"); @@ -2659,7 +2659,7 @@ public class HumanPlayer extends PlayerImpl { } // TODO: chooseUse and other dialogs must be under controlling player if (!chooseUse(Outcome.Detriment, GameLog.getPlayerConfirmColoredText("You still have mana in your mana pool. Pass regardless?") - + GameLog.getSmallSecondLineText(activePlayerText + " / " + game.getStep().getType().toString() + priorityPlayerText), null, game)) { + + GameLog.getSmallSecondLineText(activePlayerText + " / " + game.getTurnStepType().toString() + priorityPlayerText), null, game)) { sendPlayerAction(PlayerAction.PASS_PRIORITY_CANCEL_ALL_ACTIONS, game, null); return false; } diff --git a/Mage.Server/src/main/java/mage/server/game/GameController.java b/Mage.Server/src/main/java/mage/server/game/GameController.java index 9c0ea67c281..592d7878436 100644 --- a/Mage.Server/src/main/java/mage/server/game/GameController.java +++ b/Mage.Server/src/main/java/mage/server/game/GameController.java @@ -877,7 +877,7 @@ public class GameController implements GameCallback { private void informOthers(UUID playerId) throws MageException { StringBuilder message = new StringBuilder(); if (game.getStep() != null) { - message.append(game.getStep().getType().toString()).append(" - "); + message.append(game.getTurnStepType().toString()).append(" - "); } message.append("Waiting for ").append(game.getPlayer(playerId).getLogName()); for (final Entry entry : getGameSessionsMap().entrySet()) { @@ -896,10 +896,10 @@ public class GameController implements GameCallback { if (players != null && !players.isEmpty()) { controller = game.getPlayer(players.get(0)); } - if (controller == null || game.getStep() == null || game.getStep().getType() == null) { + if (controller == null || game.getStep() == null || game.getTurnStepType() == null) { return; } - final String message = new StringBuilder(game.getStep().getType().toString()).append(" - Waiting for ").append(controller.getName()).toString(); + final String message = new StringBuilder(game.getTurnStepType().toString()).append(" - Waiting for ").append(controller.getName()).toString(); for (final Entry entry : getGameSessionsMap().entrySet()) { boolean skip = players.stream().anyMatch(playerId -> entry.getKey().equals(playerId)); if (!skip) { @@ -1296,10 +1296,10 @@ public class GameController implements GameCallback { sb.append("FIX command called by ").append(user.getName()).append(""); sb.append(""); // font resize start for all next logs sb.append("
Game ID: ").append(game.getId()); - if (game.getTurn().getPhaseType() == null) { + if (game.getTurnPhaseType() == null) { sb.append("
Phase: not started").append(" Step: not started"); } else { - sb.append("
Phase: ").append(game.getTurn().getPhaseType().toString()).append(" Step: ").append(game.getTurn().getStepType().toString()); + sb.append("
Phase: ").append(game.getTurnPhaseType().toString()).append(" Step: ").append(game.getTurnStepType().toString()); } // pings info sb.append("
"); diff --git a/Mage.Sets/src/mage/cards/a/AngusMackenzie.java b/Mage.Sets/src/mage/cards/a/AngusMackenzie.java index b61738dc893..41b850330eb 100644 --- a/Mage.Sets/src/mage/cards/a/AngusMackenzie.java +++ b/Mage.Sets/src/mage/cards/a/AngusMackenzie.java @@ -62,7 +62,7 @@ class BeforeCombatDamageCondition implements Condition { @Override public boolean apply(Game game, Ability source) { - PhaseStep phaseStep = game.getStep().getType(); + PhaseStep phaseStep = game.getTurnStepType(); if(phaseStep.getIndex() < PhaseStep.FIRST_COMBAT_DAMAGE.getIndex()) { return true; } diff --git a/Mage.Sets/src/mage/cards/a/AshenGhoul.java b/Mage.Sets/src/mage/cards/a/AshenGhoul.java index 9dada968139..739c9488d1e 100644 --- a/Mage.Sets/src/mage/cards/a/AshenGhoul.java +++ b/Mage.Sets/src/mage/cards/a/AshenGhoul.java @@ -61,7 +61,7 @@ enum AshenGhoulCondition implements Condition { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (game.getStep().getType() != PhaseStep.UPKEEP + if (game.getTurnStepType() != PhaseStep.UPKEEP || !game.isActivePlayer(source.getControllerId())) { return false; } diff --git a/Mage.Sets/src/mage/cards/b/BasandraBattleSeraph.java b/Mage.Sets/src/mage/cards/b/BasandraBattleSeraph.java index b27e06f3bfc..afd9bccb8ea 100644 --- a/Mage.Sets/src/mage/cards/b/BasandraBattleSeraph.java +++ b/Mage.Sets/src/mage/cards/b/BasandraBattleSeraph.java @@ -84,7 +84,7 @@ class BasandraBattleSeraphEffect extends ContinuousRuleModifyingEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (game.getPhase().getType() == TurnPhase.COMBAT) { + if (game.getTurnPhaseType() == TurnPhase.COMBAT) { return true; } return false; diff --git a/Mage.Sets/src/mage/cards/b/BerserkersFrenzy.java b/Mage.Sets/src/mage/cards/b/BerserkersFrenzy.java index 744b5503e4e..284eab7380a 100644 --- a/Mage.Sets/src/mage/cards/b/BerserkersFrenzy.java +++ b/Mage.Sets/src/mage/cards/b/BerserkersFrenzy.java @@ -68,8 +68,8 @@ enum BerserkersFrenzyCondition implements Condition { @Override public boolean apply(Game game, Ability source) { - if (game.getPhase().getType() == TurnPhase.COMBAT) { - return game.getStep().getType().isBefore(PhaseStep.DECLARE_BLOCKERS); + if (game.getTurnPhaseType() == TurnPhase.COMBAT) { + return game.getTurnStepType().isBefore(PhaseStep.DECLARE_BLOCKERS); } return !game.getTurn().isDeclareAttackersStepStarted(); } diff --git a/Mage.Sets/src/mage/cards/b/BlindingBeam.java b/Mage.Sets/src/mage/cards/b/BlindingBeam.java index e208efa112e..1a952f94b58 100644 --- a/Mage.Sets/src/mage/cards/b/BlindingBeam.java +++ b/Mage.Sets/src/mage/cards/b/BlindingBeam.java @@ -132,7 +132,7 @@ class BlindingBeamEffect2 extends ContinuousRuleModifyingEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { // prevent untap event of creatures of target player - if (game.getTurn().getStepType() == PhaseStep.UNTAP) { + if (game.getTurnStepType() == PhaseStep.UNTAP) { Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null && permanent.isControlledBy(targetPlayerId) && filter.match(permanent, game)) { return true; diff --git a/Mage.Sets/src/mage/cards/b/BloodFrenzy.java b/Mage.Sets/src/mage/cards/b/BloodFrenzy.java index 046282d6a5a..8e7c4fe21a1 100644 --- a/Mage.Sets/src/mage/cards/b/BloodFrenzy.java +++ b/Mage.Sets/src/mage/cards/b/BloodFrenzy.java @@ -68,11 +68,11 @@ class BloodFrenzyCastRestriction extends ContinuousRuleModifyingEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { if(event.getSourceId().equals(source.getSourceId())) { - if(game.getPhase().getType() == TurnPhase.COMBAT + if(game.getTurnPhaseType() == TurnPhase.COMBAT // There cannot be a legal target before declare attackers, // so in practice it is limited to these two steps. - && (game.getStep().getType() == PhaseStep.DECLARE_ATTACKERS - || game.getStep().getType() == PhaseStep.DECLARE_BLOCKERS)) { + && (game.getTurnStepType() == PhaseStep.DECLARE_ATTACKERS + || game.getTurnStepType() == PhaseStep.DECLARE_BLOCKERS)) { return false; } return true; diff --git a/Mage.Sets/src/mage/cards/c/CathedralMembrane.java b/Mage.Sets/src/mage/cards/c/CathedralMembrane.java index 65c6e374de8..923776d1012 100644 --- a/Mage.Sets/src/mage/cards/c/CathedralMembrane.java +++ b/Mage.Sets/src/mage/cards/c/CathedralMembrane.java @@ -67,7 +67,7 @@ class CathedralMembraneAbility extends ZoneChangeTriggeredAbility { @Override public boolean checkTrigger(GameEvent event, Game game) { if (super.checkTrigger(event, game)) { - if (game.getPhase().getType() == TurnPhase.COMBAT) { + if (game.getTurnPhaseType() == TurnPhase.COMBAT) { return true; } } diff --git a/Mage.Sets/src/mage/cards/c/CorrosiveOoze.java b/Mage.Sets/src/mage/cards/c/CorrosiveOoze.java index 636ac17ecf1..af16cadf34e 100644 --- a/Mage.Sets/src/mage/cards/c/CorrosiveOoze.java +++ b/Mage.Sets/src/mage/cards/c/CorrosiveOoze.java @@ -153,7 +153,7 @@ class CorrosiveOozeCombatWatcher extends Watcher { if (event.getType() == GameEvent.EventType.ZONE_CHANGE) { if (((ZoneChangeEvent) event).getFromZone() == Zone.BATTLEFIELD) { - if (game.getTurn() != null && TurnPhase.COMBAT == game.getTurn().getPhaseType()) { + if (game.getTurn() != null && TurnPhase.COMBAT == game.getTurnPhaseType()) { // Check if a previous blocked or blocked by creatures is leaving the battlefield for (Map.Entry> entry : oozeBlocksOrBlocked.entrySet()) { for (MageObjectReference mor : entry.getValue()) { diff --git a/Mage.Sets/src/mage/cards/d/DwarvenSeaClan.java b/Mage.Sets/src/mage/cards/d/DwarvenSeaClan.java index 4f0c91b700e..fa3a13b4df6 100644 --- a/Mage.Sets/src/mage/cards/d/DwarvenSeaClan.java +++ b/Mage.Sets/src/mage/cards/d/DwarvenSeaClan.java @@ -72,7 +72,7 @@ class BeforeEndCombatCondition implements Condition { @Override public boolean apply(Game game, Ability source) { - PhaseStep phaseStep = game.getStep().getType(); + PhaseStep phaseStep = game.getTurnStepType(); if(phaseStep.getIndex() < PhaseStep.END_COMBAT.getIndex()) { return true; } diff --git a/Mage.Sets/src/mage/cards/g/GideonBattleForged.java b/Mage.Sets/src/mage/cards/g/GideonBattleForged.java index 67ddfbe2f58..5cc7546e7c9 100644 --- a/Mage.Sets/src/mage/cards/g/GideonBattleForged.java +++ b/Mage.Sets/src/mage/cards/g/GideonBattleForged.java @@ -127,7 +127,7 @@ class GideonBattleForgedAttacksIfAbleTargetEffect extends RequirementEffect { if (targetPermanent == null) { return true; } - return game.getPhase().getType() == TurnPhase.END && this.isYourNextTurn(game); // discard on end of their next turn + return game.getTurnPhaseType() == TurnPhase.END && this.isYourNextTurn(game); // discard on end of their next turn } @Override diff --git a/Mage.Sets/src/mage/cards/g/GideonJura.java b/Mage.Sets/src/mage/cards/g/GideonJura.java index 6da6c4e7efb..2de02b040b7 100644 --- a/Mage.Sets/src/mage/cards/g/GideonJura.java +++ b/Mage.Sets/src/mage/cards/g/GideonJura.java @@ -123,7 +123,7 @@ class GideonJuraEffect extends RequirementEffect { @Override public boolean isInactive(Ability source, Game game) { - return (game.getPhase().getType() == TurnPhase.END && this.isYourNextTurn(game)) + return (game.getTurnPhaseType() == TurnPhase.END && this.isYourNextTurn(game)) // 6/15/2010: If a creature controlled by the affected player can't attack Gideon Jura // (because he's no longer on the battlefield, for example), that player may have it attack you, // another one of your planeswalkers, or nothing at all. diff --git a/Mage.Sets/src/mage/cards/g/GoblinRockSled.java b/Mage.Sets/src/mage/cards/g/GoblinRockSled.java index 7ae0c185b8e..42958248560 100644 --- a/Mage.Sets/src/mage/cards/g/GoblinRockSled.java +++ b/Mage.Sets/src/mage/cards/g/GoblinRockSled.java @@ -91,7 +91,7 @@ class DontUntapIfAttackedLastTurnSourceEffect extends ContinuousRuleModifyingEff @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (game.getTurn().getStepType() == PhaseStep.UNTAP + if (game.getTurnStepType() == PhaseStep.UNTAP && event.getTargetId().equals(source.getSourceId())) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null && permanent.isControlledBy(game.getActivePlayerId())) { diff --git a/Mage.Sets/src/mage/cards/h/HakimLoreweaver.java b/Mage.Sets/src/mage/cards/h/HakimLoreweaver.java index be8563dd853..b2bf82bd9e5 100644 --- a/Mage.Sets/src/mage/cards/h/HakimLoreweaver.java +++ b/Mage.Sets/src/mage/cards/h/HakimLoreweaver.java @@ -125,7 +125,7 @@ enum HakimLoreweaverCondition implements Condition { @Override public boolean apply(Game game, Ability source) { - if (PhaseStep.UPKEEP != game.getStep().getType() + if (PhaseStep.UPKEEP != game.getTurnStepType() || !game.isActivePlayer(source.getControllerId())) { return false; } diff --git a/Mage.Sets/src/mage/cards/h/Halfdane.java b/Mage.Sets/src/mage/cards/h/Halfdane.java index 8c44950e810..9a4b4a4c098 100644 --- a/Mage.Sets/src/mage/cards/h/Halfdane.java +++ b/Mage.Sets/src/mage/cards/h/Halfdane.java @@ -95,7 +95,7 @@ class HalfdaneSetBasePowerToughnessEffect extends SetBasePowerToughnessSourceEff @Override public boolean isInactive(Ability source, Game game) { - if (super.isInactive(source, game) && game.getStep().getType().isAfter(PhaseStep.UPKEEP)) { + if (super.isInactive(source, game) && game.getTurnStepType().isAfter(PhaseStep.UPKEEP)) { return true; } return false; diff --git a/Mage.Sets/src/mage/cards/h/HandToHand.java b/Mage.Sets/src/mage/cards/h/HandToHand.java index a16e107c437..941c365d892 100644 --- a/Mage.Sets/src/mage/cards/h/HandToHand.java +++ b/Mage.Sets/src/mage/cards/h/HandToHand.java @@ -69,7 +69,7 @@ class HandToHandEffect extends ContinuousRuleModifyingEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (game.getPhase().getType() == TurnPhase.COMBAT) { + if (game.getTurnPhaseType() == TurnPhase.COMBAT) { MageObject object = game.getObject(event.getSourceId()); if (event.getType() == GameEvent.EventType.CAST_SPELL) { if (object != null && object.isInstant(game)) { diff --git a/Mage.Sets/src/mage/cards/h/HeavyArbalest.java b/Mage.Sets/src/mage/cards/h/HeavyArbalest.java index 4bc88c9a740..afbf33446d5 100644 --- a/Mage.Sets/src/mage/cards/h/HeavyArbalest.java +++ b/Mage.Sets/src/mage/cards/h/HeavyArbalest.java @@ -86,7 +86,7 @@ class HeavyArbalestEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (game.getTurn().getStepType() == PhaseStep.UNTAP) { + if (game.getTurnStepType() == PhaseStep.UNTAP) { Permanent equipment = game.getPermanent(source.getSourceId()); if (equipment != null && equipment.getAttachedTo() != null) { Permanent equipped = game.getPermanent(equipment.getAttachedTo()); diff --git a/Mage.Sets/src/mage/cards/h/Hullbreacher.java b/Mage.Sets/src/mage/cards/h/Hullbreacher.java index b78037d8053..c82f6eb3545 100644 --- a/Mage.Sets/src/mage/cards/h/Hullbreacher.java +++ b/Mage.Sets/src/mage/cards/h/Hullbreacher.java @@ -86,7 +86,7 @@ class HullbreacherReplacementEffect extends ReplacementEffectImpl { return false; } if (!game.isActivePlayer(event.getPlayerId()) - || game.getStep().getType() != PhaseStep.DRAW) { + || game.getTurnStepType() != PhaseStep.DRAW) { return true; } CardsDrawnDuringDrawStepWatcher watcher = game.getState().getWatcher(CardsDrawnDuringDrawStepWatcher.class); diff --git a/Mage.Sets/src/mage/cards/i/IllusionistsGambit.java b/Mage.Sets/src/mage/cards/i/IllusionistsGambit.java index c41cd46e386..0b0d29dc1f6 100644 --- a/Mage.Sets/src/mage/cards/i/IllusionistsGambit.java +++ b/Mage.Sets/src/mage/cards/i/IllusionistsGambit.java @@ -116,7 +116,7 @@ class IllusionistsGambitRequirementEffect extends RequirementEffect { @Override public boolean isInactive(Ability source, Game game) { - if (game.getTurn().getStepType() == PhaseStep.END_COMBAT) { + if (game.getTurnStepType() == PhaseStep.END_COMBAT) { return !Objects.equals(game.getTurn().getPhase(), phase); } return false; @@ -158,7 +158,7 @@ class IllusionistsGambitRestrictionEffect extends RestrictionEffect { @Override public boolean isInactive(Ability source, Game game) { - if (game.getTurn().getStepType() == PhaseStep.END_COMBAT) { + if (game.getTurnStepType() == PhaseStep.END_COMBAT) { return !Objects.equals(game.getTurn().getPhase(), phase); } return false; diff --git a/Mage.Sets/src/mage/cards/i/IslandSanctuary.java b/Mage.Sets/src/mage/cards/i/IslandSanctuary.java index 7e5548813ca..ed2a4a20960 100644 --- a/Mage.Sets/src/mage/cards/i/IslandSanctuary.java +++ b/Mage.Sets/src/mage/cards/i/IslandSanctuary.java @@ -81,7 +81,7 @@ class IslandSanctuaryEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - return source.isControlledBy(event.getPlayerId()) && game.getTurn().getStepType() == PhaseStep.DRAW && game.getActivePlayerId().equals(source.getControllerId()); + return source.isControlledBy(event.getPlayerId()) && game.getTurnStepType() == PhaseStep.DRAW && game.getActivePlayerId().equals(source.getControllerId()); } @Override diff --git a/Mage.Sets/src/mage/cards/k/KillSwitch.java b/Mage.Sets/src/mage/cards/k/KillSwitch.java index 2586798764d..34d31e5c511 100644 --- a/Mage.Sets/src/mage/cards/k/KillSwitch.java +++ b/Mage.Sets/src/mage/cards/k/KillSwitch.java @@ -109,7 +109,7 @@ class KillSwitchUntapEffect extends ContinuousRuleModifyingEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (game.getTurn().getStepType() != PhaseStep.UNTAP) { + if (game.getTurnStepType() != PhaseStep.UNTAP) { return false; } Permanent sourcePermanent = source.getSourcePermanentIfItStillExists(game); diff --git a/Mage.Sets/src/mage/cards/m/ManaCache.java b/Mage.Sets/src/mage/cards/m/ManaCache.java index 716ae7d3050..9596b6a6f1d 100644 --- a/Mage.Sets/src/mage/cards/m/ManaCache.java +++ b/Mage.Sets/src/mage/cards/m/ManaCache.java @@ -104,7 +104,7 @@ class ManaCacheManaAbility extends ActivatedManaAbilityImpl { Player player = game.getPlayer(playerId); if (player == null || !playerId.equals(game.getActivePlayerId()) - || !game.getStep().getType().isBefore(PhaseStep.END_TURN)) { + || !game.getTurnStepType().isBefore(PhaseStep.END_TURN)) { return ActivationStatus.getFalse(); } diff --git a/Mage.Sets/src/mage/cards/m/MarisiBreakerOfTheCoil.java b/Mage.Sets/src/mage/cards/m/MarisiBreakerOfTheCoil.java index 8b5c14d8839..ccfd8e736b8 100644 --- a/Mage.Sets/src/mage/cards/m/MarisiBreakerOfTheCoil.java +++ b/Mage.Sets/src/mage/cards/m/MarisiBreakerOfTheCoil.java @@ -79,7 +79,7 @@ class MarisiBreakerOfTheCoilSpellEffect extends ContinuousRuleModifyingEffectImp @Override public boolean applies(GameEvent event, Ability source, Game game) { - return game.getPhase().getType() == TurnPhase.COMBAT + return game.getTurnPhaseType() == TurnPhase.COMBAT && game.getOpponents(source.getControllerId()).contains(event.getPlayerId()); } } diff --git a/Mage.Sets/src/mage/cards/m/MongrelPack.java b/Mage.Sets/src/mage/cards/m/MongrelPack.java index 94d40ab16df..30536fdb973 100644 --- a/Mage.Sets/src/mage/cards/m/MongrelPack.java +++ b/Mage.Sets/src/mage/cards/m/MongrelPack.java @@ -59,7 +59,7 @@ class MongrelPackAbility extends ZoneChangeTriggeredAbility { @Override public boolean checkTrigger(GameEvent event, Game game) { if (super.checkTrigger(event, game)) { - if (game.getPhase().getType() == TurnPhase.COMBAT) { + if (game.getTurnPhaseType() == TurnPhase.COMBAT) { return true; } } diff --git a/Mage.Sets/src/mage/cards/m/MoraugFuryOfAkoum.java b/Mage.Sets/src/mage/cards/m/MoraugFuryOfAkoum.java index e74916a4ca7..447be56bacc 100644 --- a/Mage.Sets/src/mage/cards/m/MoraugFuryOfAkoum.java +++ b/Mage.Sets/src/mage/cards/m/MoraugFuryOfAkoum.java @@ -63,7 +63,7 @@ enum MoraugFuryOfAkoumCondition implements Condition { @Override public boolean apply(Game game, Ability source) { - return game.isActivePlayer(source.getControllerId()) && game.getPhase().getType().isMain(); + return game.isActivePlayer(source.getControllerId()) && game.getTurnPhaseType().isMain(); } } @@ -113,7 +113,7 @@ class MoraugFuryOfAkoumCombatEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - TurnPhase turnPhase = game.getPhase().getType(); + TurnPhase turnPhase = game.getTurnPhaseType(); for (TurnMod turnMod : game.getState().getTurnMods()) { if ("moraug".equals(turnMod.getNote()) && turnMod.getPlayerId().equals(source.getControllerId()) diff --git a/Mage.Sets/src/mage/cards/n/NemesisPhoenix.java b/Mage.Sets/src/mage/cards/n/NemesisPhoenix.java index dbbcefb6b69..16bbb5edeb1 100644 --- a/Mage.Sets/src/mage/cards/n/NemesisPhoenix.java +++ b/Mage.Sets/src/mage/cards/n/NemesisPhoenix.java @@ -58,7 +58,7 @@ enum NemesisPhoenixCondition implements Condition { @Override public boolean apply(Game game, Ability source) { - if (game.getStep().getType() != PhaseStep.DECLARE_ATTACKERS) { + if (game.getTurnStepType() != PhaseStep.DECLARE_ATTACKERS) { return false; } Set opponents = game.getOpponents(source.getControllerId()); diff --git a/Mage.Sets/src/mage/cards/n/NotionThief.java b/Mage.Sets/src/mage/cards/n/NotionThief.java index 4a034b6dd20..f333fa19ab8 100644 --- a/Mage.Sets/src/mage/cards/n/NotionThief.java +++ b/Mage.Sets/src/mage/cards/n/NotionThief.java @@ -89,7 +89,7 @@ class NotionThiefReplacementEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { - if (game.isActivePlayer(event.getPlayerId()) && game.getStep().getType() == PhaseStep.DRAW) { + if (game.isActivePlayer(event.getPlayerId()) && game.getTurnStepType() == PhaseStep.DRAW) { CardsDrawnDuringDrawStepWatcher watcher = game.getState().getWatcher(CardsDrawnDuringDrawStepWatcher.class); if (watcher != null && watcher.getAmountCardsDrawn(event.getPlayerId()) > 0) { return true; diff --git a/Mage.Sets/src/mage/cards/o/OracleEnVec.java b/Mage.Sets/src/mage/cards/o/OracleEnVec.java index be139101af4..3b90f7a8c95 100644 --- a/Mage.Sets/src/mage/cards/o/OracleEnVec.java +++ b/Mage.Sets/src/mage/cards/o/OracleEnVec.java @@ -150,7 +150,7 @@ class OracleEnVecMustAttackRequirementEffect extends RequirementEffect { @Override public boolean isInactive(Ability source, Game game) { - return game.getPhase().getType() == TurnPhase.END && this.isYourNextTurn(game); + return game.getTurnPhaseType() == TurnPhase.END && this.isYourNextTurn(game); } @Override @@ -199,7 +199,7 @@ class OracleEnVecCantAttackRestrictionEffect extends RestrictionEffect { @Override public boolean isInactive(Ability source, Game game) { - return game.getPhase().getType() == TurnPhase.END && this.isYourNextTurn(game); + return game.getTurnPhaseType() == TurnPhase.END && this.isYourNextTurn(game); } } diff --git a/Mage.Sets/src/mage/cards/r/RowanKenrith.java b/Mage.Sets/src/mage/cards/r/RowanKenrith.java index 6013b149646..229d91b9d23 100644 --- a/Mage.Sets/src/mage/cards/r/RowanKenrith.java +++ b/Mage.Sets/src/mage/cards/r/RowanKenrith.java @@ -92,7 +92,7 @@ class RowanKenrithAttackEffect extends RequirementEffect { @Override public boolean isInactive(Ability source, Game game) { - return (game.getPhase().getType() == TurnPhase.END + return (game.getTurnPhaseType() == TurnPhase.END && this.isYourNextTurn(game)); } diff --git a/Mage.Sets/src/mage/cards/s/SizzlingSoloist.java b/Mage.Sets/src/mage/cards/s/SizzlingSoloist.java index fa01c7500ad..8c67c686496 100644 --- a/Mage.Sets/src/mage/cards/s/SizzlingSoloist.java +++ b/Mage.Sets/src/mage/cards/s/SizzlingSoloist.java @@ -75,8 +75,8 @@ class SizzlingSoloistEffect extends RequirementEffect { return true; } return game.isActivePlayer(game.getControllerId(getTargetPointer().getFirst(game, source))) - && game.getPhase().getType() == TurnPhase.COMBAT - && game.getStep().getType() == PhaseStep.END_COMBAT; + && game.getTurnPhaseType() == TurnPhase.COMBAT + && game.getTurnStepType() == PhaseStep.END_COMBAT; } @Override diff --git a/Mage.Sets/src/mage/cards/s/SphinxOfTheSecondSun.java b/Mage.Sets/src/mage/cards/s/SphinxOfTheSecondSun.java index 5a929f62ff0..c9ee70bac15 100644 --- a/Mage.Sets/src/mage/cards/s/SphinxOfTheSecondSun.java +++ b/Mage.Sets/src/mage/cards/s/SphinxOfTheSecondSun.java @@ -64,7 +64,7 @@ class SphinxOfTheSecondSunEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - TurnPhase turnPhase = game.getPhase().getType(); + TurnPhase turnPhase = game.getTurnPhaseType(); for (TurnMod turnMod : game.getState().getTurnMods()) { if ("sphinxSecondSun".equals(turnMod.getNote()) && turnMod.getPlayerId().equals(source.getControllerId()) diff --git a/Mage.Sets/src/mage/cards/s/StorageMatrix.java b/Mage.Sets/src/mage/cards/s/StorageMatrix.java index a842bd1c8e0..c5f39024ae1 100644 --- a/Mage.Sets/src/mage/cards/s/StorageMatrix.java +++ b/Mage.Sets/src/mage/cards/s/StorageMatrix.java @@ -69,7 +69,7 @@ class StorageMatrixRestrictionEffect extends RestrictionEffect { @Override public boolean applies(Permanent permanent, Ability source, Game game) { - if (game.getStep().getType() == PhaseStep.UNTAP) { + if (game.getTurnStepType() == PhaseStep.UNTAP) { if (game.getTurnNum() != turn) { turn = game.getTurnNum(); applies = false; diff --git a/Mage.Sets/src/mage/cards/t/TangleKelp.java b/Mage.Sets/src/mage/cards/t/TangleKelp.java index 019526a98d3..53b5e5f022c 100644 --- a/Mage.Sets/src/mage/cards/t/TangleKelp.java +++ b/Mage.Sets/src/mage/cards/t/TangleKelp.java @@ -101,7 +101,7 @@ class DontUntapIfAttackedLastTurnEnchantedEffect extends ContinuousRuleModifying @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (game.getTurn().getStepType() == PhaseStep.UNTAP) { + if (game.getTurnStepType() == PhaseStep.UNTAP) { Permanent enchantment = game.getPermanent(source.getSourceId()); if (enchantment != null && enchantment.getAttachedTo() != null && event.getTargetId().equals(enchantment.getAttachedTo())) { Permanent permanent = game.getPermanent(enchantment.getAttachedTo()); diff --git a/Mage.Sets/src/mage/cards/t/Taunt.java b/Mage.Sets/src/mage/cards/t/Taunt.java index 7bd0e01116a..cd8c2b91f83 100644 --- a/Mage.Sets/src/mage/cards/t/Taunt.java +++ b/Mage.Sets/src/mage/cards/t/Taunt.java @@ -59,7 +59,7 @@ class TauntEffect extends RequirementEffect { @Override public boolean isInactive(Ability source, Game game) { - return game.getPhase().getType() == TurnPhase.END && this.isYourNextTurn(game); + return game.getTurnPhaseType() == TurnPhase.END && this.isYourNextTurn(game); } @Override diff --git a/Mage.Sets/src/mage/cards/t/TrenchBehemoth.java b/Mage.Sets/src/mage/cards/t/TrenchBehemoth.java index 1e79659ff86..3ea0754025a 100644 --- a/Mage.Sets/src/mage/cards/t/TrenchBehemoth.java +++ b/Mage.Sets/src/mage/cards/t/TrenchBehemoth.java @@ -85,8 +85,8 @@ class TrenchBehemothEffect extends RequirementEffect { return true; } return game.isActivePlayer(game.getControllerId(getTargetPointer().getFirst(game, source))) - && game.getPhase().getType() == TurnPhase.COMBAT - && game.getStep().getType() == PhaseStep.END_COMBAT; + && game.getTurnPhaseType() == TurnPhase.COMBAT + && game.getTurnStepType() == PhaseStep.END_COMBAT; } @Override diff --git a/Mage.Sets/src/mage/cards/t/TsabosWeb.java b/Mage.Sets/src/mage/cards/t/TsabosWeb.java index 8e3c736b306..50012e04638 100644 --- a/Mage.Sets/src/mage/cards/t/TsabosWeb.java +++ b/Mage.Sets/src/mage/cards/t/TsabosWeb.java @@ -69,7 +69,7 @@ class TsabosWebPreventUntapEffect extends ContinuousRuleModifyingEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (game.getTurn().getStepType() == PhaseStep.UNTAP) { + if (game.getTurnStepType() == PhaseStep.UNTAP) { Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null && permanent.isLand(game)) { for (Ability ability :permanent.getAbilities()) { diff --git a/Mage.Sets/src/mage/cards/u/UnwindingClock.java b/Mage.Sets/src/mage/cards/u/UnwindingClock.java index d7745f073af..2061a5c0a81 100644 --- a/Mage.Sets/src/mage/cards/u/UnwindingClock.java +++ b/Mage.Sets/src/mage/cards/u/UnwindingClock.java @@ -57,7 +57,7 @@ class UnwindingClockEffect extends ContinuousEffectImpl { public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { boolean applied = Boolean.TRUE.equals(game.getState().getValue(source.getSourceId() + "applied")); if (!applied && layer == Layer.RulesEffects) { - if (!game.isActivePlayer(source.getControllerId()) && game.getStep().getType() == PhaseStep.UNTAP) { + if (!game.isActivePlayer(source.getControllerId()) && game.getTurnStepType() == PhaseStep.UNTAP) { game.getState().setValue(source.getSourceId() + "applied", true); for (Permanent artifact : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { boolean untap = true; @@ -70,7 +70,7 @@ class UnwindingClockEffect extends ContinuousEffectImpl { } } } else if (applied && layer == Layer.RulesEffects) { - if (game.getStep().getType() == PhaseStep.END_TURN) { + if (game.getTurnStepType() == PhaseStep.END_TURN) { game.getState().setValue(source.getSourceId() + "applied", false); } } diff --git a/Mage.Sets/src/mage/cards/u/UrbanBurgeoning.java b/Mage.Sets/src/mage/cards/u/UrbanBurgeoning.java index 4f3b2484ca8..c4fc31ac010 100644 --- a/Mage.Sets/src/mage/cards/u/UrbanBurgeoning.java +++ b/Mage.Sets/src/mage/cards/u/UrbanBurgeoning.java @@ -70,7 +70,7 @@ class UrbanBurgeoningUntapEffect extends ContinuousEffectImpl { public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { boolean applied = Boolean.TRUE.equals(game.getState().getValue(source.getSourceId() + "applied")); if (!applied && layer == Layer.RulesEffects) { - if (!game.isActivePlayer(source.getControllerId()) && game.getStep().getType() == PhaseStep.UNTAP) { + if (!game.isActivePlayer(source.getControllerId()) && game.getTurnStepType() == PhaseStep.UNTAP) { game.getState().setValue(source.getSourceId() + "applied", true); Permanent land = game.getPermanent(source.getSourceId()); boolean untap = true; @@ -82,7 +82,7 @@ class UrbanBurgeoningUntapEffect extends ContinuousEffectImpl { } } } else if (applied && layer == Layer.RulesEffects) { - if (game.getStep().getType() == PhaseStep.END_TURN) { + if (game.getTurnStepType() == PhaseStep.END_TURN) { game.getState().setValue(source.getSourceId() + "applied", false); } } diff --git a/Mage.Sets/src/mage/cards/v/VraskaTheUnseen.java b/Mage.Sets/src/mage/cards/v/VraskaTheUnseen.java index c55e5e1c357..1cdcad224f3 100644 --- a/Mage.Sets/src/mage/cards/v/VraskaTheUnseen.java +++ b/Mage.Sets/src/mage/cards/v/VraskaTheUnseen.java @@ -92,7 +92,7 @@ class VraskaTheUnseenGainAbilityEffect extends ContinuousEffectImpl { @Override public boolean isInactive(Ability source, Game game) { - return game.getPhase().getType() == TurnPhase.END && this.isYourNextTurn(game); + return game.getTurnPhaseType() == TurnPhase.END && this.isYourNextTurn(game); } } diff --git a/Mage.Sets/src/mage/cards/v/VulshokGauntlets.java b/Mage.Sets/src/mage/cards/v/VulshokGauntlets.java index 2a4544b004e..f562e4a992f 100644 --- a/Mage.Sets/src/mage/cards/v/VulshokGauntlets.java +++ b/Mage.Sets/src/mage/cards/v/VulshokGauntlets.java @@ -82,7 +82,7 @@ class VulshokGauntletsEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (game.getTurn().getStepType() == PhaseStep.UNTAP) { + if (game.getTurnStepType() == PhaseStep.UNTAP) { Permanent equipment = game.getPermanent(source.getSourceId()); if (equipment != null && equipment.getAttachedTo() != null) { Permanent equipped = game.getPermanent(equipment.getAttachedTo()); diff --git a/Mage.Sets/src/mage/cards/w/WallOfDust.java b/Mage.Sets/src/mage/cards/w/WallOfDust.java index af110164e2e..62a2b33cbab 100644 --- a/Mage.Sets/src/mage/cards/w/WallOfDust.java +++ b/Mage.Sets/src/mage/cards/w/WallOfDust.java @@ -70,7 +70,7 @@ class WallOfDustRestrictionEffect extends RestrictionEffect { return true; } - return game.getPhase().getType() == TurnPhase.END && this.isYourNextTurn(game); + return game.getTurnPhaseType() == TurnPhase.END && this.isYourNextTurn(game); } @Override diff --git a/Mage.Sets/src/mage/cards/w/Wiretapping.java b/Mage.Sets/src/mage/cards/w/Wiretapping.java index cf0c6d161dc..1b4a563f59f 100644 --- a/Mage.Sets/src/mage/cards/w/Wiretapping.java +++ b/Mage.Sets/src/mage/cards/w/Wiretapping.java @@ -71,7 +71,7 @@ class WiretappingTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { return game.isActivePlayer(event.getPlayerId()) - && game.getStep().getType() == PhaseStep.DRAW + && game.getTurnStepType() == PhaseStep.DRAW && isControlledBy(event.getPlayerId()) && game .getState() diff --git a/Mage.Sets/src/mage/cards/z/ZursWeirding.java b/Mage.Sets/src/mage/cards/z/ZursWeirding.java index a8b31103f7f..9b0b35c5ee0 100644 --- a/Mage.Sets/src/mage/cards/z/ZursWeirding.java +++ b/Mage.Sets/src/mage/cards/z/ZursWeirding.java @@ -73,7 +73,7 @@ class ZursWeirdingReplacementEffect extends ReplacementEffectImpl { return false; } // Reveals it instead - player.revealCards(sourceObject.getIdName() + " next draw of " + player.getName() + " (" + game.getTurnNum() + '|' + game.getPhase().getType() + ')', new CardsImpl(card), game); + player.revealCards(sourceObject.getIdName() + " next draw of " + player.getName() + " (" + game.getTurnNum() + '|' + game.getTurnPhaseType() + ')', new CardsImpl(card), game); // Then any other player may pay 2 life. If a player does, put that card into its owner's graveyard String message = "Pay 2 life to put " + card.getLogName() + " into " + player.getLogName() + " graveyard?"; diff --git a/Mage.Tests/src/test/java/org/mage/test/game/ends/PhageTheUntouchableTest.java b/Mage.Tests/src/test/java/org/mage/test/game/ends/PhageTheUntouchableTest.java index ce07832f887..4534d72b076 100644 --- a/Mage.Tests/src/test/java/org/mage/test/game/ends/PhageTheUntouchableTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/game/ends/PhageTheUntouchableTest.java @@ -48,6 +48,6 @@ public class PhageTheUntouchableTest extends CardTestPlayerBase { Assert.assertTrue("Game has ended.", currentGame.hasEnded()); assertWonTheGame(playerA); - Assert.assertTrue("Game ist At end phase", currentGame.getPhase().getType() == TurnPhase.END); + Assert.assertTrue("Game ist At end phase", currentGame.getTurnPhaseType() == TurnPhase.END); } } diff --git a/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java b/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java index cec37e8b0bc..bee78f88a08 100644 --- a/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java +++ b/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java @@ -567,7 +567,7 @@ public class TestPlayer implements Player { if (actionsToRemoveLater.size() > 0) { List removed = new ArrayList<>(); actionsToRemoveLater.forEach((action, step) -> { - if (game.getStep().getType() != step) { + if (game.getTurnStepType() != step) { action.onActionRemovedLater(game, this); actions.remove(action); removed.add(action); @@ -584,7 +584,7 @@ public class TestPlayer implements Player { List tempActions = new ArrayList<>(); tempActions.addAll(actions); for (PlayerAction action : tempActions) { - if (action.getTurnNum() == game.getTurnNum() && action.getStep() == game.getStep().getType()) { + if (action.getTurnNum() == game.getTurnNum() && action.getStep() == game.getTurnStepType()) { if (action.getAction().startsWith(ACTIVATE_ABILITY)) { String command = action.getAction(); @@ -677,9 +677,8 @@ public class TestPlayer implements Player { printEnd(); // TODO: enable assert and rewrite failed activateManaAbility tests // (must use checkAbility instead multiple mana calls) + LOGGER.warn("WARNING, test must be rewritten to use checkAbility instead multiple mana calls"); //Assert.fail("Can't find mana ability to activate command: " + command); - new Exception("WARNING, test must be rewritten to use checkAbility instead multiple mana calls") - .printStackTrace(); } else if (action.getAction().startsWith("addCounters:")) { String command = action.getAction(); command = command.substring(command.indexOf("addCounters:") + 12); @@ -748,7 +747,7 @@ public class TestPlayer implements Player { // play step if (command.equals(AI_COMMAND_PLAY_STEP)) { AIRealGameSimulation = true; // disable on action's remove - actionsToRemoveLater.put(action, game.getStep().getType()); + actionsToRemoveLater.put(action, game.getTurnStepType()); computerPlayer.priority(game); return true; } @@ -1966,7 +1965,7 @@ public class TestPlayer implements Player { } Assert.fail("Missing " + choiceType.toUpperCase(Locale.ENGLISH) + " def for" + " turn " + game.getTurnNum() - + ", step " + (game.getStep() != null ? game.getStep().getType().name() : "not started") + + ", step " + (game.getStep() != null ? game.getTurnStepType().name() : "not started") + ", " + this.getName() + "\n" + reason); } diff --git a/Mage/src/main/java/mage/abilities/common/DealsDamageToOneOrMoreCreaturesTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/DealsDamageToOneOrMoreCreaturesTriggeredAbility.java index 947dde9ed01..8d4005c7cd4 100644 --- a/Mage/src/main/java/mage/abilities/common/DealsDamageToOneOrMoreCreaturesTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/DealsDamageToOneOrMoreCreaturesTriggeredAbility.java @@ -23,13 +23,13 @@ public class DealsDamageToOneOrMoreCreaturesTriggeredAbility extends DealsDamage public boolean checkTrigger(GameEvent event, Game game) { if (super.checkTrigger(event, game)) { // check that combat damage does only once trigger also if multiple creatures were damaged because they block or were blocked by source - if (game.getTurn().getStepType() == PhaseStep.COMBAT_DAMAGE - || game.getTurn().getStepType() == PhaseStep.FIRST_COMBAT_DAMAGE) { + if (game.getTurnStepType() == PhaseStep.COMBAT_DAMAGE + || game.getTurnStepType() == PhaseStep.FIRST_COMBAT_DAMAGE) { String stepHash = (String) game.getState().getValue("damageStep" + getOriginalId()); - String newStepHash = game.getStep().getType().toString() + game.getTurnNum(); + String newStepHash = game.getTurnStepType().toString() + game.getTurnNum(); if (!newStepHash.equals(stepHash)) { // this ability did not trigger during this damage step - game.getState().setValue("damageStep" + getOriginalId(), game.getStep().getType().toString() + game.getTurnNum()); + game.getState().setValue("damageStep" + getOriginalId(), game.getTurnStepType().toString() + game.getTurnNum()); return true; } } else { diff --git a/Mage/src/main/java/mage/abilities/condition/common/AddendumCondition.java b/Mage/src/main/java/mage/abilities/condition/common/AddendumCondition.java index bc634265c11..81324372212 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/AddendumCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/AddendumCondition.java @@ -18,7 +18,7 @@ public enum AddendumCondition implements Condition { @Override public boolean apply(Game game, Ability source) { if (!game.isActivePlayer(source.getControllerId()) || - !game.getPhase().getType().isMain()) { + !game.getTurnPhaseType().isMain()) { return false; } if (CastFromEverywhereSourceCondition.instance.apply(game, source)) { diff --git a/Mage/src/main/java/mage/abilities/condition/common/AfterBlockersAreDeclaredCondition.java b/Mage/src/main/java/mage/abilities/condition/common/AfterBlockersAreDeclaredCondition.java index 05c0b1cac65..cae00986d4f 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/AfterBlockersAreDeclaredCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/AfterBlockersAreDeclaredCondition.java @@ -18,8 +18,8 @@ public enum AfterBlockersAreDeclaredCondition implements Condition { @Override public boolean apply(Game game, Ability source) { - return !(game.getStep().getType() == PhaseStep.BEGIN_COMBAT - || game.getStep().getType() == PhaseStep.DECLARE_ATTACKERS); + return !(game.getTurnStepType() == PhaseStep.BEGIN_COMBAT + || game.getTurnStepType() == PhaseStep.DECLARE_ATTACKERS); } @Override diff --git a/Mage/src/main/java/mage/abilities/condition/common/AfterCombatCondition.java b/Mage/src/main/java/mage/abilities/condition/common/AfterCombatCondition.java index 76bdc4be626..3b198c63ac6 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/AfterCombatCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/AfterCombatCondition.java @@ -15,7 +15,7 @@ public enum AfterCombatCondition implements Condition { @Override public boolean apply(Game game, Ability source) { - return game.getStep().getType().isAfter(PhaseStep.END_COMBAT); + return game.getTurnStepType().isAfter(PhaseStep.END_COMBAT); } @Override diff --git a/Mage/src/main/java/mage/abilities/condition/common/AfterUpkeepStepCondtion.java b/Mage/src/main/java/mage/abilities/condition/common/AfterUpkeepStepCondtion.java index 94de517c593..869dda2e880 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/AfterUpkeepStepCondtion.java +++ b/Mage/src/main/java/mage/abilities/condition/common/AfterUpkeepStepCondtion.java @@ -14,7 +14,7 @@ public enum AfterUpkeepStepCondtion implements Condition { @Override public boolean apply(Game game, Ability source) { - return game.getStep().getType().isAfter(PhaseStep.UPKEEP); + return game.getTurnStepType().isAfter(PhaseStep.UPKEEP); } @Override diff --git a/Mage/src/main/java/mage/abilities/condition/common/BeforeBlockersAreDeclaredCondition.java b/Mage/src/main/java/mage/abilities/condition/common/BeforeBlockersAreDeclaredCondition.java index 3e80bb6418b..212e07c472c 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/BeforeBlockersAreDeclaredCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/BeforeBlockersAreDeclaredCondition.java @@ -17,7 +17,7 @@ public enum BeforeBlockersAreDeclaredCondition implements Condition { @Override public boolean apply(Game game, Ability source) { - return game.getStep().getType().isBefore(PhaseStep.DECLARE_BLOCKERS); + return game.getTurnStepType().isBefore(PhaseStep.DECLARE_BLOCKERS); } @Override diff --git a/Mage/src/main/java/mage/abilities/condition/common/IsPhaseCondition.java b/Mage/src/main/java/mage/abilities/condition/common/IsPhaseCondition.java index 0e00e9b6b8c..c153038fbcb 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/IsPhaseCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/IsPhaseCondition.java @@ -28,7 +28,7 @@ public class IsPhaseCondition implements Condition { @Override public boolean apply(Game game, Ability source) { - return turnPhase == game.getTurn().getPhaseType() && (!yourTurn || game.getActivePlayerId().equals(source.getControllerId())); + return turnPhase == game.getTurnPhaseType() && (!yourTurn || game.getActivePlayerId().equals(source.getControllerId())); } @Override diff --git a/Mage/src/main/java/mage/abilities/condition/common/IsStepCondition.java b/Mage/src/main/java/mage/abilities/condition/common/IsStepCondition.java index 070fb08b36b..ad4387727fd 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/IsStepCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/IsStepCondition.java @@ -26,7 +26,7 @@ public class IsStepCondition implements Condition { @Override public boolean apply(Game game, Ability source) { - return phaseStep == game.getStep().getType() && (!onlyDuringYourSteps || game.isActivePlayer(source.getControllerId())); + return phaseStep == game.getTurnStepType() && (!onlyDuringYourSteps || game.isActivePlayer(source.getControllerId())); } @Override diff --git a/Mage/src/main/java/mage/abilities/effects/ContinuousEffects.java b/Mage/src/main/java/mage/abilities/effects/ContinuousEffects.java index 8f9f85e257a..d1f5ca01e0a 100644 --- a/Mage/src/main/java/mage/abilities/effects/ContinuousEffects.java +++ b/Mage/src/main/java/mage/abilities/effects/ContinuousEffects.java @@ -201,7 +201,7 @@ public class ContinuousEffects implements Serializable { updateTimestamps(timestampGroupName, layerEffects); layerEffects.sort(Comparator.comparingLong(ContinuousEffect::getOrder)); /* debug effects apply order: - if (game.getStep() != null) System.out.println("layr - " + game.getTurnNum() + "." + game.getStep().getType() + ": layers " + layerEffects.size() + if (game.getStep() != null) System.out.println("layr - " + game.getTurnNum() + "." + game.getTurnStepType() + ": layers " + layerEffects.size() + " - " + layerEffects.stream().map(l -> l.getClass().getSimpleName()).collect(Collectors.joining(", ")) + " - " + callName); //*/ diff --git a/Mage/src/main/java/mage/abilities/effects/common/AddCombatAndMainPhaseEffect.java b/Mage/src/main/java/mage/abilities/effects/common/AddCombatAndMainPhaseEffect.java index cee84d732b6..e83492039fb 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/AddCombatAndMainPhaseEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/AddCombatAndMainPhaseEffect.java @@ -35,8 +35,8 @@ public class AddCombatAndMainPhaseEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { // 15.07.2006 If it's somehow not a main phase when Fury of the Horde resolves, all it does is untap all creatures that attacked that turn. No new phases are created. - if (game.getTurn().getPhaseType() == TurnPhase.PRECOMBAT_MAIN - || game.getTurn().getPhaseType() == TurnPhase.POSTCOMBAT_MAIN) { + if (game.getTurnPhaseType() == TurnPhase.PRECOMBAT_MAIN + || game.getTurnPhaseType() == TurnPhase.POSTCOMBAT_MAIN) { // we can't add two turn modes at once, will add additional post combat on delayed trigger resolution TurnMod combat = new TurnMod(source.getControllerId(), TurnPhase.COMBAT, TurnPhase.POSTCOMBAT_MAIN, false); game.getState().getTurnMods().add(combat); diff --git a/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersNextUntapStepSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersNextUntapStepSourceEffect.java index 60289092c21..742fb56ec33 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersNextUntapStepSourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersNextUntapStepSourceEffect.java @@ -68,7 +68,7 @@ public class DontUntapInControllersNextUntapStepSourceEffect extends ContinuousR validForTurnNum = game.getTurnNum(); } // skip untap action - if (game.getTurn().getStepType() == PhaseStep.UNTAP + if (game.getTurnStepType() == PhaseStep.UNTAP && event.getType() == GameEvent.EventType.UNTAP && game.isActivePlayer(source.getControllerId()) && event.getTargetId().equals(source.getSourceId())) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersNextUntapStepTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersNextUntapStepTargetEffect.java index ff145ffa222..95feb62ab18 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersNextUntapStepTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersNextUntapStepTargetEffect.java @@ -120,7 +120,7 @@ public class DontUntapInControllersNextUntapStepTargetEffect extends ContinuousR } } - if (game.getTurn().getStepType() == PhaseStep.UNTAP && event.getType() == GameEvent.EventType.UNTAP) { + if (game.getTurnStepType() == PhaseStep.UNTAP && event.getType() == GameEvent.EventType.UNTAP) { if (handledTargetsDuringTurn.containsKey(event.getTargetId()) && !handledTargetsDuringTurn.get(event.getTargetId()) && getTargetPointer().getTargets(game, source).contains(event.getTargetId())) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersUntapStepAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersUntapStepAllEffect.java index 372a63a9fdc..4e6bfb850b4 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersUntapStepAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersUntapStepAllEffect.java @@ -55,7 +55,7 @@ public class DontUntapInControllersUntapStepAllEffect extends ContinuousRuleModi @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (game.getTurn().getStepType() == PhaseStep.UNTAP) { + if (game.getTurnStepType() == PhaseStep.UNTAP) { Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null) { switch(targetController) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersUntapStepEnchantedEffect.java b/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersUntapStepEnchantedEffect.java index c0e7b28f54b..2a73ac6dc53 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersUntapStepEnchantedEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersUntapStepEnchantedEffect.java @@ -56,7 +56,7 @@ public class DontUntapInControllersUntapStepEnchantedEffect extends ContinuousRu @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (game.getTurn().getStepType() == PhaseStep.UNTAP) { + if (game.getTurnStepType() == PhaseStep.UNTAP) { Permanent enchantment = game.getPermanent(source.getSourceId()); if (enchantment != null && enchantment.getAttachedTo() != null && event.getTargetId().equals(enchantment.getAttachedTo())) { Permanent permanent = game.getPermanent(enchantment.getAttachedTo()); diff --git a/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersUntapStepSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersUntapStepSourceEffect.java index e77ac30df73..da1808947a5 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersUntapStepSourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersUntapStepSourceEffect.java @@ -47,7 +47,7 @@ public class DontUntapInControllersUntapStepSourceEffect extends ContinuousRuleM @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (game.getTurn().getStepType() == PhaseStep.UNTAP + if (game.getTurnStepType() == PhaseStep.UNTAP && event.getTargetId().equals(source.getSourceId())) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null && permanent.isControlledBy(game.getActivePlayerId())) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersUntapStepTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersUntapStepTargetEffect.java index c7c264c6805..08f1aff4421 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersUntapStepTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/DontUntapInControllersUntapStepTargetEffect.java @@ -50,7 +50,7 @@ public class DontUntapInControllersUntapStepTargetEffect extends ContinuousRuleM @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (game.getTurn().getStepType() != PhaseStep.UNTAP) { + if (game.getTurnStepType() != PhaseStep.UNTAP) { return false; } for (UUID targetId : targetPointer.getTargets(game, source)) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/DontUntapInPlayersNextUntapStepAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/DontUntapInPlayersNextUntapStepAllEffect.java index 5faf2d88abe..9ef3496a11d 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/DontUntapInPlayersNextUntapStepAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/DontUntapInPlayersNextUntapStepAllEffect.java @@ -89,7 +89,7 @@ public class DontUntapInPlayersNextUntapStepAllEffect extends ContinuousRuleModi } } - if (game.getTurn().getStepType() == PhaseStep.UNTAP && event.getType() == GameEvent.EventType.UNTAP) { + if (game.getTurnStepType() == PhaseStep.UNTAP && event.getType() == GameEvent.EventType.UNTAP) { Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null) { Player controller = game.getPlayer(source.getControllerId()); diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/UntapAllDuringEachOtherPlayersUntapStepEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/UntapAllDuringEachOtherPlayersUntapStepEffect.java index bc2b0c89358..5d47a6992fa 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/UntapAllDuringEachOtherPlayersUntapStepEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/UntapAllDuringEachOtherPlayersUntapStepEffect.java @@ -33,7 +33,7 @@ public class UntapAllDuringEachOtherPlayersUntapStepEffect extends ContinuousEff @Override public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { - if (layer == Layer.RulesEffects && game.getStep().getType() == PhaseStep.UNTAP && !source.isControlledBy(game.getActivePlayerId())) { + if (layer == Layer.RulesEffects && game.getTurnStepType() == PhaseStep.UNTAP && !source.isControlledBy(game.getActivePlayerId())) { Integer appliedTurn = (Integer) game.getState().getValue(source.getSourceId() + "appliedTurn"); if (appliedTurn == null) { appliedTurn = 0; diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/UntapSourceDuringEachOtherPlayersUntapStepEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/UntapSourceDuringEachOtherPlayersUntapStepEffect.java index 1574bfecafd..fde4985b2d1 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/UntapSourceDuringEachOtherPlayersUntapStepEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/UntapSourceDuringEachOtherPlayersUntapStepEffect.java @@ -32,7 +32,7 @@ public class UntapSourceDuringEachOtherPlayersUntapStepEffect extends Continuous if (!applied && layer == Layer.RulesEffects) { if (!source.isControlledBy(game.getActivePlayerId()) && game.getStep() != null - && game.getStep().getType() == PhaseStep.UNTAP) { + && game.getTurnStepType() == PhaseStep.UNTAP) { game.getState().setValue(source.getSourceId() + "applied", true); Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { @@ -46,7 +46,7 @@ public class UntapSourceDuringEachOtherPlayersUntapStepEffect extends Continuous } } } else if (applied && layer == Layer.RulesEffects) { - if (game.getStep() != null && game.getStep().getType() == PhaseStep.END_TURN) { + if (game.getStep() != null && game.getTurnStepType() == PhaseStep.END_TURN) { game.getState().setValue(source.getSourceId() + "applied", false); } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/ruleModifying/CastOnlyDuringPhaseStepSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/ruleModifying/CastOnlyDuringPhaseStepSourceEffect.java index 147e1ba9eb7..3b241e866dd 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/ruleModifying/CastOnlyDuringPhaseStepSourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/ruleModifying/CastOnlyDuringPhaseStepSourceEffect.java @@ -46,8 +46,8 @@ public class CastOnlyDuringPhaseStepSourceEffect extends ContinuousRuleModifying public boolean applies(GameEvent event, Ability source, Game game) { // has to return true, if the spell cannot be cast in the current phase / step if (event.getSourceId().equals(source.getSourceId())) { - if ((turnPhase != null && game.getPhase().getType() != turnPhase) - || (phaseStep != null && (game.getTurn().getStepType() != phaseStep)) + if ((turnPhase != null && game.getTurnPhaseType() != turnPhase) + || (phaseStep != null && (game.getTurnStepType() != phaseStep)) || (condition != null && !condition.apply(game, source))) { return true; } diff --git a/Mage/src/main/java/mage/actions/score/ArtificialScoringSystem.java b/Mage/src/main/java/mage/actions/score/ArtificialScoringSystem.java index ebd9a6de56f..67fc047c4f6 100644 --- a/Mage/src/main/java/mage/actions/score/ArtificialScoringSystem.java +++ b/Mage/src/main/java/mage/actions/score/ArtificialScoringSystem.java @@ -30,7 +30,7 @@ public class ArtificialScoringSystem implements ScoringSystem { if (game.getStep() == null) { return 0; } - return ScoringConstants.LOSE_GAME_SCORE + game.getTurnNum() * 2500 + game.getStep().getType().getIndex() * 200; + return ScoringConstants.LOSE_GAME_SCORE + game.getTurnNum() * 2500 + game.getTurnStepType().getIndex() * 200; } @Override diff --git a/Mage/src/main/java/mage/game/Game.java b/Mage/src/main/java/mage/game/Game.java index 39f035d5d28..613dda36da3 100644 --- a/Mage/src/main/java/mage/game/Game.java +++ b/Mage/src/main/java/mage/game/Game.java @@ -180,6 +180,19 @@ public interface Game extends MageItem, Serializable, Copyable { Turn getTurn(); + /** + * @return can return null in non started games + */ + PhaseStep getTurnStepType(); + + /** + * @return can return null in non started games + */ + TurnPhase getTurnPhaseType(); + + /** + * @return can return null in non started games + */ Phase getPhase(); Step getStep(); diff --git a/Mage/src/main/java/mage/game/GameImpl.java b/Mage/src/main/java/mage/game/GameImpl.java index 904f4711bcd..e1d057d3c45 100644 --- a/Mage/src/main/java/mage/game/GameImpl.java +++ b/Mage/src/main/java/mage/game/GameImpl.java @@ -2882,6 +2882,16 @@ public abstract class GameImpl implements Game { return state.getTurn(); } + @Override + public PhaseStep getTurnStepType() { + return state.getTurnStepType(); + } + + @Override + public TurnPhase getTurnPhaseType() { + return state.getTurnPhaseType(); + } + @Override public Phase getPhase() { return state.getTurn().getPhase(); @@ -2919,7 +2929,7 @@ public abstract class GameImpl implements Game { @Override public boolean isMainPhase() { - return state.getTurn().getStepType() == PhaseStep.PRECOMBAT_MAIN || state.getTurn().getStepType() == PhaseStep.POSTCOMBAT_MAIN; + return state.getTurnStepType() == PhaseStep.PRECOMBAT_MAIN || state.getTurnStepType() == PhaseStep.POSTCOMBAT_MAIN; } @Override diff --git a/Mage/src/main/java/mage/game/GameState.java b/Mage/src/main/java/mage/game/GameState.java index c6f0412d536..6f7c733bba4 100644 --- a/Mage/src/main/java/mage/game/GameState.java +++ b/Mage/src/main/java/mage/game/GameState.java @@ -7,6 +7,8 @@ import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.ContinuousEffects; import mage.abilities.effects.Effect; import mage.cards.*; +import mage.constants.PhaseStep; +import mage.constants.TurnPhase; import mage.constants.Zone; import mage.designations.Designation; import mage.filter.common.FilterCreaturePermanent; @@ -22,6 +24,8 @@ import mage.game.permanent.PermanentCard; import mage.game.permanent.PermanentToken; import mage.game.stack.SpellStack; import mage.game.stack.StackObject; +import mage.game.turn.Phase; +import mage.game.turn.Step; import mage.game.turn.Turn; import mage.game.turn.TurnMods; import mage.players.Player; @@ -572,6 +576,19 @@ public class GameState implements Serializable, Copyable { return turn; } + public PhaseStep getTurnStepType() { + Turn turn = this.getTurn(); + Phase phase = turn != null ? turn.getPhase() : null; + Step step = phase != null ? phase.getStep() : null; + return step != null ? step.getType() : null; + } + + public TurnPhase getTurnPhaseType() { + Turn turn = this.getTurn(); + Phase phase = turn != null ? turn.getPhase() : null; + return phase != null ? phase.getType() : null; + } + public Combat getCombat() { return combat; } diff --git a/Mage/src/main/java/mage/game/command/emblems/LukeSkywalkerEmblem.java b/Mage/src/main/java/mage/game/command/emblems/LukeSkywalkerEmblem.java index d94165a4b07..a3411988499 100644 --- a/Mage/src/main/java/mage/game/command/emblems/LukeSkywalkerEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/LukeSkywalkerEmblem.java @@ -41,7 +41,7 @@ class LukeSkywalkerEmblemEffect extends PreventionEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (game.getPhase().getType() == TurnPhase.COMBAT + if (game.getTurnPhaseType() == TurnPhase.COMBAT && super.applies(event, source, game) && event.getType() == GameEvent.EventType.DAMAGE_PLAYER) { Player controller = game.getPlayer(source.getControllerId()); diff --git a/Mage/src/main/java/mage/game/command/planes/EdgeOfMalacolPlane.java b/Mage/src/main/java/mage/game/command/planes/EdgeOfMalacolPlane.java index ddf68e00b00..5f5841f6c08 100644 --- a/Mage/src/main/java/mage/game/command/planes/EdgeOfMalacolPlane.java +++ b/Mage/src/main/java/mage/game/command/planes/EdgeOfMalacolPlane.java @@ -90,7 +90,7 @@ class EdgeOfMalacolEffect extends ContinuousRuleModifyingEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { // Prevent untap event of creatures of target player - if (game.getTurn().getStepType() == PhaseStep.UNTAP) { + if (game.getTurnStepType() == PhaseStep.UNTAP) { Plane cPlane = game.getState().getCurrentPlane(); if (cPlane == null) { return false; diff --git a/Mage/src/main/java/mage/game/turn/Turn.java b/Mage/src/main/java/mage/game/turn/Turn.java index 577eb988245..3355a740646 100644 --- a/Mage/src/main/java/mage/game/turn/Turn.java +++ b/Mage/src/main/java/mage/game/turn/Turn.java @@ -84,13 +84,6 @@ public class Turn implements Serializable { return null; } - public PhaseStep getStepType() { - if (currentPhase != null && currentPhase.getStep() != null) { - return currentPhase.getStep().getType(); - } - return null; - } - /** * @param game * @param activePlayer @@ -148,8 +141,8 @@ public class Turn implements Serializable { public void resumePlay(Game game, boolean wasPaused) { activePlayerId = game.getActivePlayerId(); UUID priorityPlayerId = game.getPriorityPlayerId(); - TurnPhase phaseType = game.getPhase().getType(); - PhaseStep stepType = game.getStep().getType(); + TurnPhase phaseType = game.getTurnPhaseType(); + PhaseStep stepType = game.getTurnStepType(); Iterator it = phases.iterator(); Phase phase; diff --git a/Mage/src/main/java/mage/players/ManaPool.java b/Mage/src/main/java/mage/players/ManaPool.java index ab081adea79..ff0a11a3b05 100644 --- a/Mage/src/main/java/mage/players/ManaPool.java +++ b/Mage/src/main/java/mage/players/ManaPool.java @@ -271,7 +271,7 @@ public class ManaPool implements Serializable { private int emptyItem(ManaPoolItem item, Emptiable toEmpty, Game game, ManaType manaType) { if (item.getDuration() == Duration.EndOfTurn - && game.getPhase().getType() != TurnPhase.END) { + && game.getTurnPhaseType() != TurnPhase.END) { return 0; } if (!manaBecomesColorless) { diff --git a/Mage/src/main/java/mage/players/PlayerImpl.java b/Mage/src/main/java/mage/players/PlayerImpl.java index 4481adc2051..7d7b5d46dad 100644 --- a/Mage/src/main/java/mage/players/PlayerImpl.java +++ b/Mage/src/main/java/mage/players/PlayerImpl.java @@ -2407,7 +2407,7 @@ public abstract class PlayerImpl implements Player, Serializable { case PASS_PRIORITY_UNTIL_TURN_END_STEP: // F5 resetPlayerPassedActions(); passedUntilEndOfTurn = true; - skippedAtLeastOnce = PhaseStep.END_TURN != game.getTurn().getStepType(); + skippedAtLeastOnce = PhaseStep.END_TURN != game.getTurnStepType(); this.skip(); break; case PASS_PRIORITY_UNTIL_NEXT_TURN: // F4 @@ -2423,8 +2423,8 @@ public abstract class PlayerImpl implements Player, Serializable { case PASS_PRIORITY_UNTIL_NEXT_MAIN_PHASE: //F7 resetPlayerPassedActions(); passedUntilNextMain = true; - skippedAtLeastOnce = !(game.getTurn().getStepType() == PhaseStep.POSTCOMBAT_MAIN - || game.getTurn().getStepType() == PhaseStep.PRECOMBAT_MAIN); + skippedAtLeastOnce = !(game.getTurnStepType() == PhaseStep.POSTCOMBAT_MAIN + || game.getTurnStepType() == PhaseStep.PRECOMBAT_MAIN); this.skip(); break; case PASS_PRIORITY_UNTIL_STACK_RESOLVED: // Default F10 - Skips until the current stack is resolved