Added CurrencyDropAmountMax field which, if set, makes your currency generation drop random amount of flowers between DropAmount and DropAmountMax, inclusive

This commit is contained in:
Master Kwoth 2017-06-14 01:21:31 +02:00
parent 1fa23c095a
commit eeaf1a001e
6 changed files with 1598 additions and 1 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore.Migrations;
namespace NadekoBot.Migrations
{
public partial class maxdropamount : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "CurrencyDropAmountMax",
table: "BotConfig",
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "CurrencyDropAmountMax",
table: "BotConfig");
}
}
}

View File

@ -137,6 +137,8 @@ namespace NadekoBot.Migrations
b.Property<int>("CurrencyDropAmount");
b.Property<int?>("CurrencyDropAmountMax");
b.Property<float>("CurrencyGenerationChance");
b.Property<int>("CurrencyGenerationCooldown");

View File

@ -28,6 +28,7 @@ namespace NadekoBot.Services.Database.Models
public int MinimumBetAmount { get; set; } = 2;
public float BetflipMultiplier { get; set; } = 1.95f;
public int CurrencyDropAmount { get; set; } = 1;
public int? CurrencyDropAmountMax { get; set; } = null;
public float Betroll67Multiplier { get; set; } = 2;
public float Betroll91Multiplier { get; set; } = 4;
public float Betroll100Multiplier { get; set; } = 10;

View File

@ -125,6 +125,10 @@ namespace NadekoBot.Services.Games
if (num > 100 && LastGenerations.TryUpdate(channel.Id, DateTime.UtcNow, lastGeneration))
{
var dropAmount = _bc.CurrencyDropAmount;
var dropAmountMax = _bc.CurrencyDropAmountMax;
if (dropAmountMax != null && dropAmountMax > dropAmount)
dropAmount = new NadekoRandom().Next(dropAmount, dropAmountMax.Value + 1);
if (dropAmount > 0)
{

View File

@ -17,7 +17,7 @@ namespace NadekoBot.Services.Impl
private readonly IBotCredentials _creds;
private readonly DateTime _started;
public const string BotVersion = "1.42";
public const string BotVersion = "1.43";
public string Author => "Kwoth#2560";
public string Library => "Discord.Net";