Exemple #1
0
    // Ready Game Turn
    void ReadyGameTurn()
    {
        if (pcControl.GetHealthPoint() > 0 && npcControl.GetHealthPoint() > 0)
        {
            if (bonusTurns == 0)
            {
                playerHumanTurn = !playerHumanTurn;

                //Disable freeze icon
                pcControl.EnableFreezeStatus(false);
                npcControl.EnableFreezeStatus(false);
            }
            else
            {
                bonusTurns--;
            }

            if (isPlayerHumanTurn())
            {
                isDoing    = false;
                canDoInput = true;
                pcControl.EnableActiveBackground(true);
                npcControl.EnableActiveBackground(false);
                DebugFindHint();
            }
            else
            {
                pcControl.EnableActiveBackground(false);
                npcControl.EnableActiveBackground(true);
                DoAITurn();
            }
        }
        else if (pcControl.GetHealthPoint() <= 0)
        {
            //Player Died
            //Show GameOver
            levelGameOverText.text = "Level " + (GameState.control.currentLevelIndex + 1);
            UIHandler.ShowGameOverPanel();
        }
        else if (npcControl.GetHealthPoint() <= 0)
        {
            //Enemy robot died
            //Show win screen
            levelText.text = "Level " + (GameState.control.currentLevelIndex + 1);
            UIHandler.ShowWinPanel();
            //Set the level to completed and unlocked
            GameState.control.SetCurrentLevelState(1, 1);
            GameState.control.levels[GameState.control.currentLevelIndex + 1].unlocked = 1;
            GameState.control.SetCurrentLevel(GameState.control.currentLevelIndex + 1);
            GameState.control.Save();
        }
    }