Esempio n. 1
0
    IEnumerator Text5()
    {
        mylog.buycoinsmenu.SetActive(true);
        yield return(StartCoroutine(mylog.text("Welcome to ROCKET")));

        yield return(StartCoroutine(mylog.line("GAME CORNER!", 1)));

        yield return(StartCoroutine(mylog.para("Do you need some")));

        yield return(StartCoroutine(mylog.line("game coins?", 1)));

        yield return(StartCoroutine(mylog.para("It's $1000 for 50")));

        yield return(StartCoroutine(mylog.line("coins. Would you", 0)));

        yield return(StartCoroutine(mylog.cont("like some?")));

        mylog.prompt();
        while (!mylog.finishedThePrompt)
        {
            yield return(new WaitForSeconds(0.1f));

            if (mylog.finishedThePrompt)
            {
                break;
            }
        }
        if (mylog.selectedOption == 0)
        {
            if (play.coins <= 9949 && play.money >= 1000)
            {
                play.money -= 1000;
                play.coins += 50;
                yield return(StartCoroutine(mylog.text("Thanks! Here are")));

                yield return(StartCoroutine(mylog.line("your 50 coins!")));

                yield return(StartCoroutine(mylog.done()));
            }
            else
            {
                if (play.money < 1000)
                {
                    yield return(StartCoroutine(mylog.text("You can't afford")));

                    yield return(StartCoroutine(mylog.line("the coins!")));

                    yield return(StartCoroutine(mylog.done()));

                    mylog.buycoinsmenu.SetActive(false);
                    yield break;
                }
                if (play.coins > 9949)
                {
                    yield return(StartCoroutine(mylog.text("Oops! Your COIN")));

                    yield return(StartCoroutine(mylog.line("CASE is full.")));

                    yield return(StartCoroutine(mylog.done()));

                    mylog.buycoinsmenu.SetActive(false);
                    yield break;
                }
            }
        }
        else
        {
            yield return(StartCoroutine(mylog.text("No? Please come")));

            yield return(StartCoroutine(mylog.line("play sometime!")));

            yield return(StartCoroutine(mylog.done()));
        }
        if (play.coins >= 500 && !lag.itemInInventory("BIKE VOUCHER"))
        {
            yield return(StartCoroutine(mylog.text("Hey, by the")));

            yield return(StartCoroutine(mylog.line("way...", 1)));

            yield return(StartCoroutine(mylog.para("You have enough")));

            yield return(StartCoroutine(mylog.line("coins to buy", 0)));

            yield return(StartCoroutine(mylog.cont("this BIKE VOUCHER!", 1)));

            yield return(StartCoroutine(mylog.para("Interested?")));

            yield return(StartCoroutine(mylog.prompt()));

            if (mylog.selectedOption == 0)
            {
                play.coins -= 500;
                StartCoroutine(lag.AddItem("BIKE VOUCHER", -2));
                yield return(StartCoroutine(mylog.text("Here you go!", 1)));

                yield return(StartCoroutine(mylog.para("You recieved a BIKE VOUCHER!")));

                yield return(StartCoroutine(mylog.done()));
            }
            else
            {
                mylog.Deactivate();
            }
        }

        mylog.buycoinsmenu.SetActive(false);
    }