public static async void StartCombo(int casinoId, int rate) { Screen.LoadingPrompt.Show("Крутим барабан..."); await Delay(10000); Screen.LoadingPrompt.Hide(); var rand = new Random(); var number1 = rand.Next(9); var number2 = rand.Next(9); var number3 = rand.Next(9); if ((number1 == number2 || number2 == number3 || number1 == number3) && rand.Next(3) == 0) { number1 = rand.Next(9); number2 = rand.Next(9); number3 = rand.Next(9); } Notification.SendWithTime($"~g~Выпало число ~y~{number1}{number2}{number3}"); if (number1 == number2 && number2 == number3) { rate = rate * 3; Notification.SendWithTime($"~g~Ваш выигрыш умножен на 3: ${rate:#,#}."); User.AddCashMoney(rate); Business.RemoveMoney(casinoId, rate); } else if (number1 == number2 || number2 == number3 || number1 == number3) { rate = rate * 2; Notification.SendWithTime($"~g~Ваш выигрыш умножен на 2: ${rate:#,#}."); User.AddCashMoney(rate); Business.RemoveMoney(casinoId, rate); } else { User.RemoveCashMoney(rate); Business.AddMoney(casinoId, rate); Notification.SendWithTime($"~r~Вы проиграли ${rate}"); } await Delay(500); MenuList.ShowCasinoRateMenu(casinoId, 0); }
public static async void StartRulet(int casinoId, int rate, int idx) { switch (idx) { case 0: Notification.SendWithTime("~b~Вы сделали ставку на ~y~Red"); break; case 1: Notification.SendWithTime("~b~Вы сделали ставку на ~y~Black"); break; default: Notification.SendWithTime("~b~Вы сделали ставку на ~y~Zero"); break; } Screen.LoadingPrompt.Show("Крутим рулетку..."); await Delay(10000); Screen.LoadingPrompt.Hide(); var rand = new Random(); var number = rand.Next(36); await Delay(500); MenuList.ShowCasinoRateMenu(casinoId, 1); if (number % 2 == 0) { if (idx == 1 && rand.Next(4) > 1) { number++; } } else { if (idx == 0 && rand.Next(4) > 1) { number++; } } if (number == 0) { Notification.SendWithTime("~g~Выпало ~y~Zero"); if (idx == 2) { rate = rate * 5; Notification.SendWithTime($"~g~Ваш выигрыш умножен на 5: ${rate:#,#}."); User.AddCashMoney(rate); Business.RemoveMoney(casinoId, rate); return; } User.RemoveCashMoney(rate); Business.AddMoney(casinoId, rate); Notification.SendWithTime($"~r~Вы проиграли ${rate}"); } else if (number % 2 == 0) { Notification.SendWithTime("~g~Выпал ~y~Black"); if (idx == 1) { rate = Convert.ToInt32(rate * 1.5); Notification.SendWithTime($"~g~Ваш выигрыш умножен на 1.5: ${rate:#,#}."); User.AddCashMoney(rate); Business.RemoveMoney(casinoId, rate); return; } User.RemoveCashMoney(rate); Business.AddMoney(casinoId, rate); Notification.SendWithTime($"~r~Вы проиграли ${rate}"); } else { Notification.SendWithTime("~g~Выпал ~y~Red"); if (idx == 0) { rate = Convert.ToInt32(rate * 1.5); Notification.SendWithTime($"~g~Ваш выигрыш умножен на 1.5: ${rate:#,#}."); User.AddCashMoney(rate); Business.RemoveMoney(casinoId, rate); return; } User.RemoveCashMoney(rate); Business.AddMoney(casinoId, rate); Notification.SendWithTime($"~r~Вы проиграли ${rate}"); } }