Beispiel #1
0
    //Scores the player's first two cards
    public void InitialScoreCheck(int firstCardScore, int secondCardScore)
    {
        //Check for natural BlackJack
        if ((firstCardScore == 10 && secondCardScore == 1) || (firstCardScore == 1 && secondCardScore == 10))
        {
            Debug.Log("has BlackJack!");

            //Update the player's score
            playerScore = 21;

            //update player status
            playerStatus = "blackjack";

            //Update player's status field
            ShowPlayerStatusState(playerStatus);

            //If it's the last player's turn then start dealer and player showdown
            if (blackJackController.playerTurnIndex == blackJackController.numberOfPlayers - 1)
            {
                dealerController.DealerHitCards();
            }

            blackJackController.playerTurnIndex++;
            blackJackController.PlayerTurn();
        }

        else
        {
            playerScore = firstCardScore + secondCardScore;

            HitButtonState(true);
            StandButtonState(true);
            //ShowPlayerStatusState("bet");
        }
    }