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:
		
							
								
								
									
										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>("CurrencyDropAmount");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    b.Property<int?>("CurrencyDropAmountMax");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    b.Property<float>("CurrencyGenerationChance");
 | 
					                    b.Property<float>("CurrencyGenerationChance");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    b.Property<int>("CurrencyGenerationCooldown");
 | 
					                    b.Property<int>("CurrencyGenerationCooldown");
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -28,6 +28,7 @@ namespace NadekoBot.Services.Database.Models
 | 
				
			|||||||
        public int MinimumBetAmount { get; set; } = 2;
 | 
					        public int MinimumBetAmount { get; set; } = 2;
 | 
				
			||||||
        public float BetflipMultiplier { get; set; } = 1.95f;
 | 
					        public float BetflipMultiplier { get; set; } = 1.95f;
 | 
				
			||||||
        public int CurrencyDropAmount { get; set; } = 1;
 | 
					        public int CurrencyDropAmount { get; set; } = 1;
 | 
				
			||||||
 | 
					        public int? CurrencyDropAmountMax { get; set; } = null;
 | 
				
			||||||
        public float Betroll67Multiplier { get; set; } = 2;
 | 
					        public float Betroll67Multiplier { get; set; } = 2;
 | 
				
			||||||
        public float Betroll91Multiplier { get; set; } = 4;
 | 
					        public float Betroll91Multiplier { get; set; } = 4;
 | 
				
			||||||
        public float Betroll100Multiplier { get; set; } = 10;
 | 
					        public float Betroll100Multiplier { get; set; } = 10;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -125,6 +125,10 @@ namespace NadekoBot.Services.Games
 | 
				
			|||||||
                    if (num > 100 && LastGenerations.TryUpdate(channel.Id, DateTime.UtcNow, lastGeneration))
 | 
					                    if (num > 100 && LastGenerations.TryUpdate(channel.Id, DateTime.UtcNow, lastGeneration))
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        var dropAmount = _bc.CurrencyDropAmount;
 | 
					                        var dropAmount = _bc.CurrencyDropAmount;
 | 
				
			||||||
 | 
					                        var dropAmountMax = _bc.CurrencyDropAmountMax;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                        if (dropAmountMax != null && dropAmountMax > dropAmount)
 | 
				
			||||||
 | 
					                            dropAmount = new NadekoRandom().Next(dropAmount, dropAmountMax.Value + 1);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        if (dropAmount > 0)
 | 
					                        if (dropAmount > 0)
 | 
				
			||||||
                        {
 | 
					                        {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,7 +17,7 @@ namespace NadekoBot.Services.Impl
 | 
				
			|||||||
        private readonly IBotCredentials _creds;
 | 
					        private readonly IBotCredentials _creds;
 | 
				
			||||||
        private readonly DateTime _started;
 | 
					        private readonly DateTime _started;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public const string BotVersion = "1.42";
 | 
					        public const string BotVersion = "1.43";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public string Author => "Kwoth#2560";
 | 
					        public string Author => "Kwoth#2560";
 | 
				
			||||||
        public string Library => "Discord.Net";
 | 
					        public string Library => "Discord.Net";
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user