public void PlaceBet() { if (bribe && betCheck <= 990) { GlobalCash.CashCount += betAmount; StatusAndStats.moneyGained += (int)betAmount; StatusAndStats.fightsWon++; betText.GetComponent <Text>().text = "WIN!"; myText = ">You won a chickenfight and won " + betAmount; myColor = new Color32(59, 192, 63, 255); ALM.LogText(myText, myColor); animText = "+" + betAmount; animColor = new Color32(59, 192, 63, 255); fontSize = 47; ALM.cashAnimation(animText, animColor, fontSize); winSound.Play(); bribePrice = bribePrice * 4; bribe = false; buttonBribePriceText.GetComponent <Text>().text = "BRIBE THE JUDGE \n(-" + bribePrice + ")"; bribeBtn.SetActive(true); betSlider.value = 0.1f; } else if (betCheck % 2 == 0) { GlobalCash.CashCount += betAmount; StatusAndStats.moneyGained += (int)betAmount; StatusAndStats.fightsWon++; betText.GetComponent <Text>().text = "WIN!"; animText = "+" + betAmount; animColor = new Color32(59, 192, 63, 255); fontSize = 47; ALM.cashAnimation(animText, animColor, fontSize); myText = ">You won a chickenfight and won " + betAmount; myColor = new Color32(59, 192, 63, 255); ALM.LogText(myText, myColor); winSound.Play(); betSlider.value = 0.1f; } else { GlobalCash.CashCount -= betAmount; GlobalChickens.ChickenCount -= 1; StatusAndStats.chickensLost += 1; StatusAndStats.moneyLost += (int)betAmount; betText.GetComponent <Text>().text = "Your chicken died."; lossCashText.GetComponent <Text>().text = "" + betAmount; lossCashText.GetComponent <Animation>().Play("lossCashAnim"); myText = ">Your chicken died! You lost " + betAmount; myColor = new Color32(209, 112, 100, 255); ALM.LogText(myText, myColor); //loseSound.Play(); betSlider.value = 0.1f; bribeBtn.SetActive(true); } }
public void doCrime() { if (moneyCheck == 2 || moneyCheck == 3) { GC.crime = 0; GlobalCash.CashCount += crimeWin; StatusAndStats.moneyGained += crimeWin; animText = "+" + crimeWin; animColor = new Color32(59, 192, 63, 255); fontSize = 47; ALM.cashAnimation(animText, animColor, fontSize); myColor = new Color32(59, 192, 63, 255); myText = ">You sold a brick as an iPhone and earned " + crimeWin; ALM.LogText(myText, myColor); coinStack.Play(); } else if (moneyCheck == 5) { GC.crime = 0; GlobalCash.CashCount += crimeWinBig + Mathf.Ceil(GlobalCash.CashCount / 2); StatusAndStats.moneyGained += crimeWinBig; animText = "+" + crimeWinBig; animColor = new Color32(59, 192, 63, 255); fontSize = 47; ALM.cashAnimation(animText, animColor, fontSize); myText = ">WOW! You robbed a bank and got away with " + crimeWinBig + "!"; myColor = new Color32(14, 200, 1, 255); ALM.LogText(myText, myColor); coinStack.Play(); } else { GC.crime = 0; moneyLoss = GlobalCash.CashCount * LossRange; GlobalCash.CashCount -= (int)moneyLoss; StatusAndStats.moneyLost += (int)moneyLoss; lossCashText.GetComponent <Text>().text = "-" + (int)moneyLoss; lossCashText.GetComponent <Animation>().Play("lossCashAnim"); myText = ">You got busted selling fake eggs and was fined " + (int)moneyLoss; myColor = new Color32(209, 112, 100, 255); ALM.LogText(myText, myColor); } }
public void buyChick() { if (GlobalCash.CashCount >= ChickenPrice) { chicBak.Play(); GlobalChickens.ChickenCount += chickenAmountToBuy; StatusAndStats.chickensBought += chickenAmountToBuy; GlobalCash.CashCount -= ChickenPrice; animText = "+" + chickenAmountToBuy + " Chicken(s)"; animColor = new Color32(59, 192, 63, 255); fontSize = 32; ALM.cashAnimation(animText, animColor, fontSize); myText = ">You bought " + chickenAmountToBuy + " chicken(s)"; myColor = new Color32(233, 233, 233, 255); ALM.LogText(myText, myColor); } else if ((GlobalCash.CashCount < ChickenPrice) && (GlobalCash.CashCount >= 50)) { cashRemainder = (Convert.ToInt32(Mathf.Floor(GlobalCash.CashCount)) % 50); chickensToAfford = ((int)GlobalCash.CashCount - cashRemainder) / 50; GlobalCash.CashCount -= chickensToAfford * 50; GlobalChickens.ChickenCount += chickensToAfford; animText = "+" + chickensToAfford + " Chickens(s)"; animColor = new Color32(59, 192, 63, 255); fontSize = 32; ALM.cashAnimation(animText, animColor, fontSize); myText = ">You bought " + chickensToAfford + " chicken(s)"; myColor = new Color32(233, 233, 233, 255); ALM.LogText(myText, myColor); } else { } }
public void PickCoin() { GlobalCash.CashCount += coinPickRate; StatusAndStats.moneyGained += coinPickRate; myText = ">You found some cash!"; myColor = new Color32(233, 233, 233, 255); ALM.LogText(myText, myColor); pickCoinSound.Play(); animText = "+" + coinPickRate; animColor = new Color32(59, 192, 63, 255); fontSize = 47; ALM.cashAnimation(animText, animColor, fontSize); }
public void StartAutoMoney() { if (GlobalCash.CashCount >= 1000) { GlobalCash.CashCount -= 1000; AutoMoney.SetActive(true); upgrade10Btn.SetActive(false); lossCashText.GetComponent <Text>().text = "-1000"; lossCashText.GetComponent <Animation>().Play("lossCashAnim"); animText = "UPGRADE!"; animColor = new Color32(59, 192, 63, 255); fontSize = 47; ALM.cashAnimation(animText, animColor, fontSize); myColor = new Color32(59, 192, 63, 255); myText = ">UPGRADE! YOUR CHICKENS NOW PRODUCE 0.1 COIN EACH!"; ALM.LogText(myText, myColor); upgradeSound.Play(); } }