Ejemplo n.º 1
0
 public bool GetPlayerInsurance()
 {
     return(player.GetInsurance());
 }
Ejemplo n.º 2
0
    //Sets the proper animation to use after a turn ends, and then decides whether to add banter on afterwards.
    //Gives the player more money if they run out.
    private IEnumerator React(blackjackUIScript.Result r)
    {
        TogglePointToDeck();
        while (anim.isPlaying)
        {
            yield return(new WaitForSeconds(0.01f));
        }
        switch (r)
        {
        case blackjackUIScript.Result.PlayerWins:
            anim.CrossFade("godBossSighAnimation");
            break;

        case blackjackUIScript.Result.DealerWins:
            anim.CrossFade("godBossWinGestureAnimation");
            break;

        case blackjackUIScript.Result.PlayerBlackjack:
            anim.CrossFade("godBossHeadInHandsAnimation");
            break;

        case blackjackUIScript.Result.DealerBlackjack:
            if (player.GetInsurance())
            {
                anim.CrossFade("godBossShrugAnimation");
            }
            else
            {
                anim.CrossFade("godBossLaughAnimation");
            }
            break;

        case blackjackUIScript.Result.BothHaveBlackjack:
            if (player.GetInsurance())
            {
                anim.CrossFade("godBossSighAnimation");
            }
            else
            {
                anim.CrossFade("godBossShrugAnimation");
            }
            break;

        case blackjackUIScript.Result.PlayerBust:
            anim.CrossFade("godBossSnapAnimation");
            break;

        case blackjackUIScript.Result.DealerBust:
            anim.CrossFade("godBossSlapHeadAnimation");
            break;

        case blackjackUIScript.Result.Player5Cards:
            anim.CrossFade("godBossCollapseAnimation");
            break;

        case blackjackUIScript.Result.Dealer5Cards:
            anim.CrossFade("godBossSpinHeadAnimation");
            break;

        case blackjackUIScript.Result.Push:
            anim.CrossFade("godBossScratchChinAnimation");
            break;
        }
        player.ToggleTableLean();
        while (anim.isPlaying)
        {
            yield return(new WaitForSeconds(0.01f));
        }
        StartCoroutine(player.EndHand(r));
        yield return(new WaitForSeconds(1.0f));

        float banterChance = Random.Range(0f, 1f);

        while (voice.isPlaying)
        {
            yield return(new WaitForSeconds(0.01f));
        }
        if (UI.GetFunds() <= 0)
        {
            yield return(StartCoroutine(OutOfMoney()));
        }
        else if (banterChance > 0.5f)
        {
            yield return(StartCoroutine(SayBanter()));
        }
        results.SetButtons(true, player.GetBetAmount());
        Idle();
    }