Update bot gen code to choose mag count by bot type

This commit is contained in:
Chomp 2021-09-06 17:34:10 +01:00
parent bdd505801a
commit e9fe68a1d9

View File

@ -3,6 +3,7 @@ using Generator.Models.Input;
using Generator.Models.Output; using Generator.Models.Output;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Common.Models;
namespace Generator.Helpers.Gear namespace Generator.Helpers.Gear
{ {
@ -83,8 +84,14 @@ namespace Generator.Helpers.Gear
public static void AddGenerationChances(Bot bot) 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<Datum> baseBots) public static void CalculateEquipmentChances(Bot bot, List<Datum> baseBots)
{ {
// TODO: Convert to dynamic? // TODO: Convert to dynamic?
@ -132,5 +139,25 @@ namespace Generator.Helpers.Gear
{ {
return (int)Math.Ceiling((double)(((200 * count) + 1) / (total * 2))); 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);
}
} }
} }