diff --git a/Kehyeedra3/ApplicationDbContext.cs b/Kehyeedra3/ApplicationDbContext.cs index ee4a901..00d1fd0 100644 --- a/Kehyeedra3/ApplicationDbContext.cs +++ b/Kehyeedra3/ApplicationDbContext.cs @@ -10,6 +10,6 @@ namespace Kehyeedra3 public DbSet Users { get; set; } public DbSet Reminders { get; set; } - //public DbSet Fishing { get; set; } + public DbSet Fishing { get; set; } } } diff --git a/Kehyeedra3/Commands.cs b/Kehyeedra3/Commands.cs index 661e0b9..e38fd5b 100644 --- a/Kehyeedra3/Commands.cs +++ b/Kehyeedra3/Commands.cs @@ -249,7 +249,7 @@ namespace Kehyeedra3 var reminder = new Reminder { UserId = Context.User.Id, - Message = ($"Ok dude so at about UTC{dt} you wanted me to remind you and I quote '{r}'"), + Message = ($"At UTC {dt} you wanted me to remind you: **'{r}'**"), Created = yeedraStamp, Send = ((d * 86400) + (h * 3600) + (m * 60)) + yeedraStamp }; @@ -313,6 +313,7 @@ namespace Kehyeedra3 "a **Viet Cong Tunnel**,", "a single unit of several **Trees**,", "**1,000,000₩**,", + "**Jas's Love**,", "a **Rock Golem**,", "a piece of **Toast**,", "**Luminite**,", @@ -337,7 +338,8 @@ namespace Kehyeedra3 "it appears to have vanished", "but it seems like you were hallucinating", "but it is seized by the communists", - "you mistake it for a chance to succeed in life and throw it away" + "you mistake it for a chance to succeed in life and throw it away", + "you get scared and curb stomp it, shattering it" }; readonly string[] rfish = new string[] { @@ -479,7 +481,7 @@ namespace Kehyeedra3 { if (rarity == 7) { - rar = "***Glorious***"; + rar = "***Legendary***"; rarmult = 7; fish = "Lucky Catfish"; } @@ -493,27 +495,29 @@ namespace Kehyeedra3 } } - int weight = SRandom.Next(1, 201); + int weight = SRandom.Next(1, 151); int size = 0; - if (weight > 150 || rarmult == 7) + if (weight >= 75) { - size = 3; + size = 2; + if (weight >= 100) + { + weight = SRandom.Next(1, 201); + } } else { - if (weight > 100) - { - size = 2; - } - else - { - size = 1; - } + size = 1; + } + + if (weight >= 150 || rarmult == 7) + { + size = 3; } int value = size + rarmult; - await Context.Channel.SendMessageAsync($"You have caught a {weight/10d}kg **{fish}**, rarity: {rar}"); + await Context.Channel.SendMessageAsync($"{Context.User.Mention} You have caught a {weight/10d}kg **{fish}**, rarity: {rar}"); } [Command("balance")] public async Task Shekels([Remainder] IUser otherUser = null) @@ -545,7 +549,7 @@ namespace Kehyeedra3 await Database.SaveChangesAsync(); } } - await Context.Channel.SendMessageAsync($"{Context.User.Mention} You own {user.Money / 10000d}%\nWhich is {(user.Money * 100) / (1000000 - buser.Money - suser.Money)}% of the money in circulation"); + await Context.Channel.SendMessageAsync($"{Context.User.Mention} You own {user.Money / 10000d}%\nWhich is ~{Math.Round(((user.Money * 100d) / (1000000d - buser.Money - suser.Money)), 2, MidpointRounding.ToEven)}% of the money in circulation"); } else { @@ -566,7 +570,15 @@ namespace Kehyeedra3 await Context.Channel.SendMessageAsync($"{otherUser.Mention} owns {user.Money / 10000d}%\nWhich is {(user.Money * 100) / (1000000 - buser.Money - suser.Money)}% of the money in circulation"); } } - + [Command("top")] + public async Task Leaderboard() + { + User user; + using (var Database = new ApplicationDbContextFactory().CreateDbContext()) + { + + } + } [Command("bank")] public async Task BankBalance() { @@ -582,9 +594,16 @@ namespace Kehyeedra3 [Command("bet")] public async Task Gamble(int wager) { - int res0 = SRandom.Next(0, 10000000); - Random ran = new Random(res0); - int res1 = ran.Next(0, 101); + 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; @@ -608,7 +627,7 @@ namespace Kehyeedra3 } else { - if (res1 < 60) + if (res1 < 50) { wager = 0; } @@ -818,7 +837,14 @@ namespace Kehyeedra3 //reply await ReplyAsync($"Set name to {_name}"); } - [RequireRolePrecondition(AccessLevel.BotOwner)] + [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) @@ -845,7 +871,6 @@ namespace Kehyeedra3 break; } } - } //public class _ : ModuleBase diff --git a/Kehyeedra3/Migrations/20200220195125_Fishing.Designer.cs b/Kehyeedra3/Migrations/20200220195125_Fishing.Designer.cs new file mode 100644 index 0000000..5d1892d --- /dev/null +++ b/Kehyeedra3/Migrations/20200220195125_Fishing.Designer.cs @@ -0,0 +1,122 @@ +// +using Kehyeedra3; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +namespace Kehyeedra3.Migrations +{ + [DbContext(typeof(ApplicationDbContext))] + [Migration("20200220195125_Fishing")] + partial class Fishing + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "3.1.1") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("Kehyeedra3.Services.Models.Fishing", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + b.Property("CFish1") + .HasColumnType("bigint unsigned"); + + b.Property("CFish2") + .HasColumnType("bigint unsigned"); + + b.Property("CFish3") + .HasColumnType("bigint unsigned"); + + b.Property("LFish") + .HasColumnType("bigint unsigned"); + + b.Property("LastFish") + .HasColumnType("bigint unsigned"); + + b.Property("Lvl") + .HasColumnType("bigint unsigned"); + + b.Property("RFish1") + .HasColumnType("bigint unsigned"); + + b.Property("RFish2") + .HasColumnType("bigint unsigned"); + + b.Property("RFish3") + .HasColumnType("bigint unsigned"); + + b.Property("TXp") + .HasColumnType("bigint unsigned"); + + b.Property("UFish1") + .HasColumnType("bigint unsigned"); + + b.Property("UFish2") + .HasColumnType("bigint unsigned"); + + b.Property("UFish3") + .HasColumnType("bigint unsigned"); + + b.Property("Xp") + .HasColumnType("bigint unsigned"); + + b.HasKey("Id"); + + b.ToTable("Fishing"); + }); + + modelBuilder.Entity("Kehyeedra3.Services.Models.Reminder", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + b.Property("Created") + .HasColumnType("bigint unsigned"); + + b.Property("Message") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Send") + .HasColumnType("bigint unsigned"); + + b.Property("UserId") + .HasColumnType("bigint unsigned"); + + b.HasKey("Id"); + + b.ToTable("Reminders"); + }); + + modelBuilder.Entity("Kehyeedra3.Services.Models.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + b.Property("Avatar") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("LastMine") + .HasColumnType("bigint unsigned"); + + b.Property("Money") + .HasColumnType("bigint"); + + b.Property("Username") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.ToTable("Users"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Kehyeedra3/Migrations/20200220195125_Fishing.cs b/Kehyeedra3/Migrations/20200220195125_Fishing.cs new file mode 100644 index 0000000..91d1889 --- /dev/null +++ b/Kehyeedra3/Migrations/20200220195125_Fishing.cs @@ -0,0 +1,43 @@ +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace Kehyeedra3.Migrations +{ + public partial class Fishing : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "Fishing", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + LastFish = table.Column(nullable: false), + Xp = table.Column(nullable: false), + TXp = table.Column(nullable: false), + Lvl = table.Column(nullable: false), + CFish1 = table.Column(nullable: false), + CFish2 = table.Column(nullable: false), + CFish3 = table.Column(nullable: false), + UFish1 = table.Column(nullable: false), + UFish2 = table.Column(nullable: false), + UFish3 = table.Column(nullable: false), + RFish1 = table.Column(nullable: false), + RFish2 = table.Column(nullable: false), + RFish3 = table.Column(nullable: false), + LFish = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Fishing", x => x.Id); + }); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "Fishing"); + } + } +} diff --git a/Kehyeedra3/Migrations/ApplicationDbContextModelSnapshot.cs b/Kehyeedra3/Migrations/ApplicationDbContextModelSnapshot.cs index 844e040..44e1c31 100644 --- a/Kehyeedra3/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/Kehyeedra3/Migrations/ApplicationDbContextModelSnapshot.cs @@ -16,6 +16,59 @@ namespace Kehyeedra3.Migrations .HasAnnotation("ProductVersion", "3.1.1") .HasAnnotation("Relational:MaxIdentifierLength", 64); + modelBuilder.Entity("Kehyeedra3.Services.Models.Fishing", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + b.Property("CFish1") + .HasColumnType("bigint unsigned"); + + b.Property("CFish2") + .HasColumnType("bigint unsigned"); + + b.Property("CFish3") + .HasColumnType("bigint unsigned"); + + b.Property("LFish") + .HasColumnType("bigint unsigned"); + + b.Property("LastFish") + .HasColumnType("bigint unsigned"); + + b.Property("Lvl") + .HasColumnType("bigint unsigned"); + + b.Property("RFish1") + .HasColumnType("bigint unsigned"); + + b.Property("RFish2") + .HasColumnType("bigint unsigned"); + + b.Property("RFish3") + .HasColumnType("bigint unsigned"); + + b.Property("TXp") + .HasColumnType("bigint unsigned"); + + b.Property("UFish1") + .HasColumnType("bigint unsigned"); + + b.Property("UFish2") + .HasColumnType("bigint unsigned"); + + b.Property("UFish3") + .HasColumnType("bigint unsigned"); + + b.Property("Xp") + .HasColumnType("bigint unsigned"); + + b.HasKey("Id"); + + b.ToTable("Fishing"); + }); + modelBuilder.Entity("Kehyeedra3.Services.Models.Reminder", b => { b.Property("Id") diff --git a/Kehyeedra3/Services/Models/Fishing.cs b/Kehyeedra3/Services/Models/Fishing.cs index 403363b..35afd24 100644 --- a/Kehyeedra3/Services/Models/Fishing.cs +++ b/Kehyeedra3/Services/Models/Fishing.cs @@ -1,17 +1,25 @@ -//namespace Kehyeedra3.Services.Models -//{ -// class Fishing -// { -// public ulong UserId { get; set; } = 0; -// public ulong LastFish { get; set; } = 0; -// public ulong CFish { get; set; } = 0; -// public ulong CVal {get; set;} = 0; -// public ulong UFish { get; set; } = 0; -// public ulong UVal {get; set;} = 0; -// public ulong RFish { get; set; } = 0; -// public ulong RVal { get; set; } = 0; -// public ulong LFish { get; set; } = 0; -// public ulong LVal { get; set; } = 0; -// public ulong XP { get; set; } = 0; -// } -//} +namespace Kehyeedra3.Services.Models +{ + public class Fishing + { + public ulong Id { get; set; } = 0; // this is userid incase you get alzheimers you stupid baby waa waa + public ulong LastFish { get; set; } = 0; + public ulong Xp { get; set; } = 0; + public ulong TXp { get; set; } = 0; + public ulong Lvl { get; set; } = 0; + + public ulong CFish1 { get; set; } = 0; + public ulong CFish2 { get; set; } = 0; + public ulong CFish3 { get; set; } = 0; + + public ulong UFish1 { get; set; } = 0; + public ulong UFish2 { get; set; } = 0; + public ulong UFish3 { get; set; } = 0; + + public ulong RFish1 { get; set; } = 0; + public ulong RFish2 { get; set; } = 0; + public ulong RFish3 { get; set; } = 0; + + public ulong LFish { get; set; } = 0; + } +}