A bunch of stuff
Battlefish stuff, economy stuff, fixes, additions, everything else that I didn't remember to mention
This commit is contained in:
@@ -3,11 +3,13 @@ using Discord.Addons.Interactive;
|
||||
using Discord.Commands;
|
||||
using Kehyeedra3.Preconditions;
|
||||
using Kehyeedra3.Services.Models;
|
||||
using Microsoft.EntityFrameworkCore.ChangeTracking.Internal;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@@ -115,185 +117,260 @@ namespace Kehyeedra3.Commands
|
||||
await Context.Channel.SendMessageAsync($"{content}");
|
||||
}
|
||||
}
|
||||
// test commands
|
||||
//[RequireRolePrecondition(AccessLevel.BotOwner)]
|
||||
//[Command("cbt", RunMode = RunMode.Async)]
|
||||
//public async Task CombatTest()
|
||||
//{
|
||||
// string[] attackse = new string[]
|
||||
// {
|
||||
// "a bite",
|
||||
// "a crowbar",
|
||||
// "invasive odor",
|
||||
// "an intense slap"
|
||||
// };
|
||||
[RequireRolePrecondition(AccessLevel.BotOwner)]
|
||||
[Command("modifymoney"), Alias("mm")]
|
||||
public async Task ModMoney(string type, int amount, IUser target = null)
|
||||
{
|
||||
User user;
|
||||
if (type.ToLowerInvariant() == "add" || type.ToLowerInvariant() == "set")
|
||||
{
|
||||
using var Database = new ApplicationDbContextFactory().CreateDbContext();
|
||||
string yuser = "";
|
||||
if (target == null)
|
||||
{
|
||||
user = Database.Users.FirstOrDefault(x => x.Id == Context.User.Id);
|
||||
yuser = $"{Context.User.Username}";
|
||||
}
|
||||
else
|
||||
{
|
||||
user = Database.Users.FirstOrDefault(x => x.Id == target.Id);
|
||||
yuser = $"{target.Username}";
|
||||
}
|
||||
if (type == "add")
|
||||
{
|
||||
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");
|
||||
return;
|
||||
}
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nSet **{yuser}**'s money to **{user.Money / 10000d}%**.");
|
||||
await Database.SaveChangesAsync();
|
||||
return;
|
||||
}
|
||||
else if (type == "set")
|
||||
{
|
||||
if (amount < 0)
|
||||
{
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nCan't set to a negative.");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
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.");
|
||||
return;
|
||||
}
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nSet **{yuser}**'s money to **{amount / 10000d}%**.");
|
||||
await Database.SaveChangesAsync();
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nInvalid type.");
|
||||
}
|
||||
}
|
||||
|
||||
// int hp = 100;
|
||||
// int atk = 100;
|
||||
// int bhp = 1000;
|
||||
// int dmg = 0;
|
||||
// int edg = 0;
|
||||
// string cbta = "";
|
||||
// int numatt = SRandom.Next(attackse.Length);
|
||||
// string at1;
|
||||
// string at2;
|
||||
// string eattack;
|
||||
// int cb;
|
||||
// await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nBattle against **Fishthot**\nChoose your battle fish:\n**Pistol Shrimp | Coomfish**");
|
||||
// var message = await NextMessageAsync();
|
||||
// if (message.Content.ToLowerInvariant() == "pistol shrimp")
|
||||
//[Command("hello")]
|
||||
//public async Task Hello(int a, int b)
|
||||
//{
|
||||
// int x = a - b;
|
||||
// string message = "";
|
||||
// if (x < 0)
|
||||
// {
|
||||
// cbta = "Pistol Shrimp";
|
||||
// at1 = "Firearm";
|
||||
// at2 = "Crowbar";
|
||||
// cb = 1;
|
||||
// hp = 80;
|
||||
// atk = 20;
|
||||
// message += "The result is negative!";
|
||||
// }
|
||||
// else if (message.Content.ToLowerInvariant() == "coomfish")
|
||||
// else if (x > 0)
|
||||
// {
|
||||
// cbta = "Coomfish";
|
||||
// at1 = "Eruption";
|
||||
// at2 = "Smack";
|
||||
// cb = 2;
|
||||
// hp = 160;
|
||||
// atk = 10;
|
||||
// message += "The result is positive!";
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nInvalid battle fish??? are you RETARDeDED??");
|
||||
// return;
|
||||
// }
|
||||
// await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nYou have chosen: **{cbta}**, your stats are HP: **{hp}** ATK: **{atk}**\n\nBegin battle?");
|
||||
// message = await NextMessageAsync();
|
||||
// if (message.Content.ToLowerInvariant() == "yes")
|
||||
// {
|
||||
// string ment = $"{Context.User.Mention}\n";
|
||||
// while (bhp > 0 && hp > 0)
|
||||
// {
|
||||
// if (bhp > 0 && hp > 0)
|
||||
// {
|
||||
// edg = SRandom.Next(3, 16);
|
||||
// dmg = SRandom.Next(atk, atk * 20);
|
||||
// eattack = attackse[numatt];
|
||||
// hp -= edg;
|
||||
// await Context.Channel.SendMessageAsync($"{ment}**Fishthot** attacks with {eattack}, dealing **{edg}** damage.\n**{cbta}**'s **HP** drops to {hp}.");
|
||||
// ment = "";
|
||||
// if (hp <= 0)
|
||||
// {
|
||||
// await Context.Channel.SendMessageAsync($"Oh dear! **{cbta}** has fallen in battle.\nChoose your last ditch effort.\n**Belt** | **Punch**");
|
||||
// message = await NextMessageAsync();
|
||||
// if (message.Content.ToLowerInvariant() == "belt")
|
||||
// {
|
||||
// dmg = SRandom.Next(20, 100);
|
||||
// bhp -= dmg;
|
||||
// }
|
||||
// else if (message.Content.ToLowerInvariant() == "punch")
|
||||
// {
|
||||
// dmg = SRandom.Next(40, 80);
|
||||
// bhp -= dmg;
|
||||
// }
|
||||
// await Context.Channel.SendMessageAsync($"Your last ditch effort dealt **{dmg}** damage, reducing **Fishthot**'s health to {bhp}.");
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// bhp -= dmg;
|
||||
// await Context.Channel.SendMessageAsync($"What will you attack with?\n**{at1}** | **{at2}**");
|
||||
// message = await NextMessageAsync();
|
||||
// if (cb == 1 && message.Content.ToLowerInvariant() == "firearm")
|
||||
// {
|
||||
// await Context.Channel.SendMessageAsync($"{Context.User.Mention}\n**{cbta}** pulls out his trusty glock and shoots at **Fishthot**, dealing **{dmg}** damage.\n**Fishthot**'s HP has been reduced to **{bhp}**.");
|
||||
// }
|
||||
// else if (cb == 1 && message.Content.ToLowerInvariant() == "crowbar")
|
||||
// {
|
||||
// await Context.Channel.SendMessageAsync($"{Context.User.Mention}\n**{cbta}** unsheathes a menacing looking crowbar and lands a nice smack on **Fishthot**, dealing **{dmg}** damage.\n**Fishthot**'s HP has been reduced to **{bhp}**.");
|
||||
// }
|
||||
// else if (cb == 2 && message.Content.ToLowerInvariant() == "eruption")
|
||||
// {
|
||||
// await Context.Channel.SendMessageAsync($"{Context.User.Mention}\n**{cbta}** releases a massive ***CUM ERUPTION*** on **Fishthot**, dealing **{dmg}** damage.\n**Fishthot**'s HP has been reduced to **{bhp}**.");
|
||||
// }
|
||||
// else if (cb == 2 && message.Content.ToLowerInvariant() == "smack")
|
||||
// {
|
||||
// await Context.Channel.SendMessageAsync($"{Context.User.Mention}\n**{cbta}** feeds **Fishthot** a nice knuckle sandwich with his **Power Arm**, dealing **{dmg}** damage.\n**Fishthot**'s HP has been reduced to **{bhp}**.");
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// await Context.Channel.SendMessageAsync($"{Context.User.Mention}\n**{cbta}** did not understand your command.\n**{cbta}** is looking at you with disappointed eyes.\nYour turn is skipped, good job retard.");
|
||||
// }
|
||||
// }
|
||||
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (bhp <= 0 && hp > 0)
|
||||
// {
|
||||
// await Context.Channel.SendMessageAsync($"{Context.User.Mention}\n**You win!** Go buy **{cbta}** a beer or something for his great accomplishments.");
|
||||
// break;
|
||||
// }
|
||||
// else if (bhp <= 0 && hp < 0)
|
||||
// {
|
||||
// await Context.Channel.SendMessageAsync($"{Context.User.Mention}\n**{cbta}** is gone. But so is **Fishthot**. Make sure to boil him in a good broth, he would have deserved it.");
|
||||
// break;
|
||||
// }
|
||||
// else if (hp <= 0)
|
||||
// {
|
||||
// await Context.Channel.SendMessageAsync($"{Context.User.Mention}\n**{cbta}** is gone. Now nothing stands between **Fishthot** and your frail frame.");
|
||||
// break;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nSomething went ***REALLY*** wrong");
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nyou afraid or something? loser lmao");
|
||||
// return;
|
||||
// message += "The result is 0!";
|
||||
// }
|
||||
// await Context.Channel.SendMessageAsync($"The result is {x}\n{message}");
|
||||
//}
|
||||
// test commands
|
||||
//[Command("cbt", RunMode = RunMode.Async)]
|
||||
//public async Task CombatTest()
|
||||
//{
|
||||
// string[] attackse = new string[]
|
||||
// {
|
||||
// "a bite",
|
||||
// "a crowbar",
|
||||
// "invasive odor",
|
||||
// "an intense slap"
|
||||
// };
|
||||
|
||||
// int hp = 100;
|
||||
// int atk = 100;
|
||||
// int bhp = 1000;
|
||||
// int dmg = 0;
|
||||
// int edg = 0;
|
||||
// string cbta = "";
|
||||
// int numatt = SRandom.Next(attackse.Length);
|
||||
// string at1;
|
||||
// string at2;
|
||||
// string eattack;
|
||||
// int cb;
|
||||
// await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nBattle against **Fishthot**\nChoose your battle fish:\n**Pistol Shrimp | Coomfish**");
|
||||
// var message = await NextMessageAsync();
|
||||
// if (message.Content.ToLowerInvariant() == "pistol shrimp")
|
||||
// {
|
||||
// cbta = "Pistol Shrimp";
|
||||
// at1 = "Gun";
|
||||
// at2 = "Crowbar";
|
||||
// cb = 1;
|
||||
// hp = 80;
|
||||
// atk = 20;
|
||||
// }
|
||||
// else if (message.Content.ToLowerInvariant() == "coomfish")
|
||||
// {
|
||||
// cbta = "Coomfish";
|
||||
// at1 = "Eruption";
|
||||
// at2 = "Smack";
|
||||
// cb = 2;
|
||||
// hp = 160;
|
||||
// atk = 10;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nInvalid battle fish??? are you RETARDeDED??");
|
||||
// return;
|
||||
// }
|
||||
// await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nYou have chosen: **{cbta}**, your stats are HP: **{hp}** ATK: **{atk}**\n\nBegin battle?");
|
||||
// message = await NextMessageAsync();
|
||||
// if (message.Content.ToLowerInvariant() == "yes")
|
||||
// {
|
||||
// string ment = $"{Context.User.Mention}\n";
|
||||
// while (bhp > 0 && hp > 0)
|
||||
// {
|
||||
// if (bhp > 0 && hp > 0)
|
||||
// {
|
||||
// edg = SRandom.Next(3, 16);
|
||||
// dmg = SRandom.Next(atk, atk * 20);
|
||||
// eattack = attackse[numatt];
|
||||
// hp -= edg;
|
||||
// await Context.Channel.SendMessageAsync($"{ment}**Fishthot** attacks with {eattack}, dealing **{edg}** damage.\n**{cbta}**'s **HP** drops to {hp}.");
|
||||
// ment = "";
|
||||
// if (hp <= 0)
|
||||
// {
|
||||
// await Context.Channel.SendMessageAsync($"Oh dear! **{cbta}** has fallen in battle.\nChoose your last ditch effort.\n**Belt** | **Punch**");
|
||||
// message = await NextMessageAsync();
|
||||
// if (message.Content.ToLowerInvariant() == "belt")
|
||||
// {
|
||||
// dmg = SRandom.Next(20, 100);
|
||||
// bhp -= dmg;
|
||||
// }
|
||||
// else if (message.Content.ToLowerInvariant() == "punch")
|
||||
// {
|
||||
// dmg = SRandom.Next(40, 80);
|
||||
// bhp -= dmg;
|
||||
// }
|
||||
// await Context.Channel.SendMessageAsync($"Your last ditch effort dealt **{dmg}** damage, reducing **Fishthot**'s health to {bhp}.");
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// bhp -= dmg;
|
||||
// await Context.Channel.SendMessageAsync($"What will you attack with?\n**{at1}** | **{at2}**");
|
||||
// message = await NextMessageAsync();
|
||||
// if (cb == 1 && message.Content.ToLowerInvariant() == "gun")
|
||||
// {
|
||||
// await Context.Channel.SendMessageAsync($"{Context.User.Mention}\n**{cbta}** pulls out his trusty glock and shoots at **Fishthot**, dealing **{dmg}** damage.\n**Fishthot**'s HP has been reduced to **{bhp}**.");
|
||||
// }
|
||||
// else if (cb == 1 && message.Content.ToLowerInvariant() == "crowbar")
|
||||
// {
|
||||
// await Context.Channel.SendMessageAsync($"{Context.User.Mention}\n**{cbta}** unsheathes a menacing looking crowbar and lands a nice smack on **Fishthot**, dealing **{dmg}** damage.\n**Fishthot**'s HP has been reduced to **{bhp}**.");
|
||||
// }
|
||||
// else if (cb == 2 && message.Content.ToLowerInvariant() == "eruption")
|
||||
// {
|
||||
// await Context.Channel.SendMessageAsync($"{Context.User.Mention}\n**{cbta}** releases a massive ***CUM ERUPTION*** on **Fishthot**, dealing **{dmg}** damage.\n**Fishthot**'s HP has been reduced to **{bhp}**.");
|
||||
// }
|
||||
// else if (cb == 2 && message.Content.ToLowerInvariant() == "smack")
|
||||
// {
|
||||
// await Context.Channel.SendMessageAsync($"{Context.User.Mention}\n**{cbta}** feeds **Fishthot** a nice knuckle sandwich with his **Power Arm**, dealing **{dmg}** damage.\n**Fishthot**'s HP has been reduced to **{bhp}**.");
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// await Context.Channel.SendMessageAsync($"{Context.User.Mention}\n**{cbta}** did not understand your command.\n**{cbta}** is looking at you with disappointed eyes.\nYour turn is skipped, good job retard.");
|
||||
// }
|
||||
// }
|
||||
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (bhp <= 0 && hp > 0)
|
||||
// {
|
||||
// await Context.Channel.SendMessageAsync($"{Context.User.Mention}\n**You win!** Go buy **{cbta}** a beer or something for his great accomplishments.");
|
||||
// break;
|
||||
// }
|
||||
// else if (bhp <= 0 && hp < 0)
|
||||
// {
|
||||
// await Context.Channel.SendMessageAsync($"{Context.User.Mention}\n**{cbta}** is gone. But so is **Fishthot**. Make sure to boil him in a good broth, he would have deserved it.");
|
||||
// break;
|
||||
// }
|
||||
// else if (hp <= 0)
|
||||
// {
|
||||
// await Context.Channel.SendMessageAsync($"{Context.User.Mention}\n**{cbta}** is gone. Now nothing stands between **Fishthot** and your frail frame.");
|
||||
// break;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nSomething went ***REALLY*** wrong");
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nyou afraid or something? loser lmao");
|
||||
// return;
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//[RequireRolePrecondition(AccessLevel.BotOwner)]
|
||||
//[Command("getstamp")]
|
||||
//public async Task YeedraStamp()
|
||||
//{
|
||||
// ulong stamp = DateTime.UtcNow.ToYeedraStamp();
|
||||
// await ReplyAsync($"{Context.User.Mention} {stamp}");
|
||||
//}
|
||||
//[RequireRolePrecondition(AccessLevel.BotOwner)]
|
||||
//[Command("savefile")]
|
||||
|
||||
//public async Task SaveFile(string fday, string fscore)
|
||||
//{
|
||||
// string location = Path.Combine(Environment.CurrentDirectory, "drawtasks");
|
||||
// string tlocation = ($"{location}/days.txt");
|
||||
// var attachments = Context.Message.Attachments;
|
||||
// string fname = $"{fday}-{fscore}";
|
||||
// if (File.Exists(location + "/days.txt"))
|
||||
// {
|
||||
|
||||
// }
|
||||
// foreach (var item in attachments)
|
||||
// {
|
||||
// Uri link = new Uri(item.Url);
|
||||
// using (WebClient _webclient = new WebClient())
|
||||
// {
|
||||
// if (!Directory.Exists(location))
|
||||
// Directory.CreateDirectory(location);
|
||||
// location += ($"/{fday}-{fscore}.jpg");
|
||||
// _webclient.DownloadFileAsync(link, location);
|
||||
// }
|
||||
// await ReplyAsync($"Post archived");
|
||||
// break;
|
||||
// }
|
||||
//}
|
||||
//[RequireRolePrecondition(AccessLevel.BotOwner)]
|
||||
//[Command("getstamp")]
|
||||
//public async Task YeedraStamp()
|
||||
//{
|
||||
// ulong stamp = DateTime.UtcNow.ToYeedraStamp();
|
||||
// await ReplyAsync($"{Context.User.Mention} {stamp}");
|
||||
//}
|
||||
//[RequireRolePrecondition(AccessLevel.BotOwner)]
|
||||
//[Command("savefile")]
|
||||
|
||||
//public async Task SaveFile(string fday, string fscore)
|
||||
//{
|
||||
// string location = Path.Combine(Environment.CurrentDirectory, "drawtasks");
|
||||
// string tlocation = ($"{location}/days.txt");
|
||||
// var attachments = Context.Message.Attachments;
|
||||
// string fname = $"{fday}-{fscore}";
|
||||
// if (File.Exists(location + "/days.txt"))
|
||||
// {
|
||||
|
||||
// }
|
||||
// foreach (var item in attachments)
|
||||
// {
|
||||
// Uri link = new Uri(item.Url);
|
||||
// using (WebClient _webclient = new WebClient())
|
||||
// {
|
||||
// if (!Directory.Exists(location))
|
||||
// Directory.CreateDirectory(location);
|
||||
// location += ($"/{fday}-{fscore}.jpg");
|
||||
// _webclient.DownloadFileAsync(link, location);
|
||||
// }
|
||||
// await ReplyAsync($"Post archived");
|
||||
// break;
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -178,7 +178,8 @@ namespace Kehyeedra3.Commands
|
||||
|
||||
if (!user.GrantMoney(Database.Users.FirstOrDefault(x => x.Id == 0), end))
|
||||
{
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention} Bank has no money, convince someone to gamble");
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nBank has no money, convince someone to gamble.");
|
||||
return;
|
||||
}
|
||||
|
||||
await Database.SaveChangesAsync();
|
||||
@@ -444,8 +445,24 @@ namespace Kehyeedra3.Commands
|
||||
|
||||
toNextLvl = user.Xp - user.TXp;
|
||||
int times = 0;
|
||||
|
||||
if (user.TXp >= user.Xp)
|
||||
{
|
||||
ulong leXp = 50;
|
||||
bool leTrig = false;
|
||||
for (ulong i = 0; i < user.Lvl; i++)
|
||||
{
|
||||
if (i <= user.Lvl)
|
||||
{
|
||||
leXp += Convert.ToUInt64(Math.Round((leXp * 0.05d + 50d), 0, MidpointRounding.ToEven));
|
||||
}
|
||||
}
|
||||
if (leXp != user.Xp)
|
||||
{
|
||||
user.Lvl = 0;
|
||||
user.Xp = 0;
|
||||
leTrig = true;
|
||||
}
|
||||
while (user.TXp >= user.Xp)
|
||||
{
|
||||
user.Lvl += 1;
|
||||
@@ -462,7 +479,11 @@ namespace Kehyeedra3.Commands
|
||||
}
|
||||
toNextLvl = user.Xp - user.TXp;
|
||||
level = user.Lvl;
|
||||
if (times > 1)
|
||||
if (leTrig)
|
||||
{
|
||||
lvlUp = $"**Your level was recalculated to match your xp.** You are now **Level {level}**";
|
||||
}
|
||||
else if (times > 1)
|
||||
{
|
||||
lvlUp = $"**You leveled up {times} times!** You are now **Level {level}.**";
|
||||
}
|
||||
@@ -498,7 +519,12 @@ namespace Kehyeedra3.Commands
|
||||
using (var Database = new ApplicationDbContextFactory().CreateDbContext())
|
||||
{
|
||||
var user = Database.Fishing.FirstOrDefault(x => x.Id == Context.User.Id);
|
||||
await Context.Channel.SendMessageAsync($"You have unlocked fishing rods up to **T{user.RodOwned+1}**\nYou have currently equipped a **T{user.RodUsed+1}** rod");
|
||||
if (user == null)
|
||||
{
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nYou don't own any fishing rods. Try **fishing**.");
|
||||
return;
|
||||
}
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nYou have unlocked fishing rods up to **T{user.RodOwned+1}**\nYou have currently equipped a **T{user.RodUsed+1}** rod");
|
||||
}
|
||||
}
|
||||
[Command("setrod"),Summary("Set your fishing rod to the desired tier (for example: 'setrod 1' to set to default rod)")]
|
||||
@@ -507,6 +533,11 @@ namespace Kehyeedra3.Commands
|
||||
using (var Database = new ApplicationDbContextFactory().CreateDbContext())
|
||||
{
|
||||
var user = Database.Fishing.FirstOrDefault(x => x.Id == Context.User.Id);
|
||||
if (user == null)
|
||||
{
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nYou don't own any fishing rods. Try **fishing**.");
|
||||
return;
|
||||
}
|
||||
if (tier - 1 <= user.RodOwned)
|
||||
{
|
||||
user.RodUsed = Convert.ToByte(tier - 1);
|
||||
@@ -568,7 +599,6 @@ namespace Kehyeedra3.Commands
|
||||
|
||||
await Database.SaveChangesAsync().ConfigureAwait(false);
|
||||
}
|
||||
|
||||
if (inv.Any())
|
||||
{
|
||||
Dictionary<FishSpecies, int> small = new Dictionary<FishSpecies, int>();
|
||||
@@ -899,79 +929,52 @@ namespace Kehyeedra3.Commands
|
||||
[Command("bet"), Summary("Gamble %coins in units of 0.0001%")]
|
||||
public async Task Gamble(int wager)
|
||||
{
|
||||
Random ran = new Random(SRandom.Next(0, 100000000) + int.Parse(Context.User.AvatarId + Context.User.Discriminator));
|
||||
int res1 = ran.Next(0, 11);
|
||||
if (res1 >= 5)
|
||||
{
|
||||
res1 = ran.Next(50, 101);
|
||||
}
|
||||
else
|
||||
{
|
||||
res1 = ran.Next(0, 50);
|
||||
}
|
||||
if (wager < 0)
|
||||
{
|
||||
wager = 0;
|
||||
}
|
||||
int res1 = SRandom.Next(0, 101);
|
||||
int res2 = SRandom.Next(0, 101);
|
||||
int loss = wager;
|
||||
if (res1 == 100)
|
||||
|
||||
if (res1 > res2)
|
||||
{
|
||||
wager = wager * 4;
|
||||
wager += wager;
|
||||
}
|
||||
else if (res1 >= 95)
|
||||
else if (res1 < res2)
|
||||
{
|
||||
wager = wager * 3;
|
||||
}
|
||||
else if (res1 == 77)
|
||||
{
|
||||
wager = wager * 7;
|
||||
}
|
||||
else if (res1 < 50)
|
||||
{
|
||||
wager = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
wager = wager * 2;
|
||||
loss += wager;
|
||||
}
|
||||
|
||||
using (var Database = new ApplicationDbContextFactory().CreateDbContext())
|
||||
{
|
||||
var user = Database.Users.FirstOrDefault(x => x.Id == Context.User.Id);
|
||||
var buser = Database.Users.FirstOrDefault(x => x.Id == 0);
|
||||
if (user.Money < loss)
|
||||
{
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention} You can't afford that, go back to the mines.");
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\n You can't afford that, go back to the mines.");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (buser.Money > 100)
|
||||
{
|
||||
if (!user.GrantMoney(Database.Users.FirstOrDefault(x => x.Id == 0), (wager) - loss))
|
||||
if (!user.GrantMoney(Database.Users.FirstOrDefault(x => x.Id == 0), wager - loss))
|
||||
{
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention} Bank has no money, gamble more and lose please.");
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nBank has no money, gamble more and lose please.");
|
||||
return;
|
||||
}
|
||||
await Database.SaveChangesAsync();
|
||||
|
||||
EmbedBuilder embed = new EmbedBuilder();
|
||||
if (res1 == 77)
|
||||
string result = "";
|
||||
if ((wager - loss) > 0)
|
||||
{
|
||||
embed.AddField($"**Rolled: Lucky cat!**", $"Result: +{((wager) - loss) / 10000d}%\nBalance: {(user.Money) / 10000d}%");
|
||||
await ReplyAsync($"{Context.User.Mention}", false, embed.Build());
|
||||
result = $"Rolled: **{res1}** against **{res2}**\nResult: +{(wager - loss) / 10000d}%\nBalance: {user.Money / 10000d}%";
|
||||
await ReplyAsync($"{Context.User.Mention}\n{result}");
|
||||
}
|
||||
else if (((wager) - loss) > 0)
|
||||
if ((wager - loss) < 0)
|
||||
{
|
||||
embed.AddField($"**Rolled: {res1}**", $"Result: +{((wager) - loss) / 10000d}%\nBalance: {(user.Money) / 10000d}%");
|
||||
await ReplyAsync($"{Context.User.Mention}", false, embed.Build());
|
||||
}
|
||||
if (((wager) - loss) < 0)
|
||||
{
|
||||
embed.AddField($"**Rolled: {res1}**", $"Result: {((wager) - loss) / 10000d}%\nBalance: {(user.Money) / 10000d}%");
|
||||
await ReplyAsync($"{Context.User.Mention}", false, embed.Build());
|
||||
result = $"Rolled: **{res1}** against **{res2}**\nResult: {(wager - loss) / 10000d}%\nBalance: {user.Money / 10000d}%";
|
||||
await ReplyAsync($"{Context.User.Mention}\n{result}");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
await ReplyAsync($"Hey, stop that.");
|
||||
await ReplyAsync($"{Context.User.Mention}\nHey, stop that.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1076,22 +1079,154 @@ namespace Kehyeedra3.Commands
|
||||
[Command("stats"),Summary("View a user's stats")]
|
||||
public async Task StatProfile(IUser otherUser = null)
|
||||
{
|
||||
Dictionary<FishSpecies, int[]> inv = new Dictionary<FishSpecies, int[]>();
|
||||
Dictionary<FishSpecies, int> small = new Dictionary<FishSpecies, int>();
|
||||
Dictionary<FishSpecies, int> med = new Dictionary<FishSpecies, int>();
|
||||
Dictionary<FishSpecies, int> large = new Dictionary<FishSpecies, int>();
|
||||
Fishing feeshUser;
|
||||
|
||||
int scount = 0;
|
||||
int mcount = 0;
|
||||
int lcount = 0;
|
||||
|
||||
using (var database = new ApplicationDbContextFactory().CreateDbContext())
|
||||
{
|
||||
if (otherUser == null)
|
||||
{
|
||||
feeshUser = database.Fishing.FirstOrDefault(x => x.Id == Context.User.Id);
|
||||
}
|
||||
else
|
||||
{
|
||||
feeshUser = database.Fishing.FirstOrDefault(x => x.Id == otherUser.Id);
|
||||
}
|
||||
|
||||
if (feeshUser == null)
|
||||
{
|
||||
if (otherUser != null)
|
||||
{
|
||||
feeshUser = new Fishing
|
||||
{
|
||||
Id = otherUser.Id
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
feeshUser = new Fishing
|
||||
{
|
||||
Id = Context.User.Id
|
||||
};
|
||||
}
|
||||
database.Fishing.Add(feeshUser);
|
||||
await database.SaveChangesAsync();
|
||||
if (otherUser != null)
|
||||
{
|
||||
await Context.Channel.SendMessageAsync($"**{otherUser.Username}** Was added to the database.");
|
||||
}
|
||||
else
|
||||
{
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nYou were added to database.");
|
||||
}
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
inv = feeshUser.GetInventory();
|
||||
}
|
||||
|
||||
foreach (var entry in inv)
|
||||
{
|
||||
if (entry.Value.Count() > 0)
|
||||
{
|
||||
if (entry.Value[0] > 0)
|
||||
{
|
||||
scount += entry.Value[0];
|
||||
}
|
||||
}
|
||||
if (entry.Value.Count() > 1)
|
||||
{
|
||||
if (entry.Value[1] > 0)
|
||||
{
|
||||
mcount += entry.Value[1];
|
||||
}
|
||||
}
|
||||
if (entry.Value.Count() > 2)
|
||||
{
|
||||
if (entry.Value[2] > 0)
|
||||
{
|
||||
lcount += entry.Value[2];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (otherUser == null)
|
||||
{
|
||||
var user = database.Fishing.FirstOrDefault(x => x.Id == Context.User.Id);
|
||||
var muser = database.Users.FirstOrDefault(x => x.Id == Context.User.Id);
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}'s stats\nFishing level: **{user.Lvl}**\nFishing xp: **{user.TXp}**\nBalance: **{muser.Money/10000d}%**");
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}'s stats\nFishing level: **{user.Lvl}**\nMax catch weight: **{(user.Lvl * 5 + 2000d) / 100}kg**\nFishing xp: **{user.TXp}**\nTotal fish: **{scount + mcount + lcount}** *(Large: {lcount} Medium: {mcount} Small: {scount})*\nBalance: **{muser.Money / 10000d}%**");
|
||||
}
|
||||
else
|
||||
{
|
||||
var user = database.Fishing.FirstOrDefault(x => x.Id == otherUser.Id);
|
||||
var muser = database.Users.FirstOrDefault(x => x.Id == otherUser.Id);
|
||||
await Context.Channel.SendMessageAsync($"{otherUser.Mention}'s stats\nFishing level: **{user.Lvl}**\nFishing xp: **{user.TXp}**\nBalance: **{muser.Money/10000d}%**");
|
||||
await Context.Channel.SendMessageAsync($"{otherUser.Mention}'s stats\nFishing level: **{user.Lvl}**\nMax catch weight: **{(user.Lvl * 5 + 2000d) / 100}kg**\nFishing xp: **{user.TXp}**\nTotal fish: **{scount + mcount + lcount}** *(Large: {lcount} Medium: {mcount} Small: {scount}*)\nBalance: **{muser.Money / 10000d}%**");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
[Command("xptolevel"),Alias("tolv")]
|
||||
public async Task XpToNextLevl(ulong lvl)
|
||||
{
|
||||
ulong lvlXp = 50;
|
||||
using (var Database = new ApplicationDbContextFactory().CreateDbContext())
|
||||
{
|
||||
var user = Database.Fishing.FirstOrDefault(x => x.Id == Context.User.Id);
|
||||
if (user == null)
|
||||
{
|
||||
await Context.Channel.SendMessageAsync($"Sorry, **{Context.User.Username}**, my dad was too lazy to ");
|
||||
return;
|
||||
}
|
||||
if (lvl > 1 && lvl <= 200)
|
||||
{
|
||||
for (ulong i = 1; i < lvl; i++)
|
||||
{
|
||||
if (i <= lvl)
|
||||
{
|
||||
lvlXp += Convert.ToUInt64(Math.Round((lvlXp * 0.05d + 50d), 0, MidpointRounding.ToEven));
|
||||
}
|
||||
};
|
||||
}
|
||||
else if (lvl == 1)
|
||||
{
|
||||
lvlXp = 50;
|
||||
}
|
||||
else if (lvl < 1)
|
||||
{
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nThat's not really possible?");
|
||||
return;
|
||||
}
|
||||
else if (lvl > 200)
|
||||
{
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\n**Lvl 200** is the maximum lvl");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
await Context.Channel.SendMessageAsync($"<@242040333309837327>\nA fucky wucky has occurred with {Context.User.Mention}'s command");
|
||||
return;
|
||||
}
|
||||
if (user.Lvl >= lvl)
|
||||
{
|
||||
await Context.Channel.SendMessageAsync($"XP required for **Lvl {lvl} : {lvlXp}**" +
|
||||
$"\nXP since you reached **Lvl {lvl} : {user.TXp - lvlXp}**");
|
||||
}
|
||||
else
|
||||
{
|
||||
await Context.Channel.SendMessageAsync($"XP required for **Lvl {lvl} : {lvlXp}**" +
|
||||
$"\nXP left until **Lvl {lvl} : {lvlXp - user.TXp}**");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
485
Kehyeedra3/Commands/Interactive.cs
Normal file
485
Kehyeedra3/Commands/Interactive.cs
Normal file
@@ -0,0 +1,485 @@
|
||||
using Discord;
|
||||
using Discord.Addons.Interactive;
|
||||
using Discord.Commands;
|
||||
using Kehyeedra3.Preconditions;
|
||||
using Kehyeedra3.Services.Models;
|
||||
using Microsoft.EntityFrameworkCore.Storage;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO.IsolatedStorage;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Channels;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Kehyeedra3.Commands
|
||||
{
|
||||
public class Interactive : InteractiveBase<SocketCommandContext>
|
||||
{
|
||||
readonly string[] attacks = new string[]
|
||||
{
|
||||
"",
|
||||
""
|
||||
};
|
||||
|
||||
[RequireRolePrecondition(AccessLevel.BotOwner)]
|
||||
[Command("battlefish", RunMode = RunMode.Async),Alias("bf"),Summary("Type **bf help** or **bf h** for help with this command.")]
|
||||
public async Task BattleFish(string option = null, [Remainder]string sec = null)
|
||||
{
|
||||
using (var Database = new ApplicationDbContextFactory().CreateDbContext())
|
||||
{
|
||||
var user = Database.Users.FirstOrDefault(x => x.Id == Context.User.Id);
|
||||
if (user.BattleFish.Any() == false)
|
||||
{
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nYou don't have a battlefish.");
|
||||
}
|
||||
|
||||
var fish = user.BattleFish.FirstOrDefault();
|
||||
|
||||
string species = $"";
|
||||
string attacks = $"";
|
||||
int att = 0;
|
||||
int def = 0;
|
||||
int dg = 0;
|
||||
int hp = 0;
|
||||
int ap = 0;
|
||||
|
||||
double lvm = 20;
|
||||
double lvmhp = 100;
|
||||
|
||||
if (option == null)
|
||||
{
|
||||
for (int i = 0; i < fish.Lvl; i++)
|
||||
{
|
||||
lvm += Math.Round((Convert.ToDouble(lvm) * 0.01d), 0, MidpointRounding.ToEven) + 5;
|
||||
lvmhp += Math.Round((Convert.ToDouble(lvmhp) * 0.01d), 0, MidpointRounding.ToEven) + 10;
|
||||
}
|
||||
int lvlm = Convert.ToInt32(lvm) / 10;
|
||||
int lvlmhp = Convert.ToInt32(lvmhp) / 10;
|
||||
string prefix = "Hatchling";
|
||||
|
||||
if (fish.Lvl >= 15)
|
||||
{
|
||||
prefix = "Young";
|
||||
}
|
||||
if (fish.Lvl >= 30)
|
||||
{
|
||||
prefix = "Adolescent";
|
||||
}
|
||||
if (fish.Lvl >= 50)
|
||||
{
|
||||
prefix = "Adult";
|
||||
}
|
||||
switch (fish.FishType)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nYou don't have a battlefish.");
|
||||
}
|
||||
return;
|
||||
case 1:
|
||||
{
|
||||
species = "Herring";
|
||||
if (fish.Lvl >= 100)
|
||||
{
|
||||
species += $"ton";
|
||||
prefix = $"Authentic Masculine";
|
||||
}
|
||||
|
||||
attacks += $"1 : **Slap** - {species} slaps the opponent.";
|
||||
if (fish.Lvl >= 5)
|
||||
{
|
||||
attacks += $"\n2 : **Kick** - {species} kicks the opponent with his muscular fin.";
|
||||
}
|
||||
if (fish.Lvl >= 15)
|
||||
{
|
||||
attacks += $"\n3 : **Flex** - {species} flexes his fin muscles, stunning the opponent.";
|
||||
}
|
||||
if (fish.Lvl >= 30)
|
||||
{
|
||||
attacks += $"\n4 : **Restoration Wand** - {species} spins his wand to recover some health.";
|
||||
}
|
||||
if (fish.Lvl >= 50)
|
||||
{
|
||||
attacks += $"\n5 : **Fairy Nightmare** - {species} executes a devastating ultimate attack.";
|
||||
}
|
||||
|
||||
att = 9 * lvlm;
|
||||
def = 9 * lvlm;
|
||||
hp = 9 * lvlmhp;
|
||||
ap = 3 * lvlmhp;
|
||||
|
||||
dg = 2 * lvlm;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
species = "Birgus";
|
||||
if (fish.Lvl >= 100)
|
||||
{
|
||||
species += $"";
|
||||
prefix = $"Great Sage";
|
||||
}
|
||||
|
||||
attacks += $"1 : **Staff Slam** - {species} hits the enemy with its staff.";
|
||||
if (fish.Lvl >= 5)
|
||||
{
|
||||
attacks += $"\n2 : **Chitin Shards** - {species} summons a blast of magical shards at your opponent.";
|
||||
}
|
||||
if (fish.Lvl >= 15)
|
||||
{
|
||||
attacks += $"\n3 : **Iron Shell** - {species} materializes a hard shell, increasing defense.";
|
||||
}
|
||||
if (fish.Lvl >= 30)
|
||||
{
|
||||
attacks += $"\n4 : **Siphon Gaze** - {species} absorbs the enemy's life force with an enigmatic gaze.";
|
||||
}
|
||||
if (fish.Lvl >= 50)
|
||||
{
|
||||
attacks += $"\n5 : **Ecletic Rift** - {species} summons portals to alternate dimensions to call forth an army of raving crabs.";
|
||||
}
|
||||
|
||||
att = 10 * lvlm;
|
||||
def = 6 * lvlm;
|
||||
hp = 5 * lvlmhp;
|
||||
ap = 9 * lvlmhp;
|
||||
|
||||
dg = 4 * lvlm;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
{
|
||||
species = "Abama";
|
||||
if (fish.Lvl >= 100)
|
||||
{
|
||||
species += $"";
|
||||
prefix = $"President";
|
||||
}
|
||||
|
||||
attacks += $"1 : **Tentacle Slap** - {species} slaps the opponent with its tentacle.";
|
||||
if (fish.Lvl >= 5)
|
||||
{
|
||||
attacks += $"\n2 : **Squirt Ink** - {species} shoots ink at the opponent, blinding them temporarily.";
|
||||
}
|
||||
if (fish.Lvl >= 15)
|
||||
{
|
||||
attacks += $"\n3 : **Bind** - {species} holds down the opponent with its tentacles.";
|
||||
}
|
||||
if (fish.Lvl >= 30)
|
||||
{
|
||||
attacks += $"\n4 : **Metabolism** - {species} increases metabolism to instantly remove all ailments.";
|
||||
}
|
||||
if (fish.Lvl >= 50)
|
||||
{
|
||||
attacks += $"\n5 : **Ancestral Wrath** - {species} calls into the depths to unleash its true potential.";
|
||||
}
|
||||
|
||||
att = 4 * lvlm;
|
||||
def = 3 * lvlm;
|
||||
hp = 5 * lvlmhp;
|
||||
ap = 18 * lvlmhp;
|
||||
|
||||
dg = 8 * lvlm;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
species = "Pistashrimp";
|
||||
if (fish.Lvl >= 100)
|
||||
{
|
||||
species += $" XTREME";
|
||||
prefix = $"Hardboiled";
|
||||
}
|
||||
|
||||
attacks += $"1 : **Pistolwhip** - {species} swings at the enemy with the back of its pistol.";
|
||||
if (fish.Lvl >= 5)
|
||||
{
|
||||
attacks += $"\n2 : **Fire** - {species} shoots a round from its pistol.";
|
||||
}
|
||||
if (fish.Lvl >= 15)
|
||||
{
|
||||
attacks += $"\n3 : **Fedora Tip** - {species} tips its charming headwear, seducing the enemy.";
|
||||
}
|
||||
if (fish.Lvl >= 30)
|
||||
{
|
||||
attacks += $"\n4 : **Water Jet** - {species} tosses aside its silly weapon and snaps with its real claw.";
|
||||
}
|
||||
if (fish.Lvl >= 50)
|
||||
{
|
||||
attacks += $"\n5 : **Dual Jet** - {species} vaporizes the surrounding with its machine gun claws.";
|
||||
}
|
||||
|
||||
att = 15 * lvlm;
|
||||
def = 4 * lvlm;
|
||||
hp = 5 * lvlmhp;
|
||||
ap = 6 * lvlmhp;
|
||||
|
||||
dg = 6 * lvlm;
|
||||
}
|
||||
break;
|
||||
}
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}'s LVL {fish.Lvl} **{prefix} {species}**\nName: **{fish.Name}**\nStats: **ATK : {att} DEF : {def} HP : {hp} AP : {ap}**\nActions:\n{attacks}");
|
||||
|
||||
}
|
||||
else if (option == "name" && sec != null|| option == "n" && sec != null)
|
||||
{
|
||||
if (sec.Length > 16)
|
||||
{
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nThe maximum name length is 16 characters. \nStop jassing.");
|
||||
return;
|
||||
}
|
||||
else if (fish.FishType != 0)
|
||||
{
|
||||
fish.Name = sec;
|
||||
await Database.SaveChangesAsync();
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nYou have changed the name of your battlefish to **{sec}**.");
|
||||
}
|
||||
else
|
||||
{
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nYou can't manage a fish if you don't have one.");
|
||||
}
|
||||
|
||||
}
|
||||
else if (option == "buy" || option == "b")
|
||||
{
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nHere is a list of available battlefish. Please choose one by its respective number. All battlefish cost 0.05%." +
|
||||
$"\n1 : **Herring** - An unarmed melee fighter with well balanced stats. It is not very agile.\nModifiers: **ATK 9, DEF 9, HP 9, AP 2**" +
|
||||
$"\n2 : **Birgus** - A crustacean mage with a focus on AP and DMG. It is slightly agile.\nModifiers: **ATK 10, DEF 6, HP 5, AP 9**" +
|
||||
$"\n3 : **Abama** - A cephalopod rogue with a heavy focus on debuffs. It is very agile.\nModifiers: **ATK 4, DEF 3, HP 5, AP 18**" +
|
||||
$"\n4 : **Pistashrimp** - A crustacean ranger with a heavy focus on DPS. It is somewhat agile.\nModifiers: **ATK 15, DEF 4, HP 5, AP 6**");
|
||||
var reply = await NextMessageAsync();
|
||||
byte rep = byte.Parse(reply.Content);
|
||||
if (rep > 4 || rep < 1)
|
||||
{
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nWhat you're looking for does not exist.");
|
||||
return;
|
||||
}
|
||||
else if (user.Money < 500)
|
||||
{
|
||||
await Context.Channel.SendMessageAsync($"Sorry **{Context.User.Mention}**, I can't give credit.\nCome back when you're a little, ***mmmmm***, richer.\n*You're missing {(500 - user.Money)/10000d}%.*");
|
||||
return;
|
||||
}
|
||||
switch (rep)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
species = "a Herring";
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
species = "a Birgus";
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
{
|
||||
species = "an Abama";
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
species = "a Pistashrimp";
|
||||
}
|
||||
break;
|
||||
}
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nYou want **{species}**? It's yours my friend, as long as you have enough **%**.\n *This cannot be reverted. Type 'confirm' to confirm.*");
|
||||
reply = await NextMessageAsync();
|
||||
if (reply.Content.ToLowerInvariant() == "confirm")
|
||||
{
|
||||
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.");
|
||||
return;
|
||||
}
|
||||
//create fish here pls let there fish be
|
||||
fish.FishType = rep;
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nThank you for your purchase.");
|
||||
await Database.SaveChangesAsync();
|
||||
}
|
||||
else
|
||||
{
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nYour purchase is cancelled.");
|
||||
}
|
||||
}
|
||||
else if (option == "info" || option == "i")
|
||||
{
|
||||
string info = "";
|
||||
if (sec.ToLowerInvariant() == "herring")
|
||||
{
|
||||
info = "Equipment type: Enhancing clothing.\nBonus info: Only males of this species exist. I don't know how they reproduce, and I might not want to know.";
|
||||
}
|
||||
else if (sec.ToLowerInvariant() == "birgus")
|
||||
{
|
||||
info = "Equipment type: Staves.\nBonus info: Exceptional Birguses may live for centuries, their powers increasing with age. While breeding, they part with much of their potential power, so few of them actually do so.";
|
||||
}
|
||||
else if (sec.ToLowerInvariant() == "abama")
|
||||
{
|
||||
info = "Equipment type: Enhancing clothing.\nBonus info: The tentacles are not just for show. Being highly agile and stealthy, Abamas are experts at grabbing things unnoticed.";
|
||||
}
|
||||
else if (sec.ToLowerInvariant() == "pistashrimp")
|
||||
{
|
||||
info = "Equipment type: Firearms.\nBonus info: Despite making up only 13% of the underwater wildlife, Pistashrimps account for 100% of the unarmed firearm robberies. Few of them are righteous, but the ones that are make for great detectives.";
|
||||
}
|
||||
else
|
||||
{
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nNot a valid fish.");
|
||||
return;
|
||||
}
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\n{info}");
|
||||
}
|
||||
else if (option == "help" || option == "h")
|
||||
{
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}" +
|
||||
$"\n**name or n** to name your fish." +
|
||||
$"\n**buy or b** to buy a fish." +
|
||||
$"\n**info or i** along with **name of bf** to get further info on a battlefish." +
|
||||
$"\n**help or h** to view this." +
|
||||
$"\n**change or c** to change battlefish to any owned fish." +
|
||||
$"\nSpecify **no option** to view your battlefish stats.");
|
||||
}
|
||||
else if (option == "change" || option == "c")
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nAre you confused? Try **bf help** if you are having trouble with your bf.");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
[RequireRolePrecondition(AccessLevel.BotOwner)]
|
||||
[Command("gstore", RunMode = RunMode.Async),Alias("gs")]
|
||||
public async Task GeneralStore(string input = null)
|
||||
{
|
||||
using (var Database = new ApplicationDbContextFactory().CreateDbContext())
|
||||
{
|
||||
var fuser = Database.Fishing.FirstOrDefault(x => x.Id == Context.User.Id);
|
||||
var user = Database.Users.FirstOrDefault(x => x.Id == Context.User.Id);
|
||||
var inv = fuser.GetInventory();
|
||||
if (input != null)
|
||||
{
|
||||
input = input.ToLowerInvariant();
|
||||
}
|
||||
if (input == null)
|
||||
{
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nHere's a list of available items.");
|
||||
}
|
||||
else if (input == "b" || input == "buy")
|
||||
{
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nSpecify the item.");
|
||||
var inp = await NextMessageAsync();
|
||||
switch (Convert.ToInt32(inp))
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
{
|
||||
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
{
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
else if (input == "s" || input == "sell")
|
||||
{
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nSpecify the item.");
|
||||
|
||||
var inp = await NextMessageAsync();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
[RequireRolePrecondition(AccessLevel.BotOwner)]
|
||||
[Command("setbf")]
|
||||
public async Task SetBattleFish(byte type, IUser usar = null)
|
||||
{
|
||||
string species = "";
|
||||
switch (type)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
species = "None";
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
species = "Herring";
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
species = "Birgus";
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
{
|
||||
species = "Abama";
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
species = "Pistashrimp";
|
||||
}
|
||||
break;
|
||||
}
|
||||
using (var Database = new ApplicationDbContextFactory().CreateDbContext())
|
||||
{
|
||||
if (usar == null)
|
||||
{
|
||||
var user = Database.Users.FirstOrDefault(x => x.Id == Context.User.Id).BattleFish.FirstOrDefault();
|
||||
user.FishType = type;
|
||||
await Context.Channel.SendMessageAsync($"Changed **{Context.User.Username}**'s bf type to {species}.");
|
||||
}
|
||||
else
|
||||
{
|
||||
var user = Database.Users.FirstOrDefault(x => x.Id == usar.Id).BattleFish.FirstOrDefault();
|
||||
user.FishType = type;
|
||||
await Context.Channel.SendMessageAsync($"Changed **{usar.Username}**'s bf type to {species}.");
|
||||
}
|
||||
await Database.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
[RequireRolePrecondition(AccessLevel.BotOwner)]
|
||||
[Command("setbflv")]
|
||||
public async Task SetBattleFishLevel(int lv, IUser usar = null)
|
||||
{
|
||||
using (var Database = new ApplicationDbContextFactory().CreateDbContext())
|
||||
{
|
||||
if (usar == null)
|
||||
{
|
||||
var user = Database.Users.FirstOrDefault(x => x.Id == Context.User.Id).BattleFish.FirstOrDefault();
|
||||
user.Lvl = lv;
|
||||
await Context.Channel.SendMessageAsync($"Changed **{Context.User.Username}**'s bf lvl to {lv}.");
|
||||
}
|
||||
else
|
||||
{
|
||||
var user = Database.Users.FirstOrDefault(x => x.Id == usar.Id).BattleFish.FirstOrDefault();
|
||||
user.Lvl = lv;
|
||||
await Context.Channel.SendMessageAsync($"Changed **{usar.Username}**'s bf lvl to {lv}.");
|
||||
}
|
||||
await Database.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,24 +16,20 @@ namespace Kehyeedra3.Commands
|
||||
{
|
||||
|
||||
[Command("delet"), Summary("Posts a delet this image. Can be used on other channels.")]
|
||||
public async Task DeletThis()
|
||||
public async Task DeletThis(ITextChannel channel = null)
|
||||
{
|
||||
string imgdirpath = Path.Combine(Environment.CurrentDirectory, "Delet");
|
||||
DirectoryInfo imgdir = new DirectoryInfo(imgdirpath);
|
||||
var files = imgdir.GetFiles();
|
||||
var item = files[Bot._rnd.Next(0, files.Length)];
|
||||
await Context.Channel.SendFileAsync(item.FullName);
|
||||
|
||||
}
|
||||
[Command("delet"), Summary("Posts a delet this image. Can be used on other channels.")]
|
||||
public async Task DeletThis(ITextChannel channel)
|
||||
{
|
||||
string imgdirpath = Path.Combine(Environment.CurrentDirectory, "Delet");
|
||||
DirectoryInfo imgdir = new DirectoryInfo(imgdirpath);
|
||||
var files = imgdir.GetFiles();
|
||||
var item = files[Bot._rnd.Next(0, files.Length)];
|
||||
await channel.SendFileAsync(item.FullName);
|
||||
|
||||
if (channel == null)
|
||||
{
|
||||
await Context.Channel.SendFileAsync(item.FullName);
|
||||
}
|
||||
else
|
||||
{
|
||||
await channel.SendFileAsync(item.FullName);
|
||||
}
|
||||
}
|
||||
|
||||
[Command("ratetrap"), Summary("Rates your or another person's trap potential as a percentage")]
|
||||
@@ -47,11 +43,11 @@ namespace Kehyeedra3.Commands
|
||||
if (trapRating0 == 100)
|
||||
{
|
||||
int trapRating1 = rando1.Next(0, 1001);
|
||||
await Context.Channel.SendMessageAsync($"I'd say right now you're {trapRating1}% passable");
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nI'd say right now you're {trapRating1}% passable");
|
||||
}
|
||||
else
|
||||
{
|
||||
await Context.Channel.SendMessageAsync($"I'd say right now you're {trapRating0}% passable");
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nI'd say right now you're {trapRating0}% passable");
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -62,11 +58,11 @@ namespace Kehyeedra3.Commands
|
||||
if (trapRating0 == 100)
|
||||
{
|
||||
int trapRating1 = rando1.Next(0, 1001);
|
||||
await Context.Channel.SendMessageAsync($"I'd say right now {name} is {trapRating1}% passable");
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nI'd say right now {name} is {trapRating1}% passable");
|
||||
}
|
||||
else
|
||||
{
|
||||
await Context.Channel.SendMessageAsync($"I'd say right now {name} is {trapRating0}% passable");
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nI'd say right now {name} is {trapRating0}% passable");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,7 +71,7 @@ namespace Kehyeedra3.Commands
|
||||
[Command("ratertrap"), Summary("ratertrap")]
|
||||
public async Task RaterTrap()
|
||||
{
|
||||
await Context.Channel.SendMessageAsync("Please do not be like this man http://tinyurl.com/y7lj6nob");
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\nPlease do not be like this man http://tinyurl.com/y7lj6nob");
|
||||
}
|
||||
[Command("8b"), Summary("Gives a prediction like a generic 8ball command that every self respecting discord bot must have")]
|
||||
public async Task VapeBall([Remainder] string input)
|
||||
@@ -91,7 +87,7 @@ namespace Kehyeedra3.Commands
|
||||
};
|
||||
int randomIndex = rando.Next(predictions.Length);
|
||||
string text = predictions[randomIndex];
|
||||
await ReplyAsync(text + " " + Context.User.Mention);
|
||||
await ReplyAsync($"{Context.User.Mention}\n{text}");
|
||||
}
|
||||
[Command("math"), Summary("It's a calculator, that's what compooter do")]
|
||||
public async Task Mathboi([Remainder] string input)
|
||||
@@ -104,7 +100,7 @@ namespace Kehyeedra3.Commands
|
||||
{
|
||||
int dinput = int.Parse(input.Substring(input.IndexOf("d")).Replace("d", ""));
|
||||
int output = SRandom.Next(dinput);
|
||||
await Context.Channel.SendMessageAsync("" + output + 1);
|
||||
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")]
|
||||
public async Task Reminder(ulong d, ulong h, ulong m, [Remainder] string r)
|
||||
@@ -146,24 +142,24 @@ namespace Kehyeedra3.Commands
|
||||
}
|
||||
else
|
||||
{
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention} Are you sure you need a reminder 2 years in the future..? \nAre you stupid?");
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\n Are you sure you need a reminder 2 years in the future..? \nAre you stupid?");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (d > 0)
|
||||
{
|
||||
remin += $"{d} days ";
|
||||
remin += $" {d} days";
|
||||
}
|
||||
if (h > 0)
|
||||
{
|
||||
remin += $"{h} hours ";
|
||||
remin += $" {h} hours";
|
||||
}
|
||||
if (m > 0)
|
||||
{
|
||||
remin += $"{m} minutes ";
|
||||
remin += $" {m} minutes";
|
||||
}
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention} Ok, I'll remind you in {remin}");
|
||||
await Context.Channel.SendMessageAsync($"{Context.User.Mention}\n Ok, I'll remind you in{remin}.");
|
||||
}
|
||||
|
||||
[Command("dab"), Summary("Dabs a person")]
|
||||
|
||||
Reference in New Issue
Block a user