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:
parent
1fa23c095a
commit
eeaf1a001e
1566
src/NadekoBot/Migrations/20170613231358_maxdropamount.Designer.cs
generated
Normal file
1566
src/NadekoBot/Migrations/20170613231358_maxdropamount.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
24
src/NadekoBot/Migrations/20170613231358_maxdropamount.cs
Normal file
24
src/NadekoBot/Migrations/20170613231358_maxdropamount.cs
Normal 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");
|
||||
}
|
||||
}
|
||||
}
|
@ -137,6 +137,8 @@ namespace NadekoBot.Migrations
|
||||
|
||||
b.Property<int>("CurrencyDropAmount");
|
||||
|
||||
b.Property<int?>("CurrencyDropAmountMax");
|
||||
|
||||
b.Property<float>("CurrencyGenerationChance");
|
||||
|
||||
b.Property<int>("CurrencyGenerationCooldown");
|
||||
|
@ -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;
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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";
|
||||
|
Loading…
Reference in New Issue
Block a user