private void WrongGuess() { MessageBox.Show("Unfortunately, your guess is wrong."); PointCardDataBaseControl.Updata("RemainLuckyDrawTimes", (PointCardDataBaseControl.remainLuckyDrawTimes - 1).ToString()); Close(); }
private void LuckDraw() { MessageBox.Show("You are correct!\nYou has a lucky draw."); randomNum = rnd.Next(1, 100); double mult = 1; if (randomNum <= 50) { mult = 1.1; MessageBox.Show("Chance of increasing 10 % of topped-up Virtual Gold Coins."); } else if (randomNum <= 50 + 30) { mult = 1.2; MessageBox.Show("Chance of increasing 20 % of topped-up Virtual Gold Coins."); } else if (randomNum <= 50 + 30 + 15) { mult = 1.5; MessageBox.Show("Chance of increasing 50 % of topped-up Virtual Gold Coins."); } else if (randomNum <= 50 + 30 + 15 + 5) { mult = 2; MessageBox.Show("Chance of increasing 100 % of topped-up Virtual Gold Coins."); } PlayerDataBaseControl.playerGoldCoins = (int)(PlayerDataBaseControl.playerGoldCoins * mult); PlayerDataBaseControl.Updata("PlayerGoldCoins", PlayerDataBaseControl.playerGoldCoins.ToString()); PointCardDataBaseControl.Updata("RemainLuckyDrawTimes", (PointCardDataBaseControl.remainLuckyDrawTimes - 1).ToString()); Close(); }