fishing changes

master
Lan 5 years ago
parent f0ebaaf3e3
commit b874056bf8
  1. 193
      Kehyeedra3/Commands.cs
  2. 95
      Kehyeedra3/Migrations/20200222174350_feesh.Designer.cs
  3. 132
      Kehyeedra3/Migrations/20200222174350_feesh.cs
  4. 95
      Kehyeedra3/Migrations/20200222195851_UpdateFishing.Designer.cs
  5. 17
      Kehyeedra3/Migrations/20200222195851_UpdateFishing.cs
  6. 95
      Kehyeedra3/Migrations/20200222200755_FixFishing.Designer.cs
  7. 17
      Kehyeedra3/Migrations/20200222200755_FixFishing.cs
  8. 95
      Kehyeedra3/Migrations/20200222201346_FixFishing2ElectricBoogaloo.Designer.cs
  9. 17
      Kehyeedra3/Migrations/20200222201346_FixFishing2ElectricBoogaloo.cs
  10. 31
      Kehyeedra3/Migrations/ApplicationDbContextModelSnapshot.cs
  11. 88
      Kehyeedra3/Services/Models/Fishing.cs

@ -340,22 +340,42 @@ namespace Kehyeedra3
"but it seems like you were hallucinating", "but it seems like you were hallucinating",
"but it is seized by the communists", "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" "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", FishSpecies.Doomfish,
"Doomfish" FishSpecies.Clownfish,
FishSpecies.GenericFish,
FishSpecies.Ultracrab,
FishSpecies.BlobFish,
FishSpecies.Psychedelica,
}; };
readonly string[] ufish = new string[] readonly FishSpecies[] ufish = new FishSpecies[]
{ {
"Mantis Shrimp", FishSpecies.Gigacrab,
"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", FishSpecies.Cod,
"Salmon" 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 o = "<:ye:677089325208305665>";
readonly string n = "<:no:677091514249248778>"; readonly string n = "<:no:677091514249248778>";
@ -459,6 +479,7 @@ namespace Kehyeedra3
{ {
ulong time = ulong.Parse(DateTime.Now.ToString("yyyyMMddHHmm")); ulong time = ulong.Parse(DateTime.Now.ToString("yyyyMMddHHmm"));
ulong lastfish; ulong lastfish;
List<FishingInventorySlot> inv = new List<FishingInventorySlot>();
using (var Database = new ApplicationDbContextFactory().CreateDbContext()) using (var Database = new ApplicationDbContextFactory().CreateDbContext())
{ {
var user = Database.Fishing.FirstOrDefault(x => x.Id == Context.User.Id); var user = Database.Fishing.FirstOrDefault(x => x.Id == Context.User.Id);
@ -470,22 +491,25 @@ namespace Kehyeedra3
Id = Context.User.Id, Id = Context.User.Id,
}; };
Database.Fishing.Add(user); Database.Fishing.Add(user);
await Database.SaveChangesAsync();
} }
} }
else
{
inv = user.GetInventory();
}
lastfish = user.LastFish; lastfish = user.LastFish;
await Database.SaveChangesAsync(); await Database.SaveChangesAsync();
} }
if (lastfish < time) if (lastfish < time)
{ {
int rarity = SRandom.Next(0, 201); int rarity = SRandom.Next(0, 201);
int rarmult = 0; FishRarity rarmult;
string rar = ""; string rar = "";
string fish = ""; FishSpecies fish ;
if (rarity > 180) if (rarity > 180)
{ {
rar = "*Rare*"; rar = "*Rare*";
rarmult = 3; rarmult = FishRarity.Rare;
int num = SRandom.Next(rfish.Length); int num = SRandom.Next(rfish.Length);
fish = rfish[num]; fish = rfish[num];
} }
@ -494,7 +518,7 @@ namespace Kehyeedra3
if (rarity > 120) if (rarity > 120)
{ {
rar = "*Uncommon*"; rar = "*Uncommon*";
rarmult = 2; rarmult = FishRarity.Uncommon;
int num = SRandom.Next(ufish.Length); int num = SRandom.Next(ufish.Length);
fish = ufish[num]; fish = ufish[num];
} }
@ -503,13 +527,13 @@ namespace Kehyeedra3
if (rarity == 7) if (rarity == 7)
{ {
rar = "***Legendary***"; rar = "***Legendary***";
rarmult = 7; rarmult = FishRarity.Special;
fish = "Lucky Catfish"; fish = FishSpecies.LuckyCatfish;
} }
else else
{ {
rar = "*Common*"; rar = "*Common*";
rarmult = 1; rarmult = FishRarity.Common;
int num = SRandom.Next(cfish.Length); int num = SRandom.Next(cfish.Length);
fish = cfish[num]; fish = cfish[num];
} }
@ -517,11 +541,11 @@ namespace Kehyeedra3
} }
int weight = SRandom.Next(1, 151); int weight = SRandom.Next(1, 151);
int size = 0; FishWeight size;
if (weight >= 75) if (weight >= 75)
{ {
size = 2; size = FishWeight.Medium;
if (weight >= 100) if (weight >= 100)
{ {
weight = SRandom.Next(1, 201); weight = SRandom.Next(1, 201);
@ -529,82 +553,45 @@ namespace Kehyeedra3
} }
else 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) 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()) using (var Database = new ApplicationDbContextFactory().CreateDbContext())
{ {
var user = Database.Fishing.FirstOrDefault(x => x.Id == Context.User.Id); var user = Database.Fishing.FirstOrDefault(x => x.Id == Context.User.Id);
if (size == 1 && rarmult == 1)
{ if (inv.Any(x => x.Fish.Species == fish && x.Fish.Weight == size && x.Fish.Rarity == rarmult))
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)
{ {
Console.WriteLine("type: RFish3"); inv.FirstOrDefault(x => x.Fish.Species == fish && x.Fish.Weight == size && x.Fish.Rarity == rarmult).Amount += 1;
user.TXp += 3;
user.RFish3 += 1;
} }
if (rarmult == 7) else
{ {
Console.WriteLine("type: LFish"); inv.Add(new FishingInventorySlot
user.TXp += 10; {
user.LFish += 1; Fish = new FishObject
{
Species = fish,
Weight = size,
Rarity = rarmult
},
Amount = 1
});
} }
user.SetInventory(inv);
user.LastFish = time; 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 else
{ {
@ -621,26 +608,46 @@ namespace Kehyeedra3
public async Task FishInventory() public async Task FishInventory()
{ {
Fishing user; Fishing user;
List<FishingInventorySlot> inv = new List<FishingInventorySlot>();
using (var Database = new ApplicationDbContextFactory().CreateDbContext()) using (var Database = new ApplicationDbContextFactory().CreateDbContext())
{ {
user = Database.Fishing.FirstOrDefault(x => x.Id == Context.User.Id); 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; if(inv.Any())
var UFish2 = user.UFish2; {
var UFish3 = user.UFish3; EmbedBuilder embed = new EmbedBuilder();
var RFish1 = user.RFish1; embed.Description = $"{Context.User.Mention}'s Inventory";
var RFish2 = user.RFish2;
var RFish3 = user.RFish3;
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")] [Command("balance"),Alias("bal","money")]
public async Task Shekels([Remainder] IUser otherUser = null) public async Task Shekels([Remainder] IUser otherUser = null)

@ -0,0 +1,95 @@
// <auto-generated />
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<ulong>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint unsigned");
b.Property<string>("Inventory")
.HasColumnType("json");
b.Property<ulong>("LastFish")
.HasColumnType("bigint unsigned");
b.Property<ulong>("Lvl")
.HasColumnType("bigint unsigned");
b.Property<ulong>("TXp")
.HasColumnType("bigint unsigned");
b.Property<ulong>("Xp")
.HasColumnType("bigint unsigned");
b.HasKey("Id");
b.ToTable("Fishing");
});
modelBuilder.Entity("Kehyeedra3.Services.Models.Reminder", b =>
{
b.Property<ulong>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint unsigned");
b.Property<ulong>("Created")
.HasColumnType("bigint unsigned");
b.Property<string>("Message")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<ulong>("Send")
.HasColumnType("bigint unsigned");
b.Property<ulong>("UserId")
.HasColumnType("bigint unsigned");
b.HasKey("Id");
b.ToTable("Reminders");
});
modelBuilder.Entity("Kehyeedra3.Services.Models.User", b =>
{
b.Property<ulong>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint unsigned");
b.Property<string>("Avatar")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<ulong>("LastMine")
.HasColumnType("bigint unsigned");
b.Property<long>("Money")
.HasColumnType("bigint");
b.Property<string>("Username")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.HasKey("Id");
b.ToTable("Users");
});
#pragma warning restore 612, 618
}
}
}

@ -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<string>(
name: "Inventory",
table: "Fishing",
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Inventory",
table: "Fishing");
migrationBuilder.AddColumn<ulong>(
name: "CFish1",
table: "Fishing",
type: "bigint unsigned",
nullable: false,
defaultValue: 0ul);
migrationBuilder.AddColumn<ulong>(
name: "CFish2",
table: "Fishing",
type: "bigint unsigned",
nullable: false,
defaultValue: 0ul);
migrationBuilder.AddColumn<ulong>(
name: "CFish3",
table: "Fishing",
type: "bigint unsigned",
nullable: false,
defaultValue: 0ul);
migrationBuilder.AddColumn<ulong>(
name: "LFish",
table: "Fishing",
type: "bigint unsigned",
nullable: false,
defaultValue: 0ul);
migrationBuilder.AddColumn<ulong>(
name: "RFish1",
table: "Fishing",
type: "bigint unsigned",
nullable: false,
defaultValue: 0ul);
migrationBuilder.AddColumn<ulong>(
name: "RFish2",
table: "Fishing",
type: "bigint unsigned",
nullable: false,
defaultValue: 0ul);
migrationBuilder.AddColumn<ulong>(
name: "RFish3",
table: "Fishing",
type: "bigint unsigned",
nullable: false,
defaultValue: 0ul);
migrationBuilder.AddColumn<ulong>(
name: "UFish1",
table: "Fishing",
type: "bigint unsigned",
nullable: false,
defaultValue: 0ul);
migrationBuilder.AddColumn<ulong>(
name: "UFish2",
table: "Fishing",
type: "bigint unsigned",
nullable: false,
defaultValue: 0ul);
migrationBuilder.AddColumn<ulong>(
name: "UFish3",
table: "Fishing",
type: "bigint unsigned",
nullable: false,
defaultValue: 0ul);
}
}
}

@ -0,0 +1,95 @@
// <auto-generated />
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<ulong>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint unsigned");
b.Property<string>("Inventory")
.HasColumnType("json");
b.Property<ulong>("LastFish")
.HasColumnType("bigint unsigned");
b.Property<ulong>("Lvl")
.HasColumnType("bigint unsigned");
b.Property<ulong>("TXp")
.HasColumnType("bigint unsigned");
b.Property<ulong>("Xp")
.HasColumnType("bigint unsigned");
b.HasKey("Id");
b.ToTable("Fishing");
});
modelBuilder.Entity("Kehyeedra3.Services.Models.Reminder", b =>
{
b.Property<ulong>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint unsigned");
b.Property<ulong>("Created")
.HasColumnType("bigint unsigned");
b.Property<string>("Message")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<ulong>("Send")
.HasColumnType("bigint unsigned");
b.Property<ulong>("UserId")
.HasColumnType("bigint unsigned");
b.HasKey("Id");
b.ToTable("Reminders");
});
modelBuilder.Entity("Kehyeedra3.Services.Models.User", b =>
{
b.Property<ulong>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint unsigned");
b.Property<string>("Avatar")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<ulong>("LastMine")
.HasColumnType("bigint unsigned");
b.Property<long>("Money")
.HasColumnType("bigint");
b.Property<string>("Username")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.HasKey("Id");
b.ToTable("Users");
});
#pragma warning restore 612, 618
}
}
}

@ -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)
{
}
}
}

@ -0,0 +1,95 @@
// <auto-generated />
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<ulong>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint unsigned");
b.Property<string>("Inventory")
.HasColumnType("json");
b.Property<ulong>("LastFish")
.HasColumnType("bigint unsigned");
b.Property<ulong>("Lvl")
.HasColumnType("bigint unsigned");
b.Property<ulong>("TXp")
.HasColumnType("bigint unsigned");
b.Property<ulong>("Xp")
.HasColumnType("bigint unsigned");
b.HasKey("Id");
b.ToTable("Fishing");
});
modelBuilder.Entity("Kehyeedra3.Services.Models.Reminder", b =>
{
b.Property<ulong>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint unsigned");
b.Property<ulong>("Created")
.HasColumnType("bigint unsigned");
b.Property<string>("Message")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<ulong>("Send")
.HasColumnType("bigint unsigned");
b.Property<ulong>("UserId")
.HasColumnType("bigint unsigned");
b.HasKey("Id");
b.ToTable("Reminders");
});
modelBuilder.Entity("Kehyeedra3.Services.Models.User", b =>
{
b.Property<ulong>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint unsigned");
b.Property<string>("Avatar")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<ulong>("LastMine")
.HasColumnType("bigint unsigned");
b.Property<long>("Money")
.HasColumnType("bigint");
b.Property<string>("Username")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.HasKey("Id");
b.ToTable("Users");
});
#pragma warning restore 612, 618
}
}
}

@ -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)
{
}
}
}

@ -0,0 +1,95 @@
// <auto-generated />
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<ulong>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint unsigned");
b.Property<string>("Inventory")
.HasColumnType("json");
b.Property<ulong>("LastFish")
.HasColumnType("bigint unsigned");
b.Property<ulong>("Lvl")
.HasColumnType("bigint unsigned");
b.Property<ulong>("TXp")
.HasColumnType("bigint unsigned");
b.Property<ulong>("Xp")
.HasColumnType("bigint unsigned");
b.HasKey("Id");
b.ToTable("Fishing");
});
modelBuilder.Entity("Kehyeedra3.Services.Models.Reminder", b =>
{
b.Property<ulong>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint unsigned");
b.Property<ulong>("Created")
.HasColumnType("bigint unsigned");
b.Property<string>("Message")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<ulong>("Send")
.HasColumnType("bigint unsigned");
b.Property<ulong>("UserId")
.HasColumnType("bigint unsigned");
b.HasKey("Id");
b.ToTable("Reminders");
});
modelBuilder.Entity("Kehyeedra3.Services.Models.User", b =>
{
b.Property<ulong>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint unsigned");
b.Property<string>("Avatar")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<ulong>("LastMine")
.HasColumnType("bigint unsigned");
b.Property<long>("Money")
.HasColumnType("bigint");
b.Property<string>("Username")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.HasKey("Id");
b.ToTable("Users");
});
#pragma warning restore 612, 618
}
}
}

@ -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)
{
}
}
}

@ -22,17 +22,8 @@ namespace Kehyeedra3.Migrations
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("bigint unsigned"); .HasColumnType("bigint unsigned");
b.Property<ulong>("CFish1") b.Property<string>("Inventory")
.HasColumnType("bigint unsigned"); .HasColumnType("json");
b.Property<ulong>("CFish2")
.HasColumnType("bigint unsigned");
b.Property<ulong>("CFish3")
.HasColumnType("bigint unsigned");
b.Property<ulong>("LFish")
.HasColumnType("bigint unsigned");
b.Property<ulong>("LastFish") b.Property<ulong>("LastFish")
.HasColumnType("bigint unsigned"); .HasColumnType("bigint unsigned");
@ -40,27 +31,9 @@ namespace Kehyeedra3.Migrations
b.Property<ulong>("Lvl") b.Property<ulong>("Lvl")
.HasColumnType("bigint unsigned"); .HasColumnType("bigint unsigned");
b.Property<ulong>("RFish1")
.HasColumnType("bigint unsigned");
b.Property<ulong>("RFish2")
.HasColumnType("bigint unsigned");
b.Property<ulong>("RFish3")
.HasColumnType("bigint unsigned");
b.Property<ulong>("TXp") b.Property<ulong>("TXp")
.HasColumnType("bigint unsigned"); .HasColumnType("bigint unsigned");
b.Property<ulong>("UFish1")
.HasColumnType("bigint unsigned");
b.Property<ulong>("UFish2")
.HasColumnType("bigint unsigned");
b.Property<ulong>("UFish3")
.HasColumnType("bigint unsigned");
b.Property<ulong>("Xp") b.Property<ulong>("Xp")
.HasColumnType("bigint unsigned"); .HasColumnType("bigint unsigned");

@ -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 public class Fishing
{ {
@ -8,18 +12,80 @@
public ulong TXp { get; set; } = 0; public ulong TXp { get; set; } = 0;
public ulong Lvl { get; set; } = 0; public ulong Lvl { get; set; } = 0;
public ulong CFish1 { get; set; } = 0; [Column(TypeName="LONGTEXT")]
public ulong CFish2 { get; set; } = 0; public string Inventory { get; set; } = "[]";
public ulong CFish3 { get; set; } = 0;
public List<FishingInventorySlot> GetInventory()
{
return JsonConvert.DeserializeObject<List<FishingInventorySlot>>(Inventory);
}
public ulong UFish1 { get; set; } = 0; public void SetInventory(List<FishingInventorySlot> inv)
public ulong UFish2 { get; set; } = 0; {
public ulong UFish3 { get; set; } = 0; Inventory = JsonConvert.SerializeObject(inv);
}
public ulong RFish1 { get; set; } = 0; }
public ulong RFish2 { get; set; } = 0; public class FishObject
public ulong RFish3 { get; set; } = 0; {
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;
} }
} }

Loading…
Cancel
Save