From 9564f54f55843e59cc23231e531663a095816414 Mon Sep 17 00:00:00 2001 From: Lan <50151341+Lannnnnnnnn@users.noreply.github.com> Date: Thu, 1 Apr 2021 18:11:03 +0300 Subject: [PATCH] minor feexes fish and general store fixe --- Kehyeedra3/Commands/Economy.cs | 77 ++++++++++++++++-------------- Kehyeedra3/Commands/Interactive.cs | 20 ++++---- 2 files changed, 51 insertions(+), 46 deletions(-) diff --git a/Kehyeedra3/Commands/Economy.cs b/Kehyeedra3/Commands/Economy.cs index e013118..2f1a163 100644 --- a/Kehyeedra3/Commands/Economy.cs +++ b/Kehyeedra3/Commands/Economy.cs @@ -231,50 +231,51 @@ namespace Kehyeedra3.Commands await Context.Channel.SendMessageAsync($"{Context.User.Mention}\narrrrr-right, ye scurby bastard, I know yer eager t' scour the seven seas but ye needs t' wait till the next minute t' pillage the booty'o'the depths, savvy?"); return; } - - items = guser.GetGenInve(); // - int[] subtract = { 0 }; - subtract[0] = -1; - if (items.TryGetValue(Items.SpecialBait, out int[] SpecB)) + if (guser.GeneralInventory != null|| guser.GeneralInventory != "{}") { - SpecialBait = SpecB[0]; - BigBait = SpecB[0]; - RareBait = SpecB[0]; - if (SpecialBait > 0) - { - SpecB[0] -= 1; - } - else + items = guser.GetGenInve(); // + int[] subtract = { 0 }; + subtract[0] = -1; + if (items.TryGetValue(Items.SpecialBait, out int[] SpecB)) { - if (items.TryGetValue(Items.BigBait, out int[] BigB)) + SpecialBait = SpecB[0]; + BigBait = SpecB[0]; + RareBait = SpecB[0]; + if (SpecialBait > 0) { - BigBait = BigB[0]; - if (BigBait > 0) - { - BigB[0] -= 1; - } + SpecB[0] -= 1; } - if (items.TryGetValue(Items.RareBait, out int[] RareB)) + else { - RareBait = RareB[0]; - if (RareBait > 0) + if (items.TryGetValue(Items.BigBait, out int[] BigB)) { - RareB[0] -= 1; + BigBait = BigB[0]; + if (BigBait > 0) + { + BigB[0] -= 1; + } + } + if (items.TryGetValue(Items.RareBait, out int[] RareB)) + { + RareBait = RareB[0]; + if (RareBait > 0) + { + RareB[0] -= 1; + } } } } - } - if (items.TryGetValue(Items.Lettuce, out int[] Lettu)) - { - Lettuce = Lettu[0]; - if (Lettuce > 0) + if (items.TryGetValue(Items.Lettuce, out int[] Lettu)) { - Lettu[0] -= 1; + Lettuce = Lettu[0]; + if (Lettuce > 0) + { + Lettu[0] -= 1; + } } - } - guser.SetGenInve(items); - + guser.SetGenInve(items); + } level = user.Lvl; totalXp = user.TXp; @@ -287,7 +288,7 @@ namespace Kehyeedra3.Commands int rari = SRandom.Next(0, 2001); int weigh = SRandom.Next(10, 1501+prestige*500); - int tierRoll = SRandom.Next(0, 20*rod+10*prestige+1); + int tierRoll = SRandom.Next(0, 20*rod+10*prestige+11); int dCatchRoll = SRandom.Next(0, 1000+prestige*20); int dcatch = 1; @@ -527,7 +528,7 @@ namespace Kehyeedra3.Commands if (bLet) { - xp = Convert.ToUInt64(Math.Round(xp * 1.1, 0, MidpointRounding.ToEven)) * (ulong)dcatch; + xp = Convert.ToUInt64(Math.Round(xp * 1.1, 0, MidpointRounding.ToEven)); } string lvlUp = ""; @@ -795,7 +796,7 @@ namespace Kehyeedra3.Commands return; } - await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nProcess 1 **Lucky Catfish** for **0.1000%**? \n(Owned: {fish})\n"); + await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nProcess 1 **Lucky Catfish** for **0.1000%**? \n(Owned: {fish})\nType 'yes' to continue."); var inp = await NextMessageAsync(); if (inp.Content.ToLowerInvariant().Contains("yes")) { @@ -810,6 +811,10 @@ namespace Kehyeedra3.Commands await Database.SaveChangesAsync(); await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nYou have obtained **Lucky Paste**"); } + else + { + await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nok retard."); + } } else { @@ -821,7 +826,7 @@ namespace Kehyeedra3.Commands if (T2Up[0] != 0 && Rod[0] != 0) { - await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nDo you want to craft the **Reinforced Fishing Rod**?\nThis will use 1 **Lucky Paste** and 1 **Incomplete Rod**."); + await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nDo you want to craft the **Reinforced Fishing Rod**?\nThis will use 1 **Lucky Paste** and 1 **Incomplete Rod**.\nType 'yes' to continue."); var inp = await NextMessageAsync(); if (inp.Content != null && inp.Content.ToLowerInvariant().Contains("yes")) { diff --git a/Kehyeedra3/Commands/Interactive.cs b/Kehyeedra3/Commands/Interactive.cs index bf02b10..6aa8a64 100644 --- a/Kehyeedra3/Commands/Interactive.cs +++ b/Kehyeedra3/Commands/Interactive.cs @@ -566,7 +566,7 @@ namespace Kehyeedra3.Commands } - [Command("gstore", RunMode = RunMode.Async),Alias("gs")] + [Command("gstore", RunMode = RunMode.Async),Alias("gs"),Summary("General store: gstore or gs. Secondary variables s/sell to sell, b/buy to buy.")] public async Task GeneralStore(string input = null) { using (var Database = new ApplicationDbContextFactory().CreateDbContext()) @@ -624,12 +624,12 @@ namespace Kehyeedra3.Commands } else if (input == "b" || input == "buy") { - await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nWhich item?\n{itemtxt}"); - var inp = await NextMessageAsync(); + await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nSpecify the item and amount (ID num)\n{itemtxt}"); + var inp = await NextMessageAsync(timeout: TimeSpan.FromMinutes(2)); - item = itemlist.FirstOrDefault(i => (int)i.Id == int.Parse(inp.Content)); - await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nHow many?"); - inp = await NextMessageAsync(); + var inpsep = inp.Content.Split(" "); + + item = itemlist.FirstOrDefault(i => (int)i.Id == int.Parse(inpsep[0])); items = user.GetGenInve(); @@ -641,12 +641,12 @@ namespace Kehyeedra3.Commands items.Add(item.Id, amount); } - if (int.Parse(inp.Content) * item.Price <= user.Money) + if (int.Parse(inpsep[1]) * item.Price <= user.Money) { - amount[0] += int.Parse(inp.Content); - int count = int.Parse(inp.Content); + amount[0] += int.Parse(inpsep[1]); + int count = int.Parse(inpsep[1]); - await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nThis will cost you {count * item.Price}.\nType 'ok' to confirm."); + await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nThis will cost you {((long)(count * item.Price)).ToYeedraDisplay()}.\nType 'ok' to confirm."); inp = await NextMessageAsync(); if (inp.Content.ToLowerInvariant() == "ok")