From e9fe68a1d9993d99b42faf624098bea6129425d6 Mon Sep 17 00:00:00 2001 From: Chomp Date: Mon, 6 Sep 2021 17:34:10 +0100 Subject: [PATCH] Update bot gen code to choose mag count by bot type --- Generator/Helpers/Gear/GearChanceHelpers.cs | 29 ++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/Generator/Helpers/Gear/GearChanceHelpers.cs b/Generator/Helpers/Gear/GearChanceHelpers.cs index 7f4b98a..deae39e 100644 --- a/Generator/Helpers/Gear/GearChanceHelpers.cs +++ b/Generator/Helpers/Gear/GearChanceHelpers.cs @@ -3,6 +3,7 @@ using Generator.Models.Input; using Generator.Models.Output; using System.Collections.Generic; using System.Linq; +using Common.Models; namespace Generator.Helpers.Gear { @@ -83,8 +84,14 @@ namespace Generator.Helpers.Gear public static void AddGenerationChances(Bot bot) { - bot.generation = new GenerationChances(bot.inventory.items.SpecialLoot.Count, bot.inventory.items.SpecialLoot.Count, 1, 2, 0, 3, 2, 4, 0, 5); //TODO get dynamically + bot.generation = new GenerationChances( + bot.inventory.items.SpecialLoot.Count, bot.inventory.items.SpecialLoot.Count, + 1, 2, + 0, 3, + GetMagazineCountByBotType(bot.botType).min, GetMagazineCountByBotType(bot.botType).max, + 0, 5); //TODO get dynamically } + public static void CalculateEquipmentChances(Bot bot, List baseBots) { // TODO: Convert to dynamic? @@ -132,5 +139,25 @@ namespace Generator.Helpers.Gear { return (int)Math.Ceiling((double)(((200 * count) + 1) / (total * 2))); } + + private static MinMax GetMagazineCountByBotType(BotType botType) + { + int min; + int max; + + switch (botType) + { + case BotType.bosskilla: + min = 3; + max = 3; + break; + default: + min = 2; + max = 4; + break; + } + + return new MinMax(min, max); + } } }