From 832158a85eadb74f56dd1fa8a31de7c9db904ce2 Mon Sep 17 00:00:00 2001 From: Chomp Date: Fri, 20 Aug 2021 20:00:13 +0100 Subject: [PATCH] Add missing mods to output --- Generator/Helpers/Gear/GearChanceHelpers.cs | 28 +++++++++++- Generator/Models/Output/Output.cs | 48 +++++++++++++++------ 2 files changed, 60 insertions(+), 16 deletions(-) diff --git a/Generator/Helpers/Gear/GearChanceHelpers.cs b/Generator/Helpers/Gear/GearChanceHelpers.cs index 70326db..a253c7e 100644 --- a/Generator/Helpers/Gear/GearChanceHelpers.cs +++ b/Generator/Helpers/Gear/GearChanceHelpers.cs @@ -17,10 +17,18 @@ namespace Generator.Helpers.Gear sightRearCount = 0, chargeCount = 0, mount001Count = 0, equipmentCount = 0, gasBlockCount = 0, launcherCount = 0, sightFrontCount = 0, stock000Count = 0, foregripCount = 0, tactical000Count = 0, nvgCount = 0, pistolGripAkmsCount = 0, stockAkmsCount = 0, equipment000Count = 0, equipment001Count = 0, - equipment002Count = 0, bipodCount = 0; + equipment002Count = 0, bipodCount = 0, mount002Count = 0, mount004Count = 0, triggerCount = 0, + hammerCount = 0, catchCount = 0, stock001Count = 0, muzzle000Count = 0, mount003Count = 0; + var mods = new List(); foreach (var baseBot in baseBots) { + var modsToAdd = baseBot.Inventory.items.Where(x => x.slotId?.StartsWith("mod_") == true); + foreach (var item in modsToAdd) + { + mods.AddUnique(item.slotId); + } + muzzleCount += baseBot.Inventory.items.Count(x => x.slotId == "mod_muzzle"); barrelCount += baseBot.Inventory.items.Count(x => x.slotId == "mod_barrel"); handguardCount += baseBot.Inventory.items.Count(x => x.slotId == "mod_handguard"); @@ -53,6 +61,14 @@ namespace Generator.Helpers.Gear equipment001Count += baseBot.Inventory.items.Count(x => x.slotId == "mod_equipment_001"); equipment002Count += baseBot.Inventory.items.Count(x => x.slotId == "mod_equipment_002"); bipodCount += baseBot.Inventory.items.Count(x => x.slotId == "mod_bipod"); + mount002Count += baseBot.Inventory.items.Count(x => x.slotId == "mod_mount_002"); + mount004Count += baseBot.Inventory.items.Count(x => x.slotId == "mod_mount_004"); + triggerCount += baseBot.Inventory.items.Count(x => x.slotId == "mod_trigger"); + hammerCount += baseBot.Inventory.items.Count(x => x.slotId == "mod_hammer"); + catchCount += baseBot.Inventory.items.Count(x => x.slotId == "mod_catch"); + stock001Count += baseBot.Inventory.items.Count(x => x.slotId == "mod_stock_001"); + muzzle000Count += baseBot.Inventory.items.Count(x => x.slotId == "mod_muzzle_000"); + mount003Count += baseBot.Inventory.items.Count(x => x.slotId == "mod_mount_003"); } bot.chances.mods = new Mods( @@ -87,7 +103,15 @@ namespace Generator.Helpers.Gear GetPercent(totalBotsCount, equipment000Count), GetPercent(totalBotsCount, equipment001Count), GetPercent(totalBotsCount, equipment002Count), - GetPercent(totalBotsCount, bipodCount)); + GetPercent(totalBotsCount, bipodCount), + GetPercent(totalBotsCount, mount002Count), + GetPercent(totalBotsCount, mount004Count), + GetPercent(totalBotsCount, triggerCount), + GetPercent(totalBotsCount, hammerCount), + GetPercent(totalBotsCount, catchCount), + GetPercent(totalBotsCount, stock001Count), + GetPercent(totalBotsCount, muzzle000Count), + GetPercent(totalBotsCount, mount003Count)); } public static void AddGenerationChances(Bot bot) diff --git a/Generator/Models/Output/Output.cs b/Generator/Models/Output/Output.cs index 6a56df8..0b4f522 100644 --- a/Generator/Models/Output/Output.cs +++ b/Generator/Models/Output/Output.cs @@ -179,7 +179,9 @@ namespace Generator.Models.Output int charge, int mount_001, int equipment, int gas_block, int launcher, int sight_front, int stock_000, int foregrip, int tactical_000, int nvg, int pistol_grip_akms, int stock_akms, - int equipment_000, int equipment_001, int equipment_002, int bipod) + int equipment_000, int equipment_001, int equipment_002, int bipod, + int mount_002, int mount_004, int trigger, int hammer, int _catch, + int stock_001, int muzzle_000, int mount_003) { mod_muzzle = muzzle; mod_barrel = barrel; @@ -213,40 +215,58 @@ namespace Generator.Models.Output mod_equipment_001 = equipment_001; mod_equipment_002 = equipment_002; mod_bipod = bipod; + mod_mount_002 = mount_002; + mod_mount_004 = mount_004; + mod_trigger = trigger; + mod_hammer = hammer; + mod_catch = _catch; + mod_stock_001 = stock_001; + mod_muzzle_000 = muzzle_000; + mod_mount_003 = mount_003; + + } public int mod_muzzle { get; set; } + public int mod_mount { get; set; } public int mod_barrel { get; set; } public int mod_handguard { get; set; } public int mod_stock { get; set; } - public int mod_magazine { get; set; } - public int mod_mount { get; set; } public int mod_flashlight { get; set; } public int mod_tactical_001 { get; set; } public int mod_tactical_002 { get; set; } public int mod_tactical_003 { get; set; } public int mod_mount_000 { get; set; } + public int mod_magazine { get; set; } public int mod_pistol_grip { get; set; } - public int mod_tactical { get; set; } - public int mod_scope { get; set; } - public int mod_reciever { get; set; } - public int mod_sight_rear { get; set; } - public int mod_charge { get; set; } - public int mod_mount_001 { get; set; } - public int mod_equipment { get; set; } public int mod_gas_block { get; set; } + public int mod_reciever { get; set; } + public int mod_charge { get; set; } + public int mod_sight_rear { get; set; } public int mod_launcher { get; set; } - public int mod_sight_front { get; set; } + public int mod_equipment { get; set; } + public int mod_scope { get; set; } + public int mod_mount_001 { get; set; } + public int mod_mount_002 { get; set; } + public int mod_mount_004 { get; set; } + public int mod_tactical { get; set; } public int mod_stock_000 { get; set; } - public int mod_foregrip { get; set; } - public int mod_tactical_000 { get; set; } - public int mod_nvg { get; set; } + public int mod_sight_front { get; set; } public int mod_pistol_grip_akms { get; set; } public int mod_stock_akms { get; set; } + public int mod_foregrip { get; set; } + public int mod_tactical_000 { get; set; } + public int mod_nvg { get; set; } public int mod_equipment_000 { get; set; } public int mod_equipment_001 { get; set; } public int mod_equipment_002 { get; set; } public int mod_bipod { get; set; } + public int mod_trigger { get; set; } + public int mod_hammer { get; set; } + public int mod_catch { get; set; } + public int mod_stock_001 { get; set; } + public int mod_muzzle_000 { get; set; } + public int mod_mount_003 { get; set; } } public class GenerationChances