slight changes

changed some stuff to be more accurate since gambling has been gone for months and also made fish stuff more efficient
master
Lan 4 years ago
parent 9564f54f55
commit 519caa9430
  1. 4
      Kehyeedra3/Commands/Admin.cs
  2. 233
      Kehyeedra3/Commands/Economy.cs
  3. 221
      Kehyeedra3/Commands/Interactive.cs
  4. 117
      Kehyeedra3/Services/Models/Fishing.cs

@ -138,7 +138,7 @@ namespace Kehyeedra3.Commands
{ {
if (!user.GrantMoney(Database.Users.FirstOrDefault(x => x.Id == 0), amount)) if (!user.GrantMoney(Database.Users.FirstOrDefault(x => x.Id == 0), amount))
{ {
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nBank has no money, convince someone to gamble"); await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nBank has no money, buy more bait.");
return; return;
} }
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nSet **{yuser}**'s money to **{user.Money.ToYeedraDisplay()}%**."); await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nSet **{yuser}**'s money to **{user.Money.ToYeedraDisplay()}%**.");
@ -156,7 +156,7 @@ namespace Kehyeedra3.Commands
{ {
if (!user.GrantMoney(Database.Users.FirstOrDefault(x => x.Id == 0), amount - user.Money)) if (!user.GrantMoney(Database.Users.FirstOrDefault(x => x.Id == 0), amount - user.Money))
{ {
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nBank has no money, convince someone to gamble."); await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nBank has no money, buy more bait.");
return; return;
} }
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nSet **{yuser}**'s money to **{((long)amount).ToYeedraDisplay()}%**."); await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nSet **{yuser}**'s money to **{((long)amount).ToYeedraDisplay()}%**.");

@ -176,7 +176,7 @@ namespace Kehyeedra3.Commands
if (!user.GrantMoney(Database.Users.FirstOrDefault(x => x.Id == 0), end)) if (!user.GrantMoney(Database.Users.FirstOrDefault(x => x.Id == 0), end))
{ {
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nBank has no money, convince someone to gamble."); await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nBank has no money, buy more bait.");
return; return;
} }
@ -193,12 +193,12 @@ 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; ulong xp = 0;
ulong level; ulong level = 0;
ulong lvlXp; ulong lvlXp = 0;
int prestige; int prestige = 0;
int rod; int rod = 0;
int BigBait = 0; int BigBait = 0;
int RareBait = 0; int RareBait = 0;
int SpecialBait = 0; int SpecialBait = 0;
@ -350,132 +350,159 @@ namespace Kehyeedra3.Commands
} }
Fish fish; Fish fish;
List<Fish> fishTiers;
List<Fish> fishRarities = fishes.ToList();
FishTier ftier;
if (tierRoll > 60 && rod >= 3)
{
fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T4).ToList();
ftier = FishTier.T4;
}
else if (tierRoll > 40 && rod >= 2)
{
fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T3).ToList();
ftier = FishTier.T3;
}
else if (tierRoll > 20 && rod >= 1)
{
fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T2).ToList();
ftier = FishTier.T2;
}
else
{
fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T1).ToList();
ftier = FishTier.T1;
}
if (rarity == 777 || (rarity > 2060 && rarity <= 2070) || rarity == 2777 || rarity > 2500 && rarity < 2510 && bRar ||rarity > 2510 && rarity < 2520 && bSpe) if (rarity == 777 || (rarity > 2060 && rarity <= 2070) || rarity == 2777 || rarity > 2500 && rarity < 2510 && bRar ||rarity > 2510 && rarity < 2520 && bSpe)
{ {
fishRarities = fishTiers.Where(f => (int)f.Rarity == (int)FishRarity.Legendary).ToList();
int wRoll = SRandom.Next(0, 101); int wRoll = SRandom.Next(0, 101);
if (wRoll == 77 && bSpe)
switch (ftier)
{ {
List<Fish> possibleFishes = fishes.Where(f => (int)f.Rarity == (int)FishRarity.Unreasonable).ToList(); case FishTier.T1:
fish = possibleFishes[SRandom.Next(possibleFishes.Count)]; {
xp = 7777; xp = 10;
} }
else if (rod >= 3 && tierRoll > 60) break;
case FishTier.T2:
{ {
List<Fish> possibleFishes = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T4Legendary).ToList(); xp = 15;
fish = possibleFishes[SRandom.Next(possibleFishes.Count)];
xp = 25;
} }
else if (rod >= 2 && tierRoll > 40) break;
case FishTier.T3:
{ {
List<Fish> possibleFishes = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T3Legendary).ToList();
fish = possibleFishes[SRandom.Next(possibleFishes.Count)];
xp = 20; xp = 20;
} }
else if (rod >= 1 && tierRoll > 20) break;
case FishTier.T4:
{ {
List<Fish> possibleFishes = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T2Legendary).ToList(); xp = 25;
fish = possibleFishes[SRandom.Next(possibleFishes.Count)];
xp = 15;
} }
else break;
{
List<Fish> possibleFishes = fishes.Where(f => (int)f.Rarity == (int)FishRarity.Legendary).ToList();
fish = possibleFishes[SRandom.Next(possibleFishes.Count)];
xp = 10;
} }
if (rarity == 777 || rarity == 2777) if (rarity == 777 || rarity == 2777)
{ {
xp = 77+ Convert.ToUInt64(77*rod/2); xp = 77 + Convert.ToUInt64(77 * rod / 2);
}
if (wRoll == 77 && bSpe)
{
List<Fish> possibleFishes = fishes.Where(f => (int)f.Rarity == (int)FishRarity.Unreasonable).ToList();
fish = possibleFishes[SRandom.Next(possibleFishes.Count)];
xp = 7777;
} }
} }
else if (rarity > 1700) else if (rarity > 1700)
{ {
rarity = SRandom.Next(1700, 2801); fishRarities = fishTiers.Where(f => (int)f.Rarity == (int)FishRarity.Uncommon).ToList();
if (bRar || bSpe) switch (ftier)
{ {
rarity += 200; case FishTier.T1:
{
xp = 10;
} }
if (rod >= 3 && tierRoll > 60) break;
case FishTier.T2:
{ {
List<Fish> possibleFishes = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T4Uncommon).ToList(); xp = 13;
fish = possibleFishes[SRandom.Next(possibleFishes.Count)];
xp = 20;
} }
else if (rod >= 2 && tierRoll > 40) break;
case FishTier.T3:
{ {
List<Fish> possibleFishes = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T3Uncommon).ToList();
fish = possibleFishes[SRandom.Next(possibleFishes.Count)];
xp = 16; xp = 16;
} }
else if (rod >= 1 && tierRoll > 20) break;
case FishTier.T4:
{ {
List<Fish> possibleFishes = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T2Uncommon).ToList(); xp = 20;
fish = possibleFishes[SRandom.Next(possibleFishes.Count)];
xp = 13;
} }
else break;
}
rarity = SRandom.Next(1700, 2801);
if (bRar || bSpe)
{ {
List<Fish> possibleFishes = fishes.Where(f => (int)f.Rarity == (int)FishRarity.Uncommon).ToList(); rarity += 200;
fish = possibleFishes[SRandom.Next(possibleFishes.Count)];
xp = 10;
} }
if (rarity > 2600) if (rarity > 2600)
{ {
if (rod >= 3 && tierRoll > 60) fishRarities = fishTiers.Where(f => (int)f.Rarity == (int)FishRarity.Rare).ToList();
switch (ftier)
{ {
List<Fish> possibleFishes = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T4Rare).ToList(); case FishTier.T1:
fish = possibleFishes[SRandom.Next(possibleFishes.Count)];
xp = 35;
}
else if (rod >= 2 && tierRoll > 40)
{ {
List<Fish> possibleFishes = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T3Rare).ToList(); xp = 20;
fish = possibleFishes[SRandom.Next(possibleFishes.Count)];
xp = 30;
} }
else if (rod >= 1 && tierRoll > 20) break;
case FishTier.T2:
{ {
List<Fish> possibleFishes = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T2Rare).ToList();
fish = possibleFishes[SRandom.Next(possibleFishes.Count)];
xp = 25; xp = 25;
} }
else break;
case FishTier.T3:
{ {
List<Fish> possibleFishes = fishes.Where(f => (int)f.Rarity == (int)FishRarity.Rare).ToList(); xp = 30;
fish = possibleFishes[SRandom.Next(possibleFishes.Count)]; }
xp = 20; break;
case FishTier.T4:
{
xp = 35;
} }
break;
} }
} }
else else
{ {
if (rod >= 3 && tierRoll > 60) fishRarities = fishTiers.Where(f => (int)f.Rarity == (int)FishRarity.Common).ToList();
switch (ftier)
{ {
List<Fish> possibleFishes = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T4Common).ToList(); case FishTier.T1:
fish = possibleFishes[SRandom.Next(possibleFishes.Count)]; {
xp = 10; xp = 5;
} }
else if (rod >= 2 && tierRoll > 40) break;
case FishTier.T2:
{ {
List<Fish> possibleFishes = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T3Common).ToList(); xp = 7;
fish = possibleFishes[SRandom.Next(possibleFishes.Count)];
xp = 8;
} }
else if (rod >= 1 && tierRoll > 20) break;
case FishTier.T3:
{ {
List<Fish> possibleFishes = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T2Common).ToList(); xp = 9;
fish = possibleFishes[SRandom.Next(possibleFishes.Count)];
xp = 6;
} }
else break;
case FishTier.T4:
{ {
List<Fish> possibleFishes = fishes.Where(f => (int)f.Rarity == (int)FishRarity.Common).ToList(); xp = 11;
fish = possibleFishes[SRandom.Next(possibleFishes.Count)]; }
xp = 5; break;
}
} }
} }
fish = fishRarities[SRandom.Next(fishRarities.Count)];
FishSize size; FishSize size;
@ -484,19 +511,19 @@ namespace Kehyeedra3.Commands
weight = SRandom.Next(100, 2001) + Convert.ToInt32(level * 5 + (Convert.ToUInt64(prestige * 500))); weight = SRandom.Next(100, 2001) + Convert.ToInt32(level * 5 + (Convert.ToUInt64(prestige * 500)));
} }
if (fish.Rarity == FishRarity.Legendary || fish.Rarity == FishRarity.T2Legendary || fish.Rarity == FishRarity.T3Legendary || fish.Rarity == FishRarity.T4Legendary) if (fish.Rarity == FishRarity.Legendary)
{ {
weight = SRandom.Next(2000 + Convert.ToInt32(level * 20), 40001 + prestige * 10000); weight = SRandom.Next(2000 + Convert.ToInt32(level * 20), 40001 + prestige * 10000);
} }
if (bBig)
{
weight += 1000;
}
if (fish.Rarity == FishRarity.Unreasonable) if (fish.Rarity == FishRarity.Unreasonable)
{ {
weight = SRandom.Next(4000, 6000); weight = SRandom.Next(4000, 6000);
} }
if (bBig)
{
weight += 1000;
}
if (weight >= 1000) if (weight >= 1000)
{ {
@ -513,7 +540,7 @@ namespace Kehyeedra3.Commands
double w = Convert.ToDouble(weight); double w = Convert.ToDouble(weight);
xp = Convert.ToUInt64(Math.Round(xp * w / 1000, 0, MidpointRounding.ToEven))*(ulong)dcatch; xp = Convert.ToUInt64(Math.Round(xp * w / 1000, 0, MidpointRounding.ToEven))*(ulong)dcatch;
if (fish.Rarity == FishRarity.Legendary || fish.Rarity == FishRarity.T2Legendary || fish.Rarity == FishRarity.T3Legendary || fish.Rarity == FishRarity.T4Legendary) if (fish.Rarity == FishRarity.Legendary)
{ {
if (xp < 100) if (xp < 100)
{ {
@ -901,39 +928,30 @@ namespace Kehyeedra3.Commands
Dictionary<FishSpecies, int> large = new Dictionary<FishSpecies, int>(); Dictionary<FishSpecies, int> large = new Dictionary<FishSpecies, int>();
List<Fish> fishes = Fishing.GetFishList(); List<Fish> fishes = Fishing.GetFishList();
List<Fish> fishTiers = Fishing.GetFishList();
List<Fish> unrfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.Unreasonable).ToList(); if (tier >= 1 && tier < 5)
List<Fish> legfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.Legendary).ToList();
List<Fish> rarfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.Rare).ToList();
List<Fish> uncfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.Uncommon).ToList();
List<Fish> comfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.Common).ToList();
if (tier > 1 && tier < 5)
{ {
switch (tier) switch (tier)
{ {
case 1:
{
fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T1).ToList();
}
break;
case 2: case 2:
{ {
legfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T2Legendary).ToList(); fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T2).ToList();
rarfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T2Rare).ToList();
uncfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T2Uncommon).ToList();
comfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T2Common).ToList();
} }
break; break;
case 3: case 3:
{ {
legfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T3Legendary).ToList(); fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T3).ToList();
rarfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T3Rare).ToList();
uncfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T3Uncommon).ToList();
comfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T3Common).ToList();
} }
break; break;
case 4: case 4:
{ {
legfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T4Legendary).ToList(); fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T4).ToList();
rarfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T4Rare).ToList();
uncfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T4Uncommon).ToList();
comfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T4Common).ToList();
} }
break; break;
} }
@ -944,6 +962,13 @@ namespace Kehyeedra3.Commands
return; return;
} }
List<Fish> unrfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.Unreasonable).ToList();
List<Fish> legfish = fishTiers.Where(f => (int)f.Rarity == (int)FishRarity.Legendary).ToList();
List<Fish> rarfish = fishTiers.Where(f => (int)f.Rarity == (int)FishRarity.Rare).ToList();
List<Fish> uncfish = fishTiers.Where(f => (int)f.Rarity == (int)FishRarity.Uncommon).ToList();
List<Fish> comfish = fishTiers.Where(f => (int)f.Rarity == (int)FishRarity.Common).ToList();
string unreasonable = ""; string unreasonable = "";
string legendary = ""; string legendary = "";
string rare = ""; string rare = "";

@ -436,7 +436,7 @@ namespace Kehyeedra3.Commands
{ {
if (!user.GrantMoney(Database.Users.FirstOrDefault(x => x.Id == 0), -500)) if (!user.GrantMoney(Database.Users.FirstOrDefault(x => x.Id == 0), -500))
{ {
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nBank has no money, convince someone to gamble."); await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nBank has no money, buy more bait.");
return; return;
} }
@ -575,9 +575,14 @@ namespace Kehyeedra3.Commands
Dictionary<FishSpecies, int[]> fishinv = new Dictionary<FishSpecies, int[]>(); Dictionary<FishSpecies, int[]> fishinv = new Dictionary<FishSpecies, int[]>();
List<User.Item> itemlist = User.ListItems(); List<User.Item> itemlist = User.ListItems();
List<Fish> fishes = Fishing.GetFishList(); List<Fish> fishes = Fishing.GetFishList();
List<Fish> legfish = fishes.ToList();
List<Fish> rarfish = fishes.ToList();
List<Fish> uncfish = fishes.ToList();
List<Fish> comfish = fishes.ToList();
User.Item item; User.Item item;
Fish fish; Fish fish;
List<Fish> fishTiers = fishes.ToList();
var fuser = Database.Fishing.FirstOrDefault(x => x.Id == Context.User.Id); var fuser = Database.Fishing.FirstOrDefault(x => x.Id == Context.User.Id);
var user = Database.Users.FirstOrDefault(x => x.Id == Context.User.Id); var user = Database.Users.FirstOrDefault(x => x.Id == Context.User.Id);
@ -653,7 +658,7 @@ namespace Kehyeedra3.Commands
{ {
if (!user.GrantMoney(Database.Users.FirstOrDefault(x => x.Id == 0), -(count * item.Price))) if (!user.GrantMoney(Database.Users.FirstOrDefault(x => x.Id == 0), -(count * item.Price)))
{ {
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nBank has no money, convince someone to gamble."); await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nBank has no money, buy more bait.");
return; return;
} }
user.SetGenInve(items); user.SetGenInve(items);
@ -685,39 +690,36 @@ namespace Kehyeedra3.Commands
var inp = await NextMessageAsync(); var inp = await NextMessageAsync();
int tier = int.Parse(inp.Content); int tier = int.Parse(inp.Content);
List<Fish> legfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.Legendary).ToList();
List<Fish> rarfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.Rare).ToList(); if (tier > 0 && tier < 5)
List<Fish> uncfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.Uncommon).ToList();
List<Fish> comfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.Common).ToList();
if (tier > 1 && tier < 5)
{ {
switch (tier) switch (tier)
{ {
case 1:
{
fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T1).ToList();
}
break;
case 2: case 2:
{ {
legfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T2Legendary).ToList(); fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T2).ToList();
rarfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T2Rare).ToList();
uncfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T2Uncommon).ToList();
comfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T2Common).ToList();
} }
break; break;
case 3: case 3:
{ {
legfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T3Legendary).ToList(); fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T3).ToList();
rarfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T3Rare).ToList();
uncfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T3Uncommon).ToList();
comfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T3Common).ToList();
} }
break; break;
case 4: case 4:
{ {
legfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T4Legendary).ToList(); fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T4).ToList();
rarfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T4Rare).ToList();
uncfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T4Uncommon).ToList();
comfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T4Common).ToList();
} }
break; break;
} }
legfish = fishTiers.Where(f => (int)f.Rarity == (int)FishRarity.Legendary).ToList();
rarfish = fishTiers.Where(f => (int)f.Rarity == (int)FishRarity.Rare).ToList();
uncfish = fishTiers.Where(f => (int)f.Rarity == (int)FishRarity.Uncommon).ToList();
comfish = fishTiers.Where(f => (int)f.Rarity == (int)FishRarity.Common).ToList();
} }
else if (tier < 1 || tier > 4) else if (tier < 1 || tier > 4)
{ {
@ -820,112 +822,197 @@ namespace Kehyeedra3.Commands
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nYou don't have that many.\n"); await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nYou don't have that many.\n");
return; return;
} }
siz += 1;
switch (fish.Rarity) switch (fish.Rarity)
{ {
case FishRarity.Legendary: case FishRarity.Common:
{ {
value = 700; value = (int)fish.Tier * siz * 1;
}
break;
case FishRarity.Uncommon:
{
value = (int)fish.Tier * siz * 3;
} }
break; break;
case FishRarity.Rare: case FishRarity.Rare:
{ {
value = 6 * (int)(size+1); value = (int)fish.Tier * siz * 6;
} }
break; break;
case FishRarity.Uncommon: case FishRarity.Legendary:
{ {
value = 2 * (int)(size+1); value = (int)fish.Tier * 100 + 600;
} }
break; break;
case FishRarity.Common: }
value *= amount;
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nYou're about to sell **{amount} {fish.Name}** for **{((long)value).ToYeedraDisplay()}**.\nType 'ok' to confirm.");
inp = await NextMessageAsync();
if (inp.Content.ToLowerInvariant() == "ok")
{ {
value = (int)(size+1);
int[] amounts;
if (!fishinv.TryGetValue(fish.Id, out amounts))
{
amounts = new int[] { 0, 0, 0 };
fishinv.Add(fish.Id, amounts);
}
int sizeIndex = (int)size;
amounts[sizeIndex] -= amount;
fuser.SetInventory(fishinv);
if (!user.GrantMoney(Database.Users.FirstOrDefault(x => x.Id == 0), value))
{
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nBank has no money, buy more bait.");
return;
}
await Database.SaveChangesAsync();
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nThanks, seaman, enjoy your moolah.");
}
else
{
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nI guess I'm starving tonight. :[");
}
}/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
else if (input == "bulksell")
{
int value = 0;
int count = 0;
FishSize size;
if (fuser.Inventory.Length < 3)
{
await Context.Channel.SendMessageAsync($"Your inventory is empty. Try fishing more.");
return;
}
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nSpecify the tier.\n");
var inp = await NextMessageAsync();
int tier = int.Parse(inp.Content);
if (tier > 0 && tier < 5)
{
switch (tier)
{
case 1:
{
fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T1).ToList();
} }
break; break;
case FishRarity.T2Legendary: case 2:
{ {
value = 750; fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T2).ToList();
} }
break; break;
case FishRarity.T2Rare: case 3:
{ {
value = 12 * (int)(size+1); fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T3).ToList();
} }
break; break;
case FishRarity.T2Uncommon: case 4:
{ {
value = 4 * (int)(size+1); fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T4).ToList();
} }
break; break;
case FishRarity.T2Common: }
rarfish = fishTiers.Where(f => (int)f.Rarity == (int)FishRarity.Rare).ToList();
uncfish = fishTiers.Where(f => (int)f.Rarity == (int)FishRarity.Uncommon).ToList();
comfish = fishTiers.Where(f => (int)f.Rarity == (int)FishRarity.Common).ToList();
}
else if (tier < 1 || tier > 4)
{
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nTier not available.");
return;
}
foreach (var f in fishinv)
{
int[] amounts;
if (!fishinv.TryGetValue(f.Key, out amounts))
{
amounts = new int[] { 0, 0, 0 };
fishinv.Add(f.Key, amounts);
}
fish = fishes.FirstOrDefault(i => i.Id == f.Key);
if (fish.Rarity != FishRarity.Legendary)
{
count += f.Value[0] + f.Value[1] + f.Value[2];
switch (fish.Rarity) //small
{
case FishRarity.Common:
{ {
value = 2 * (int)(size+1); value += (int)fish.Tier * 1 * 1;
} }
break; break;
case FishRarity.T3Legendary: case FishRarity.Uncommon:
{ {
value = 800; value += (int)fish.Tier * 1 * 3;
} }
break; break;
case FishRarity.T3Rare: case FishRarity.Rare:
{ {
value = 18 * (int)(size+1); value += (int)fish.Tier * 1 * 6;
} }
break; break;
case FishRarity.T3Uncommon: }
////
switch (fish.Rarity) //med
{
case FishRarity.Common:
{ {
value = 6 * (int)(size+1); value += (int)fish.Tier * 2 * 1;
} }
break; break;
case FishRarity.T3Common: case FishRarity.Uncommon:
{ {
value = 3 * (int)(size+1); value += (int)fish.Tier * 2 * 3;
} }
break; break;
case FishRarity.T4Legendary: case FishRarity.Rare:
{ {
value = 850; value += (int)fish.Tier * 2 * 6;
} }
break; break;
case FishRarity.T4Rare: }
////
switch (fish.Rarity) //large
{ {
value = 32 * (int)(size+1); case FishRarity.Common:
{
value += (int)fish.Tier * 3 * 1;
} }
break; break;
case FishRarity.T4Uncommon: case FishRarity.Uncommon:
{ {
value = 8 * (int)(size+1); value += (int)fish.Tier * 3 * 3;
} }
break; break;
case FishRarity.T4Common: case FishRarity.Rare:
{ {
value = 4 * (int)(size+1); value += (int)fish.Tier * 3 * 6;
} }
break; break;
} }
value *= amount;
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nYou're about to sell **{amount} {fish.Name}** for **{((long)value).ToYeedraDisplay()}**.\nType 'ok' to confirm."); await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nYou're about to sell **{count} Fish** for **{((long)value).ToYeedraDisplay()}**.\nType 'ok' to confirm.");
inp = await NextMessageAsync(); inp = await NextMessageAsync();
if (inp.Content.ToLowerInvariant() == "ok") if (inp.Content.ToLowerInvariant() == "ok")
{ {
int[] amounts;
if (!fishinv.TryGetValue(fish.Id, out amounts))
{
amounts = new int[] { 0, 0, 0 };
fishinv.Add(fish.Id, amounts);
}
int sizeIndex = (int)size;
amounts[sizeIndex] -= amount;
fuser.SetInventory(fishinv); fuser.SetInventory(fishinv);
if (!user.GrantMoney(Database.Users.FirstOrDefault(x => x.Id == 0), value)) if (!user.GrantMoney(Database.Users.FirstOrDefault(x => x.Id == 0), value))
{ {
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nBank has no money, convince someone to gamble."); await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nBank has no money, buy more bait.");
return; return;
} }
await Database.SaveChangesAsync(); await Database.SaveChangesAsync();
@ -938,6 +1025,12 @@ namespace Kehyeedra3.Commands
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nI guess I'm starving tonight. :["); await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nI guess I'm starving tonight. :[");
} }
} }
}
}///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
} }
} }

@ -12,10 +12,18 @@ namespace Kehyeedra3.Services.Models
} }
public enum FishRarity public enum FishRarity
{ {
Common, Uncommon, Rare, Legendary, Common = 1,
T2Rare, T2Legendary, T2Uncommon, T2Common, Uncommon = 2,
T3Rare, T3Legendary, T3Uncommon, T3Common, Rare = 3,
T4Rare, T4Legendary, T4Uncommon, T4Common, Unreasonable Legendary = 4,
Unreasonable
}
public enum FishTier
{
T1 = 1,
T2 = 2,
T3 = 3,
T4 = 4
} }
public class Fish public class Fish
{ {
@ -25,6 +33,7 @@ namespace Kehyeedra3.Services.Models
public string Name; public string Name;
public string Emote; public string Emote;
public FishRarity Rarity; public FishRarity Rarity;
public FishTier Tier;
} }
public class Fishing public class Fishing
{ {
@ -62,141 +71,161 @@ namespace Kehyeedra3.Services.Models
{ {
Id = FishSpecies.Wakasagihime, Id = FishSpecies.Wakasagihime,
Name = "Touhoufish", Name = "Touhoufish",
Emote = "<:wakasagihime:793084118949691433><:emptyslot:709350723199959101>", Emote = "<:wakasagihime:793084118949691433>",
Rarity = FishRarity.Unreasonable Rarity = FishRarity.Unreasonable,
Tier = FishTier.T1
}, },
new Fish() new Fish()
{ {
Id = FishSpecies.LuckyCatfish, Id = FishSpecies.LuckyCatfish,
Name = "Lucky Catfish", Name = "Lucky Catfish",
Emote = "<a:catfishleft:682655661422542888><a:catfishright:682655661481525284>", Emote = "<a:catfishleft:682655661422542888><a:catfishright:682655661481525284>",
Rarity = FishRarity.Legendary Rarity = FishRarity.Legendary,
Tier = FishTier.T1
}, },
new Fish() new Fish()
{ {
Id = FishSpecies.Doomfish, Id = FishSpecies.Doomfish,
Name = "Doomfish", Name = "Doomfish",
Emote = "<a:doomfish:704407234574155834>", Emote = "<a:doomfish:704407234574155834>",
Rarity = FishRarity.Rare Rarity = FishRarity.Rare,
Tier = FishTier.T1
}, },
new Fish() new Fish()
{ {
Id = FishSpecies.Clownfish, Id = FishSpecies.Clownfish,
Name = "Clownfish", Name = "Clownfish",
Emote = "<a:clownfishleft:715846565972934718><a:clownfishright:715846565704761424>", Emote = "<a:clownfishleft:715846565972934718><a:clownfishright:715846565704761424>",
Rarity = FishRarity.Rare Rarity = FishRarity.Rare,
Tier = FishTier.T1
}, },
new Fish() new Fish()
{ {
Id = FishSpecies.Teracrab, Id = FishSpecies.Teracrab,
Name = "Teracrab", Name = "Teracrab",
Emote = "<a:teracrableft:710925664089538691><a:teracrabright:710925663439421512>", Emote = "<a:teracrableft:710925664089538691><a:teracrabright:710925663439421512>",
Rarity = FishRarity.Rare Rarity = FishRarity.Rare,
Tier = FishTier.T1
}, },
new Fish() new Fish()
{ {
Id = FishSpecies.Blobfish, Id = FishSpecies.Blobfish,
Name = "Blobfish", Name = "Blobfish",
Emote = "<a:blobfishleft:704386995996065885><a:blobfishright:704386996369358888>", Emote = "<a:blobfishleft:704386995996065885><a:blobfishright:704386996369358888>",
Rarity = FishRarity.Rare Rarity = FishRarity.Rare,
Tier = FishTier.T1
}, },
new Fish() new Fish()
{ {
Id = FishSpecies.Psychedelica, Id = FishSpecies.Psychedelica,
Name = "Psychedelica", Name = "Psychedelica",
Emote = "<a:psychedelicaleft:704406253966721135><a:psychedelicaright:704406252125421698>", Emote = "<a:psychedelicaleft:704406253966721135><a:psychedelicaright:704406252125421698>",
Rarity = FishRarity.Rare Rarity = FishRarity.Rare,
Tier = FishTier.T1
}, },
new Fish() new Fish()
{ {
Id = FishSpecies.Gigacrab, Id = FishSpecies.Gigacrab,
Name = "Gigacrab", Name = "Gigacrab",
Emote = "<:gigacrableft:715626112327221348><:gigacrabright:715626112537067580>", Emote = "<:gigacrableft:715626112327221348><:gigacrabright:715626112537067580>",
Rarity = FishRarity.Uncommon Rarity = FishRarity.Uncommon,
Tier = FishTier.T1
}, },
new Fish() new Fish()
{ {
Id = FishSpecies.Dopefish, Id = FishSpecies.Dopefish,
Name = "Dopefish", Name = "Dopefish",
Emote = "<:dopefishleft:700422139672658009><:dopefishright:700422139643428895>", Emote = "<:dopefishleft:700422139672658009><:dopefishright:700422139643428895>",
Rarity = FishRarity.Uncommon Rarity = FishRarity.Uncommon,
Tier = FishTier.T1
}, },
new Fish() new Fish()
{ {
Id = FishSpecies.Stargazer, Id = FishSpecies.Stargazer,
Name = "Stargazer", Name = "Stargazer",
Emote = "<:stargazerleft:700414644774240286><:stargazerright:700413063442202684>", Emote = "<:stargazerleft:700414644774240286><:stargazerright:700413063442202684>",
Rarity = FishRarity.Uncommon Rarity = FishRarity.Uncommon,
Tier = FishTier.T1
}, },
new Fish() new Fish()
{ {
Id = FishSpecies.Isopod, Id = FishSpecies.Isopod,
Name = "Isopod", Name = "Isopod",
Emote = "<:isopodleft:700397032271249428><:isopodright:700397031922991206>", Emote = "<:isopodleft:700397032271249428><:isopodright:700397031922991206>",
Rarity = FishRarity.Uncommon Rarity = FishRarity.Uncommon,
Tier = FishTier.T1
}, },
new Fish() new Fish()
{ {
Id = FishSpecies.Sheephead, Id = FishSpecies.Sheephead,
Name = "Sheephead", Name = "Sheephead",
Emote = "<:sheepheadleft:710894977944649728><:sheepheadright:710894979467444284>", Emote = "<:sheepheadleft:710894977944649728><:sheepheadright:710894979467444284>",
Rarity = FishRarity.Uncommon Rarity = FishRarity.Uncommon,
Tier = FishTier.T1
}, },
new Fish() new Fish()
{ {
Id = FishSpecies.Cod, Id = FishSpecies.Cod,
Name = "Cod", Name = "Cod",
Emote = "<:codleft:695304941715062887><:codright:695304941949943808>", Emote = "<:codleft:695304941715062887><:codright:695304941949943808>",
Rarity = FishRarity.Common Rarity = FishRarity.Common,
Tier = FishTier.T1
}, },
new Fish() new Fish()
{ {
Id = FishSpecies.Salmon, Id = FishSpecies.Salmon,
Name = "Salmon", Name = "Salmon",
Emote = "<:salmonleft:698167269359878236><:salmonright:698167269167202324>", Emote = "<:salmonleft:698167269359878236><:salmonright:698167269167202324>",
Rarity = FishRarity.Common Rarity = FishRarity.Common,
Tier = FishTier.T1
}, },
new Fish() new Fish()
{ {
Id = FishSpecies.Shrimp, Id = FishSpecies.Shrimp,
Name = "Shrimp", Name = "Shrimp",
Emote = "<:shrimpleft:715074288788570112><:shrimpright:715074288863936552>", Emote = "<:shrimpleft:715074288788570112><:shrimpright:715074288863936552>",
Rarity = FishRarity.Common Rarity = FishRarity.Common,
Tier = FishTier.T1
}, },
new Fish() new Fish()
{ {
Id = FishSpecies.Crayfish, Id = FishSpecies.Crayfish,
Name = "Crayfish", Name = "Crayfish",
Emote = "<:crayfishleft:715638929885495377><:crayfishright:715638929843421284>", Emote = "<:crayfishleft:715638929885495377><:crayfishright:715638929843421284>",
Rarity = FishRarity.Common Rarity = FishRarity.Common,
Tier = FishTier.T1
}, },
new Fish() new Fish()
{ {
Id = FishSpecies.Betta, Id = FishSpecies.Betta,
Name = "Betta", Name = "Betta",
Emote = "<:bettaleft:698179217107714088><:bettaright:698179216868638851>", Emote = "<:bettaleft:698179217107714088><:bettaright:698179216868638851>",
Rarity = FishRarity.Common Rarity = FishRarity.Common,
Tier = FishTier.T1
}, },
new Fish() new Fish()
{ {
Id = FishSpecies.Pufferfish, Id = FishSpecies.Pufferfish,
Name = "Pufferfish", Name = "Pufferfish",
Emote = "<:pufferfishleft:715075414179184691><:pufferfishright:715075414116007937>", Emote = "<:pufferfishleft:715075414179184691><:pufferfishright:715075414116007937>",
Rarity = FishRarity.Common Rarity = FishRarity.Common,
Tier = FishTier.T1
}, },
new Fish() new Fish()
{ {
Id = FishSpecies.Carp, Id = FishSpecies.Carp,
Name = "Carp", Name = "Carp",
Emote = "<:koicarpleft:698204388556275752><:koicarpright:698204386421374986>", Emote = "<:koicarpleft:698204388556275752><:koicarpright:698204386421374986>",
Rarity = FishRarity.Common Rarity = FishRarity.Common,
Tier = FishTier.T1
}, },
new Fish() new Fish()
{ {
Id = FishSpecies.Megacrab, Id = FishSpecies.Megacrab,
Name = "Hermit Crab", Name = "Hermit Crab",
Emote = "<:hermitcrableft:715071501996392519><:hermitcrabright:715071501971488808>", Emote = "<:hermitcrableft:715071501996392519><:hermitcrabright:715071501971488808>",
Rarity = FishRarity.Common Rarity = FishRarity.Common,
Tier = FishTier.T1
}, },
new Fish() //// Tier 2 new Fish() //// Tier 2
@ -204,28 +233,32 @@ namespace Kehyeedra3.Services.Models
Id = FishSpecies.T2Leg, Id = FishSpecies.T2Leg,
Name = "Hypnofish", Name = "Hypnofish",
Emote = "<:paska:786244602440450109><:hypnoosi:786244623478947841>", Emote = "<:paska:786244602440450109><:hypnoosi:786244623478947841>",
Rarity = FishRarity.T2Legendary Rarity = FishRarity.Legendary,
Tier = FishTier.T2
}, },
new Fish() new Fish()
{ {
Id = FishSpecies.T2Swolefish, Id = FishSpecies.T2Swolefish,
Name = "Pumped Up Swolefish", Name = "Pumped Up Swolefish",
Emote = "<:missingLeg:682586847830081551>", Emote = "<:missingLeg:682586847830081551>",
Rarity = FishRarity.T2Rare Rarity = FishRarity.Rare,
Tier = FishTier.T2
}, },
new Fish() new Fish()
{ {
Id = FishSpecies.T2Gunfish, Id = FishSpecies.T2Gunfish,
Name = "Gunfish", Name = "Gunfish",
Emote = "<:gunfishleft:793492588799590460><:gunfishright:793492625277714442>", Emote = "<:gunfishleft:793492588799590460><:gunfishright:793492625277714442>",
Rarity = FishRarity.T2Uncommon Rarity = FishRarity.Uncommon,
Tier = FishTier.T2
}, },
new Fish() new Fish()
{ {
Id = FishSpecies.T2Com, Id = FishSpecies.T2Com,
Name = "Missing T2 Common Fish", Name = "Rockfish",
Emote = "<:missingLeg:682586847830081551>", Emote = "<:missingLeg:682586847830081551>",
Rarity = FishRarity.T2Common Rarity = FishRarity.Common,
Tier = FishTier.T2
}, },
new Fish() //// Tier 3 new Fish() //// Tier 3
@ -233,28 +266,32 @@ namespace Kehyeedra3.Services.Models
Id = FishSpecies.T3Doomfish, Id = FishSpecies.T3Doomfish,
Name = "Spectral Doomfish", Name = "Spectral Doomfish",
Emote = "<:missingLeg:682586847830081551>", Emote = "<:missingLeg:682586847830081551>",
Rarity = FishRarity.T3Legendary Rarity = FishRarity.Legendary,
Tier = FishTier.T3
}, },
new Fish() new Fish()
{ {
Id = FishSpecies.T3Crab, Id = FishSpecies.T3Crab,
Name = "Revenant Crab", Name = "Revenant Crab",
Emote = "<:missingLeg:682586847830081551>", Emote = "<:missingLeg:682586847830081551>",
Rarity = FishRarity.T3Rare Rarity = FishRarity.Rare,
Tier = FishTier.T3
}, },
new Fish() new Fish()
{ {
Id = FishSpecies.T3Flameworm, Id = FishSpecies.T3Flameworm,
Name = "Spectral Flameworm", Name = "Spectral Flameworm",
Emote = "<:missingLeg:682586847830081551>", Emote = "<:missingLeg:682586847830081551>",
Rarity = FishRarity.T3Uncommon Rarity = FishRarity.Uncommon,
Tier = FishTier.T3
}, },
new Fish() new Fish()
{ {
Id = FishSpecies.T3Com, Id = FishSpecies.T3Com,
Name = "Spectral Shrimp", Name = "Spectral Shrimp",
Emote = "<:missingLeg:682586847830081551>", Emote = "<:missingLeg:682586847830081551>",
Rarity = FishRarity.T3Common Rarity = FishRarity.Common,
Tier = FishTier.T3
}, },
new Fish() //// Tier 4 new Fish() //// Tier 4
@ -262,28 +299,32 @@ namespace Kehyeedra3.Services.Models
Id = FishSpecies.T4Leg, Id = FishSpecies.T4Leg,
Name = "Missing T4 Legendary Fish", Name = "Missing T4 Legendary Fish",
Emote = "<:missingLeg:682586847830081551>", Emote = "<:missingLeg:682586847830081551>",
Rarity = FishRarity.T4Legendary Rarity = FishRarity.Legendary,
Tier = FishTier.T4
}, },
new Fish() new Fish()
{ {
Id = FishSpecies.T4Rar, Id = FishSpecies.T4Rar,
Name = "Missing T4 Rare Fish", Name = "Missing T4 Rare Fish",
Emote = "<:missingLeg:682586847830081551>", Emote = "<:missingLeg:682586847830081551>",
Rarity = FishRarity.T4Rare Rarity = FishRarity.Rare,
Tier = FishTier.T4
}, },
new Fish() new Fish()
{ {
Id = FishSpecies.T4Unc, Id = FishSpecies.T4Unc,
Name = "Missing T4 Uncommon Fish", Name = "Missing T4 Uncommon Fish",
Emote = "<:missingLeg:682586847830081551>", Emote = "<:missingLeg:682586847830081551>",
Rarity = FishRarity.T4Uncommon Rarity = FishRarity.Uncommon,
Tier = FishTier.T4
}, },
new Fish() new Fish()
{ {
Id = FishSpecies.T4Com, Id = FishSpecies.T4Com,
Name = "Missing T4 Common Fish", Name = "Missing T4 Common Fish",
Emote = "<:missingLeg:682586847830081551>", Emote = "<:missingLeg:682586847830081551>",
Rarity = FishRarity.T4Common Rarity = FishRarity.Common,
Tier = FishTier.T4
} }
}; };

Loading…
Cancel
Save