small edits

also minor improvements to fish stuff and commented bulksell because I accidentally pushed it as an incomplete thing
master
Lan 4 years ago
parent 519caa9430
commit 8b41386d07
  1. 6
      Kehyeedra3/Commands/Economy.cs
  2. 302
      Kehyeedra3/Commands/Interactive.cs
  3. 23
      Kehyeedra3/Commands/Stuff.cs
  4. 76
      Kehyeedra3/Services/Models/Fishing.cs

@ -231,9 +231,9 @@ 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 || guser.GeneralInventory != "{}")
{ {
items = guser.GetGenInve(); // items = guser.GetGenInve();
int[] subtract = { 0 }; int[] subtract = { 0 };
subtract[0] = -1; subtract[0] = -1;
if (items.TryGetValue(Items.SpecialBait, out int[] SpecB)) if (items.TryGetValue(Items.SpecialBait, out int[] SpecB))
@ -289,7 +289,7 @@ namespace Kehyeedra3.Commands
int rari = SRandom.Next(0, 2001); int rari = SRandom.Next(0, 2001);
int weigh = SRandom.Next(10, 1501+prestige*500); int weigh = SRandom.Next(10, 1501+prestige*500);
int tierRoll = SRandom.Next(0, 20*rod+10*prestige+11); int tierRoll = SRandom.Next(0, 20*rod+10*prestige+11);
int dCatchRoll = SRandom.Next(0, 1000+prestige*20); int dCatchRoll = SRandom.Next(1, 1000)+prestige*20;
int dcatch = 1; int dcatch = 1;
int rarity; int rarity;

@ -880,157 +880,159 @@ 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. :[");
} }
}/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
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 2:
{
fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T2).ToList();
}
break;
case 3:
{
fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T3).ToList();
} }
break; /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
case 4: //else if (input == "bulksell")
{ //{
fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T4).ToList(); // int value = 0;
} // int count = 0;
break;
} // FishSize size;
rarfish = fishTiers.Where(f => (int)f.Rarity == (int)FishRarity.Rare).ToList(); // if (fuser.Inventory.Length < 3)
uncfish = fishTiers.Where(f => (int)f.Rarity == (int)FishRarity.Uncommon).ToList(); // {
comfish = fishTiers.Where(f => (int)f.Rarity == (int)FishRarity.Common).ToList(); // await Context.Channel.SendMessageAsync($"Your inventory is empty. Try fishing more.");
} // return;
else if (tier < 1 || tier > 4) // }
{
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nTier not available."); // await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nSpecify the tier.\n");
return; // var inp = await NextMessageAsync();
} // int tier = int.Parse(inp.Content);
foreach (var f in fishinv)
{ // if (tier > 0 && tier < 5)
int[] amounts; // {
if (!fishinv.TryGetValue(f.Key, out amounts)) // switch (tier)
{ // {
amounts = new int[] { 0, 0, 0 }; // case 1:
fishinv.Add(f.Key, amounts); // {
} // fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T1).ToList();
// }
// break;
fish = fishes.FirstOrDefault(i => i.Id == f.Key); // case 2:
if (fish.Rarity != FishRarity.Legendary) // {
{ // fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T2).ToList();
count += f.Value[0] + f.Value[1] + f.Value[2]; // }
// break;
switch (fish.Rarity) //small // case 3:
{ // {
case FishRarity.Common: // fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T3).ToList();
{ // }
value += (int)fish.Tier * 1 * 1; // break;
} // case 4:
break; // {
case FishRarity.Uncommon: // fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T4).ToList();
{ // }
value += (int)fish.Tier * 1 * 3; // break;
} // }
break; // rarfish = fishTiers.Where(f => (int)f.Rarity == (int)FishRarity.Rare).ToList();
case FishRarity.Rare: // uncfish = fishTiers.Where(f => (int)f.Rarity == (int)FishRarity.Uncommon).ToList();
{ // comfish = fishTiers.Where(f => (int)f.Rarity == (int)FishRarity.Common).ToList();
value += (int)fish.Tier * 1 * 6; // }
} // else if (tier < 1 || tier > 4)
break; // {
} // await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nTier not available.");
//// // return;
switch (fish.Rarity) //med // }
{ // foreach (var f in fishinv)
case FishRarity.Common: // {
{ // int[] amounts;
value += (int)fish.Tier * 2 * 1; // if (!fishinv.TryGetValue(f.Key, out amounts))
} // {
break; // amounts = new int[] { 0, 0, 0 };
case FishRarity.Uncommon: // fishinv.Add(f.Key, amounts);
{ // }
value += (int)fish.Tier * 2 * 3;
}
break; // fish = fishes.FirstOrDefault(i => i.Id == f.Key);
case FishRarity.Rare: // if (fish.Rarity != FishRarity.Legendary)
{ // {
value += (int)fish.Tier * 2 * 6; // count += f.Value[0] + f.Value[1] + f.Value[2];
}
break; // switch (fish.Rarity) //small
} // {
//// // case FishRarity.Common:
switch (fish.Rarity) //large // {
{ // value += (int)fish.Tier * 1 * 1;
case FishRarity.Common: // }
{ // break;
value += (int)fish.Tier * 3 * 1; // case FishRarity.Uncommon:
} // {
break; // value += (int)fish.Tier * 1 * 3;
case FishRarity.Uncommon: // }
{ // break;
value += (int)fish.Tier * 3 * 3; // case FishRarity.Rare:
} // {
break; // value += (int)fish.Tier * 1 * 6;
case FishRarity.Rare: // }
{ // break;
value += (int)fish.Tier * 3 * 6; // }
} // ////
break; // switch (fish.Rarity) //med
} // {
// case FishRarity.Common:
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(); // value += (int)fish.Tier * 2 * 1;
if (inp.Content.ToLowerInvariant() == "ok") // }
{ // break;
// case FishRarity.Uncommon:
fuser.SetInventory(fishinv); // {
// value += (int)fish.Tier * 2 * 3;
if (!user.GrantMoney(Database.Users.FirstOrDefault(x => x.Id == 0), value)) // }
{ // break;
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nBank has no money, buy more bait."); // case FishRarity.Rare:
return; // {
} // value += (int)fish.Tier * 2 * 6;
await Database.SaveChangesAsync(); // }
// break;
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nThanks, seaman, enjoy your moolah."); // }
// ////
} // switch (fish.Rarity) //large
else // {
{ // case FishRarity.Common:
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nI guess I'm starving tonight. :["); // {
} // value += (int)fish.Tier * 3 * 1;
} // }
// break;
// case FishRarity.Uncommon:
} // {
// value += (int)fish.Tier * 3 * 3;
// }
}/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // break;
// case FishRarity.Rare:
// {
// value += (int)fish.Tier * 3 * 6;
// }
// break;
// }
// 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")
// {
// 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. :[");
// }
// }
// }
//}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
} }
} }

@ -35,7 +35,7 @@ namespace Kehyeedra3.Commands
} }
} }
[Command("ratetrap"), Summary("Rates your or another person's trap potential as a percentage")] [Command("ratenuts"), Summary("Rates your or another person's sack.")]
public async Task RateTrap( string name = null) public async Task RateTrap( string name = null)
{ {
if (name == null) if (name == null)
@ -45,12 +45,12 @@ namespace Kehyeedra3.Commands
int trapRating0 = rando.Next(0, 101); int trapRating0 = rando.Next(0, 101);
if (trapRating0 == 100) if (trapRating0 == 100)
{ {
int trapRating1 = rando1.Next(0, 1001); int trapRating1 = rando1.Next(0, 10001);
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nI'd say right now you're {trapRating1}% passable"); await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nCongrats king, your boss nuts weigh {trapRating1}g.");
} }
else else
{ {
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nI'd say right now you're {trapRating0}% passable"); await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nYour nuts weigh {trapRating0}g.");
} }
} }
else else
@ -60,12 +60,12 @@ namespace Kehyeedra3.Commands
int trapRating0 = rando.Next(0, 101); int trapRating0 = rando.Next(0, 101);
if (trapRating0 == 100) if (trapRating0 == 100)
{ {
int trapRating1 = rando1.Next(0, 1001); int trapRating1 = rando1.Next(100, 10001);
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nI'd say right now {name} is {trapRating1}% passable"); await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nCongrats {name}, your boss nuts weigh {trapRating1}g.");
} }
else else
{ {
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nI'd say right now {name} is {trapRating0}% passable"); await Context.Channel.SendMessageAsync($"{Context.User.Mention}\n{name}'s nuts weigh {trapRating0}g.");
} }
} }
@ -98,12 +98,11 @@ namespace Kehyeedra3.Commands
string result = new DataTable().Compute(input, null).ToString(); string result = new DataTable().Compute(input, null).ToString();
await Context.Channel.SendMessageAsync($"{Context.User.Mention} {input} = {result}"); await Context.Channel.SendMessageAsync($"{Context.User.Mention} {input} = {result}");
} }
[Command("roll"), Summary("Rolls dice. Eg. 'roll d20'")] [Command("roll"), Summary("Rolls dice. Eg. 'roll 20'")]
public async Task RollDice([Remainder] string input) public async Task RollDice([Remainder] int input)
{ {
int dinput = int.Parse(input.Substring(input.IndexOf("d")).Replace("d", "")); int output = SRandom.Next(input+1);
int output = SRandom.Next(dinput); await Context.Channel.SendMessageAsync($"{Context.User.Mention}\n{output}");
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\n{output+1}");
} }
[Command("remind"), Summary("Reminds you in a given time. (days, hours, minutes) Eg. 'remind 1 2 3 wash hands' would remind you in 1 day, 2 hours, 3 minutes to wash your hands")] [Command("remind"), Summary("Reminds you in a given time. (days, hours, minutes) Eg. 'remind 1 2 3 wash hands' would remind you in 1 day, 2 hours, 3 minutes to wash your hands")]
public async Task Reminder(ulong d, ulong h, ulong m, [Remainder] string r = null) public async Task Reminder(ulong d, ulong h, ulong m, [Remainder] string r = null)

@ -230,7 +230,7 @@ namespace Kehyeedra3.Services.Models
new Fish() //// Tier 2 new Fish() //// Tier 2
{ {
Id = FishSpecies.T2Leg, Id = FishSpecies.Hypnofish,
Name = "Hypnofish", Name = "Hypnofish",
Emote = "<:paska:786244602440450109><:hypnoosi:786244623478947841>", Emote = "<:paska:786244602440450109><:hypnoosi:786244623478947841>",
Rarity = FishRarity.Legendary, Rarity = FishRarity.Legendary,
@ -238,7 +238,7 @@ namespace Kehyeedra3.Services.Models
}, },
new Fish() new Fish()
{ {
Id = FishSpecies.T2Swolefish, Id = FishSpecies.Swolefish,
Name = "Pumped Up Swolefish", Name = "Pumped Up Swolefish",
Emote = "<:missingLeg:682586847830081551>", Emote = "<:missingLeg:682586847830081551>",
Rarity = FishRarity.Rare, Rarity = FishRarity.Rare,
@ -246,7 +246,7 @@ namespace Kehyeedra3.Services.Models
}, },
new Fish() new Fish()
{ {
Id = FishSpecies.T2Gunfish, Id = FishSpecies.Gunfish,
Name = "Gunfish", Name = "Gunfish",
Emote = "<:gunfishleft:793492588799590460><:gunfishright:793492625277714442>", Emote = "<:gunfishleft:793492588799590460><:gunfishright:793492625277714442>",
Rarity = FishRarity.Uncommon, Rarity = FishRarity.Uncommon,
@ -254,16 +254,24 @@ namespace Kehyeedra3.Services.Models
}, },
new Fish() new Fish()
{ {
Id = FishSpecies.T2Com, Id = FishSpecies.Rockfish,
Name = "Rockfish", Name = "Rockfish",
Emote = "<:missingLeg:682586847830081551>", Emote = "<:missingLeg:682586847830081551>",
Rarity = FishRarity.Common, Rarity = FishRarity.Common,
Tier = FishTier.T2 Tier = FishTier.T2
}, },
new Fish()
{
Id = FishSpecies.Fishlet,
Name = "Fishlet",
Emote = "<:missingLeg:682586847830081551>",
Rarity = FishRarity.Common,
Tier = FishTier.T2
},
new Fish() //// Tier 3 new Fish() //// Tier 3
{ {
Id = FishSpecies.T3Doomfish, Id = FishSpecies.SpecDoomfish,
Name = "Spectral Doomfish", Name = "Spectral Doomfish",
Emote = "<:missingLeg:682586847830081551>", Emote = "<:missingLeg:682586847830081551>",
Rarity = FishRarity.Legendary, Rarity = FishRarity.Legendary,
@ -271,7 +279,7 @@ namespace Kehyeedra3.Services.Models
}, },
new Fish() new Fish()
{ {
Id = FishSpecies.T3Crab, Id = FishSpecies.RevCrab,
Name = "Revenant Crab", Name = "Revenant Crab",
Emote = "<:missingLeg:682586847830081551>", Emote = "<:missingLeg:682586847830081551>",
Rarity = FishRarity.Rare, Rarity = FishRarity.Rare,
@ -279,7 +287,7 @@ namespace Kehyeedra3.Services.Models
}, },
new Fish() new Fish()
{ {
Id = FishSpecies.T3Flameworm, Id = FishSpecies.SpecFlameworm,
Name = "Spectral Flameworm", Name = "Spectral Flameworm",
Emote = "<:missingLeg:682586847830081551>", Emote = "<:missingLeg:682586847830081551>",
Rarity = FishRarity.Uncommon, Rarity = FishRarity.Uncommon,
@ -287,45 +295,46 @@ namespace Kehyeedra3.Services.Models
}, },
new Fish() new Fish()
{ {
Id = FishSpecies.T3Com, Id = FishSpecies.SpecShrimp,
Name = "Spectral Shrimp", Name = "Spectral Shrimp",
Emote = "<:missingLeg:682586847830081551>", Emote = "<:missingLeg:682586847830081551>",
Rarity = FishRarity.Common, Rarity = FishRarity.Common,
Tier = FishTier.T3 Tier = FishTier.T3
}, },
new Fish() //// Tier 4
new Fish()
{ {
Id = FishSpecies.T4Leg, Id = FishSpecies.T4PH1,
Name = "Missing T4 Legendary Fish", Name = "Placeholder",
Emote = "<:missingLeg:682586847830081551>", Emote = "<:missingLeg:682586847830081551>",
Rarity = FishRarity.Legendary, Rarity = FishRarity.Legendary,
Tier = FishTier.T4 Tier = FishTier.T4
}, },
new Fish() new Fish()
{ {
Id = FishSpecies.T4Rar, Id = FishSpecies.T4PH2,
Name = "Missing T4 Rare Fish", Name = "Placeholder",
Emote = "<:missingLeg:682586847830081551>", Emote = "<:missingLeg:682586847830081551>",
Rarity = FishRarity.Rare, Rarity = FishRarity.Rare,
Tier = FishTier.T4 Tier = FishTier.T4
}, },
new Fish() new Fish()
{ {
Id = FishSpecies.T4Unc, Id = FishSpecies.T4PH3,
Name = "Missing T4 Uncommon Fish", Name = "Placeholder",
Emote = "<:missingLeg:682586847830081551>", Emote = "<:missingLeg:682586847830081551>",
Rarity = FishRarity.Uncommon, Rarity = FishRarity.Uncommon,
Tier = FishTier.T4 Tier = FishTier.T4
}, },
new Fish() new Fish()
{ {
Id = FishSpecies.T4Com, Id = FishSpecies.T4PH4,
Name = "Missing T4 Common Fish", Name = "Placeholder",
Emote = "<:missingLeg:682586847830081551>", Emote = "<:missingLeg:682586847830081551>",
Rarity = FishRarity.Common, Rarity = FishRarity.Common,
Tier = FishTier.T4 Tier = FishTier.T4
} },
}; };
} }
@ -359,29 +368,28 @@ namespace Kehyeedra3.Services.Models
Carp = 18, Carp = 18,
Megacrab = 19, Megacrab = 19,
//T2 Legendary //T2 Legendary
T2Leg = 20, Hypnofish = 20,
//T2 Rare //T2 Rare
T2Swolefish = 21, Swolefish = 21,
//T2 Uncommon //T2 Uncommon
T2Gunfish = 22, Gunfish = 22,
//T2 Common //T2 Common
T2Com = 23, Rockfish = 23,
Fishlet = 24,
//T3 Legendary //T3 Legendary
T3Doomfish = 24, SpecDoomfish = 25,
//T3 Rare //T3 Rare
T3Crab = 25, RevCrab = 26,
//T3 Uncommon //T3 Uncommon
T3Flameworm = 26, SpecFlameworm = 27,
//T3 Common //T3 Common
T3Com = 27, SpecShrimp = 28,
//T4 Legendary //T4
T4Leg = 28, T4PH1 = 29,
//T4 Rare T4PH2 = 30,
T4Rar = 29, T4PH3 = 31,
//T4 Uncommon T4PH4 = 32,
T4Unc = 30,
//T4 Common
T4Com = 31
} }
public class FishingInventorySlot public class FishingInventorySlot
{ {

Loading…
Cancel
Save