예제 #1
0
    //for the pumpkin pieceset
    public void code(string dir)
    {
        if (achievementHandler.is_Pieceset_Unlocked("Pumpkin"))
        {
            return;
        }

        switch (codeStage)
        {
        case 0:
            if (dir == "Up")
            {
                codeStage++;
            }
            else
            {
                codeStage = 0;
            }
            break;

        case 1:
            if (dir == "Up")
            {
                codeStage++;
            }
            else
            {
                codeStage = 0;
            }
            break;

        case 2:
            if (dir == "Down")
            {
                codeStage++;
            }
            else
            {
                codeStage = 0;
            }
            break;

        case 3:
            if (dir == "Down")
            {
                codeStage++;
            }
            else
            {
                codeStage = 0;
            }
            break;

        case 4:
            if (dir == "Left")
            {
                codeStage++;
            }
            else
            {
                codeStage = 0;
            }
            break;

        case 5:
            if (dir == "Right")
            {
                codeStage++;
            }
            else
            {
                codeStage = 0;
            }
            break;

        case 6:
            if (dir == "Left")
            {
                codeStage++;
            }
            else
            {
                codeStage = 0;
            }
            break;

        case 7:
            if (dir == "Right")
            {
                achievementHandler.Unlock_Pieceset("Pumpkin");
            }
            else
            {
                codeStage = 0;
            }
            break;
        }
    }
예제 #2
0
    void FixedUpdate()
    {
        //check to see if a piece is in the splitter area after each board check
        if (checkGameOver)
        {
            for (int c = 7; c <= 8; c++)
            {
                for (int r = 0; r <= 7; r++)
                {
                    if (colorGrid[r, c] != null && grid[r, c] != null)
                    {
                        gameOverText.text = "Game Over";
                        gameOver          = true;
                        GameOverLayer.SetActive(true);
                        mc.Stop_Music();
                        splitter.setState("canShoot", false);
                        //unlocking candy cane splitter
                        if (!achievementHandler.is_Splitter_Unlocked("Candy Cane") && score > 0 && score < 200)
                        {
                            achievementHandler.Unlock_Splitter("Candy Cane");
                        }

                        if (!achievementHandler.is_Splitter_Unlocked("Dark") && (gameType == "Wiz" || gameType == "Holy"))
                        {
                            if (!spellHandler.Used_Spells() && score > 1000)
                            {
                                achievementHandler.Unlock_Splitter("Dark");
                            }
                        }
                    }
                }
            }
            checkGameOver = false;
        }

        //things that should only happen once at gameover
        if (gameOver && ffGameOver)
        {
            ffGameOver = false;
            achievementHandler.Add_Score(gameType, score);
            GameObject.Find("GO Black Screen").GetComponent <Fader>().FadeIn();
            tipText.text = tips[Random.Range(0, tips.Count())];
            mc.Play_Music("Gameover");
        }

        //check that the music controller isn't being a dick about the game over music
        if (gameOver && (mc.MusicSource.clip.name != "Split It Game Over" || !mc.MusicSource.isPlaying))
        {
            mc.Play_Music("Gameover");
        }

        if (!achievementHandler.is_Splitter_Unlocked("Caution") || !achievementHandler.is_Pieceset_Unlocked("Blob"))
        {
            int dangerPieces = Get_Danger_Pieces();
            if (!achievementHandler.is_Splitter_Unlocked("Caution") && gameType != "Holy" && gameType != "Wiz" && dangerPieces >= 5 && dangerPieces == 0)
            {
                achievementHandler.Unlock_Splitter("Caution");
            }
            if (!achievementHandler.is_Pieceset_Unlocked("Blob") && gameType == "Holy" && dangerPieces == 16)
            {
                achievementHandler.Unlock_Pieceset("Blob");
            }
        }

        if (!gameOver && Get_Danger_Pieces() > 0)
        {
            mc.Start_Slow_Tick();
        }
        else
        {
            mc.Stop_Slow_Tick();
        }
        //if both pieces have been placed, set the checkGrid to false and check the board
        if (piecesPlaced >= 2)
        {
            piecesPlaced  = 0;
            checkGameOver = true;
            if (checkFlag)
            {
                clearedLastTurn        = piecesDeletedThisSplit;
                piecesDeletedThisSplit = false;
                checkBoard();
                checkFlag = false;
                //check to see if it's time to move the sides in
            }
            else if (!isCountingDown)
            {
                splitter.setState("canShoot", true);
            }
            GameObject[] sidebars = GameObject.FindGameObjectsWithTag("Sidebar");
            //here's where we do side-entering management
            if ((gameType == "Wiz" || gameType == "Holy") && !sidesChecked)
            {
                if (movesMade % sideMovesLimit == 0)
                {
                    addSideColumns();
                    sideColumns[0].shakeStage = 0;
                    sideColumns[1].shakeStage = 0;
                    sidebars [0].BroadcastMessage("Reset");
                    sidebars [1].BroadcastMessage("Reset");
                    mc.Stop_Fast_Tick();
                }
                else if (sideMovesLimit - (movesMade % sideMovesLimit) <= 8)
                {
                    switch (sideMovesLimit - (movesMade % sideMovesLimit))
                    {
                    case 1:
                        sideColumns[0].isShaking  = false;
                        sideColumns[1].isShaking  = false;
                        sideColumns[0].ready      = true;
                        sideColumns[1].ready      = true;
                        sideColumns[0].shakeStage = 0;
                        sideColumns[1].shakeStage = 0;
                        sidebars [0].BroadcastMessage("Increment_Lights");
                        sidebars [1].BroadcastMessage("Increment_Lights");
                        break;

                    case 2:
                        sideColumns[0].shakeStage = 3;
                        sideColumns[1].shakeStage = 3;
                        sidebars [0].BroadcastMessage("Increment_Lights");
                        sidebars [1].BroadcastMessage("Increment_Lights");
                        break;

                    case 3:
                        sideColumns[0].shakeStage = 2;
                        sideColumns[1].shakeStage = 2;
                        sidebars [0].BroadcastMessage("Increment_Lights");
                        sidebars [1].BroadcastMessage("Increment_Lights");
                        break;

                    case 4:
                        sideColumns[0].isShaking  = true;
                        sideColumns[1].isShaking  = true;
                        sideColumns[0].shakeStage = 1;
                        sideColumns[1].shakeStage = 1;
                        mc.Start_Fast_Tick();
                        sidebars [0].BroadcastMessage("Increment_Lights");
                        sidebars [1].BroadcastMessage("Increment_Lights");
                        break;

                    case 5:
                        sidebars [0].BroadcastMessage("Increment_Lights");
                        sidebars [1].BroadcastMessage("Increment_Lights");
                        break;

                    case 6:
                        sidebars [0].BroadcastMessage("Increment_Lights");
                        sidebars [1].BroadcastMessage("Increment_Lights");
                        break;

                    case 7:
                        sidebars [0].BroadcastMessage("Increment_Lights");
                        sidebars [1].BroadcastMessage("Increment_Lights");
                        break;

                    case 8:
                        sidebars [0].BroadcastMessage("Increment_Lights");
                        sidebars [1].BroadcastMessage("Increment_Lights");
                        break;
                    }
                }
                sidesChecked = true;
            }
            else if ((gameType == "Quick") && !sidesChecked)
            {
                //quick mode moves the sides in based off of time, not moves
                if (quickMoveSides)
                {
                    addSideColumns();
                    sideColumns[0].ready = false;
                    sideColumns[1].ready = false;
                    quickMoveSides       = false;
                    StartCoroutine("QuickSideTimer");
                    mc.Stop_Fast_Tick();
                }
                sidesChecked = true;
            }
        }
    }