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. 231
      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))
{
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;
}
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))
{
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;
}
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))
{
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;
}
@ -193,12 +193,12 @@ namespace Kehyeedra3.Commands
public async Task FishCommand()
{
ulong time = ulong.Parse(DateTime.Now.ToString("yyyyMMddHHmm"));
ulong totalXp;
ulong xp;
ulong level;
ulong lvlXp;
int prestige;
int rod;
ulong totalXp = 0;
ulong xp = 0;
ulong level = 0;
ulong lvlXp = 0;
int prestige = 0;
int rod = 0;
int BigBait = 0;
int RareBait = 0;
int SpecialBait = 0;
@ -350,132 +350,159 @@ namespace Kehyeedra3.Commands
}
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)
{
fishRarities = fishTiers.Where(f => (int)f.Rarity == (int)FishRarity.Legendary).ToList();
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();
fish = possibleFishes[SRandom.Next(possibleFishes.Count)];
xp = 7777;
case FishTier.T1:
{
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();
fish = possibleFishes[SRandom.Next(possibleFishes.Count)];
xp = 25;
xp = 15;
}
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;
}
else if (rod >= 1 && tierRoll > 20)
break;
case FishTier.T4:
{
List<Fish> possibleFishes = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T2Legendary).ToList();
fish = possibleFishes[SRandom.Next(possibleFishes.Count)];
xp = 15;
xp = 25;
}
else
{
List<Fish> possibleFishes = fishes.Where(f => (int)f.Rarity == (int)FishRarity.Legendary).ToList();
fish = possibleFishes[SRandom.Next(possibleFishes.Count)];
xp = 10;
break;
}
if (rarity == 777 || rarity == 2777)
{
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)
{
rarity = SRandom.Next(1700, 2801);
if (bRar || bSpe)
fishRarities = fishTiers.Where(f => (int)f.Rarity == (int)FishRarity.Uncommon).ToList();
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();
fish = possibleFishes[SRandom.Next(possibleFishes.Count)];
xp = 20;
xp = 13;
}
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;
}
else if (rod >= 1 && tierRoll > 20)
break;
case FishTier.T4:
{
List<Fish> possibleFishes = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T2Uncommon).ToList();
fish = possibleFishes[SRandom.Next(possibleFishes.Count)];
xp = 13;
xp = 20;
}
else
break;
}
rarity = SRandom.Next(1700, 2801);
if (bRar || bSpe)
{
List<Fish> possibleFishes = fishes.Where(f => (int)f.Rarity == (int)FishRarity.Uncommon).ToList();
fish = possibleFishes[SRandom.Next(possibleFishes.Count)];
xp = 10;
rarity += 200;
}
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();
fish = possibleFishes[SRandom.Next(possibleFishes.Count)];
xp = 35;
}
else if (rod >= 2 && tierRoll > 40)
case FishTier.T1:
{
List<Fish> possibleFishes = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T3Rare).ToList();
fish = possibleFishes[SRandom.Next(possibleFishes.Count)];
xp = 30;
xp = 20;
}
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;
}
else
break;
case FishTier.T3:
{
List<Fish> possibleFishes = fishes.Where(f => (int)f.Rarity == (int)FishRarity.Rare).ToList();
fish = possibleFishes[SRandom.Next(possibleFishes.Count)];
xp = 20;
xp = 30;
}
break;
case FishTier.T4:
{
xp = 35;
}
break;
}
}
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();
fish = possibleFishes[SRandom.Next(possibleFishes.Count)];
xp = 10;
case FishTier.T1:
{
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();
fish = possibleFishes[SRandom.Next(possibleFishes.Count)];
xp = 8;
xp = 7;
}
else if (rod >= 1 && tierRoll > 20)
break;
case FishTier.T3:
{
List<Fish> possibleFishes = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T2Common).ToList();
fish = possibleFishes[SRandom.Next(possibleFishes.Count)];
xp = 6;
xp = 9;
}
else
break;
case FishTier.T4:
{
List<Fish> possibleFishes = fishes.Where(f => (int)f.Rarity == (int)FishRarity.Common).ToList();
fish = possibleFishes[SRandom.Next(possibleFishes.Count)];
xp = 5;
xp = 11;
}
break;
}
}
}
fish = fishRarities[SRandom.Next(fishRarities.Count)];
FishSize size;
@ -484,19 +511,19 @@ namespace Kehyeedra3.Commands
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);
}
if (bBig)
{
weight += 1000;
}
if (fish.Rarity == FishRarity.Unreasonable)
{
weight = SRandom.Next(4000, 6000);
}
if (bBig)
{
weight += 1000;
}
if (weight >= 1000)
{
@ -513,7 +540,7 @@ namespace Kehyeedra3.Commands
double w = Convert.ToDouble(weight);
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)
{
@ -901,39 +928,30 @@ namespace Kehyeedra3.Commands
Dictionary<FishSpecies, int> large = new Dictionary<FishSpecies, int>();
List<Fish> fishes = Fishing.GetFishList();
List<Fish> fishTiers = Fishing.GetFishList();
List<Fish> unrfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.Unreasonable).ToList();
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)
if (tier >= 1 && tier < 5)
{
switch (tier)
{
case 1:
{
fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T1).ToList();
}
break;
case 2:
{
legfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T2Legendary).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();
fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T2).ToList();
}
break;
case 3:
{
legfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T3Legendary).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();
fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T3).ToList();
}
break;
case 4:
{
legfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T4Legendary).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();
fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T4).ToList();
}
break;
}
@ -944,6 +962,13 @@ namespace Kehyeedra3.Commands
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 legendary = "";
string rare = "";

@ -436,7 +436,7 @@ namespace Kehyeedra3.Commands
{
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;
}
@ -575,9 +575,14 @@ namespace Kehyeedra3.Commands
Dictionary<FishSpecies, int[]> fishinv = new Dictionary<FishSpecies, int[]>();
List<User.Item> itemlist = User.ListItems();
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;
Fish fish;
List<Fish> fishTiers = fishes.ToList();
var fuser = Database.Fishing.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)))
{
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;
}
user.SetGenInve(items);
@ -685,39 +690,36 @@ namespace Kehyeedra3.Commands
var inp = await NextMessageAsync();
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();
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)
if (tier > 0 && tier < 5)
{
switch (tier)
{
case 1:
{
fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T1).ToList();
}
break;
case 2:
{
legfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T2Legendary).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();
fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T2).ToList();
}
break;
case 3:
{
legfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T3Legendary).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();
fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T3).ToList();
}
break;
case 4:
{
legfish = fishes.Where(f => (int)f.Rarity == (int)FishRarity.T4Legendary).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();
fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T4).ToList();
}
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)
{
@ -820,112 +822,197 @@ namespace Kehyeedra3.Commands
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nYou don't have that many.\n");
return;
}
siz += 1;
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;
case FishRarity.Rare:
{
value = 6 * (int)(size+1);
value = (int)fish.Tier * siz * 6;
}
break;
case FishRarity.Uncommon:
case FishRarity.Legendary:
{
value = 2 * (int)(size+1);
value = (int)fish.Tier * 100 + 600;
}
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;
case FishRarity.T2Legendary:
case 2:
{
value = 750;
fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T2).ToList();
}
break;
case FishRarity.T2Rare:
case 3:
{
value = 12 * (int)(size+1);
fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T3).ToList();
}
break;
case FishRarity.T2Uncommon:
case 4:
{
value = 4 * (int)(size+1);
fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T4).ToList();
}
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;
case FishRarity.T3Legendary:
case FishRarity.Uncommon:
{
value = 800;
value += (int)fish.Tier * 1 * 3;
}
break;
case FishRarity.T3Rare:
case FishRarity.Rare:
{
value = 18 * (int)(size+1);
value += (int)fish.Tier * 1 * 6;
}
break;
case FishRarity.T3Uncommon:
}
////
switch (fish.Rarity) //med
{
case FishRarity.Common:
{
value = 6 * (int)(size+1);
value += (int)fish.Tier * 2 * 1;
}
break;
case FishRarity.T3Common:
case FishRarity.Uncommon:
{
value = 3 * (int)(size+1);
value += (int)fish.Tier * 2 * 3;
}
break;
case FishRarity.T4Legendary:
case FishRarity.Rare:
{
value = 850;
value += (int)fish.Tier * 2 * 6;
}
break;
case FishRarity.T4Rare:
}
////
switch (fish.Rarity) //large
{
value = 32 * (int)(size+1);
case FishRarity.Common:
{
value += (int)fish.Tier * 3 * 1;
}
break;
case FishRarity.T4Uncommon:
case FishRarity.Uncommon:
{
value = 8 * (int)(size+1);
value += (int)fish.Tier * 3 * 3;
}
break;
case FishRarity.T4Common:
case FishRarity.Rare:
{
value = 4 * (int)(size+1);
value += (int)fish.Tier * 3 * 6;
}
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();
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);
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;
}
await Database.SaveChangesAsync();
@ -938,6 +1025,12 @@ namespace Kehyeedra3.Commands
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nI guess I'm starving tonight. :[");
}
}
}
}///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
}
}

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

Loading…
Cancel
Save