From 336379cc228b66dda3a7d00a13a80f3f17e42d42 Mon Sep 17 00:00:00 2001 From: Lan <50151341+Lannnnnnnnn@users.noreply.github.com> Date: Sun, 4 Apr 2021 18:53:48 +0300 Subject: [PATCH] really important yeah fixed the fish --- Kehyeedra3/Commands/Economy.cs | 74 ++++++++++++++++++---------------- Kehyeedra3/Commands/Stuff.cs | 4 +- 2 files changed, 41 insertions(+), 37 deletions(-) diff --git a/Kehyeedra3/Commands/Economy.cs b/Kehyeedra3/Commands/Economy.cs index 7ec326b..93c97bd 100644 --- a/Kehyeedra3/Commands/Economy.cs +++ b/Kehyeedra3/Commands/Economy.cs @@ -193,7 +193,7 @@ namespace Kehyeedra3.Commands public async Task FishCommand() { ulong time = ulong.Parse(DateTime.Now.ToString("yyyyMMddHHmm")); - ulong totalXp; + ulong totalXp = 0; ulong xp = 0; ulong level = 0; ulong lvlXp = 0; @@ -204,7 +204,7 @@ namespace Kehyeedra3.Commands int SpecialBait = 0; int Lettuce = 0; Dictionary inv = new Dictionary(); - Dictionary items = new Dictionary(); + List fishes = Fishing.GetFishList(); using (var Database = new ApplicationDbContextFactory().CreateDbContext()) @@ -231,51 +231,55 @@ 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; } - if (guser.GeneralInventory != null || guser.GeneralInventory != "{}") + if (guser.GeneralInventory == null) + { + guser.GeneralInventory = "{}"; + } + + Dictionary items = new Dictionary(); + items = guser.GetGenInve(); + int[] subtract = { 0 }; + subtract[0] = -1; + if (items.TryGetValue(Items.SpecialBait, out int[] SpecB)) { - items = guser.GetGenInve(); - int[] subtract = { 0 }; - subtract[0] = -1; - if (items.TryGetValue(Items.SpecialBait, out int[] SpecB)) + SpecialBait = SpecB[0]; + BigBait = SpecB[0]; + RareBait = SpecB[0]; + if (SpecialBait > 0) { - SpecialBait = SpecB[0]; - BigBait = SpecB[0]; - RareBait = SpecB[0]; - if (SpecialBait > 0) - { - SpecB[0] -= 1; - } - else + SpecB[0] -= 1; + } + else + { + if (items.TryGetValue(Items.BigBait, out int[] BigB)) { - if (items.TryGetValue(Items.BigBait, out int[] BigB)) + BigBait = BigB[0]; + if (BigBait > 0) { - BigBait = BigB[0]; - if (BigBait > 0) - { - BigB[0] -= 1; - } + BigB[0] -= 1; } - if (items.TryGetValue(Items.RareBait, out int[] RareB)) + } + if (items.TryGetValue(Items.RareBait, out int[] RareB)) + { + RareBait = RareB[0]; + if (RareBait > 0) { - RareBait = RareB[0]; - if (RareBait > 0) - { - RareB[0] -= 1; - } + RareB[0] -= 1; } } } - if (items.TryGetValue(Items.Lettuce, out int[] Lettu)) + } + if (items.TryGetValue(Items.Lettuce, out int[] Lettu)) + { + Lettuce = Lettu[0]; + if (Lettuce > 0) { - Lettuce = Lettu[0]; - if (Lettuce > 0) - { - Lettu[0] -= 1; - } + Lettu[0] -= 1; } - - guser.SetGenInve(items); } + + guser.SetGenInve(items); + level = user.Lvl; totalXp = user.TXp; diff --git a/Kehyeedra3/Commands/Stuff.cs b/Kehyeedra3/Commands/Stuff.cs index cbaeabf..c92c069 100644 --- a/Kehyeedra3/Commands/Stuff.cs +++ b/Kehyeedra3/Commands/Stuff.cs @@ -42,8 +42,8 @@ namespace Kehyeedra3.Commands { Random rando = new Random(); Random rando1 = new Random(); - int trapRating0 = rando.Next(0, 101); - if (trapRating0 == 100) + int trapRating0 = rando.Next(0, 201); + if (trapRating0 > 100 || trapRating0 < 120) { int trapRating1 = rando1.Next(0, 10001); await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nCongrats king, your boss nuts weigh {trapRating1}g.");