From cfc00b5df6864636cc9f806f3328ed0b145a62ba Mon Sep 17 00:00:00 2001 From: Kwoth Date: Tue, 21 Feb 2017 03:04:22 +0100 Subject: [PATCH] Fixed $roll X response, $waifuinfo now shows up to 40 random wives, not all --- .../Modules/Gambling/Commands/DiceRollCommand.cs | 4 ++-- .../Modules/Gambling/Commands/WaifuClaimCommands.cs | 4 +++- src/NadekoBot/Resources/ResponseStrings.Designer.cs | 11 ++++++++++- src/NadekoBot/Resources/ResponseStrings.resx | 5 ++++- 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/NadekoBot/Modules/Gambling/Commands/DiceRollCommand.cs b/src/NadekoBot/Modules/Gambling/Commands/DiceRollCommand.cs index 721b5b4e..8a0323b9 100644 --- a/src/NadekoBot/Modules/Gambling/Commands/DiceRollCommand.cs +++ b/src/NadekoBot/Modules/Gambling/Commands/DiceRollCommand.cs @@ -124,9 +124,9 @@ namespace NadekoBot.Modules.Gambling bitmap.Save(ms); ms.Position = 0; await Context.Channel.SendFileAsync(ms, "dice.png", - Context.User.Mention + + Context.User.Mention + " " + GetText("dice_rolled_num", Format.Bold(values.Count.ToString())) + - " " + GetText("Total: {1} Average: {2}", + " " + GetText("total_average", Format.Bold(values.Sum().ToString()), Format.Bold((values.Sum() / (1.0f * values.Count)).ToString("N2")))).ConfigureAwait(false); } diff --git a/src/NadekoBot/Modules/Gambling/Commands/WaifuClaimCommands.cs b/src/NadekoBot/Modules/Gambling/Commands/WaifuClaimCommands.cs index 212fd1d2..6847dcfc 100644 --- a/src/NadekoBot/Modules/Gambling/Commands/WaifuClaimCommands.cs +++ b/src/NadekoBot/Modules/Gambling/Commands/WaifuClaimCommands.cs @@ -423,6 +423,8 @@ namespace NadekoBot.Modules.Gambling var claimInfo = GetClaimTitle(target.Id); var affInfo = GetAffinityTitle(target.Id); + var rng = new NadekoRandom(); + var nobody = GetText("nobody"); var embed = new EmbedBuilder() .WithOkColor() @@ -432,7 +434,7 @@ namespace NadekoBot.Modules.Gambling .AddField(efb => efb.WithName(GetText("likes")).WithValue(w.Affinity?.ToString() ?? nobody).WithIsInline(true)) .AddField(efb => efb.WithName(GetText("changes_of_heart")).WithValue($"{affInfo.Count} - \"the {affInfo.Title}\"").WithIsInline(true)) .AddField(efb => efb.WithName(GetText("divorces")).WithValue(divorces.ToString()).WithIsInline(true)) - .AddField(efb => efb.WithName($"Waifus ({claims.Count})").WithValue(claims.Count == 0 ? nobody : string.Join("\n", claims.Select(x => x.Waifu))).WithIsInline(true)); + .AddField(efb => efb.WithName($"Waifus ({claims.Count})").WithValue(claims.Count == 0 ? nobody : string.Join("\n", claims.OrderBy(x => rng.Next()).Take(40).Select(x => x.Waifu))).WithIsInline(true)); await Context.Channel.EmbedAsync(embed).ConfigureAwait(false); } diff --git a/src/NadekoBot/Resources/ResponseStrings.Designer.cs b/src/NadekoBot/Resources/ResponseStrings.Designer.cs index e2d01a97..57744c5b 100644 --- a/src/NadekoBot/Resources/ResponseStrings.Designer.cs +++ b/src/NadekoBot/Resources/ResponseStrings.Designer.cs @@ -2244,7 +2244,7 @@ namespace NadekoBot.Resources { } /// - /// Looks up a localized string similar to Dice rolled: {1}. + /// Looks up a localized string similar to Dice rolled: {0}. /// public static string gambling_dice_rolled_num { get { @@ -2577,6 +2577,15 @@ namespace NadekoBot.Resources { } } + /// + /// Looks up a localized string similar to Total: {0} Average: {1}. + /// + public static string gambling_total_average { + get { + return ResourceManager.GetString("gambling_total_average", resourceCulture); + } + } + /// /// Looks up a localized string similar to your affinity is already set to that waifu or you're trying to remove your affinity while not having one.. /// diff --git a/src/NadekoBot/Resources/ResponseStrings.resx b/src/NadekoBot/Resources/ResponseStrings.resx index c1eb0a5d..5e1f21f7 100644 --- a/src/NadekoBot/Resources/ResponseStrings.resx +++ b/src/NadekoBot/Resources/ResponseStrings.resx @@ -1081,7 +1081,7 @@ Don't forget to leave your discord name or id in the message. Someone rolled 35 - Dice rolled: {1} + Dice rolled: {0} Dice Rolled: 5 @@ -1218,4 +1218,7 @@ Don't forget to leave your discord name or id in the message. Submissions Closed + + Total: {0} Average: {1} + \ No newline at end of file