really important yeah

fixed the fish
This commit is contained in:
Lan
2021-04-04 18:53:48 +03:00
parent dd2ca3ec3f
commit 336379cc22
2 changed files with 51 additions and 47 deletions

View File

@@ -193,7 +193,7 @@ namespace Kehyeedra3.Commands
public async Task FishCommand() public async Task FishCommand()
{ {
ulong time = ulong.Parse(DateTime.Now.ToString("yyyyMMddHHmm")); ulong time = ulong.Parse(DateTime.Now.ToString("yyyyMMddHHmm"));
ulong totalXp; ulong totalXp = 0;
ulong xp = 0; ulong xp = 0;
ulong level = 0; ulong level = 0;
ulong lvlXp = 0; ulong lvlXp = 0;
@@ -204,7 +204,7 @@ namespace Kehyeedra3.Commands
int SpecialBait = 0; int SpecialBait = 0;
int Lettuce = 0; int Lettuce = 0;
Dictionary<FishSpecies, int[]> inv = new Dictionary<FishSpecies, int[]>(); Dictionary<FishSpecies, int[]> inv = new Dictionary<FishSpecies, int[]>();
Dictionary<Items, int[]> items = new Dictionary<Items, int[]>();
List<Fish> fishes = Fishing.GetFishList(); List<Fish> fishes = Fishing.GetFishList();
using (var Database = new ApplicationDbContextFactory().CreateDbContext()) using (var Database = new ApplicationDbContextFactory().CreateDbContext())
@@ -231,52 +231,56 @@ 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?"); 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; return;
} }
if (guser.GeneralInventory != null || guser.GeneralInventory != "{}") if (guser.GeneralInventory == null)
{ {
items = guser.GetGenInve(); guser.GeneralInventory = "{}";
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)
{
SpecB[0] -= 1;
}
else
{
if (items.TryGetValue(Items.BigBait, out int[] BigB))
{
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)
{
Lettu[0] -= 1;
}
}
guser.SetGenInve(items);
} }
Dictionary<Items, int[]> items = new Dictionary<Items, int[]>();
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)
{
SpecB[0] -= 1;
}
else
{
if (items.TryGetValue(Items.BigBait, out int[] BigB))
{
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)
{
Lettu[0] -= 1;
}
}
guser.SetGenInve(items);
level = user.Lvl; level = user.Lvl;
totalXp = user.TXp; totalXp = user.TXp;
lvlXp = user.Xp; lvlXp = user.Xp;

View File

@@ -42,8 +42,8 @@ namespace Kehyeedra3.Commands
{ {
Random rando = new Random(); Random rando = new Random();
Random rando1 = new Random(); Random rando1 = new Random();
int trapRating0 = rando.Next(0, 101); int trapRating0 = rando.Next(0, 201);
if (trapRating0 == 100) if (trapRating0 > 100 || trapRating0 < 120)
{ {
int trapRating1 = rando1.Next(0, 10001); int trapRating1 = rando1.Next(0, 10001);
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nCongrats king, your boss nuts weigh {trapRating1}g."); await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nCongrats king, your boss nuts weigh {trapRating1}g.");