예제 #1
0
파일: AIBot.cs 프로젝트: linuxaged/hsbot
        private void gameplay_mode()
        {
            GameState gs = GameState.Get();

            // If we're in mulligan
            if (gs.IsMulliganPhase())
            {
                if (mulligan_state == MulliganState.BEGIN)
                {
                    if (gs.IsMulliganManagerActive() && PrivateHacker.get_m_UIbuttons() != null)
                    {
                        mulligan();
                        mulligan_state = MulliganState.DO_END;
                        Delay(2000);
                    }
                }
                else if (mulligan_state == MulliganState.DO_END)
                {
                    MulliganManager.Get().AutomaticContinueMulligan();
                    mulligan_state = MulliganState.DONE;
                }
                return;
            }
            // If the game is over
            else if (gs.IsGameOver())
            {
                game_over();
            }
            // If it's our turn
            else if (gs.IsLocalPlayerTurn())
            {
                // If it was not our turn last tick
                if (!was_my_turn)
                {
                    // Wait extra time for turn to start
                    was_my_turn = true;
                    Delay(5000);
                    return;
                }

                run_ai();
            }
            else
            {
                was_my_turn = false;
            }

            // Reset variables
            mulligan_state = MulliganState.BEGIN;
        }
예제 #2
0
        private void gameplay_mode()
        {
            GameState gs = GameState.Get();

            // If we're in mulligan
            if (gs.IsMulliganPhase())
            {
                if (mulligan_state == MulliganState.BEGIN)
                {
                    if(gs.IsMulliganManagerActive() && PrivateHacker.get_m_UIbuttons() != null)
                    {
                        mulligan();
                        mulligan_state = MulliganState.DO_END;
                        Delay(2000);
                    }
                }
                else if (mulligan_state == MulliganState.DO_END)
                {
                    MulliganManager.Get().AutomaticContinueMulligan();
                    mulligan_state = MulliganState.DONE;
                }
                return;
            }
            // If the game is over
            else if (gs.IsGameOver())
            {
                game_over();
            }
            // If it's our turn
            else if (gs.IsLocalPlayerTurn())
            {
                // If it was not our turn last tick
                if (!was_my_turn)
                {
                    // Wait extra time for turn to start
                    was_my_turn = true;
                    Delay(5000);
                    return;
                }

                run_ai();
            }
            else
            {
                was_my_turn = false;
            }

            // Reset variables
            mulligan_state = MulliganState.BEGIN;
        }