Ejemplo n.º 1
0
    public static void FinalizeOdds(GameObject raceManagerGameObjectRef)
    {
        RaceManager racemanagerScriptRef = raceManagerGameObjectRef.GetComponent <RaceManager>();

        foreach (BetData betD in racemanagerScriptRef.CurrentRaceBets)
        {
            foreach (GameObject eachTurtle in racemanagerScriptRef.TurtlesInTheRace)
            {
                if (betD.TurtlesName == eachTurtle.name)
                {
                    TurtleAI turtleScriptRef = eachTurtle.GetComponent <TurtleAI>();
                    betD.BetOdds = turtleScriptRef.myRealOdds;
                }
            }
        }
    }
Ejemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        if (Time.timeSinceLevelLoad > 1 && !hasPlacedAIBets)
        {
            TwitchChatExample ChatLink = gameObject.GetComponent <TwitchChatExample>();
            for (int i = 0; i <= 128; i++)
            {
                ChatLink.fakeMessage(TurtlesInTheRace[Random.Range(0, 10)].name);
                if (i > 122)
                {
                    ChatLink.fakeMessage("bid A " + CurrentTurtlesForSale[0].GetComponent <TurtleForSale>().myName + " " + Random.Range(1, 10));
                }
            }
            hasPlacedAIBets = true;
        }

        if (Input.GetKeyDown(KeyCode.M))
        {
            if (BonusRoundManager.IsMusicEnabled)
            {
                BonusRoundManager.IsMusicEnabled = false;
                Debug.Log("Disabling Music");
            }
            else
            {
                BonusRoundManager.IsMusicEnabled = true;
                Debug.Log("Enabling Music");
            }
        }
        if (Input.GetKeyDown(KeyCode.X))
        {
            foreach (GameObject eachTurtle in TurtlesInTheRace)
            {
                TurtleAI ti = eachTurtle.GetComponent <TurtleAI>();
                ti.BaseSpeed = 50;
            }
            TimeBetweenRaces = 2;
        }
        if (Input.GetKeyDown(KeyCode.S))
        { //start the race shortcut
            TimeBetweenRaces = 2;
        }

        if (TimeBetweenRaces - 9 < Time.timeSinceLevelLoad && BettingOpenDialog.activeInHierarchy == true)
        {
            AudioSource.PlayClipAtPoint(bellSound, Camera.main.transform.position);
            BettingClosedDialog.SetActive(true);
            BettingOpenDialog.SetActive(false);
            raceInfoDialog.SetActive(false);
            RaceDetailsGridObject.SetActive(false);
        }
        if (TimeBetweenRaces - Time.timeSinceLevelLoad < 40 && !startedMusic)
        {
            print("time race ended " + timeRaceEnded + " time between races " + TimeBetweenRaces);

            MainCameraHelper.StartTheRaceMusic();
            startedMusic = true;
        }
        if (TimeBetweenRaces - 6 < Time.timeSinceLevelLoad && isBettingOpen)
        {
            isBettingOpen = false;
        }

        if (TimeBetweenRaces * 0.9f < Time.timeSinceLevelLoad && !hasAucionCompleted)
        {
            Auctioneer.FinalizeAuction(this.gameObject);
            hasAucionCompleted = true;
            AuctionTimerObject.SetActive(false);
            WholeAuctionObject.SetActive(false);
        }
        else
        {
            AuctionTimer.text = Mathf.RoundToInt((TimeBetweenRaces * 0.9f) - Time.timeSinceLevelLoad) + " Seconds";
        }

        if (TimeBetweenRaces < Time.timeSinceLevelLoad && !hasRaceStarted)
        {
            hasRaceStarted = true;
            RaceStartingTimerObject.SetActive(false);
            BettingClosedDialog.SetActive(false);
            RaceCam1.m_Speed = 1;
            //TimeBetweenRaces += Time.time; //this was causing extra delays
            BetManager.FinalizeOdds(this.gameObject);
        }
        else
        {
            RaceStartingTimer.text = Mathf.RoundToInt(TimeBetweenRaces - Time.timeSinceLevelLoad) + " Seconds";
        }
        if (hasRaceStarted && FinishLineCam.Priority != 16)
        {
            foreach (GameObject turtleRef in TurtlesInTheRace)
            {
                TurtleAI turlteScriptRef = turtleRef.GetComponent <TurtleAI>();

                /*if(BackHalfCam.Priority!=15 && turlteScriptRef.percentFinished > 0.5f){
                 *                      BackHalfCam.Priority = 15;
                 *              }*/
                if (turlteScriptRef.percentFinished > 0.9f)
                {
                    FinishLineCam.Priority = 16;
                }
            }
        }

        //If a single turtle finshed, open the in-race results gui.
        if (TurtleAI.HowManyTurtlesFinished > 0 && !hasRaceEnded)
        {
            if (!InRaceresultsScreen.activeInHierarchy)
            {
                InRaceresultsScreen.SetActive(true);
            }
        }

        if (TurtleAI.HowManyTurtlesFinished == 10 && !hasRaceEnded)
        {
            hasRaceEnded = true;
            PayOutWinners();
            InRaceresultsScreen.SetActive(false);
            RaceResultsScreen.SetActive(true);
            RaceStartingTitle.text = "Bonus Round in";
            BettingClosedDialog.SetActive(true);
            raceInfoDialog.SetActive(true);
            RaceResultsGUITextA.text = TurtleAI.RaceResultsColumn1 + "<nobr>";
            RaceResultsGUITextB.text = TurtleAI.RaceResultsColumn2 + "<nobr>";
            RaceResultsGuiTextC.text = TurtleAI.RaceResultsColumn3 + "<nobr>";
            RaceResultsGiuTextD.text = TurtleAI.RaceResultsColumn4 + "<nobr>";

            timeRaceEnded = Time.timeSinceLevelLoad;
            int   totalTrueBets = 0;
            float totalPaidOut  = 0;
            foreach (BetData eachBet in CurrentRaceBets)
            {
                //Check for winning bets
                if (eachBet.BetType == "win")
                {
                    foreach (RaceResultData contestant in GuestManager.CurrentRaceresults)
                    {
                        if (contestant.FinishingPlace == 1 && contestant.TurtleName == eachBet.TurtlesName)
                        {
                            //They predicted this win!
                            eachBet.didBetComeTrue = true;
                            totalTrueBets++;
                        }
                    }
                }
                if (eachBet.BetType == "place")
                {
                    foreach (RaceResultData contestant in GuestManager.CurrentRaceresults)
                    {
                        if (contestant.TurtleName == eachBet.TurtlesName)
                        {
                            if (contestant.FinishingPlace == 1 || contestant.FinishingPlace == 2)
                            {
                                eachBet.didBetComeTrue = true;
                                totalTrueBets++;
                            }
                        }
                    }
                }
                if (eachBet.BetType == "show")
                {
                    foreach (RaceResultData contestant in GuestManager.CurrentRaceresults)
                    {
                        if (contestant.TurtleName == eachBet.TurtlesName)
                        {
                            if (contestant.FinishingPlace <= 3)
                            {
                                eachBet.didBetComeTrue = true;
                                totalTrueBets++;
                            }
                        }
                    }
                }

                foreach (GuestData eachGuest in GuestManager.AllGuests)
                {
                    if (eachGuest.guestName == eachBet.BettersName)
                    {
                        if (eachBet.didBetComeTrue)
                        {
                            //Pay them if the bet won.
                            float     amountToPay = eachBet.BetAmount * eachBet.BetOdds;
                            TwitchIRC tIRC        = GetComponent <TwitchIRC>();
                            if (eachBet.BetType == "place")
                            {
                                amountToPay = eachBet.BetAmount + OddsDisplay.CurrentTotalPlacePool * (eachBet.BetAmount / (OddsDisplay.CurrentTotalPlacePool / 2));
                                //Debug.Log("Paying out " + amountToPay + " to " + eachGuest.guestName + " for betting " + eachBet.BetAmount + " on " + eachBet.TurtlesName + " to place of a pool of " + OddsDisplay.CurrentTotalPlacePool);
                                if (!eachGuest.guestName.Contains("turtlebot"))
                                {
                                    //tIRC.SendMsg("Paying out " + amountToPay + " to " + eachGuest.guestName + " for betting " + eachBet.BetAmount + " on " + eachBet.TurtlesName + "to place of a pool of " + OddsDisplay.CurrentTotalPlacePool);
                                }
                            }
                            if (eachBet.BetType == "win")
                            {
                                //Debug.Log("Paying out " + amountToPay + " to " + eachGuest.guestName + " for betting " + eachBet.BetAmount + " on " + eachBet.TurtlesName + " at odds of " + eachBet.BetOdds);
                                if (!eachGuest.guestName.Contains("turtlebot"))
                                {
                                    //tIRC.SendMsg("Paying out " + amountToPay + " to " + eachGuest.guestName + " for betting " + eachBet.BetAmount + " on " + eachBet.TurtlesName + " at odds of " + eachBet.BetOdds);
                                }
                            }
                            if (eachBet.BetType == "show")
                            {
                                amountToPay = eachBet.BetAmount + OddsDisplay.CurrentTotalShowPool * (eachBet.BetAmount / (OddsDisplay.CurrentTotalShowPool / 3));
                                //Debug.Log("Paying out " + amountToPay + " to " + eachGuest.guestName + " for betting " + eachBet.BetAmount + " on " + eachBet.TurtlesName + " to show of a pool of " + OddsDisplay.CurrentTotalShowPool);
                                if (!eachGuest.guestName.Contains("turtlebot"))
                                {
                                    //tIRC.SendMsg("Paying out " + amountToPay + " to " + eachGuest.guestName + " for betting " + eachBet.BetAmount + " on " + eachBet.TurtlesName + " to show of a pool of " + OddsDisplay.CurrentTotalShowPool);
                                }
                            }
                            eachGuest.guestCash += amountToPay;
                            totalPaidOut        += amountToPay;
                            float totalPaidIn = OddsDisplay.CurrentTotalPlacePool + OddsDisplay.CurrentTotalPot + OddsDisplay.CurrentTotalShowPool;
                            //print("Total paid out = " + totalPaidOut + " Total paid in = " + totalPaidIn);
                        }
                    }
                }
            }
        }
        if (timeRaceEnded > 1)
        {
            if (RaceStartingTimerObject.activeInHierarchy != true)
            {
                RaceStartingTimerObject.SetActive(true);
            }
            RaceStartingTimer.text = Mathf.RoundToInt((timeRaceEnded + (TimeBetweenRaces / 5)) - Time.timeSinceLevelLoad) + " Seconds";
            RaceStartingTitle.text = "Bonus Round in...";
            //Debug.Log("Time race ended " + timeRaceEnded + "  Time between races " + TimeBetweenRaces + "  current time " + Time.time);
            if (Time.timeSinceLevelLoad > timeRaceEnded + (TimeBetweenRaces / 5))
            {
                GuestManager.SaveGuestData();
                GuestManager.ClearNextRaceTurtles();
                SceneManager.LoadScene("Pachinko");
            }
        }
    }
Ejemplo n.º 3
0
    // Use this for initialization
    void Awake()
    {
        Debug.Log("Loading data...");
        GuestManager.LoadGuestData();
        //Debug.Log("Clearing race results...");
        GuestManager.CurrentRaceresults.Clear();
        TurtleAuctionManager.TurtlesForAuction.Clear();
        for (int i = 0; i <= 9; i++)
        {
            //TurtlesInTheRace[i].name = AllTurtlesData[i].name;
            if (GuestManager.NextRacesTurtles.Count <= i) //If there are less custom turtles entered than the number of names we have filled out
            {
                //Debug.Log("GuestManager.NextRacesTurtles.Count is at " + GuestManager.NextRacesTurtles.Count + " and i is at " + i);
                //print(i + " nextracesturtlescount " + GuestManager.NextRacesTurtles.Count);
                TurtlesInTheRace[i].name = gameObject.GetComponent <TurtleNamer>().GiveNewRandomName();
                TurtleAI thisAI = TurtlesInTheRace[i].GetComponent <TurtleAI>();
                thisAI.myTurtleData.MyScaleX = Random.Range(-10, 10);
                thisAI.myTurtleData.MyScaleY = Random.Range(-10, 10);
                //print("making a fake turtle name");
            }
            else
            {
                TurtlesInTheRace[i].GetComponent <TurtleAI>().myTurtleData = GuestManager.NextRacesTurtles[i];
            }
        }
        //Debug.Log("Deactivating objects...");
        DeactivateObjects(possibleTracks);
        DeactivateObjects(possibleFinishLines);

        int randomTrack  = Random.Range(0, possibleTracks.Length - 1);
        int randomLength = Random.Range(0, possibleFinishLines.Length - 1);

        if (PlayerPrefs.HasKey("NextSurface"))
        {
            randomTrack  = PlayerPrefs.GetInt("NextSurface");
            randomLength = PlayerPrefs.GetInt("NextLength");
            //Debug.Log("Oh shit we loaded the random legnth from playerprefs, this has caused issues, it is " + randomLength);
        }
        if (PlayerPrefs.HasKey("NextPurse"))
        {
            Purse = PlayerPrefs.GetInt("NextPurse");
        }

        //Debug.Log("Picking random track...");
        possibleTracks[randomTrack].SetActive(true);
        //Debug.Log("Picking random finish line...");
        possibleFinishLines[randomLength].SetActive(true);
        //Debug.Log("Picking track name...");
        TrackName            = possibleTracks[randomTrack].name;
        RaceInfoSurface.text = "Surface: " + TrackName;
        //Debug.Log("Writing track length...");
        RaceInfoLength.text = "Length: " + possibleFinishLines[randomLength].name;

        //Debug.Log("Setting up finish line...");
        FinishLineCam.gameObject.transform.position = new Vector3(FinishLineCam.transform.position.x, FinishLineCam.transform.position.y, possibleFinishLines[randomLength].transform.position.z);
        FinishLineLocator.transform.position        = possibleFinishLines[randomLength].transform.position;

        isBettingOpen = true;
        //Debug.Log("picking random name for HUD...");
        string exampleName = TurtlesInTheRace[Random.Range(2, 5)].name;

        bettingOpenInstructions.text = "Type ''" + exampleName + " Win 10'' to bet 10 on " + exampleName + " to win!";
    }
Ejemplo n.º 4
0
    public static void GetABet(string incomingBet, string incomingBettersName, GameObject raceManagerGameObjectRef)
    {
        //print("We got a bet: "+ incomingBet);

        RaceManager racemanagerScriptRef = raceManagerGameObjectRef.GetComponent <RaceManager>();

        foreach (GameObject eachTurtle in racemanagerScriptRef.TurtlesInTheRace)
        {
            TurtleAI turtleScriptRef = eachTurtle.GetComponent <TurtleAI>();
            if (incomingBet.CaseInsensitiveContains("register"))
            {
                foreach (GuestData gD in GuestManager.AllGuests)
                {
                    if (gD.guestName == incomingBettersName)
                    {
                        gD.registeredAddress = incomingBet;
                    }
                }
            }

            if (incomingBet.CaseInsensitiveContains("bid"))
            {
                if (incomingBet.CaseInsensitiveContains(" a"))
                {
                    Debug.Log("incoming bet " + incomingBet);
                    TurtleForSale turtleForBiddingScriptRef = racemanagerScriptRef.CurrentTurtlesForSale[0].GetComponent <TurtleForSale>();
                    turtleForBiddingScriptRef.GetABid(int.Parse(Regex.Match(incomingBet, @"\d+").Value));
                }
                if (incomingBet.CaseInsensitiveContains(" b"))
                {
                    Debug.Log("incoming bet " + incomingBet);
                    TurtleForSale turtleForBiddingScriptRef = racemanagerScriptRef.CurrentTurtlesForSale[1].GetComponent <TurtleForSale>();
                    turtleForBiddingScriptRef.GetABid(int.Parse(Regex.Match(incomingBet, @"\d+").Value));
                }
                if (incomingBet.CaseInsensitiveContains(" c"))
                {
                    Debug.Log("incoming bet " + incomingBet);
                    TurtleForSale turtleForBiddingScriptRef = racemanagerScriptRef.CurrentTurtlesForSale[2].GetComponent <TurtleForSale>();
                    turtleForBiddingScriptRef.GetABid(int.Parse(Regex.Match(incomingBet, @"\d+").Value));
                }
            }

            if (incomingBet.CaseInsensitiveContains(eachTurtle.name) && RaceManager.isBettingOpen)
            {
                //bet on the turtle
                //print("Bet on this turtle " + eachTurtle.name);


                if (incomingBet.CaseInsensitiveContains("win") || incomingBet.CaseInsensitiveContains("show") || incomingBet.CaseInsensitiveContains("place"))
                {
                    //bet to win
                    string numbersInMessage = Regex.Match(incomingBet, @"\d+").Value;
                    int    betAsInt         = int.Parse(numbersInMessage);
                    if (betAsInt < 0)
                    {
                        return;
                    }
                    BetData thisBet = new BetData();
                    thisBet.TurtlesName = eachTurtle.name;
                    thisBet.BetAmount   = betAsInt;
                    if (incomingBet.CaseInsensitiveContains("win"))
                    {
                        thisBet.BetType = "win";
                        turtleScriptRef.howMuchIsBetOnMe += thisBet.BetAmount;
                    }
                    if (incomingBet.CaseInsensitiveContains("place"))
                    {
                        thisBet.BetType = "place";
                        turtleScriptRef.howMuchIsBetOnMeToPlace += thisBet.BetAmount;
                    }
                    if (incomingBet.CaseInsensitiveContains("show"))
                    {
                        thisBet.BetType = "show";
                        turtleScriptRef.howMuchIsBetOnMeToShow += thisBet.BetAmount;
                    }
                    thisBet.BettersName = incomingBettersName;
                    thisBet.BetOdds     = turtleScriptRef.myRealOdds;
                    foreach (GuestData gD in GuestManager.AllGuests)
                    {
                        if (gD.guestName == thisBet.BettersName)
                        {
                            if (gD.guestCash < thisBet.BetAmount)
                            {
                                thisBet.BetAmount = gD.guestCash;
                            }
                            if (gD.guestCash == thisBet.BetAmount)
                            {
                                GameObject     bottomToaster  = GameObject.Find("Toaster");
                                ToasterManager toastScriptRef = bottomToaster.GetComponent <ToasterManager>();
                                toastScriptRef.ShowAToaster(gD.guestName, " Went ALL IN!");
                            }
                            gD.guestCash -= thisBet.BetAmount;
                        }
                    }
                    racemanagerScriptRef.CurrentRaceBets.Add(thisBet);

                    TwitchIRC tIRC = raceManagerGameObjectRef.GetComponent <TwitchIRC>();
                    if (!thisBet.BettersName.Contains("turtlebot"))
                    {
                        tIRC.SendMsg("Confirmed: " + thisBet.BettersName + " Bet " + thisBet.BetAmount + " on " + thisBet.TurtlesName + " to " + thisBet.BetType);
                    }

                    //tIRC.SendCommand(".PRIVMSG #turtleracingalpha :/w turtleracingalpha this is a whisper with .");
                    //tIRC.SendCommand("/PRIVMSG #turtleracingalpha :/w turtleracingalpha this is a whisper with /");
                    //tIRC.SendCommand(":PRIVMSG #turtleracingalpha :/w turtleracingalpha this is a whisper with :");
                    //tIRC.SendMsg("/w turtleracingalpha this is a whisper with msg");

                    //Debug.Log("For <color=green>" + thisBet.BetAmount + "</color> at odds of " + thisBet.BetOdds);
                }
            }
        }
    }
Ejemplo n.º 5
0
    public static void GetABet(string incomingBet, string incomingBettersName, GameObject raceManagerGameObjectRef)
    {
        //print("We got a bet: "+ incomingBet);

        RaceManager racemanagerScriptRef = raceManagerGameObjectRef.GetComponent <RaceManager>();

        foreach (GameObject eachTurtle in racemanagerScriptRef.TurtlesInTheRace)
        {
            TurtleAI turtleScriptRef = eachTurtle.GetComponent <TurtleAI>();
            if (incomingBet.CaseInsensitiveContains("register"))
            {
                foreach (GuestData gD in GuestManager.AllGuests)
                {
                    if (gD.guestName == incomingBettersName)
                    {
                        gD.registeredAddress = incomingBet;
                    }
                }
            }
            if (incomingBet.CaseInsensitiveContains("bid"))
            {
                TurtleForSale turtleForBiddingScriptRef = racemanagerScriptRef.CurrentTurtlesForSale[0].GetComponent <TurtleForSale>();
                if (incomingBet.CaseInsensitiveContains(turtleForBiddingScriptRef.myName))
                {
                    //Debug.Log("incoming bet " + incomingBet);
                    turtleForBiddingScriptRef.GetABid(int.Parse(Regex.Match(incomingBet, @"\d+").Value), incomingBettersName);
                }
            }
            if (RaceManager.isBettingOpen)
            {
                string mightBeExclamation;
                if (incomingBet.CaseInsensitiveContains("!1"))
                {
                }
                if (incomingBet.CaseInsensitiveContains(eachTurtle.name))
                {
                    //bet on the turtle
                    //print("Bet on this turtle " + eachTurtle.name);
                    DealWiththeBet(incomingBet, incomingBettersName, eachTurtle, turtleScriptRef, racemanagerScriptRef, raceManagerGameObjectRef);
                }
            }
            else
            {
                if (racemanagerScriptRef.hasRaceStarted && racemanagerScriptRef.hasRaceEnded != true)
                {
                    if (incomingBet.CaseInsensitiveContains(eachTurtle.name))
                    {
                        TurtleAI tsRef = eachTurtle.GetComponent <TurtleAI>();
                        tsRef.BaseSpeed += 0.1f;
                        TwitchIRC tIRC             = raceManagerGameObjectRef.GetComponent <TwitchIRC>();
                        string    ConfirmedQuip    = "Good luck!";
                        int       RandomQuipNumber = Random.Range(0, 20);
                        switch (RandomQuipNumber)
                        {
                        case 0:
                            ConfirmedQuip = eachTurtle.name + " has recieved a boost of inspiration! PogChamp";
                            break;

                        case 1:
                            ConfirmedQuip = "Go " + eachTurtle.name + " Go! PogChamp";
                            break;

                        case 2:
                            ConfirmedQuip = eachTurtle.name + " is freaking out! PogChamp";
                            break;

                        case 3:
                            ConfirmedQuip = eachTurtle.name + " is going in strong! PogChamp";
                            break;

                        case 4:
                            ConfirmedQuip = eachTurtle.name + " got another wind! PogChamp";
                            break;

                        case 5:
                            ConfirmedQuip = eachTurtle.name + " is making a break for it! PogChamp";
                            break;

                        case 6:
                            ConfirmedQuip = eachTurtle.name + "hogs the spotlight! PogChamp";
                            break;

                        case 7:
                            ConfirmedQuip = eachTurtle.name + "! PogChamp";
                            break;

                        case 8:
                            ConfirmedQuip = "Excitement rippling around " + eachTurtle.name + " now! PogChamp";
                            break;

                        case 9:
                            ConfirmedQuip = eachTurtle.name + " for home! PogChamp";
                            break;

                        case 10:
                            ConfirmedQuip = eachTurtle.name + " giving chase! PogChamp";
                            break;

                        case 11:
                            ConfirmedQuip = eachTurtle.name + " stretches hard! PogChamp";
                            break;

                        case 12:
                            ConfirmedQuip = eachTurtle.name + " is under the whip! PogChamp";
                            break;

                        case 13:
                            ConfirmedQuip = eachTurtle.name + " around wide, this could be setup for something special! PogChamp";
                            break;

                        case 14:
                            ConfirmedQuip = "There's the run for " + eachTurtle.name + "! PogChamp";
                            break;

                        case 15:
                            ConfirmedQuip = eachTurtle.name + " hype! PogChamp";
                            break;

                        case 16:
                            ConfirmedQuip = eachTurtle.name + " takes footing in its stride! PogChamp";
                            break;

                        case 17:
                            ConfirmedQuip = "There's " + eachTurtle.name + " going home! PogChamp";
                            break;

                        case 18:
                            ConfirmedQuip = eachTurtle.name + " still has a little bit left in the tank! PogChamp";
                            break;

                        case 19:
                            ConfirmedQuip = eachTurtle.name + " is starting to wind up! PogChamp";
                            break;

                        case 20:
                            ConfirmedQuip = eachTurtle.name + " hears the crowd! PogChamp";
                            break;
                        }
                        tIRC.SendCommand("PRIVMSG #" + tIRC.channelName + " : " + ConfirmedQuip);
                        Debug.Log("Boosted");
                    }
                }
            }
        }
    }
Ejemplo n.º 6
0
    static void DealWiththeBet(string incomingBet, string incomingBettersName, GameObject eachTurtle, TurtleAI turtleScriptRef, RaceManager racemanagerScriptRef, GameObject raceManagerGameObjectRef)
    {
        if (incomingBet.CaseInsensitiveContains("win") || incomingBet.CaseInsensitiveContains("show") || incomingBet.CaseInsensitiveContains("place"))
        {
            //bet to win
            string numbersInMessage = Regex.Match(incomingBet, @"\d+").Value;
            int    betAsInt         = int.Parse(numbersInMessage);
            if (betAsInt < 0 || betAsInt > 1000000)
            {
                return;
            }
            BetData thisBet = new BetData();
            thisBet.TurtlesName = eachTurtle.name;
            thisBet.BetAmount   = betAsInt;
            if (incomingBet.CaseInsensitiveContains("win"))
            {
                thisBet.BetType = "win";
                turtleScriptRef.howMuchIsBetOnMe += thisBet.BetAmount;
            }
            if (incomingBet.CaseInsensitiveContains("place"))
            {
                thisBet.BetType = "place";
                turtleScriptRef.howMuchIsBetOnMeToPlace += thisBet.BetAmount;
            }
            if (incomingBet.CaseInsensitiveContains("show"))
            {
                thisBet.BetType = "show";
                turtleScriptRef.howMuchIsBetOnMeToShow += thisBet.BetAmount;
            }
            thisBet.BettersName = incomingBettersName;
            thisBet.BetOdds     = turtleScriptRef.myRealOdds;
            foreach (GuestData gD in GuestManager.AllGuests)
            {
                if (gD.guestName == thisBet.BettersName)
                {
                    if (gD.guestCash < thisBet.BetAmount)
                    {
                        thisBet.BetAmount = gD.guestCash;
                    }
                    if (gD.guestCash == thisBet.BetAmount)
                    {
                        GameObject     bottomToaster  = GameObject.Find("Toaster");
                        ToasterManager toastScriptRef = bottomToaster.GetComponent <ToasterManager>();
                        toastScriptRef.ShowAToaster(gD.guestName, " Went ALL IN!");
                    }
                    gD.guestCash -= thisBet.BetAmount;
                }
            }
            racemanagerScriptRef.CurrentRaceBets.Add(thisBet);

            TwitchIRC tIRC = raceManagerGameObjectRef.GetComponent <TwitchIRC>();
            if (!thisBet.BettersName.Contains("turtlebot"))
            {
                string betConfirmedQuip = "Good luck!";
                int    RandomQuipNumber = Random.Range(0, 10);
                switch (RandomQuipNumber)
                {
                case 0:
                    betConfirmedQuip = "Good luck!";
                    break;

                case 1:
                    betConfirmedQuip = "Go Go Go!";
                    break;

                case 2:
                    betConfirmedQuip = "Be sure to cheer it on!";
                    break;

                case 3:
                    betConfirmedQuip = "It's a lock. KevinTurtle";
                    break;

                case 4:
                    betConfirmedQuip = "It's been sandbagging looking for a good spot.";
                    break;

                case 5:
                    betConfirmedQuip = "Ka-Chow!";
                    break;

                case 6:
                    betConfirmedQuip = "They heard their going to break it's maiden. Kappa";
                    break;

                case 7:
                    betConfirmedQuip = "It's workouts are unpublished. Kappa";
                    break;

                case 8:
                    betConfirmedQuip = "Their UPS driver Lance knows it's owner. Kappa";
                    break;

                case 9:
                    betConfirmedQuip = "It's been getting in light because they were using the bug boy on it. Now they're ready to run with it!";
                    break;

                case 10:
                    betConfirmedQuip = "It's going to go for a great prize.";
                    break;
                }
                tIRC.SendCommand("PRIVMSG #" + tIRC.channelName + " : Bet confirmed. " + thisBet.BettersName + " Bet " + thisBet.BetAmount + " on " + thisBet.TurtlesName + " to " + thisBet.BetType + ". " + betConfirmedQuip);
            }
        }
    }