diff --git a/Kehyeedra3/Commands.cs b/Kehyeedra3/Commands.cs index 70e202e..be13ca5 100644 --- a/Kehyeedra3/Commands.cs +++ b/Kehyeedra3/Commands.cs @@ -340,22 +340,42 @@ namespace Kehyeedra3 "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 get scared and curb stomp it, shattering it" + "you get scared and curb stomp it, shattering it", + "the **Goblins** claim rightful possession of it" }; - readonly string[] rfish = new string[] + readonly FishSpecies[] rfish = new FishSpecies[] { - "Clownfish", - "Doomfish" + FishSpecies.Doomfish, + FishSpecies.Clownfish, + FishSpecies.GenericFish, + FishSpecies.Ultracrab, + FishSpecies.BlobFish, + FishSpecies.Psychedelica, }; - readonly string[] ufish = new string[] + readonly FishSpecies[] ufish = new FishSpecies[] { - "Mantis Shrimp", - "Gigacrab" + FishSpecies.Gigacrab, + FishSpecies.MantisShrimp, + FishSpecies.GoblinFish, + FishSpecies.BatFish, + FishSpecies.FrogFish, + FishSpecies.TigerFish, + FishSpecies.Stargazer, + FishSpecies.Isopod, + FishSpecies.SheepHead, }; - readonly string[] cfish = new string[] + readonly FishSpecies[] cfish = new FishSpecies[] { - "Cod", - "Salmon" + FishSpecies.Cod, + FishSpecies.Salmon, + FishSpecies.Pike, + FishSpecies.Bass, + FishSpecies.Crayfish, + FishSpecies.Betta, + FishSpecies.PufferFish, + FishSpecies.Tuna, + FishSpecies.Carp, + FishSpecies.Megacrab }; readonly string o = "<:ye:677089325208305665>"; readonly string n = "<:no:677091514249248778>"; @@ -459,6 +479,7 @@ namespace Kehyeedra3 { ulong time = ulong.Parse(DateTime.Now.ToString("yyyyMMddHHmm")); ulong lastfish; + List inv = new List(); using (var Database = new ApplicationDbContextFactory().CreateDbContext()) { var user = Database.Fishing.FirstOrDefault(x => x.Id == Context.User.Id); @@ -470,22 +491,25 @@ namespace Kehyeedra3 Id = Context.User.Id, }; Database.Fishing.Add(user); - await Database.SaveChangesAsync(); } } + else + { + inv = user.GetInventory(); + } lastfish = user.LastFish; await Database.SaveChangesAsync(); } if (lastfish < time) { int rarity = SRandom.Next(0, 201); - int rarmult = 0; + FishRarity rarmult; string rar = ""; - string fish = ""; + FishSpecies fish ; if (rarity > 180) { rar = "*Rare*"; - rarmult = 3; + rarmult = FishRarity.Rare; int num = SRandom.Next(rfish.Length); fish = rfish[num]; } @@ -494,7 +518,7 @@ namespace Kehyeedra3 if (rarity > 120) { rar = "*Uncommon*"; - rarmult = 2; + rarmult = FishRarity.Uncommon; int num = SRandom.Next(ufish.Length); fish = ufish[num]; } @@ -503,13 +527,13 @@ namespace Kehyeedra3 if (rarity == 7) { rar = "***Legendary***"; - rarmult = 7; - fish = "Lucky Catfish"; + rarmult = FishRarity.Special; + fish = FishSpecies.LuckyCatfish; } else { rar = "*Common*"; - rarmult = 1; + rarmult = FishRarity.Common; int num = SRandom.Next(cfish.Length); fish = cfish[num]; } @@ -517,11 +541,11 @@ namespace Kehyeedra3 } int weight = SRandom.Next(1, 151); - int size = 0; + FishWeight size; if (weight >= 75) { - size = 2; + size = FishWeight.Medium; if (weight >= 100) { weight = SRandom.Next(1, 201); @@ -529,82 +553,45 @@ namespace Kehyeedra3 } else { - size = 1; + size = FishWeight.Small; } - if (weight >= 150 || rarmult == 7) + if (weight >= 150 || rarmult == FishRarity.Special) { - size = 3; + size = FishWeight.Large; } if (rarity > 40) { - await Context.Channel.SendMessageAsync($"{Context.User.Mention} You have caught a {weight / 10d}kg **{fish}**, rarity: {rar}"); using (var Database = new ApplicationDbContextFactory().CreateDbContext()) { var user = Database.Fishing.FirstOrDefault(x => x.Id == Context.User.Id); - if (size == 1 && rarmult == 1) - { - Console.WriteLine("type: CFish1"); - user.TXp += 1; - user.CFish1 += 1; - } - if (size == 1 && rarmult == 2) - { - Console.WriteLine("type: UFish1"); - user.TXp += 2; - user.UFish1 += 1; - } - if (size == 1 && rarmult == 3) - { - Console.WriteLine("type: RFish1"); - user.TXp += 3; - user.RFish1 += 1; - } - if (size == 2 && rarmult == 1) - { - Console.WriteLine("type: CFish2"); - user.TXp += 1; - user.CFish2 += 1; - } - if (size == 2 && rarmult == 2) - { - Console.WriteLine("type: UFish2"); - user.TXp += 2; - user.UFish2 += 1; - } - if (size == 2 && rarmult == 3) - { - Console.WriteLine("type: RFish2"); - user.TXp += 3; - user.RFish2 += 1; - } - if (size == 3 && rarmult == 1) - { - Console.WriteLine("type: CFish3"); - user.TXp += 1; - user.CFish3 += 1; - } - if (size == 3 && rarmult == 2) - { - Console.WriteLine("type: UFish3"); - user.TXp += 2; - user.UFish3 += 1; - } - if (size == 3 && rarmult == 3) + + if (inv.Any(x => x.Fish.Species == fish && x.Fish.Weight == size && x.Fish.Rarity == rarmult)) { - Console.WriteLine("type: RFish3"); - user.TXp += 3; - user.RFish3 += 1; + inv.FirstOrDefault(x => x.Fish.Species == fish && x.Fish.Weight == size && x.Fish.Rarity == rarmult).Amount += 1; } - if (rarmult == 7) + else { - Console.WriteLine("type: LFish"); - user.TXp += 10; - user.LFish += 1; + inv.Add(new FishingInventorySlot + { + Fish = new FishObject + { + Species = fish, + Weight = size, + Rarity = rarmult + }, + Amount = 1 + }); } + + user.SetInventory(inv); + user.LastFish = time; - await Database.SaveChangesAsync(); + + await Database.SaveChangesAsync().ConfigureAwait(false); // :] } + + await Context.Channel.SendMessageAsync($"{Context.User.Mention} You have caught a {weight / 10d}kg **{fish}**, rarity: {rar}"); } else { @@ -621,26 +608,46 @@ namespace Kehyeedra3 public async Task FishInventory() { Fishing user; + List inv = new List(); using (var Database = new ApplicationDbContextFactory().CreateDbContext()) { user = Database.Fishing.FirstOrDefault(x => x.Id == Context.User.Id); - await Database.SaveChangesAsync(); + + if (user == null) + { + user = new Fishing + { + Id = Context.User.Id + }; + + Database.Fishing.Add(user); + } + else + { + inv = user.GetInventory(); + } + + await Database.SaveChangesAsync().ConfigureAwait(false); } - var CFish1 = user.CFish1; - var CFish2 = user.CFish2; - var CFish3 = user.CFish3; - var UFish1 = user.UFish1; - var UFish2 = user.UFish2; - var UFish3 = user.UFish3; + if(inv.Any()) + { + EmbedBuilder embed = new EmbedBuilder(); - var RFish1 = user.RFish1; - var RFish2 = user.RFish2; - var RFish3 = user.RFish3; + embed.Description = $"{Context.User.Mention}'s Inventory"; - var LFish = user.LFish; + inv.ForEach(x => + { + embed.AddField(x.Fish.ToString(), x.Amount.ToString(), true); + }); - await Context.Channel.SendMessageAsync($"{Context.User.Mention}\n**[Your Fish Inventory]**\n**Legendary**: {LFish}\n**A**: S{RFish1} M{RFish2} L{RFish3}\n**B**: S{UFish1} M{UFish2} L{UFish3}\n**C**: S{CFish1} M{CFish2} L{CFish3}"); + //fishgohere + await Context.Channel.SendMessageAsync(embed: embed.Build()).ConfigureAwait(false); + } + else + { + await Context.Channel.SendMessageAsync("Go fish nigger").ConfigureAwait(false); + } } [Command("balance"),Alias("bal","money")] public async Task Shekels([Remainder] IUser otherUser = null) diff --git a/Kehyeedra3/Migrations/20200222174350_feesh.Designer.cs b/Kehyeedra3/Migrations/20200222174350_feesh.Designer.cs new file mode 100644 index 0000000..f44abee --- /dev/null +++ b/Kehyeedra3/Migrations/20200222174350_feesh.Designer.cs @@ -0,0 +1,95 @@ +// +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("20200222174350_feesh")] + partial class feesh + { + 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("Inventory") + .HasColumnType("json"); + + b.Property("LastFish") + .HasColumnType("bigint unsigned"); + + b.Property("Lvl") + .HasColumnType("bigint unsigned"); + + b.Property("TXp") + .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/20200222174350_feesh.cs b/Kehyeedra3/Migrations/20200222174350_feesh.cs new file mode 100644 index 0000000..171e365 --- /dev/null +++ b/Kehyeedra3/Migrations/20200222174350_feesh.cs @@ -0,0 +1,132 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace Kehyeedra3.Migrations +{ + public partial class feesh : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "CFish1", + table: "Fishing"); + + migrationBuilder.DropColumn( + name: "CFish2", + table: "Fishing"); + + migrationBuilder.DropColumn( + name: "CFish3", + table: "Fishing"); + + migrationBuilder.DropColumn( + name: "LFish", + table: "Fishing"); + + migrationBuilder.DropColumn( + name: "RFish1", + table: "Fishing"); + + migrationBuilder.DropColumn( + name: "RFish2", + table: "Fishing"); + + migrationBuilder.DropColumn( + name: "RFish3", + table: "Fishing"); + + migrationBuilder.DropColumn( + name: "UFish1", + table: "Fishing"); + + migrationBuilder.DropColumn( + name: "UFish2", + table: "Fishing"); + + migrationBuilder.DropColumn( + name: "UFish3", + table: "Fishing"); + + migrationBuilder.AddColumn( + name: "Inventory", + table: "Fishing", + nullable: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "Inventory", + table: "Fishing"); + + migrationBuilder.AddColumn( + name: "CFish1", + table: "Fishing", + type: "bigint unsigned", + nullable: false, + defaultValue: 0ul); + + migrationBuilder.AddColumn( + name: "CFish2", + table: "Fishing", + type: "bigint unsigned", + nullable: false, + defaultValue: 0ul); + + migrationBuilder.AddColumn( + name: "CFish3", + table: "Fishing", + type: "bigint unsigned", + nullable: false, + defaultValue: 0ul); + + migrationBuilder.AddColumn( + name: "LFish", + table: "Fishing", + type: "bigint unsigned", + nullable: false, + defaultValue: 0ul); + + migrationBuilder.AddColumn( + name: "RFish1", + table: "Fishing", + type: "bigint unsigned", + nullable: false, + defaultValue: 0ul); + + migrationBuilder.AddColumn( + name: "RFish2", + table: "Fishing", + type: "bigint unsigned", + nullable: false, + defaultValue: 0ul); + + migrationBuilder.AddColumn( + name: "RFish3", + table: "Fishing", + type: "bigint unsigned", + nullable: false, + defaultValue: 0ul); + + migrationBuilder.AddColumn( + name: "UFish1", + table: "Fishing", + type: "bigint unsigned", + nullable: false, + defaultValue: 0ul); + + migrationBuilder.AddColumn( + name: "UFish2", + table: "Fishing", + type: "bigint unsigned", + nullable: false, + defaultValue: 0ul); + + migrationBuilder.AddColumn( + name: "UFish3", + table: "Fishing", + type: "bigint unsigned", + nullable: false, + defaultValue: 0ul); + } + } +} diff --git a/Kehyeedra3/Migrations/20200222195851_UpdateFishing.Designer.cs b/Kehyeedra3/Migrations/20200222195851_UpdateFishing.Designer.cs new file mode 100644 index 0000000..90dd894 --- /dev/null +++ b/Kehyeedra3/Migrations/20200222195851_UpdateFishing.Designer.cs @@ -0,0 +1,95 @@ +// +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("20200222195851_UpdateFishing")] + partial class UpdateFishing + { + 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("Inventory") + .HasColumnType("json"); + + b.Property("LastFish") + .HasColumnType("bigint unsigned"); + + b.Property("Lvl") + .HasColumnType("bigint unsigned"); + + b.Property("TXp") + .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/20200222195851_UpdateFishing.cs b/Kehyeedra3/Migrations/20200222195851_UpdateFishing.cs new file mode 100644 index 0000000..6d0190d --- /dev/null +++ b/Kehyeedra3/Migrations/20200222195851_UpdateFishing.cs @@ -0,0 +1,17 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace Kehyeedra3.Migrations +{ + public partial class UpdateFishing : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + + } + } +} diff --git a/Kehyeedra3/Migrations/20200222200755_FixFishing.Designer.cs b/Kehyeedra3/Migrations/20200222200755_FixFishing.Designer.cs new file mode 100644 index 0000000..5f23ab2 --- /dev/null +++ b/Kehyeedra3/Migrations/20200222200755_FixFishing.Designer.cs @@ -0,0 +1,95 @@ +// +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("20200222200755_FixFishing")] + partial class FixFishing + { + 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("Inventory") + .HasColumnType("json"); + + b.Property("LastFish") + .HasColumnType("bigint unsigned"); + + b.Property("Lvl") + .HasColumnType("bigint unsigned"); + + b.Property("TXp") + .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/20200222200755_FixFishing.cs b/Kehyeedra3/Migrations/20200222200755_FixFishing.cs new file mode 100644 index 0000000..fad1fd3 --- /dev/null +++ b/Kehyeedra3/Migrations/20200222200755_FixFishing.cs @@ -0,0 +1,17 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace Kehyeedra3.Migrations +{ + public partial class FixFishing : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + + } + } +} diff --git a/Kehyeedra3/Migrations/20200222201346_FixFishing2ElectricBoogaloo.Designer.cs b/Kehyeedra3/Migrations/20200222201346_FixFishing2ElectricBoogaloo.Designer.cs new file mode 100644 index 0000000..beab51f --- /dev/null +++ b/Kehyeedra3/Migrations/20200222201346_FixFishing2ElectricBoogaloo.Designer.cs @@ -0,0 +1,95 @@ +// +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("20200222201346_FixFishing2ElectricBoogaloo")] + partial class FixFishing2ElectricBoogaloo + { + 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("Inventory") + .HasColumnType("json"); + + b.Property("LastFish") + .HasColumnType("bigint unsigned"); + + b.Property("Lvl") + .HasColumnType("bigint unsigned"); + + b.Property("TXp") + .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/20200222201346_FixFishing2ElectricBoogaloo.cs b/Kehyeedra3/Migrations/20200222201346_FixFishing2ElectricBoogaloo.cs new file mode 100644 index 0000000..406c1b0 --- /dev/null +++ b/Kehyeedra3/Migrations/20200222201346_FixFishing2ElectricBoogaloo.cs @@ -0,0 +1,17 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace Kehyeedra3.Migrations +{ + public partial class FixFishing2ElectricBoogaloo : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + + } + } +} diff --git a/Kehyeedra3/Migrations/ApplicationDbContextModelSnapshot.cs b/Kehyeedra3/Migrations/ApplicationDbContextModelSnapshot.cs index 44e1c31..e7ada2e 100644 --- a/Kehyeedra3/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/Kehyeedra3/Migrations/ApplicationDbContextModelSnapshot.cs @@ -22,17 +22,8 @@ namespace Kehyeedra3.Migrations .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("Inventory") + .HasColumnType("json"); b.Property("LastFish") .HasColumnType("bigint unsigned"); @@ -40,27 +31,9 @@ namespace Kehyeedra3.Migrations 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"); diff --git a/Kehyeedra3/Services/Models/Fishing.cs b/Kehyeedra3/Services/Models/Fishing.cs index 35afd24..20d7332 100644 --- a/Kehyeedra3/Services/Models/Fishing.cs +++ b/Kehyeedra3/Services/Models/Fishing.cs @@ -1,4 +1,8 @@ -namespace Kehyeedra3.Services.Models +using Newtonsoft.Json; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Kehyeedra3.Services.Models { public class Fishing { @@ -8,18 +12,80 @@ 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; + [Column(TypeName="LONGTEXT")] + public string Inventory { get; set; } = "[]"; + + public List GetInventory() + { + return JsonConvert.DeserializeObject>(Inventory); + } - public ulong UFish1 { get; set; } = 0; - public ulong UFish2 { get; set; } = 0; - public ulong UFish3 { get; set; } = 0; + public void SetInventory(List inv) + { + Inventory = JsonConvert.SerializeObject(inv); + } - public ulong RFish1 { get; set; } = 0; - public ulong RFish2 { get; set; } = 0; - public ulong RFish3 { get; set; } = 0; + } + public class FishObject + { + public FishSpecies Species; + public FishWeight Weight; + public FishRarity Rarity; - public ulong LFish { get; set; } = 0; + public override string ToString() + { + return $"{Weight.ToString()} {Rarity.ToString()} {Species.ToString()}"; + } + } + public enum FishSpecies + { + //legendary + LuckyCatfish = 1, + //rare + Doomfish = 2, + Clownfish = 3, + GenericFish = 4, + Ultracrab = 5, + BlobFish = 6, + Psychedelica = 7, + //uncommon + Gigacrab = 8, + MantisShrimp = 9, + GoblinFish = 10, + BatFish = 11, + FrogFish = 12, + TigerFish = 13, + Stargazer = 14, + Isopod = 15, + SheepHead = 16, + //common + Cod = 17, + Salmon = 18, + Pike = 19, + Bass = 20, + Crayfish = 21, + Betta = 22, + PufferFish = 23, + Tuna = 24, + Carp = 25, + Megacrab = 26 + } + public enum FishWeight + { + Small = 1, + Medium = 2, + Large = 3 + } + public enum FishRarity + { + Common = 1, + Uncommon = 2, + Rare = 3, + Special = 4 + } + public class FishingInventorySlot + { + public FishObject Fish; + public ulong Amount; } }