From f227c4775de07870a97ced9196090b2d21fa872d Mon Sep 17 00:00:00 2001 From: "omegablast2002@yahoo.com" Date: Wed, 8 Dec 2010 15:33:02 +0000 Subject: [PATCH] moved phase pass automation into stateeffects() where it should have been from the start, it really shouldnt be run as part of "update()" it bothered me enough to actually move it. --- projects/mtg/src/GameObserver.cpp | 41 +++++++++++++++++-------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/projects/mtg/src/GameObserver.cpp b/projects/mtg/src/GameObserver.cpp index 2ff35ca4c..9e2496747 100644 --- a/projects/mtg/src/GameObserver.cpp +++ b/projects/mtg/src/GameObserver.cpp @@ -388,25 +388,7 @@ void GameObserver::Update(float dt) stateEffects(); oldGamePhase = currentGamePhase; - //Auto skip Phases - int skipLevel = (player->playMode == Player::MODE_TEST_SUITE) ? Constants::ASKIP_NONE : options[Options::ASPHASES].number; - int nrCreatures = currentPlayer->game->inPlay->countByType("Creature"); - - if (skipLevel == Constants::ASKIP_SAFE || skipLevel == Constants::ASKIP_FULL) - { - if ((opponent()->isAI() && !(isInterrupting)) && (currentGamePhase == Constants::MTG_PHASE_UNTAP || currentGamePhase - == Constants::MTG_PHASE_DRAW || currentGamePhase == Constants::MTG_PHASE_COMBATBEGIN || ((currentGamePhase - == Constants::MTG_PHASE_COMBATATTACKERS) && (nrCreatures == 0)) || currentGamePhase - == Constants::MTG_PHASE_COMBATEND || currentGamePhase == Constants::MTG_PHASE_ENDOFTURN - || ((currentGamePhase == Constants::MTG_PHASE_CLEANUP) && (currentPlayer->game->hand->nb_cards < 8)))) - userRequestNextGamePhase(); - } - if (skipLevel == Constants::ASKIP_FULL) - { - if ((opponent()->isAI() && !(isInterrupting)) && (currentGamePhase == Constants::MTG_PHASE_UPKEEP || currentGamePhase - == Constants::MTG_PHASE_COMBATDAMAGE)) - userRequestNextGamePhase(); - } + } @@ -475,6 +457,27 @@ void GameObserver::stateEffects() userRequestNextGamePhase(); } + //Auto skip Phases + GameObserver * game = game->GetInstance(); + int skipLevel = (game->currentPlayer->playMode == Player::MODE_TEST_SUITE) ? Constants::ASKIP_NONE : options[Options::ASPHASES].number; + int nrCreatures = currentPlayer->game->inPlay->countByType("Creature"); + + if (skipLevel == Constants::ASKIP_SAFE || skipLevel == Constants::ASKIP_FULL) + { + if ((opponent()->isAI() && !(isInterrupting)) && (currentGamePhase == Constants::MTG_PHASE_UNTAP || currentGamePhase + == Constants::MTG_PHASE_DRAW || currentGamePhase == Constants::MTG_PHASE_COMBATBEGIN || ((currentGamePhase + == Constants::MTG_PHASE_COMBATATTACKERS) && (nrCreatures == 0)) || currentGamePhase + == Constants::MTG_PHASE_COMBATEND || currentGamePhase == Constants::MTG_PHASE_ENDOFTURN + || ((currentGamePhase == Constants::MTG_PHASE_CLEANUP) && (currentPlayer->game->hand->nb_cards < 8)))) + userRequestNextGamePhase(); + } + if (skipLevel == Constants::ASKIP_FULL) + { + if ((opponent()->isAI() && !(isInterrupting)) && (currentGamePhase == Constants::MTG_PHASE_UPKEEP || currentGamePhase + == Constants::MTG_PHASE_COMBATDAMAGE)) + userRequestNextGamePhase(); + } + } void GameObserver::Render()