internal override async Task <bool> Run() { int?wheelDifficulty = null; while (!wheelDifficulty.HasValue) { var builder = new DiscordEmbedBuilder() { Title = "How Difficult would you like the Wheel to be? Lower Difficulties will lower your required Edges and work, but also your Chance for a good ending :)", Url = "http://IJustWantThisToBeBlue.com" }; builder.AddField("Easiest Setting. Almost no Edges, will leave you in ruins.", WheelExtension.WheelDifficultyPreference.Baby.ToString()); builder.AddField( "Easy Setting, for when you are just starting with Edging.", WheelExtension.WheelDifficultyPreference.Easy.ToString()); builder.AddField( "Default. This is how the Wheel was before the Settings arrived, and how it is before you set up the settings.", WheelExtension.WheelDifficultyPreference.Default.ToString()); builder.AddField("Pretty Challenging.", WheelExtension.WheelDifficultyPreference.Hard.ToString()); builder.AddField("This will make every single roll Hardcore. High risk, High reward though.", WheelExtension.WheelDifficultyPreference.Masterbater.ToString()); await _dm.SendMessageAsync(embed : builder.Build()); var m = await _ctx.Client.GetInteractivityModule().WaitForMessageAsync( x => x.Channel.Id == _dm.Id && x.Author.Id == _ctx.Member.Id, TimeSpan.FromSeconds(240)); if (m == null) { await _dm.SendMessageAsync($"Or just don't respond at all. That's ok too :("); return(false); } if (Enum.TryParse(m.Message.Content, true, out WheelExtension.WheelDifficultyPreference wheelDifficultyPreference)) { wheelDifficulty = (int)wheelDifficultyPreference; } else { await _dm.SendMessageAsync($"Sorry, I didn't ge that. You have to precisely enter the name of one of the difficulties."); } } await UserSettingExtension.SetSettingAsync(_userId, UserSettingExtension.SettingID.WheelDifficulty, wheelDifficulty.ToString(), _context); return(true); }
public async Task ApplySettings(DiscordContext context = null) { if (context == null) { context = new DiscordContext(); } var userId = _settings.Values.First().UserId; foreach (var setting in _settings) { await UserSettingExtension.SetSettingAsync(userId, setting.Key, setting.Value.Value, context, false); } await context.SaveChangesAsync(); }
internal override async Task <bool> Run() { WheelExtension.WheelTaskPreferenceSetting?wheelTaskPreference = null; var builder = new DiscordEmbedBuilder() { Title = "What kind of task do you prefer? There are no penalties here.", Url = "http://IJustWantThisToBeBlue.com" }; builder.AddField("Edge for 15 Minutes. 30 second Cooldown.", WheelExtension.WheelTaskPreferenceSetting.Time.ToString()); builder.AddField("Edge 10 times.", WheelExtension.WheelTaskPreferenceSetting.Amount.ToString()); builder.AddField("Edge 10 times per day, for the next 2 Days.", WheelExtension.WheelTaskPreferenceSetting.Task.ToString()); builder.AddField("No preference", WheelExtension.WheelTaskPreferenceSetting.Default.ToString()); await _dm.SendMessageAsync(embed : builder.Build()); var m = await _ctx.Client.GetInteractivityModule().WaitForMessageAsync( x => x.Channel.Id == _dm.Id && x.Author.Id == _ctx.Member.Id, TimeSpan.FromSeconds(240)); if (m == null) { await _dm.SendMessageAsync($"Or just don't respond at all. That's ok too :("); return(false); } if (Enum.TryParse(m.Message.Content, true, out WheelExtension.WheelTaskPreferenceSetting wheelPreferenceSetting)) { wheelTaskPreference = wheelPreferenceSetting; } else { await _dm.SendMessageAsync($"Sorry, i didn't get that. You have to precisely enter the name of one of the possible preferences."); } UserSetting wheelTaskPreferenceSetting = await UserSettingExtension.SetSettingAsync(_userId, UserSettingExtension.SettingID.WheelTaskPreference, (int)wheelTaskPreference.Value, _context); return(true); }
internal override async Task <bool> Run() { int?analLevel = null; var builder = new DiscordEmbedBuilder() { Title = "At which level do you want your anal tasks to be? This is pretty much a difficulty setting.", Url = "http://IJustWantThisToBeBlue.com" }; builder.AddField("If you don't like anal, choose this.", UserSettingExtension.AnalLevel.None.ToString()); builder.AddField("If you're new to anal, or just not interested that much. take this.", UserSettingExtension.AnalLevel.Light.ToString()); builder.AddField("This setting is for regular anal", UserSettingExtension.AnalLevel.Normal.ToString()); builder.AddField("You've got a d***o up your ass even now? Choose this.", UserSettingExtension.AnalLevel.Hardcore.ToString()); await _dm.SendMessageAsync(embed : builder.Build()); var m = await _ctx.Client.GetInteractivityModule().WaitForMessageAsync( x => x.Channel.Id == _dm.Id && x.Author.Id == _ctx.Member.Id, TimeSpan.FromSeconds(240)); if (m == null) { await _dm.SendMessageAsync($"Or just don't respond at all. That's ok too :("); return(false); } if (Enum.TryParse(m.Message.Content, true, out UserSettingExtension.AnalLevel analLevelPreference)) { analLevel = (int)analLevelPreference; } else { await _dm.SendMessageAsync($"Sorry, I didn't get that. You have to precisely enter the name of one of the levels."); } await UserSettingExtension.SetSettingAsync(_userId, UserSettingExtension.SettingID.AnalLevel, analLevel.ToString(), _context); return(true); }
internal override async Task <bool> Run() { int?gender = null; var builder = new DiscordEmbedBuilder() { Title = "Please specify the Gender which with you want to be addressed.", Url = "https://en.wikipedia.org/wiki/Gender" }; builder.AddField("If you don't want, to set your Gender, use this.", UserSettingExtension.Gender.None.ToString()); builder.AddField("You have a Penis.", UserSettingExtension.Gender.Male.ToString()); builder.AddField("You don't have a Penis.", UserSettingExtension.Gender.Female.ToString()); await _dm.SendMessageAsync(embed : builder.Build()); var m = await _ctx.Client.GetInteractivityModule().WaitForMessageAsync( x => x.Channel.Id == _dm.Id && x.Author.Id == _ctx.Member.Id, TimeSpan.FromSeconds(240)); if (m == null) { await _dm.SendMessageAsync($"Or just don't respond at all. That's ok too :("); return(false); } if (Enum.TryParse(m.Message.Content, true, out UserSettingExtension.Gender genderPreference)) { gender = (int)genderPreference; } else { await _dm.SendMessageAsync($"Sorry, I didn't get that. You have to precisely enter the name of one of the levels."); } await UserSettingExtension.SetSettingAsync(_userId, UserSettingExtension.SettingID.Gender, gender, _context); return(true); }
private async Task PunishmentInternal(CommandContext ctx) { var context = new DiscordContext(); var user = await UserExtension.GetUser(ctx.Message.Author.Id); var settings = UserSettingExtension.GetAllSettings(Convert.ToInt64(ctx.User.Id), context).ToDictionary(setting => (UserSettingExtension.SettingID)setting.SettingId); var items = await WheelItemExtension.GetUserItemsAsync(user.UserId, context); var punishmentModules = PunishmentModule.GetAll(settings, items.ToList(), context); var sumChances = punishmentModules.Sum(cModule => cModule.Chance); var chanceValue = Helpers.RandomGenerator.RandomInt(0, sumChances); int cChance = 0; PunishmentModule module = null; DiscordEmbed embed = null; foreach (var cModule in punishmentModules) { cChance += cModule.Chance; if (chanceValue < cChance) { module = cModule; break; } } if (module == null) { DiscordEmbedBuilder builder = new DiscordEmbedBuilder() { Title = "No suitable punishment found :(", Description = "Please set up your preferences with ``//settings setup``. You should at least enable cbt and set up some bondage gear." }; await ctx.RespondAsync(embed : builder.Build()); return; } await module.Generate(); embed = module.Embed; if (module.WheelLockTime != null && user.LockTime <= DateTime.Now) { user.LockTime += module.WheelLockTime; var builder = new DiscordEmbedBuilder(embed); builder.Description += " You are not allowed to re-roll until then."; embed = builder.Build(); } if (module.WheelLockTime != null && user.DenialTime <= DateTime.Now) { user.DenialTime += module.DenialTime; } await ctx.RespondAsync(embed : embed); await context.SaveChangesAsync(); }
internal override async Task <bool> Run() { int?bondageLevel = null; var builder = new DiscordEmbedBuilder() { Title = "At which level do you want your bondage tasks to be? This is like a difficulty setting.", Url = "http://IJustWantThisToBeBlue.com" }; builder.AddField("If you don't like bondage, choose this.", UserSettingExtension.BondageLevel.None.ToString()); builder.AddField("If you're new to bondage, or just not interested that much. take this.", UserSettingExtension.BondageLevel.Light.ToString()); builder.AddField("This setting is for regular bondage play", UserSettingExtension.BondageLevel.Normal.ToString()); builder.AddField("You like to rob on the floor, arms bound to your legs? Choose this.", UserSettingExtension.BondageLevel.Hardcore.ToString()); await _dm.SendMessageAsync(embed : builder.Build()); var m = await _ctx.Client.GetInteractivityModule().WaitForMessageAsync( x => x.Channel.Id == _dm.Id && x.Author.Id == _ctx.Member.Id, TimeSpan.FromSeconds(240)); if (m == null) { await _dm.SendMessageAsync($"Or just don't respond at all. That's ok too :("); return(false); } if (Enum.TryParse(m.Message.Content, true, out UserSettingExtension.BondageLevel bondageLevelPreference)) { bondageLevel = (int)bondageLevelPreference; } else { await _dm.SendMessageAsync($"Sorry, I didn't get that. You have to precisely enter the name of one of the levels."); } await UserSettingExtension.SetSettingAsync(_userId, UserSettingExtension.SettingID.BondageLevel, bondageLevel.ToString(), _context); await _dm.TriggerTypingAsync(); await Task.Delay(500); await _dm.SendMessageAsync($"Do you want to set up your gear as well? If you don't do it, i won't know your items. (Y/N)"); var addGearResponse = await _ctx.Client.GetInteractivityModule().WaitForMessageAsync( x => x.Channel.Id == _dm.Id && x.Author.Id == _ctx.Member.Id, TimeSpan.FromSeconds(240)); if (m == null) { await _dm.SendMessageAsync($"Or just don't respond at all. That's ok too :("); return(false); } if (Helpers.RegexHelper.YesRegex.Match(addGearResponse.Message.Content).Success) { bool setupGear = await new BondageGearModule(_context, _dm, _ctx, _userId).Run(); if (!setupGear) { return(false); } } else { await _dm.TriggerTypingAsync(); await Task.Delay(500); await _dm.SendMessageAsync($"That's ok, you can do it later :)"); } return(true); }
public async Task SpinNewWheelAsync(CommandContext ctx) { DiscordContext context = new DiscordContext(); Users user = await UserExtension.GetUser(Convert.ToInt64(ctx.Message.Author.Id), context); SabrinaSettings sabrinaSettings = await context.SabrinaSettings.FindAsync(Convert.ToInt64(ctx.Guild.Id)); if (sabrinaSettings == null) { sabrinaSettings = new SabrinaSettings { GuildId = Convert.ToInt64(ctx.Guild.Id), WheelChannel = Convert.ToInt64(ctx.Channel.Id) }; await context.SabrinaSettings.AddAsync(sabrinaSettings); await context.SaveChangesAsync(); } if (sabrinaSettings.WheelChannel == null) { sabrinaSettings.WheelChannel = Convert.ToInt64(ctx.Channel.Id); await context.SaveChangesAsync(); } if (Convert.ToInt64(ctx.Channel.Id) != sabrinaSettings.WheelChannel.Value) { DiscordChannel channel = await ctx.Client.GetChannelAsync(Convert.ToUInt64(sabrinaSettings.WheelChannel)); await ctx.RespondAsync( $"You cannot issue this command from this Channel. Please use {channel.Mention}"); return; } var wheelDifficultySetting = await UserSettingExtension.GetSettingAsync(user.UserId, UserSettingExtension.SettingID.WheelDifficulty, context); var difficulty = WheelExtension.WheelDifficultyPreference.Default; if (wheelDifficultySetting != null) { difficulty = (WheelExtension.WheelDifficultyPreference) int.Parse(wheelDifficultySetting.Value); } WheelChances chances = await context.WheelChances.FindAsync((int)difficulty); if (user.LockTime != null && user.LockTime > DateTime.Now) { TimeSpan?timeUntilFree = user.LockTime - DateTime.Now; TimeSpan newTimeUntilFree = TimeSpan.FromTicks(timeUntilFree.Value.Ticks * Helpers.RandomGenerator.RandomInt(1, 4)); if (newTimeUntilFree > TimeSpan.FromDays(365)) { await ctx.RespondAsync("F**k off"); return; } var responseText = "Oho, it seems like I told you to stay away from spinning the wheel...\n" + $"That means you get some more extra time of no spinning {DiscordEmoji.FromName(ctx.Client, Config.Emojis.Blush)}"; if (int.TryParse(user.LockReason, out int reasonInt)) { var reason = (UserSettingExtension.LockReason)reasonInt; switch (reason) { case UserSettingExtension.LockReason.Cooldown: responseText = "Oho, it seems like I told you to stay away from spinning the wheel...\n" + $"That means you get some more extra time of no spinning {DiscordEmoji.FromName(ctx.Client, Config.Emojis.Blush)}"; user.LockTime += newTimeUntilFree; break; case UserSettingExtension.LockReason.Extension: responseText = "Hey! I already told you, that you'd get a longer lock on the Wheel! You still want more? Sure!"; user.LockTime += TimeSpan.FromMinutes(1); break; case UserSettingExtension.LockReason.Task: responseText = "Haha, there's no way you were able to finish your Task so quickly. Do your Task, " + "and then I'll give you another minute to think about your Actions."; user.LockTime += TimeSpan.FromMinutes(1); break; } } user.LockReason = ((int)UserSettingExtension.LockReason.Extension).ToString(); await ctx.RespondAsync(responseText); await context.SaveChangesAsync().ConfigureAwait(false); return; } float cumScore = 1; var lastOrgasm = await WheelOutcomeExtension.GetLastOutcome(WheelExtension.Outcome.O****m, user.UserId, null, context); var lastRuin = await WheelOutcomeExtension.GetLastOutcome(WheelExtension.Outcome.Ruin, user.UserId, null, context); if (lastOrgasm != null || lastRuin != null) { DbWheelOutcome lastCum = null; if (lastOrgasm != null && lastRuin != null) { lastCum = lastOrgasm?.Time > lastRuin?.Time ? lastOrgasm : lastRuin; } else { lastCum = lastOrgasm != null ? lastOrgasm : lastRuin; } var allSinceLastCum = (await WheelOutcomeExtension.GetLastOutcomesUntil(lastCum, context)).ToList(); var denialSinceLastCum = allSinceLastCum.Where(cOutcome => cOutcome.Type == (int)WheelExtension.Outcome.Denial); var taskSinceLastCum = allSinceLastCum.Where(cOutcome => cOutcome.Type == (int)WheelExtension.Outcome.Task); var edgeSinceLastCum = allSinceLastCum.Where(cOutcome => cOutcome.Type == (int)WheelExtension.Outcome.Edge); cumScore = (denialSinceLastCum.Count() * 6 + taskSinceLastCum.Count() * 2 + edgeSinceLastCum.Count()) / 4f; cumScore = cumScore == 0 ? 1 : cumScore; } var outcomeChanceValue = Helpers.RandomGenerator.RandomInt( 0, chances.Denial + chances.Task + chances.Edge + Convert.ToInt32(cumScore * chances.Ruin) + Convert.ToInt32(cumScore * chances.O****m)); WheelExtension.Outcome outcome = WheelExtension.Outcome.Edge; if (outcomeChanceValue < chances.Denial) { outcome = WheelExtension.Outcome.Denial; } else if (outcomeChanceValue < chances.Denial + chances.Edge) { outcome = WheelExtension.Outcome.Edge; } else if (outcomeChanceValue < chances.Denial + chances.Edge + chances.Task) { outcome = WheelExtension.Outcome.Task; } else if (outcomeChanceValue < chances.Denial + chances.Edge + chances.Task + Convert.ToInt32(cumScore * chances.Ruin)) { outcome = WheelExtension.Outcome.Ruin; } else { outcome = WheelExtension.Outcome.O****m; } if (user.DenialTime != null && user.DenialTime > DateTime.Now) { TimeSpan?timeUntilFree = user.DenialTime - DateTime.Now; if (outcome.HasFlag(WheelExtension.Outcome.O****m) || outcome.HasFlag(WheelExtension.Outcome.Ruin)) { await ctx.RespondAsync( "Haha, I would\'ve let you cum this time, but since you\'re still denied, " + $"that won't happen {DiscordEmoji.FromName(ctx.Client, Config.Emojis.Blush)}.\n" + "As a punishment, you\'re gonna do your Task anyways though:"); } else { await ctx.RespondAsync( "Well, i told you, that you\'d be denied now.\n" + "You still want to do something? Hmm... let's see..."); } await Task.Delay(1500); outcome = WheelExtension.Outcome.Denial | WheelExtension.Outcome.Edge; } WheelOutcome wheelOutcome = null; while (wheelOutcome == null) { try { wheelOutcomes = ReflectiveEnumerator.GetEnumerableOfType <WheelOutcome>(outcome, UserSettingExtension.GetAllSettings(user.UserId, context).ToDictionary(setting => (UserSettingExtension.SettingID)setting.SettingId), await WheelItemExtension.GetUserItemsAsync(user.UserId, context), _dependencies) .ToList(); } catch (Exception e) { Console.WriteLine(e); } foreach (var wheeloutcome in wheelOutcomes) { await wheeloutcome.BuildAsync(); } wheelOutcomes = wheelOutcomes.Where(e => !e.Outcome.HasFlag(WheelExtension.Outcome.NotSet)).ToList(); if (wheelOutcomes.Count < 1) { continue; } // Choose an outcome by summing up the chance values of all possible outcomes and // then generating a random number inside those. var combinedChance = 0; foreach (WheelOutcome currentOutcome in wheelOutcomes) { combinedChance += currentOutcome.Chance; } var chance = 0; var minChance = Helpers.RandomGenerator.RandomInt(0, combinedChance); foreach (WheelOutcome currentOutcome in wheelOutcomes) { chance += currentOutcome.Chance; if (minChance < chance) { wheelOutcome = currentOutcome; break; } } } if (wheelOutcome.Embed != null) { await ctx.RespondAsync(embed : wheelOutcome.Embed); } else { await ctx.RespondAsync(wheelOutcome.Text); } DbWheelOutcome dbOutcome = new DbWheelOutcome() { IsUserReport = 0, Time = DateTime.Now, Type = (int)outcome, UserId = user.UserId }; context.WheelOutcome.Add(dbOutcome); if (wheelOutcome.GetType() == typeof(Entities.WheelOutcomes.Content)) { ((Entities.WheelOutcomes.Content)wheelOutcome).CleanUp(context); } if (user.DenialTime == null) { user.DenialTime = DateTime.Now; } if (user.LockTime == null) { user.LockTime = DateTime.Now; } if (user.DenialTime < DateTime.Now) { user.DenialTime = DateTime.Now; } if (user.LockTime < DateTime.Now) { user.LockTime = DateTime.Now; } if (wheelOutcome.WheelLockedTime != null && wheelOutcome.WheelLockedTime > TimeSpan.Zero) { switch (outcome) { case WheelExtension.Outcome.Edge: case WheelExtension.Outcome.Task: user.LockReason = ((int)UserSettingExtension.LockReason.Task).ToString(); break; default: user.LockReason = ((int)UserSettingExtension.LockReason.Cooldown).ToString(); break; } } user.DenialTime += wheelOutcome.DenialTime; user.LockTime += wheelOutcome.WheelLockedTime; await Task.Run(async() => await context.SaveChangesAsync()); if (outcome == WheelExtension.Outcome.O****m || outcome == WheelExtension.Outcome.Ruin) { var m = await ctx.Client.GetInteractivityModule().WaitForMessageAsync( x => x.Channel.Id == ctx.Channel.Id && x.Author.Id == ctx.Member.Id && x.Content.Contains(@"//ruin") || x.Content.Contains(@"//cum") || x.Content.Contains(@"//came"), TimeSpan.FromSeconds(120)); if (m == null) { string text = outcome == WheelExtension.Outcome.Ruin ? "ruin it like a good boy" : "cum in the end"; var builder = new DiscordEmbedBuilder() { Title = $"Did you {text}?", Description = $"{ctx.Message.Author.Mention} You didn't tell me, if you properly did {text} :(" + Environment.NewLine + "Please use either ``//ruined`` or ``//came`` depending on what you did" }; await ctx.RespondAsync(embed : builder.Build()); } } }
public async Task Came(CommandContext ctx) { var context = new DiscordContext(); bool punish = true; var userId = Convert.ToInt64(ctx.Message.Author.Id); var user = await UserExtension.GetUser(userId); var difficulty = (await UserSettingExtension.GetSettingAsync(userId, UserSettingExtension.SettingID.WheelDifficulty, context)).GetValue <WheelExtension.WheelDifficultyPreference>(); var lastOutcome = await WheelOutcomeExtension.GetLastOutcome(userId, false, context); var lastallowedOrgasm = await WheelOutcomeExtension.GetLastOutcome(WheelExtension.Outcome.O****m, userId, true, context); var lastUserOrgasm = await WheelOutcomeExtension.GetLastOutcome(WheelExtension.Outcome.O****m, userId, true, context); if (lastOutcome == null) { await ctx.RespondAsync("Please start your *training* with ``//orgasmwheel`` first."); return; } DiscordEmbedBuilder builder = new DiscordEmbedBuilder(); var denialTime = TimeSpan.FromTicks(1); if (lastallowedOrgasm != null && lastUserOrgasm != null) { if (lastUserOrgasm.Time > lastallowedOrgasm.Time) { denialTime = TimeSpan.FromDays(Math.Round((int)difficulty + 1 * 1.5, 0, MidpointRounding.AwayFromZero)); builder.Description = "What!? You already came after i allowed you to!!" + Environment.NewLine + "Can you not even follow simple instructions?" + Environment.NewLine + $"I'll give you {denialTime.Days} day{(denialTime.Days > 1 ? "s" : "")} of denial for that!"; } } switch ((WheelExtension.Outcome)lastOutcome.Type) { case WheelExtension.Outcome.NotSet: break; case WheelExtension.Outcome.Denial: denialTime = TimeSpan.FromDays(Math.Round((int)difficulty + 1 * 1.5, 0, MidpointRounding.AwayFromZero)); builder.Description = "What!? I told you, that you'd be denied!" + Environment.NewLine + "Can you not even follow simple instructions?" + Environment.NewLine + $"I'll give you {denialTime.Days} day{(denialTime.Days > 1 ? "s" : "")} of denial for that!"; break; case WheelExtension.Outcome.Ruin: denialTime = TimeSpan.FromDays((int)difficulty + 1); builder.Description = "Oh, was my poor little boy not strong enough, to follow through with the ruin?" + Environment.NewLine + "Guess you're gonna learn the hard way, to do what i say." + Environment.NewLine + $"That means no cumming for {denialTime.Days} day{(denialTime.Days > 1 ? "s" : "")}. And no ruins of course!"; break; case WheelExtension.Outcome.O****m: punish = Helpers.RandomGenerator.RandomInt(0, 50) < (int)difficulty * 2; if (punish) { builder.Description = "That must've felt sooo good." + Environment.NewLine + "But your luck ends here." + Environment.NewLine + $"I don't really feel, like you should've come after all."; } else { builder.Description = "Yes, i hope you enjoyed that." + Environment.NewLine + "I do reward my subs every now and then." + Environment.NewLine + $"But don't get used to it."; } break; case WheelExtension.Outcome.Edge: denialTime = TimeSpan.FromDays(Math.Round((int)difficulty + 1 * 1.5, 0, MidpointRounding.AwayFromZero)); builder.Description = "So... you tipped over and didn't even ruin it? What a shame..." + Environment.NewLine + "You're naturally going to have to make up for that." + Environment.NewLine + $"I guess {denialTime.Days} day{(denialTime.Days > 1 ? "s" : "")} of denial should do for now."; break; case WheelExtension.Outcome.Task: denialTime = TimeSpan.FromDays(Math.Round((int)difficulty + 1 * 1.5, 0, MidpointRounding.AwayFromZero)); builder.Description = "So... you tipped over and didn't even ruin it? What a shame..." + Environment.NewLine + "You're naturally going to have to make up for that." + Environment.NewLine + $"I guess {denialTime.Days} day{(denialTime.Days > 1 ? "s" : "")} of denial should do for now."; break; } var prevDenialTime = user.DenialTime > DateTime.Now ? user.DenialTime : DateTime.Now; user.DenialTime = prevDenialTime + denialTime; var thisOutcome = new DbWheelOutcome() { IsUserReport = 1, Time = DateTime.Now, Type = (int)WheelExtension.Outcome.O****m, UserId = userId }; await context.WheelOutcome.AddAsync(thisOutcome); await context.SaveChangesAsync(); if (punish) { builder.Description += Environment.NewLine + " And here's your punishment <3"; } await ctx.RespondAsync(embed : builder.Build()); if (punish) { await PunishmentInternal(ctx); } }
public async Task Ruin(CommandContext ctx) { var context = new DiscordContext(); bool punish = true; var userId = Convert.ToInt64(ctx.Message.Author.Id); var user = await UserExtension.GetUser(userId); var difficulty = (await UserSettingExtension.GetSettingAsync(userId, UserSettingExtension.SettingID.WheelDifficulty, context)).GetValue <WheelExtension.WheelDifficultyPreference>(); var lastOutcome = await WheelOutcomeExtension.GetLastOutcome(userId, false, context); if (lastOutcome == null) { await ctx.RespondAsync("Please start your *session* with ``//orgasmwheel`` first."); return; } DiscordEmbedBuilder builder = new DiscordEmbedBuilder(); var denialTime = TimeSpan.FromTicks(1); switch ((WheelExtension.Outcome)lastOutcome.Type) { case WheelExtension.Outcome.NotSet: break; case WheelExtension.Outcome.Denial: denialTime = TimeSpan.FromDays((int)difficulty + 1); builder.Description = "What!? I told you, that you'd be denied!" + Environment.NewLine + "I mean... at least you tried. Still, you didn't do what i said, and this must be punished!" + Environment.NewLine + $"I'll give you {denialTime.Days} day{(denialTime.Days > 1 ? "s" : "")} of denial for that!"; break; case WheelExtension.Outcome.Ruin: builder.Description = "Oh, this makes me so happy." + Environment.NewLine + "I love seeing it just dribble out." + Environment.NewLine + $"You're a good little sub."; punish = false; break; case WheelExtension.Outcome.O****m: punish = Helpers.RandomGenerator.RandomInt(0, 50) < (int)difficulty * 2; if (punish) { builder.Description = "I can see, that my conditioning worked!" + Environment.NewLine + "Even when you're allowed to cum, you still ruin it." + Environment.NewLine + $"But... this wasn't a suggestion. It was an order."; } else { builder.Description = "I can see, that my conditioning worked!" + Environment.NewLine + "Even when you're allowed to cum, you still ruin it." + Environment.NewLine + $"Good boy."; } break; case WheelExtension.Outcome.Edge: denialTime = TimeSpan.FromDays(Math.Round((int)difficulty + 1 * 1.5, 0, MidpointRounding.AwayFromZero)); builder.Description = "So... you couldn't control it and just tipped over?" + Environment.NewLine + "You're naturally going to have to make up for that." + Environment.NewLine + $"I guess {denialTime.Days} day{(denialTime.Days > 1 ? "s" : "")} of denial should do it for now."; break; case WheelExtension.Outcome.Task: denialTime = TimeSpan.FromDays(Math.Round((int)difficulty + 1 * 1.5, 0, MidpointRounding.AwayFromZero)); builder.Description = "I'm not sure, how you can be so useless." + Environment.NewLine + "You're naturally going to have to make up for that." + Environment.NewLine + $"At least you tried... so I guess {denialTime.Days} day{(denialTime.Days > 1 ? "s" : "")} of denial should do it for now."; break; } var prevDenialTime = user.DenialTime > DateTime.Now ? user.DenialTime : DateTime.Now; user.DenialTime = prevDenialTime + denialTime; var thisOutcome = new DbWheelOutcome() { IsUserReport = 1, Time = DateTime.Now, Type = (int)WheelExtension.Outcome.O****m, UserId = userId }; await context.WheelOutcome.AddAsync(thisOutcome); await context.SaveChangesAsync(); if (punish) { builder.Description += Environment.NewLine + "And here's your punishment <3"; } await ctx.RespondAsync(embed : builder.Build()); if (punish) { await PunishmentInternal(ctx); } }
public async Task DenialTimeAsync(CommandContext ctx) { DiscordContext context = new DiscordContext(); var userId = Convert.ToInt64(ctx.Message.Author.Id); Users user = await UserExtension.GetUser(ctx.Message.Author.Id); var difficulty = (await UserSettingExtension.GetSettingAsync(userId, UserSettingExtension.SettingID.WheelDifficulty, context)).GetValue <WheelExtension.WheelDifficultyPreference>(); var denialString = "I guess I could give you another chance to cum..."; var wheelLockedString = "So how about you test your luck?"; if (user.DenialTime != null && user.DenialTime > DateTime.Now) { TimeSpan timeLeft = user.DenialTime.Value - DateTime.Now; var ballChance = 100 - (20 / (int)difficulty) - (timeLeft.TotalDays * 5); var generatedChance = Helpers.RandomGenerator.RandomInt(0, 101); if (generatedChance > ballChance) { denialString = "*shakes a magic ball*" + Environment.NewLine + $"*the ball reads {Math.Round(timeLeft.TotalHours, 0)}*" + Environment.NewLine + $"...I say no."; } else if (timeLeft > TimeSpan.FromHours(24)) { denialString = "Haha, no, you won't cum today."; } else if (timeLeft > TimeSpan.FromHours(12)) { denialString = "Ask me again after you've slept a bit... Or gone to work or whatever, I don't care."; } else if (timeLeft > TimeSpan.FromHours(6)) { denialString = "Don't be ridiculous. You won't get a chance to cum now."; } else if (timeLeft > TimeSpan.FromHours(2)) { denialString = "Maybe later. I don't feel like you should cum right now."; } else if (timeLeft > TimeSpan.FromMinutes(20)) { denialString = "You won't cum right now. How about you try again in... say... 30 minutes? An hour?"; } else { denialString = "No, you won't get a chance now. I want to see you squirm for just a few more minutes~"; } if (user.LockTime != null && user.LockTime < DateTime.Now) { wheelLockedString = $"But i would allow you to spin right now, if you want {Environment.NewLine}" + $"*grins* {Environment.NewLine}" + "There\'s no way I\'ll let you cum though. You didn\'t deserve it yet."; } else { wheelLockedString = ""; } } else { if (user.LockTime != null && user.LockTime > DateTime.Now) { TimeSpan lockTimeLeft = user.LockTime.Value - DateTime.Now; if (lockTimeLeft > TimeSpan.FromHours(24)) { wheelLockedString = "But not today."; } else if (lockTimeLeft > TimeSpan.FromHours(12)) { wheelLockedString = "But i don't want to, right now. Maybe later today."; } else if (lockTimeLeft > TimeSpan.FromHours(6)) { wheelLockedString = "But I'm not in the mood right now. Ask me again in a few hours."; } else if (lockTimeLeft > TimeSpan.FromHours(2)) { wheelLockedString = "But i'm kinda in the middle of something right now. We can play later."; } else { wheelLockedString = "I won't let you spin for the moment though :)"; } } } await ctx.RespondAsync($"Hey {(await ctx.Client.GetUserAsync(Convert.ToUInt64(user.UserId))).Mention},\n" + $"{denialString}\n" + $"{wheelLockedString}"); }
public async Task OverviewAsync(CommandContext ctx) { var context = new DiscordContext(); DiscordEmbedBuilder builder = new DiscordEmbedBuilder() { Title = "These are all of your settings" }; var settings = UserSettingExtension.GetAllSettings(ctx.Message.Author.Id, context).ToDictionary(setting => (UserSettingExtension.SettingID)setting.SettingId); var items = await WheelItemExtension.GetUserItemsAsync(ctx.Message.Author.Id, context); AnalLevel analLevel = AnalLevel.None; if (settings.ContainsKey(SettingID.AnalLevel)) { analLevel = settings[SettingID.AnalLevel].GetValue <AnalLevel>(); } WheelExtension.WheelDifficultyPreference wheelDifficulty = WheelExtension.WheelDifficultyPreference.Default; if (settings.ContainsKey(SettingID.WheelDifficulty)) { wheelDifficulty = settings[SettingID.WheelDifficulty].GetValue <WheelExtension.WheelDifficultyPreference>(); } WheelExtension.WheelTaskPreferenceSetting wheelTaskPreference = WheelExtension.WheelTaskPreferenceSetting.Default; if (settings.ContainsKey(SettingID.WheelTaskPreference)) { wheelTaskPreference = settings[SettingID.WheelTaskPreference].GetValue <WheelExtension.WheelTaskPreferenceSetting>(); } BondageLevel bondageLevel = BondageLevel.None; if (settings.ContainsKey(SettingID.BondageLevel)) { bondageLevel = settings[SettingID.BondageLevel].GetValue <BondageLevel>(); } CBTLevel cbtLevel = CBTLevel.None; if (settings.ContainsKey(SettingID.CBTLevel)) { cbtLevel = settings[SettingID.CBTLevel].GetValue <CBTLevel>(); } DungeonDifficulty dungeonDifficulty = DungeonDifficulty.Normal; if (settings.ContainsKey(SettingID.DungeonDifficulty)) { dungeonDifficulty = settings[SettingID.DungeonDifficulty].GetValue <DungeonDifficulty>(); } //PeeLevel peeLevel = PeeLevel.None; //if (settings.ContainsKey(SettingID.PeeLevel)) //{ // peeLevel = settings[SettingID.PeeLevel].GetValue<PeeLevel>(); //} SissyLevel sissyLevel = SissyLevel.None; if (settings.ContainsKey(SettingID.SissyLevel)) { sissyLevel = settings[SettingID.SissyLevel].GetValue <SissyLevel>(); } //DegrationLevel degrationLevel = DegrationLevel.None; //if (settings.ContainsKey(SettingID.DegrationLevel)) //{ // degrationLevel = settings[SettingID.DegrationLevel].GetValue<DegrationLevel>(); //} PublicLevel publicLevel = PublicLevel.None; if (settings.ContainsKey(SettingID.PublicLevel)) { publicLevel = settings[SettingID.PublicLevel].GetValue <PublicLevel>(); } Gender gender = Gender.None; if (settings.ContainsKey(SettingID.Gender)) { gender = settings[SettingID.Gender].GetValue <Gender>(); } foreach (SettingID possibleSetting in Enum.GetValues(typeof(SettingID))) { Enum setting = null; switch (possibleSetting) { case SettingID.AnalLevel: setting = analLevel; break; case SettingID.BanType: break; case SettingID.WheelDifficulty: setting = wheelDifficulty; break; case SettingID.WheelTaskPreference: setting = wheelTaskPreference; break; case SettingID.BondageLevel: setting = bondageLevel; break; case SettingID.Toys: break; case SettingID.CBTLevel: setting = cbtLevel; break; case SettingID.DungeonDifficulty: break; case SettingID.PeeLevel: break; case SettingID.SissyLevel: setting = sissyLevel; break; case SettingID.DegrationLevel: break; case SettingID.PublicLevel: setting = publicLevel; break; case SettingID.BanEnd: break; case SettingID.Gender: setting = gender; break; } if (setting == null) { continue; } var name = possibleSetting.ToFormattedText(); var value = $"{setting.ToFormattedText()} ({Convert.ToInt32(setting)})"; builder.AddField(name, value, true); } await ctx.RespondAsync(embed : builder.Build()); if (items.Any()) { builder = new DiscordEmbedBuilder() { Title = "Your Items" }; foreach (var item in items.OrderBy(it => it.ItemId)) { var cItem = (WheelItemExtension.Item)item.ItemId; builder.AddField(cItem.ToFormattedText(), item.ItemId.ToString()); } await ctx.RespondAsync(embed : builder.Build()); } }
public async Task SetupAsync(CommandContext ctx) { await ctx.RespondAsync("You got Mail! *AOL chime plays*"); var context = new DiscordContext(); var dm = await ctx.Member.CreateDmChannelAsync(); var userId = Convert.ToInt64(ctx.User.Id); string userName = ctx.Message.Author.Username; string readableUserName = RemoveSpecialCharacters(userName); if (readableUserName.Length > 4) { userName = readableUserName; } await dm.TriggerTypingAsync(); await Task.Delay(1000); await dm.SendMessageAsync($"Hey there {userName}."); await Task.Delay(1000); bool isFirstChange = true; var settings = UserSettingExtension.GetAllSettings(userId, context); if (settings == null || settings.Count() == 0) { // *** First time setup *** if (!await Introduction(dm, ctx)) { return; } await dm.TriggerTypingAsync(); await Task.Delay(1000); await dm.SendMessageAsync($"Splendid! Now that you know how this works, let's start with the Settings!"); if (!await new WheelDifficultyModule(context, dm, ctx, userId).Execute()) { return; } if (!await new WheelTaskPreferenceModule(context, dm, ctx, userId).Execute()) { return; } isFirstChange = false; } // *** User has come back to change settings *** bool exit = false; while (!exit) { await dm.SendMessageAsync($"What{(isFirstChange ? "" : " else")} would you like to change?"); isFirstChange = false; var m = await ctx.Client.GetInteractivityModule().WaitForMessageAsync( x => x.Channel.Id == dm.Id && x.Author.Id == ctx.Member.Id, TimeSpan.FromSeconds(240)); if (m == null) { // *** User didn't enter anything *** return; } var text = m.Message.Content; var modules = ReflectiveEnumerator.GetEnumerableOfType <SettingsModule>(context, dm, ctx, userId).OrderByDescending(module => module.GetScore(text)).ToList(); int suggestion = 0; bool isMatch = false; while (suggestion < 2 && !isMatch) { await dm.TriggerTypingAsync(); await Task.Delay(1000); await dm.SendMessageAsync($"Do you want to change your {modules[suggestion].FriendlyName} settings? (Y/N)"); var suggestionReply = await ctx.Client.GetInteractivityModule().WaitForMessageAsync( x => x.Channel.Id == dm.Id && x.Author.Id == ctx.Member.Id, TimeSpan.FromSeconds(240)); if (suggestionReply == null) { return; } if (Regex.Match(suggestionReply.Message.Content, YesRegex).Success) { isMatch = true; exit = !await modules[suggestion].Execute(); } else { suggestion++; } } if (suggestion >= 2) { DiscordEmbedBuilder builder = new DiscordEmbedBuilder() { Title = "These are your options" }; foreach (var module in modules) { builder.AddField(module.FriendlyName, "--------", false); } await dm.TriggerTypingAsync(); await Task.Delay(2000); await dm.SendMessageAsync(embed : builder.Build()); } else { await dm.TriggerTypingAsync(); await Task.Delay(1000); await dm.SendMessageAsync("Would you like to change something else? (Y/N)"); var moreChangesResponse = await ctx.Client.GetInteractivityModule().WaitForMessageAsync( x => x.Channel.Id == dm.Id && x.Author.Id == ctx.Member.Id, TimeSpan.FromSeconds(240)); if (moreChangesResponse == null) { return; } if (Regex.Match(moreChangesResponse.Message.Content, YesRegex).Success) { exit = false; } else { exit = true; } } } await dm.TriggerTypingAsync(); await Task.Delay(1000); await dm.SendMessageAsync($"Alrighty! I'll try to remember that"); await Task.Delay(2000); await dm.TriggerTypingAsync(); await Task.Delay(500); await dm.SendMessageAsync($"..... I'll better write it down..."); await dm.TriggerTypingAsync(); try { await context.SaveChangesAsync(); } catch (Exception ex) { await dm.SendMessageAsync($"**Uhh... something seems to have gone badly wrong...{Environment.NewLine}" + $"If you see Salem around here somewhere, tell him the following:**"); await dm.TriggerTypingAsync(); await Task.Delay(5000); string msgToSend = $"```{ex.Message}```"; while (msgToSend.Length > 1999) { await dm.SendMessageAsync(msgToSend.Substring(0, 1999)); await dm.TriggerTypingAsync(); await Task.Delay(2000); msgToSend = msgToSend.Substring(1999); } await dm.SendMessageAsync(msgToSend); return; } await dm.SendMessageAsync($"Done!"); await dm.TriggerTypingAsync(); await Task.Delay(1000); await dm.SendMessageAsync($"Nice. You can now start using the Wheel with your brand new set of settings \\*-\\*{Environment.NewLine}" + $"These might get more over time. I will remind you to revisit them, when i feel fit."); }
internal override async Task <bool> Run() { // See if User has bondage level set beforehand if (await UserSettingExtension.GetSettingAsync(_userId, UserSettingExtension.SettingID.BondageLevel, _context) == null) { await _dm.TriggerTypingAsync(); await Task.Delay(1000); await _dm.SendMessageAsync($"First i've got to know something else."); var setBondageLevel = await new BondageLevelModule(_context, _dm, _ctx, _userId).Run(); if (setBondageLevel == false) { return(false); } var bondageLevel = await UserSettingExtension.GetSettingAsync(_userId, UserSettingExtension.SettingID.BondageLevel, _context); if (bondageLevel.GetValue <UserSettingExtension.BondageLevel>() == UserSettingExtension.BondageLevel.None) { await _dm.TriggerTypingAsync(); await Task.Delay(1000); await _dm.SendMessageAsync($"So you don't wanna do any Bondage? ...ok"); return(true); } } bool cancel = false; while (!cancel) { var existingBondageGear = (await WheelItemExtension.GetUserItemsAsync(_userId, _context)).Where(item => item.ItemId > (int)WheelItemExtension.Item.Bondage && item.ItemId < (int)WheelItemExtension.Item.Bondage + 1000).ToList(); await _dm.SendMessageAsync($"Do you want to [add], or do you want to [remove] some of your bondage items? Or are you [done]?"); var m = await _ctx.Client.GetInteractivityModule().WaitForMessageAsync( x => x.Channel.Id == _dm.Id && x.Author.Id == _ctx.Member.Id, TimeSpan.FromSeconds(240)); if (m == null) { await _dm.SendMessageAsync($"Or just don't respond at all. That's ok too :("); cancel = true; return(false); } if (Helpers.RegexHelper.ExitRegex.Match(m.Message.Content).Success) { cancel = true; return(true); } if (Helpers.RegexHelper.AddRegex.Match(m.Message.Content).Success) { var possibleItems = new List <WheelUserItem>(); foreach (var item in (WheelItemExtension.Item[])Enum.GetValues(typeof(WheelItemExtension.Item))) { if ((int)item <= (int)WheelItemExtension.Item.Bondage || (int)item >= (int)WheelItemExtension.Item.Bondage + 1000 || existingBondageGear.Any(gear => gear.ItemId == (int)item)) { continue; } possibleItems.Add(new WheelUserItem() { ItemId = (int)item, UserId = _userId }); } var addItems = await new Items.ItemDialog().OpenAsync(possibleItems, Items.ItemDialog.DialogType.Add, _dm, _ctx); if (addItems != null && addItems.Any()) { _context.WheelUserItem.AddRange(addItems); await _context.SaveChangesAsync(); } } if (Helpers.RegexHelper.RemoveRegex.Match(m.Message.Content).Success) { var removeItems = await new Items.ItemDialog().OpenAsync(existingBondageGear, Items.ItemDialog.DialogType.Remove, _dm, _ctx); if (removeItems != null && removeItems.Any()) { _context.RemoveRange(removeItems); await _context.SaveChangesAsync(); } } } return(true); }