don't even remember what I changed

but there's a lot of stuff, like fishing images instead of just text, and mining levels
This commit is contained in:
Lan
2021-06-15 22:51:10 +03:00
parent 105d6c82b5
commit 75095f36a5
22 changed files with 1842 additions and 571 deletions

View File

@@ -6,6 +6,7 @@ using Kehyeedra3.Preconditions;
using Kehyeedra3.Services.Models;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Net;
@@ -379,13 +380,10 @@ namespace Kehyeedra3.Commands
{
string path = Path.Combine(Environment.CurrentDirectory, "btextures");
string avatar = "";
string rod = "";
string tier = "";
ulong lvl = 0;
ulong xp = 0;
int total = 0;
int minc = 0;
int maxc = 0;
Fishing fuser;
User user;
Dictionary<FishSpecies, int[]> inv = new Dictionary<FishSpecies, int[]>();
@@ -397,7 +395,6 @@ namespace Kehyeedra3.Commands
}
if (fuser == null || user == null)
{
rod = "rod1.png";
tier = "tier1.png";
}
else
@@ -409,25 +406,21 @@ namespace Kehyeedra3.Commands
{
case 0:
{
rod = "rod1.png";
tier = "tier1.png";
}
break;
case 1:
{
rod = "rod2.png";
tier = "tier2.png";
}
break;
case 2:
{
rod = "rod3.png";
tier = "tier3.png";
}
break;
case 3:
{
rod = "rod4.png";
tier = "tier4.png";
}
break;
@@ -478,14 +471,6 @@ namespace Kehyeedra3.Commands
card.Composite(frame, 5, 5, CompositeOperator.Over);
}
//using (MagickImage frame = new MagickImage(Path.Combine(path, rod), new MagickReadSettings //rod
//{
// BackgroundColor = MagickColors.None
//}))
//{
// card.Composite(frame, 79, 79, CompositeOperator.Over);
//}
using (MagickImage frame = new MagickImage(Path.Combine(path, "frame.png"), new MagickReadSettings //frame
{
BackgroundColor = MagickColors.None
@@ -511,10 +496,7 @@ namespace Kehyeedra3.Commands
using (MagickImage stats = new MagickImage($"label:" +
$"\nFishing Lv : {lvl}" +
$"\nXP : {xp}" +
$"\nMax catch : {maxc}" +
$"\nMin catch : {minc}" +
$"\nTotal Fish : {total}", new MagickReadSettings
$"\nXP : {xp}", new MagickReadSettings
{
BackgroundColor = MagickColors.None,
FillColor = MagickColors.White,
@@ -528,9 +510,38 @@ namespace Kehyeedra3.Commands
outputStream.Position = 0;
await Context.Channel.SendFileAsync(outputStream, "profile.png");
}
}
[RequireRolePrecondition(AccessLevel.ServerAdmin)]
[Command("fc")]
public async Task MakeFishCard(string fishName = null)
{
List<Fish> fishes = Fishing.GetFishList();
Fish fish;
if (string.IsNullOrEmpty(fishName))
{
fish = fishes[SRandom.Next(fishes.Count)];
}
else
{
fish = fishes.FirstOrDefault(f => f.Name.ToLowerInvariant() == fishName.ToLowerInvariant());
if (fish == null)
{
await Context.Channel.SendMessageAsync("No fish with that name retarb, chenk input and try again, or cry to mommy");
return;
}
}
var (cardCollection, outFormatEnum, outFormat) = await Helpers.MakeFishCardAsync(fish, 0, 0, 0, "", 0, 0, 0);
MemoryStream outputStream = new MemoryStream();
cardCollection.Write(outputStream, outFormatEnum);
outputStream.Position = 0;
await Context.Channel.SendFileAsync(outputStream, $"card.{outFormat}");
}
}
}

View File

@@ -12,6 +12,7 @@ using ImageMagick;
using System.Threading.Channels;
using System.Threading.Tasks;
using Kehyeedra3.Preconditions;
using System.IO;
namespace Kehyeedra3.Commands
{
@@ -98,7 +99,7 @@ namespace Kehyeedra3.Commands
readonly string n = "<:no:677091514249248778>";
readonly string ye = "<:ya:677179974154715146>";
[Command("mine"), Ratelimit(6, 2, Measure.Minutes), Summary("Mines %coins.")]
[Command("mine"), Ratelimit(10, 2, Measure.Minutes), Summary("Mines %coins.")]
public async Task Mine()
{
ulong time = ulong.Parse(DateTime.Now.ToString("yyyyMMddHHmm"));
@@ -106,73 +107,92 @@ namespace Kehyeedra3.Commands
using (var Database = new ApplicationDbContextFactory().CreateDbContext())
{
var user = Database.Users.FirstOrDefault(x => x.Id == Context.User.Id);
lastmine = user.LastMine;
user.LastMine = time;
user.Username = Context.User.Username;
await Database.SaveChangesAsync();
}
if (lastmine < time)
{
int res1 = SRandom.Next(0, 101);
int res2 = SRandom.Next(0, 101);
int res3 = SRandom.Next(0, 101);
long end = 0;
string marks = $"{n}{n}{n}";
int num = SRandom.Next(ores.Length);
int numd = SRandom.Next(discards.Length);
string ore = ores[num];
string discard = discards[numd];
if (res1 > 20)
var muser = Database.Mining.FirstOrDefault(x => x.Id == Context.User.Id);
if (muser == null)
{
end = 1;
marks = $"{o}{n}{n}";
if (res2 > 50)
muser = new Mining
{
Id = Context.User.Id
};
Database.Mining.Add(muser);
}
lastmine = muser.LastMine;
muser.LastMine = time;
user.Username = Context.User.Username;
if (lastmine < time)
{
int res = SRandom.Next((int)muser.Lvl, 101);
long end = 0;
string marks = $"{n}{n}{n}";
int num = SRandom.Next(ores.Length);
int numd = SRandom.Next(discards.Length);
string bns = "";
string lucky = "";
string ore = ores[num];
string discard = discards[numd];
if (res >= 20)
{
res += SRandom.Next(0, 101);
end = 2;
marks = $"{o}{o}{n}";
if (res3 > 80)
marks = $"{o}{n}{n}";
if (res >= 100)
{
marks = $"{o}{o}{o}";
string bonus = "";
int res4 = SRandom.Next(0, 6) * 2;
int res5 = res4 / 2;
end = (long)res4 + 3;
for (int i = 0; i < 5; i++)
res += SRandom.Next(0, 101);
end += 2;
marks = $"{o}{o}{n}";
if (res >= 200)
{
if (i < res5)
res = SRandom.Next(0, 6) * 4;
marks = $"{o}{o}{o}";
string bonus = "";
end += (long)res + 3;
for (int i = 0; i < 5; i++)
{
bonus += $"{ye}";
if (i < res / 2)
{
bonus += $"{ye}";
}
else
{
bonus += $"{n}";
}
}
bns = $" **+** {bonus}";
if (res == 0)
{
lucky = $" **Lucky strike!** Bonus: {ore}";
}
else
{
bonus += $"{n}";
lucky = $" **Lucky strike!** Bonus: {res},";
}
}
if (res4 == 0)
{
await Context.Channel.SendMessageAsync($"{marks} **+** {bonus}\n{Context.User.Mention} **Lucky strike!** Bonus: {ore} You earned {end.ToYeedraDisplay()}%");
}
else
{
await Context.Channel.SendMessageAsync($"{marks} **+** {bonus}\n{Context.User.Mention} **Lucky strike!** Bonus: {res4}, You earned {end.ToYeedraDisplay()}%");
}
}
}
}
if (end <= 0)
{
await Context.Channel.SendMessageAsync($"{marks}\n{Context.User.Mention} You have found {ore} {discard}.");
return;
}
else if(end < 3)
{
await Context.Channel.SendMessageAsync($"{marks}\n{Context.User.Mention} You found {end.ToYeedraDisplay()}% while mining");
}
using (var Database = new ApplicationDbContextFactory().CreateDbContext())
{
var user = Database.Users.FirstOrDefault(x => x.Id == Context.User.Id);
string levelup = $"\nYou gain **{end+1}**xp.\n";
muser.TXp += (ulong)end+1;
if (muser.TXp >= muser.Xp)
{
muser.Lvl += 1;
ulong leXp = 50;
for (ulong i = 0; i < muser.Lvl; i++)
{
if (i <= muser.Lvl)
{
leXp += Convert.ToUInt64(Math.Round((leXp * 0.05d + 50d), 0, MidpointRounding.ToEven));
}
}
muser.Xp = leXp;
levelup += $"You leveled up. You are now **Lvl {muser.Lvl}**";
}
else
{
levelup += $"You need **{muser.Xp - muser.TXp}**xp more to reach Lvl **{muser.Lvl+1}**";
}
if (!user.GrantMoney(Database.Users.FirstOrDefault(x => x.Id == 0), end))
{
@@ -181,16 +201,25 @@ namespace Kehyeedra3.Commands
}
await Database.SaveChangesAsync();
if (end <= 0)
{
await Context.Channel.SendMessageAsync($"{marks}\n{Context.User.Mention} You have found {ore} {discard}.{levelup}");
}
else
{
await Context.Channel.SendMessageAsync($"{marks}{bns}\n{Context.User.Mention}{lucky}\nYou earned **{end.ToYeedraDisplay()}**%{levelup}");
}
}
else
{
await Context.Channel.SendMessageAsync($"{Context.User.Mention} wait 1 minute ok next minute yeah? yeah buddy?");
}
}
else
{
await Context.Channel.SendMessageAsync($"{Context.User.Mention} wait 1 minute ok next minute yeah? yeah buddy?");
}
}
[Command("fish"), Ratelimit(6, 2, Measure.Minutes), Summary("Cast your line into the abyss, see if something bites?")]
public async Task FishCommand()
public async Task FishCommand(string nocard = "")
{
ulong time = ulong.Parse(DateTime.Now.ToString("yyyyMMddHHmm"));
ulong totalXp = 0;
@@ -513,7 +542,14 @@ namespace Kehyeedra3.Commands
if (weight >= (1000 - Convert.ToInt32(level * 2))) //second weight roll
{
weight = SRandom.Next(100, 2001) + Convert.ToInt32(level * 5 + (Convert.ToUInt64(prestige * 500)));
if (level < 100)
{
weight = SRandom.Next(300, 2001 + prestige * 500) + Convert.ToInt32(level * 5);
}
else
{
weight = SRandom.Next(300, 2001 + prestige * 500) + 500;
}
}
if (fish.Rarity == FishRarity.Legendary)
@@ -547,9 +583,9 @@ namespace Kehyeedra3.Commands
if (fish.Rarity == FishRarity.Legendary)
{
if (xp < 100)
if (xp < 50+50*(ulong)fish.Tier)
{
xp = 100;
xp = 50+50*(ulong)fish.Tier;
}
}
}
@@ -597,7 +633,23 @@ namespace Kehyeedra3.Commands
toNextLvl = user.Xp - user.TXp;
int times = 0;
if (user.TXp > 50 && user.FXp == 0)
{
lvlXp = 50;
for (ulong i = 0; i < user.Lvl; i++)
{
if (i <= user.Lvl)
{
lvlXp += Convert.ToUInt64(Math.Round((lvlXp * 0.05d + 50d), 0, MidpointRounding.ToEven));
}
if (i == user.Lvl - 2)
{
user.FXp = lvlXp;
}
}
}
if (user.TXp >= user.Xp)
{
ulong leXp = 50;
@@ -620,12 +672,19 @@ namespace Kehyeedra3.Commands
user.Lvl += 1;
times += 1;
lvlXp = 50;
for (ulong i = 0; i < user.Lvl; i++)
{
if (i <= user.Lvl)
{
lvlXp += Convert.ToUInt64(Math.Round((lvlXp * 0.05d + 50d), 0, MidpointRounding.ToEven));
}
if (i == user.Lvl - 2)
{
user.FXp = lvlXp;
}
}
user.Xp = lvlXp;
}
@@ -633,54 +692,73 @@ namespace Kehyeedra3.Commands
level = user.Lvl;
if (leTrig)
{
lvlUp = $"**Your level was recalculated to match your xp.** You are now **Level {level}**";
lvlUp = $"**Your level was recalculated\n to match your xp.** \nYou are now **Level {level}**";
}
else if (times > 1)
{
lvlUp = $"**You leveled up {times} times!** You are now **Level {level}.**";
lvlUp = $"**You leveled up {times} times!** \nYou are now **Level {level}.**";
}
else
{
lvlUp = $"**You leveled up!** You are now **Level {level}**";
lvlUp = $"**You leveled up!** \nYou are now **Level {level}**";
}
}
else
{
lvlUp = $"You need **{toNextLvl}**xp more to reach Level **{level + 1}**";
lvlUp = $"You need **{toNextLvl}**xp to reach Level **{level + 1}**";
}
await Database.SaveChangesAsync().ConfigureAwait(false);
}
string baited = "";
string baiRa = "";
string baiBi = "";
string baiLe = "";
if (bRar || bBig)
{
baited += "\nYou used bait. ";
if (bRar)
string baited = "";
string baiRa = "";
string baiBi = "";
string baiLe = "";
if (bRar || bBig)
{
baiRa = "(+)";
baited += "\nYou used bait. ";
if (bRar)
{
baiRa = "(+)";
}
if (bBig)
{
baiBi = "(+)";
}
}
if (bBig)
if (bLet)
{
baiBi = "(+)";
baited += "\nYou ate lettuce. ";
baiLe = "(+10%)";
}
if (nocard.ToLowerInvariant() != "nocard")
{
var (cardCollection, outFormatEnum, outFormat) = await Helpers.MakeFishCardAsync(fish, user.TXp, user.FXp, user.Xp, lvlUp, weight, xp, dcatch);
MemoryStream outputStream = new MemoryStream();
cardCollection.Write(outputStream, outFormatEnum);
outputStream.Position = 0;
await Context.Channel.SendFileAsync(outputStream, $"fish.{outFormat}");
}
else
{
if (dcatch == 1)
{
await Context.Channel.SendMessageAsync($"{Context.User.Mention}{baited}\n{fish.Emote} You have caught a {weight / 100d}kg{baiBi} **{fish.Name}**, rarity: {fish.Rarity}{baiRa}\nYou gain **{xp}**xp{baiLe}.\n{lvlUp}");
}
else
{
await Context.Channel.SendMessageAsync($"{Context.User.Mention}{baited}\n{fish.Emote} You have caught **{dcatch}** {weight / 100d}kg{baiBi} **{fish.Name}**, rarity: {fish.Rarity}{baiRa}\nYou gain **{xp}**xp{baiLe}.\n{lvlUp}");
}
}
}
if (bLet)
{
baited += "\nYou ate lettuce. ";
baiLe = "(+10%)";
}
if (dcatch == 1)
{
await Context.Channel.SendMessageAsync($"{Context.User.Mention}{baited}\n{fish.Emote} You have caught a {weight / 100d}kg{baiBi} **{fish.Name}**, rarity: {fish.Rarity}{baiRa}\nYou gain **{xp}**xp{baiLe}.\n{lvlUp}");
}
else
{
await Context.Channel.SendMessageAsync($"{Context.User.Mention}{baited}\n{fish.Emote} You have caught **{dcatch}** {weight / 100d}kg{baiBi} **{fish.Name}**, rarity: {fish.Rarity}{baiRa}\nYou gain **{xp}**xp{baiLe}.\n{lvlUp}");
}
}
}
else
{
@@ -1498,6 +1576,7 @@ namespace Kehyeedra3.Commands
{
var user = database.Fishing.FirstOrDefault(x => x.Id == Context.User.Id);
var muser = database.Users.FirstOrDefault(x => x.Id == Context.User.Id);
var minuser = database.Mining.FirstOrDefault(x => x.Id == Context.User.Id);
string pres = "";
double cawe = 0;
if (user.Prestige == 1)
@@ -1515,12 +1594,13 @@ namespace Kehyeedra3.Commands
cawe = user.Lvl * 5d + 10d;
}
await Context.Channel.SendMessageAsync($"{Context.User.Mention}'s stats\nFishing level: **{user.Lvl}{pres}**\nMax catch weight: **{(user.Lvl * 5 + 2000d + user.Prestige*500d) / 100}kg**\nMin catch weight: **{cawe /100}kg**\n" +
$"Fishing xp: **{user.TXp}**\nTotal fish: **{scount + mcount + lcount}** *(Large: {lcount} Medium: {mcount} Small: {scount})*\nBalance: **{muser.Money.ToYeedraDisplay()}%**");
$"Fishing xp: **{user.TXp}**\nTotal fish: **{scount + mcount + lcount}** *(Large: {lcount} Medium: {mcount} Small: {scount})*\nMining level: **{minuser.Lvl}**\nMining xp: **{minuser.TXp}**\nBalance: **{muser.Money.ToYeedraDisplay()}%**");
}
else
{
var user = database.Fishing.FirstOrDefault(x => x.Id == otherUser.Id);
var muser = database.Users.FirstOrDefault(x => x.Id == otherUser.Id);
var minuser = database.Mining.FirstOrDefault(x => x.Id == otherUser.Id);
string pres = "";
double cawe = 0;
if (user.Prestige > 0)
@@ -1533,7 +1613,7 @@ namespace Kehyeedra3.Commands
cawe = user.Lvl * 5d + 10d;
}
await Context.Channel.SendMessageAsync($"{otherUser.Mention}'s stats\nFishing level: **{user.Lvl}{pres}**\nMax catch weight: **{(user.Lvl * 5 + 2000d + user.Prestige*500d) / 100}kg**\nMin catch weight: **{cawe / 100}kg**\n" +
$"Fishing xp: **{user.TXp}**\nTotal fish: **{scount + mcount + lcount}** *(Large: {lcount} Medium: {mcount} Small: {scount}*)\nBalance: **{muser.Money.ToYeedraDisplay()}%**");
$"Fishing xp: **{user.TXp}**\nTotal fish: **{scount + mcount + lcount}** *(Large: {lcount} Medium: {mcount} Small: {scount}*)\nMining level: **{minuser.Lvl}**\nMining xp: **{minuser.TXp}**\nBalance: **{muser.Money.ToYeedraDisplay()}%**");
}
}
}

View File

@@ -17,76 +17,6 @@ namespace Kehyeedra3.Commands
{
_service = service;
}
/*[Command("commands"), Alias("coomands")]
public async Task HelpAsync()
{
string debug = null;
string prefix = Configuration.Load().Prefix;
var builder = new EmbedBuilder()
{
Color = new Color(114, 137, 218),
Description = "These are the commands you can use"
};
foreach (var module in _service.Modules)
{
string description = null;
debug += $"{module.Name}\n";
foreach (var cmd in module.Commands)
{
var result = await cmd.CheckPreconditionsAsync(Context);
if (result.IsSuccess)
description += $"{prefix}{cmd.Aliases.First()}\n";
debug += $"{prefix}{cmd.Aliases.First()}\n";
}
if (!string.IsNullOrWhiteSpace(description))
{
builder.AddField(x =>
{
x.Name = module.Name;
x.Value = description;
x.IsInline = false;
});
}
}
await ReplyAsync(debug);
}
[Command("command"), Alias("coomand")]
public async Task HelpAsync(string command)
{
var result = _service.Search(Context, command);
if (!result.IsSuccess)
{
await ReplyAsync($"Sorry, I couldn't find a command with the name **{command}**.");
return;
}
string prefix = Configuration.Load().Prefix;
var builder = new EmbedBuilder()
{
Color = new Color(0, 255, 0),
Description = $"Here are some commands like **{command}**"
};
foreach (var match in result.Commands)
{
var cmd = match.Command;
builder.AddField(x =>
{
x.Name = string.Join(", ", cmd.Aliases);
x.Value = $"Parameters: {string.Join(", ", cmd.Parameters.Select(p => p.Name))}\n" +
$"Remarks: {cmd.Remarks}";
x.IsInline = false;
});
}
await ReplyAsync("", false, builder.Build());
}*/
[Command("help"), Summary("Shows this thing")]
public async Task HelpCommand([Remainder] string command = null)
@@ -94,7 +24,6 @@ namespace Kehyeedra3.Commands
if(command == null)
{
EmbedBuilder embed = new EmbedBuilder();
embed.AddField("AIMLbot", "Mention me to talk with me (don't expect intelligence)");
foreach (var module in Bot._cmds.Modules)
{
StringBuilder coommands = new StringBuilder("");

View File

@@ -850,7 +850,7 @@ namespace Kehyeedra3.Commands
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();
inp = await NextMessageAsync(timeout: TimeSpan.FromMinutes(2));
if (inp.Content.ToLowerInvariant() == "ok")
{
@@ -882,162 +882,187 @@ namespace Kehyeedra3.Commands
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//else if (input == "bulksell")
//{
// int value = 0;
// int count = 0;
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;
// }
FishTier ftier = FishTier.T1;
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);
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nSpecify the tier.\n");
var inp = await NextMessageAsync(timeout: TimeSpan.FromMinutes(2));
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:
// {
// fishTiers = fishes.Where(f => (int)f.Tier == (int)FishTier.T4).ToList();
// }
// break;
// }
// 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);
// }
if (tier > 0 && tier < 5)
{
switch (tier)
{
case 1:
{
ftier = FishTier.T1;
}
break;
case 2:
{
ftier = FishTier.T2;
}
break;
case 3:
{
ftier = FishTier.T3;
}
break;
case 4:
{
ftier = FishTier.T4;
}
break;
}
}
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);
}
if (f.Value[0] < 0)
{
f.Value[0] = 0;
}
if (f.Value[1] < 0)
{
f.Value[1] = 0;
}
if (f.Value[2] < 0)
{
f.Value[2] = 0;
}
fish = fishes.FirstOrDefault(i => i.Id == f.Key);
if (fish.Tier == ftier && fish.Rarity != FishRarity.Unreasonable && fish.Rarity != FishRarity.Legendary)
{
if (f.Value[0] > 0)
{
switch (fish.Rarity)
{
case FishRarity.Common:
{
value += (int)fish.Tier * 1 * 1 * f.Value[0];
}
break;
case FishRarity.Uncommon:
{
value += (int)fish.Tier * 1 * 3 * f.Value[0];
}
break;
case FishRarity.Rare:
{
value += (int)fish.Tier * 1 * 6 * f.Value[0];
}
break;
}
count += f.Value[0];
f.Value[0] = 0;
}
if (f.Value[1] > 0)
{
switch (fish.Rarity)
{
case FishRarity.Common:
{
value += (int)fish.Tier * 2 * 1 * f.Value[1];
}
break;
case FishRarity.Uncommon:
{
value += (int)fish.Tier * 2 * 3 * f.Value[1];
}
break;
case FishRarity.Rare:
{
value += (int)fish.Tier * 2 * 6 * f.Value[1];
}
break;
}
count += f.Value[1];
f.Value[1] = 0;
}
if (f.Value[2] > 0)
{
switch (fish.Rarity)
{
case FishRarity.Common:
{
value += (int)fish.Tier * 3 * 1 * f.Value[2];
}
break;
case FishRarity.Uncommon:
{
value += (int)fish.Tier * 3 * 3 * f.Value[2];
}
break;
case FishRarity.Rare:
{
value += (int)fish.Tier * 3 * 6 * f.Value[2];
}
break;
}
count += f.Value[2];
f.Value[2] = 0;
}
}
}
if (count < 1)
{
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nYou have nothing to sell in this tier. Try ;finv.");
return;
}
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(timeout: TimeSpan.FromMinutes(2));
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. :[");
}
// 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 += (int)fish.Tier * 1 * 1;
// }
// break;
// case FishRarity.Uncommon:
// {
// value += (int)fish.Tier * 1 * 3;
// }
// break;
// case FishRarity.Rare:
// {
// value += (int)fish.Tier * 1 * 6;
// }
// break;
// }
// ////
// switch (fish.Rarity) //med
// {
// case FishRarity.Common:
// {
// value += (int)fish.Tier * 2 * 1;
// }
// break;
// case FishRarity.Uncommon:
// {
// value += (int)fish.Tier * 2 * 3;
// }
// break;
// case FishRarity.Rare:
// {
// value += (int)fish.Tier * 2 * 6;
// }
// break;
// }
// ////
// switch (fish.Rarity) //large
// {
// case FishRarity.Common:
// {
// 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. :[");
// }
// }
// }
//}
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
}
}
}
}

View File

@@ -38,34 +38,89 @@ namespace Kehyeedra3.Commands
[Command("ratenuts"), Summary("Rates your or another person's sack.")]
public async Task RateTrap( string name = null)
{
int nutRating = SRandom.Next(0, 301);
string nuts = "nuts";
if (name == null)
{
Random rando = new Random();
Random rando1 = new Random();
int trapRating0 = rando.Next(0, 201);
if (trapRating0 > 100 || trapRating0 < 120)
if (Context.User.Id == 534859726090010672)
{
int trapRating1 = rando1.Next(0, 10001);
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nCongrats king, your boss nuts weigh {trapRating1}g.");
nutRating -= 60;
}
if (Context.User.Id == 318478574325596163)
{
nutRating = SRandom.Next(1000000, 10000000);
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nWarning: King, your african scale boss nuts have reached critical mass at {nutRating}g.");
return;
}
if (Context.User.Id == 242040333309837327 || Context.User.Id == 194538583649026049)
{
nutRating += 10000;
}
if (nutRating > 160 && nutRating < 200)
{
nutRating += SRandom.Next(nutRating, 10001);
nuts = "boss nuts";
if (nutRating > 10000)
{
nutRating = SRandom.Next(nutRating, nutRating + 100101);
nuts = "king size boss nuts";
}
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nCongrats king, your {nuts} weigh {nutRating}g.");
return;
}
if (nutRating < 10)
{
nutRating = SRandom.Next(100, 2001);
nuts = "tiny lady nuts";
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nHope you get better soon, your {nuts} weigh 0.{nutRating}g.");
}
else
{
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nYour nuts weigh {trapRating0}g.");
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nYour {nuts} weigh {nutRating}g.");
}
}
else
{
Random rando = new Random();
Random rando1 = new Random();
int trapRating0 = rando.Next(0, 101);
if (trapRating0 == 100)
if (name.Contains("534859726090010672"))
{
int trapRating1 = rando1.Next(100, 10001);
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nCongrats {name}, your boss nuts weigh {trapRating1}g.");
nutRating -= 60;
}
if (name.Contains("318478574325596163"))
{
nutRating = SRandom.Next(1000000, 10000000);
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nWarning: {name}'s african scale boss nuts have reached critical mass at {nutRating}g.");
return;
}
if (name.Contains("242040333309837327") || name.Contains("194538583649026049"))
{
nutRating += 10000;
}
if (nutRating > 180 && nutRating < 200)
{
nuts = "boss nuts";
nutRating += SRandom.Next(nutRating, 10001);
if (nutRating > 10000)
{
nutRating = SRandom.Next(nutRating, nutRating + 100101);
nuts = "king size boss nuts";
}
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nCongrats {name}, your {nuts} weigh {nutRating}g.");
return;
}
if (nutRating < 10)
{
nutRating = SRandom.Next(100, 2001);
nuts = "tiny lady nuts";
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nSorry to hear about {name}, those {nuts} weigh 0.{nutRating}g.");
}
else
{
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\n{name}'s nuts weigh {trapRating0}g.");
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\n{name}'s {nuts} weigh {nutRating}g.");
}
}
@@ -322,6 +377,27 @@ namespace Kehyeedra3.Commands
}
}
}
[Command("changenick")]
public async Task ChangeNickname(IGuildUser usr = null, [Remainder]string name = null)
{
if (Context.Guild.Id != 691361760300761139)
{
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nWrong server retard");
return;
}
if (usr == null || usr == Context.User || name == null)
{
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nYeah you gotta ping someone and write a name, retard");
return;
}
else
{
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nLet's fucking goooo");
await usr.ModifyAsync(x => x.Nickname = $"{name}");
}
}
}
}