public async Task WheelOfFortune(ShmartNumber amount) { if (!await CheckBetMandatory(amount).ConfigureAwait(false)) { return; } if (!await _cs.RemoveAsync(ctx.User.Id, "Wheel Of Fortune - bet", amount, gamble: true).ConfigureAwait(false)) { await ReplyErrorLocalizedAsync("not_enough", Bc.BotConfig.CurrencySign).ConfigureAwait(false); return; } await _lb.AddAsync(ctx.User.Id, LeaderboardType.WheelSpent, LeaderboardTimeType.AllTime, amount.Value); await _lb.AddAsync(ctx.User.Id, LeaderboardType.GamblingSpent, LeaderboardTimeType.AllTime, amount.Value); var result = await _service.WheelOfFortuneSpinAsync(ctx.User.Id, amount).ConfigureAwait(false); await ctx.Channel.SendConfirmAsync( Format.Bold($@"{ctx.User.ToString()} won: {result.Amount + Bc.BotConfig.CurrencySign} 『{Wof.Multipliers[1]}』 『{Wof.Multipliers[0]}』 『{Wof.Multipliers[7]}』 『{Wof.Multipliers[2]}』 {_emojis[result.Index]} 『{Wof.Multipliers[6]}』 『{Wof.Multipliers[3]}』 『{Wof.Multipliers[4]}』 『{Wof.Multipliers[5]}』")).ConfigureAwait(false); }
public async Task <Result> SpinAsync() { var result = _rng.Next(0, Multipliers.Length); var amount = (long)(_bet * Multipliers[result]); if (amount > 0) { await _cs.AddAsync(_userId, "Wheel Of Fortune - won", amount, gamble : true).ConfigureAwait(false); await _lb.AddAsync(_userId, LeaderboardType.Wheel, LeaderboardTimeType.AllTime, amount); await _lb.AddAsync(_userId, LeaderboardType.Gambling, LeaderboardTimeType.AllTime, amount); await _lb.AddAsync(_userId, LeaderboardType.Gambling, LeaderboardTimeType.Monthly, amount); } return(new Result { Index = result, Amount = amount, }); }