start adding fishing

master
Lan 5 years ago
parent 6cff0b753b
commit d6fc3878d6
  1. 2
      Kehyeedra3/ApplicationDbContext.cs
  2. 69
      Kehyeedra3/Commands.cs
  3. 122
      Kehyeedra3/Migrations/20200220195125_Fishing.Designer.cs
  4. 43
      Kehyeedra3/Migrations/20200220195125_Fishing.cs
  5. 53
      Kehyeedra3/Migrations/ApplicationDbContextModelSnapshot.cs
  6. 42
      Kehyeedra3/Services/Models/Fishing.cs

@ -10,6 +10,6 @@ namespace Kehyeedra3
public DbSet<User> Users { get; set; } public DbSet<User> Users { get; set; }
public DbSet<Reminder> Reminders { get; set; } public DbSet<Reminder> Reminders { get; set; }
//public DbSet<Fishing> Fishing { get; set; } public DbSet<Fishing> Fishing { get; set; }
} }
} }

@ -249,7 +249,7 @@ namespace Kehyeedra3
var reminder = new Reminder var reminder = new Reminder
{ {
UserId = Context.User.Id, 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, Created = yeedraStamp,
Send = ((d * 86400) + (h * 3600) + (m * 60)) + yeedraStamp Send = ((d * 86400) + (h * 3600) + (m * 60)) + yeedraStamp
}; };
@ -313,6 +313,7 @@ namespace Kehyeedra3
"a **Viet Cong Tunnel**,", "a **Viet Cong Tunnel**,",
"a single unit of several **Trees**,", "a single unit of several **Trees**,",
"**1,000,000₩**,", "**1,000,000₩**,",
"**Jas's Love**,",
"a **Rock Golem**,", "a **Rock Golem**,",
"a piece of **Toast**,", "a piece of **Toast**,",
"**Luminite**,", "**Luminite**,",
@ -337,7 +338,8 @@ namespace Kehyeedra3
"it appears to have vanished", "it appears to have vanished",
"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"
}; };
readonly string[] rfish = new string[] readonly string[] rfish = new string[]
{ {
@ -479,7 +481,7 @@ namespace Kehyeedra3
{ {
if (rarity == 7) if (rarity == 7)
{ {
rar = "***Glorious***"; rar = "***Legendary***";
rarmult = 7; rarmult = 7;
fish = "Lucky Catfish"; fish = "Lucky Catfish";
} }
@ -493,27 +495,29 @@ namespace Kehyeedra3
} }
} }
int weight = SRandom.Next(1, 201); int weight = SRandom.Next(1, 151);
int size = 0; int size = 0;
if (weight > 150 || rarmult == 7) if (weight >= 75)
{ {
size = 3; size = 2;
if (weight >= 100)
{
weight = SRandom.Next(1, 201);
}
} }
else else
{ {
if (weight > 100) size = 1;
{ }
size = 2;
} if (weight >= 150 || rarmult == 7)
else {
{ size = 3;
size = 1;
}
} }
int value = size + rarmult; 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")] [Command("balance")]
public async Task Shekels([Remainder] IUser otherUser = null) public async Task Shekels([Remainder] IUser otherUser = null)
@ -545,7 +549,7 @@ namespace Kehyeedra3
await Database.SaveChangesAsync(); 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 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"); 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")] [Command("bank")]
public async Task BankBalance() public async Task BankBalance()
{ {
@ -582,9 +594,16 @@ namespace Kehyeedra3
[Command("bet")] [Command("bet")]
public async Task Gamble(int wager) public async Task Gamble(int wager)
{ {
int res0 = SRandom.Next(0, 10000000); Random ran = new Random(SRandom.Next(0, 100000000) + int.Parse(Context.User.AvatarId + Context.User.Discriminator));
Random ran = new Random(res0); int res1 = ran.Next(0, 11);
int res1 = ran.Next(0, 101); if (res1 >= 5)
{
res1 = ran.Next(50, 101);
}
else
{
res1 = ran.Next(0, 50);
}
if (wager<0) if (wager<0)
{ {
wager = 0; wager = 0;
@ -608,7 +627,7 @@ namespace Kehyeedra3
} }
else else
{ {
if (res1 < 60) if (res1 < 50)
{ {
wager = 0; wager = 0;
} }
@ -818,7 +837,14 @@ namespace Kehyeedra3
//reply //reply
await ReplyAsync($"Set name to {_name}"); 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")] [Command("savefile")]
public async Task SaveFile(string fday, string fscore) public async Task SaveFile(string fday, string fscore)
@ -845,7 +871,6 @@ namespace Kehyeedra3
break; break;
} }
} }
} }
//public class _ : ModuleBase //public class _ : ModuleBase

@ -0,0 +1,122 @@
// <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("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<ulong>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint unsigned");
b.Property<ulong>("CFish1")
.HasColumnType("bigint unsigned");
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")
.HasColumnType("bigint unsigned");
b.Property<ulong>("Lvl")
.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")
.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")
.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,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<ulong>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
LastFish = table.Column<ulong>(nullable: false),
Xp = table.Column<ulong>(nullable: false),
TXp = table.Column<ulong>(nullable: false),
Lvl = table.Column<ulong>(nullable: false),
CFish1 = table.Column<ulong>(nullable: false),
CFish2 = table.Column<ulong>(nullable: false),
CFish3 = table.Column<ulong>(nullable: false),
UFish1 = table.Column<ulong>(nullable: false),
UFish2 = table.Column<ulong>(nullable: false),
UFish3 = table.Column<ulong>(nullable: false),
RFish1 = table.Column<ulong>(nullable: false),
RFish2 = table.Column<ulong>(nullable: false),
RFish3 = table.Column<ulong>(nullable: false),
LFish = table.Column<ulong>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Fishing", x => x.Id);
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Fishing");
}
}
}

@ -16,6 +16,59 @@ namespace Kehyeedra3.Migrations
.HasAnnotation("ProductVersion", "3.1.1") .HasAnnotation("ProductVersion", "3.1.1")
.HasAnnotation("Relational:MaxIdentifierLength", 64); .HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("Kehyeedra3.Services.Models.Fishing", b =>
{
b.Property<ulong>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint unsigned");
b.Property<ulong>("CFish1")
.HasColumnType("bigint unsigned");
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")
.HasColumnType("bigint unsigned");
b.Property<ulong>("Lvl")
.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")
.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")
.HasColumnType("bigint unsigned");
b.HasKey("Id");
b.ToTable("Fishing");
});
modelBuilder.Entity("Kehyeedra3.Services.Models.Reminder", b => modelBuilder.Entity("Kehyeedra3.Services.Models.Reminder", b =>
{ {
b.Property<ulong>("Id") b.Property<ulong>("Id")

@ -1,17 +1,25 @@
//namespace Kehyeedra3.Services.Models namespace Kehyeedra3.Services.Models
//{ {
// class Fishing public class Fishing
// { {
// public ulong UserId { get; set; } = 0; 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 LastFish { get; set; } = 0;
// public ulong CFish { get; set; } = 0; public ulong Xp { get; set; } = 0;
// public ulong CVal {get; set;} = 0; public ulong TXp { get; set; } = 0;
// public ulong UFish { get; set; } = 0; public ulong Lvl { get; set; } = 0;
// public ulong UVal {get; set;} = 0;
// public ulong RFish { get; set; } = 0; public ulong CFish1 { get; set; } = 0;
// public ulong RVal { get; set; } = 0; public ulong CFish2 { get; set; } = 0;
// public ulong LFish { get; set; } = 0; public ulong CFish3 { get; set; } = 0;
// public ulong LVal { get; set; } = 0;
// public ulong XP { 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;
}
}

Loading…
Cancel
Save