Add special loot aray to output and add helper class for storing special items that must spawn with specific bot types

This commit is contained in:
Chomp 2021-08-27 21:01:59 +01:00
parent d03b06fd1a
commit f3975badac
3 changed files with 79 additions and 6 deletions

View File

@ -1,6 +1,7 @@
using Common;
using Common.Extensions;
using Generator.Helpers;
using Generator.Helpers.Gear;
using Generator.Models.Input;
using Generator.Models.Output;
using System;
@ -46,6 +47,7 @@ namespace Generator
AddTacticalVestLoot(botToUpdate, rawBotsOfSameType);
AddBackbackLoot(botToUpdate, rawBotsOfSameType);
AddSecureContainerLoot(botToUpdate, rawBotsOfSameType);
AddSpecialLoot(botToUpdate);
}
stopwatch.Stop();
@ -54,6 +56,15 @@ namespace Generator
return _botsWithGear;
}
private void AddPocketLoot(Bot finalBot, Datum bot)
{
// pocket loot
foreach (var lootItem in bot.Inventory.items.Where(x => x?.slotId?.StartsWith("pocket") == true))
{
finalBot.inventory.items.Pockets.AddUnique(lootItem._tpl);
}
}
private void AddTacticalVestLoot(Bot finalAssaultBot, List<Datum> bots)
{
var tacVestItems = GetItemsStoredInEquipmentItem(bots, "TacticalVest");
@ -72,13 +83,9 @@ namespace Generator
finalAssaultBot.inventory.items.SecuredContainer.AddRange(tacVestItems);
}
private void AddPocketLoot(Bot finalBot, Datum bot)
private void AddSpecialLoot(Bot botToUpdate)
{
// pocket loot
foreach (var lootItem in bot.Inventory.items.Where(x => x?.slotId?.StartsWith("pocket") == true))
{
finalBot.inventory.items.Pockets.AddUnique(lootItem._tpl);
}
botToUpdate.specialLoot.AddRange(SpecialLootHelper.GetSpecialLootForBotType(botToUpdate.botType));
}
private List<string> GetItemsStoredInEquipmentItem(List<Datum> bots, string containerName)

View File

@ -0,0 +1,64 @@
using Generator.Models;
using System.Collections.Generic;
namespace Generator.Helpers.Gear
{
public static class SpecialLootHelper
{
public static IEnumerable<string> GetSpecialLootForBotType(BotType botType)
{
var results = new List<string>();
switch (botType)
{
case BotType.assault:
break;
case BotType.pmcBot:
break;
case BotType.marksman:
break;
case BotType.bossbully:
break;
case BotType.bossgluhar:
break;
case BotType.bosskilla:
break;
case BotType.bosskojaniy:
results.Add("5d08d21286f774736e7c94c3"); // Shturman's stash key
break;
case BotType.bosssanitar:
results.Add("5efde6b4f5448336730dbd61"); // Keycard with a blue marking
break;
case BotType.bossstormtrooper:
break;
case BotType.followerbully:
break;
case BotType.followergluharassault:
break;
case BotType.followergluharscout:
break;
case BotType.followergluharsecurity:
break;
case BotType.followergluharsnipe:
break;
case BotType.followerkojaniy:
break;
case BotType.followersanitar:
break;
case BotType.followerstormtrooper:
break;
case BotType.cursedassault:
break;
case BotType.sectantpriest:
break;
case BotType.sectantwarrior:
break;
case BotType.usec:
break;
default:
break;
}
return results;
}
}
}

View File

@ -13,6 +13,7 @@ namespace Generator.Models.Output
health = new Health();
skills = new Skills();
inventory = new Inventory();
specialLoot = new List<string>();
firstName = new List<string>();
lastName = new List<string>();
difficulty = new Difficulty.Difficulty();
@ -27,6 +28,7 @@ namespace Generator.Models.Output
public Health health { get; set; }
public Skills skills { get; set; }
public Inventory inventory { get; set; }
public List<string> specialLoot { get; set; }
public List<string> firstName { get; set; }
public List<string> lastName { get; set; }
public Difficulty.Difficulty difficulty { get; set;}