コード例 #1
0
        private async Task <UserSetting.Outcome> GetOutcome(CommandContext ctx, DiscordContext context)
        {
            Users user = await UserExtension.GetUser(Convert.ToInt64(ctx.Message.Author.Id), context);

            var wheelMode = await WheelSettingExtension.GetMode(ctx.Guild.Id, context);

            var wheelDifficultySetting = await UserSetting.GetSettingAsync(user.UserId, UserSetting.SettingID.WheelDifficulty, context);

            var difficulty = UserSettingExtensions.GetValue <UserSetting.WheelDifficultyPreference>(wheelDifficultySetting);

            WheelChances chances = await context.WheelChances.FindAsync((int)difficulty);

            var cumScore = await CalculateCumScore(context, user);

            var cumChance = Convert.ToInt32(cumScore * chances.O****m);

            if (wheelMode.HasFlag(WheelSettingExtension.WheelMode.NoCum))
            {
                cumChance = 0;
            }

            var ruinChance = Convert.ToInt32(cumScore * chances.Ruin);

            if (wheelMode.HasFlag(WheelSettingExtension.WheelMode.NoRuin))
            {
                ruinChance = 0;
            }

            var denialChance = chances.Denial;

            if (wheelMode.HasFlag(WheelSettingExtension.WheelMode.NoDenial))
            {
                denialChance = 0;
            }

            var outcomeChanceValue = Helpers.RandomGenerator.RandomInt(
                0,
                denialChance + chances.Task + chances.Edge + ruinChance + cumChance);

            UserSetting.Outcome outcome;
            if (outcomeChanceValue < denialChance)
            {
                outcome = UserSetting.Outcome.Denial;
            }
            else if (outcomeChanceValue < denialChance + chances.Edge)
            {
                outcome = UserSetting.Outcome.Edge;
            }
            else if (outcomeChanceValue < denialChance + chances.Edge + chances.Task)
            {
                outcome = UserSetting.Outcome.Task;
            }
            else if (outcomeChanceValue < denialChance + chances.Edge + chances.Task + cumChance)
            {
                outcome = UserSetting.Outcome.Ruin;
            }
            else
            {
                outcome = UserSetting.Outcome.O****m;
            }

            return(outcome);
        }
コード例 #2
0
        public async Task Came(CommandContext ctx)
        {
            using var context = new DiscordContext();
            bool punish = true;
            var  userId = Convert.ToInt64(ctx.Message.Author.Id);
            var  user   = await UserExtension.GetUser(userId, context);

            var difficulty  = (await UserSetting.GetSettingAsync(userId, UserSetting.SettingID.WheelDifficulty, context)).GetValue <UserSetting.WheelDifficultyPreference>();
            var lastOutcome = await WheelOutcomeExtension.GetLastOutcome(userId, false, context);

            var lastallowedOrgasm = await WheelOutcomeExtension.GetLastOutcome(UserSetting.Outcome.O****m, userId, true, context);

            var lastUserOrgasm = await WheelOutcomeExtension.GetLastOutcome(UserSetting.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 ((UserSetting.Outcome)lastOutcome.Type)
            {
            case UserSetting.Outcome.NotSet:
                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 UserSetting.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 UserSetting.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 UserSetting.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 UserSetting.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 UserSetting.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)UserSetting.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);
            }
        }
コード例 #3
0
        public async Task DenialTimeAsync(CommandContext ctx)
        {
            using DiscordContext context = new DiscordContext();

            var   userId = Convert.ToInt64(ctx.Message.Author.Id);
            Users user   = await UserExtension.GetUser(ctx.Message.Author.Id);

            var difficulty        = (await UserSetting.GetSettingAsync(userId, UserSetting.SettingID.WheelDifficulty, context)).GetValue <UserSetting.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;

                difficulty = difficulty == 0 ? UserSetting.WheelDifficultyPreference.Default : difficulty;

                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}");
        }
コード例 #4
0
        public async Task Ruin(CommandContext ctx)
        {
            using var context = new DiscordContext();
            bool punish = true;
            var  userId = Convert.ToInt64(ctx.Message.Author.Id);
            var  user   = await UserExtension.GetUser(userId, context);

            var difficulty  = (await UserSetting.GetSettingAsync(userId, UserSetting.SettingID.WheelDifficulty, context)).GetValue <UserSetting.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 ((UserSetting.Outcome)lastOutcome.Type)
            {
            case UserSetting.Outcome.NotSet:

                break;

            case UserSetting.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 UserSetting.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 UserSetting.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 UserSetting.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 UserSetting.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)UserSetting.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);
            }
        }
コード例 #5
0
ファイル: BondageGearModule.cs プロジェクト: Damitrix/Sabrina
        internal override async Task <bool> Run()
        {
            // See if User has bondage level set beforehand
            if (await UserSetting.GetSettingAsync(_userId, UserSetting.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 UserSetting.GetSettingAsync(_userId, UserSetting.SettingID.BondageLevel, _context);

                if (bondageLevel.GetValue <UserSetting.BondageLevel>() == UserSetting.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.GetInteractivity().WaitForMessageAsync(
                    x => x.Channel.Id == _dm.Id &&
                    x.Author.Id == _ctx.Member.Id,
                    TimeSpan.FromSeconds(240));

                if (m.TimedOut)
                {
                    await _dm.SendMessageAsync($"Or just don't respond at all. That's ok too :(");

                    cancel = true;
                    return(false);
                }

                if (Helpers.RegexHelper.ExitRegex.Match(m.Result.Content).Success)
                {
                    cancel = true;
                    return(true);
                }

                if (Helpers.RegexHelper.AddRegex.Match(m.Result.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.Result.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);
        }