minor improvements

made it possible to get multiple fishing levels at once, fixed up reminder command, commented test commands
master
Lan 5 years ago
parent e0d81edf49
commit 9ccc007b3f
  1. 211
      Kehyeedra3/Commands/Admin.cs
  2. 30
      Kehyeedra3/Commands/Economy.cs
  3. 65
      Kehyeedra3/Commands/Stuff.cs
  4. 4
      Kehyeedra3/Services/Models/Fishing.cs

@ -115,40 +115,185 @@ namespace Kehyeedra3.Commands
await Context.Channel.SendMessageAsync($"{content}"); await Context.Channel.SendMessageAsync($"{content}");
} }
} }
/* // test commands
[RequireRolePrecondition(AccessLevel.BotOwner)] //[RequireRolePrecondition(AccessLevel.BotOwner)]
[Command("getstamp")] //[Command("cbt", RunMode = RunMode.Async)]
public async Task YeedraStamp() //public async Task CombatTest()
{ //{
ulong stamp = DateTime.UtcNow.ToYeedraStamp(); // string[] attackse = new string[]
await ReplyAsync($"{Context.User.Mention} {stamp}"); // {
} // "a bite",
[RequireRolePrecondition(AccessLevel.BotOwner)] // "a crowbar",
[Command("savefile")] // "invasive odor",
// "an intense slap"
// };
public async Task SaveFile(string fday, string fscore) // int hp = 100;
{ // int atk = 100;
string location = Path.Combine(Environment.CurrentDirectory, "drawtasks"); // int bhp = 1000;
string tlocation = ($"{location}/days.txt"); // int dmg = 0;
var attachments = Context.Message.Attachments; // int edg = 0;
string fname = $"{fday}-{fscore}"; // string cbta = "";
if (File.Exists(location + "/days.txt")) // 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 = "Firearm";
// 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() == "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;
// }
//}
//[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) // foreach (var item in attachments)
{ // {
Uri link = new Uri(item.Url); // Uri link = new Uri(item.Url);
using (WebClient _webclient = new WebClient()) // using (WebClient _webclient = new WebClient())
{ // {
if (!Directory.Exists(location)) // if (!Directory.Exists(location))
Directory.CreateDirectory(location); // Directory.CreateDirectory(location);
location += ($"/{fday}-{fscore}.jpg"); // location += ($"/{fday}-{fscore}.jpg");
_webclient.DownloadFileAsync(link, location); // _webclient.DownloadFileAsync(link, location);
} // }
await ReplyAsync($"Post archived"); // await ReplyAsync($"Post archived");
break; // break;
} // }
}*/ //}
} }
} }

@ -443,21 +443,33 @@ namespace Kehyeedra3.Commands
user.TXp += xp; user.TXp += xp;
toNextLvl = user.Xp - user.TXp; toNextLvl = user.Xp - user.TXp;
int times = 0;
if (user.TXp >= user.Xp) if (user.TXp >= user.Xp)
{ {
user.Lvl += 1; while (user.TXp >= user.Xp)
lvlXp = 50;
for (ulong i = 0; i < user.Lvl; i++)
{ {
if (i <= user.Lvl) user.Lvl += 1;
times += 1;
lvlXp = 50;
for (ulong i = 0; i < user.Lvl; i++)
{ {
lvlXp += Convert.ToUInt64(Math.Round((lvlXp * 0.05d + 50d), 0, MidpointRounding.ToEven)); if (i <= user.Lvl)
{
lvlXp += Convert.ToUInt64(Math.Round((lvlXp * 0.05d + 50d), 0, MidpointRounding.ToEven));
}
} }
user.Xp = lvlXp;
} }
user.Xp = lvlXp;
toNextLvl = user.Xp - user.TXp; toNextLvl = user.Xp - user.TXp;
level = user.Lvl; level = user.Lvl;
lvlUp = $"**You leveled up!** You are now **Level {level}**"; if (times > 1)
{
lvlUp = $"**You leveled up {times} times!** You are now **Level {level}.**";
}
else
{
lvlUp = $"**You leveled up!** You are now **Level {level}**";
}
} }
else else
{ {
@ -511,6 +523,10 @@ namespace Kehyeedra3.Commands
{ {
rodtype = "Spectral"; rodtype = "Spectral";
} }
else if (tier == 4)
{
rodtype = "Cosmic";
}
else else
{ {
rodtype = "Currently unobtainable"; rodtype = "Currently unobtainable";

@ -108,41 +108,60 @@ namespace Kehyeedra3.Commands
DateTime dt = DateTime.UtcNow; DateTime dt = DateTime.UtcNow;
string time = dt.ToString("dd/MM/yyyy HH:mm"); string time = dt.ToString("dd/MM/yyyy HH:mm");
string remin = "";
ulong sen = (d * 86400) + (h * 3600) + (m * 60);
ulong yeedraStamp = DateTime.UtcNow.ToYeedraStamp(); ulong yeedraStamp = DateTime.UtcNow.ToYeedraStamp();
var reminder = new Reminder while (m > 60)
{ {
UserId = Context.User.Id, h += 1;
Message = ($"At **UTC {time}** you wanted me to remind you:\n**'{r}'**"), m -= 60;
Created = yeedraStamp, }
Send = ((d * 86400) + (h * 3600) + (m * 60)) + yeedraStamp while (h > 24)
}; {
d += 1;
h -= 24;
}
using (var Database = new ApplicationDbContextFactory().CreateDbContext()) if (sen < 63072000)
{ {
Database.Reminders.Add(reminder); var reminder = new Reminder
{
UserId = Context.User.Id,
Message = ($"At **UTC {time}** you wanted me to remind you:\n**'{r}'**"),
Created = yeedraStamp,
Send = sen + yeedraStamp
};
await Database.SaveChangesAsync().ConfigureAwait(false); using (var Database = new ApplicationDbContextFactory().CreateDbContext())
{
Database.Reminders.Add(reminder);
await Database.SaveChangesAsync().ConfigureAwait(false);
}
} }
await Context.Channel.SendMessageAsync($"{Context.User.Mention} Ok, I'll remind you in {d}d {h}h {m}m"); else
}
[Command("grant"), Summary("Bambi Sit janksie")]
public async Task Daycare(IGuildUser ouser)
{
var user = Context.Guild.GetUser(Context.User.Id);
var drole = Context.Guild.GetRole(682109241363922965);
if (user.Roles.Any(x => x.Id == 682109241363922965))
{ {
await user.RemoveRoleAsync(drole); await Context.Channel.SendMessageAsync($"{Context.User.Mention} Are you sure you need a reminder 2 years in the future..? \nAre you stupid?");
await ouser.AddRoleAsync(drole); return;
await Context.Channel.SendMessageAsync($"*{ouser.Mention} the power of daycare rests in the palm of your hands*");
} }
else
if (d > 0)
{
remin += $"{d} days ";
}
if (h > 0)
{
remin += $"{h} hours ";
}
if (m > 0)
{ {
await Context.Channel.SendMessageAsync($"HNNNNG you do not possess this power HNNNGGGG"); remin += $"{m} minutes ";
} }
await Context.Channel.SendMessageAsync($"{Context.User.Mention} Ok, I'll remind you in {remin}");
} }
[Command("dab"), Summary("Dabs a person")] [Command("dab"), Summary("Dabs a person")]
public async Task Dab(IGuildUser user = null) public async Task Dab(IGuildUser user = null)
{ {

@ -236,7 +236,7 @@ namespace Kehyeedra3.Services.Models
}, },
new Fish() new Fish()
{ {
Id = FishSpecies.T3Unc, Id = FishSpecies.T3Flameworm,
Name = "Spectral Flameworm", Name = "Spectral Flameworm",
Emote = "<:missingLeg:682586847830081551>", Emote = "<:missingLeg:682586847830081551>",
Rarity = FishRarity.T3Uncommon Rarity = FishRarity.T3Uncommon
@ -320,7 +320,7 @@ namespace Kehyeedra3.Services.Models
//T3 Rare //T3 Rare
T3Crab = 25, T3Crab = 25,
//T3 Uncommon //T3 Uncommon
T3Unc = 26, T3Flameworm = 26,
//T3 Common //T3 Common
T3Com = 27, T3Com = 27,
//T4 Legendary //T4 Legendary

Loading…
Cancel
Save