forked from chomp/BotGenerator
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:
parent
d03b06fd1a
commit
f3975badac
@ -1,6 +1,7 @@
|
|||||||
using Common;
|
using Common;
|
||||||
using Common.Extensions;
|
using Common.Extensions;
|
||||||
using Generator.Helpers;
|
using Generator.Helpers;
|
||||||
|
using Generator.Helpers.Gear;
|
||||||
using Generator.Models.Input;
|
using Generator.Models.Input;
|
||||||
using Generator.Models.Output;
|
using Generator.Models.Output;
|
||||||
using System;
|
using System;
|
||||||
@ -46,6 +47,7 @@ namespace Generator
|
|||||||
AddTacticalVestLoot(botToUpdate, rawBotsOfSameType);
|
AddTacticalVestLoot(botToUpdate, rawBotsOfSameType);
|
||||||
AddBackbackLoot(botToUpdate, rawBotsOfSameType);
|
AddBackbackLoot(botToUpdate, rawBotsOfSameType);
|
||||||
AddSecureContainerLoot(botToUpdate, rawBotsOfSameType);
|
AddSecureContainerLoot(botToUpdate, rawBotsOfSameType);
|
||||||
|
AddSpecialLoot(botToUpdate);
|
||||||
}
|
}
|
||||||
|
|
||||||
stopwatch.Stop();
|
stopwatch.Stop();
|
||||||
@ -54,6 +56,15 @@ namespace Generator
|
|||||||
return _botsWithGear;
|
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)
|
private void AddTacticalVestLoot(Bot finalAssaultBot, List<Datum> bots)
|
||||||
{
|
{
|
||||||
var tacVestItems = GetItemsStoredInEquipmentItem(bots, "TacticalVest");
|
var tacVestItems = GetItemsStoredInEquipmentItem(bots, "TacticalVest");
|
||||||
@ -72,13 +83,9 @@ namespace Generator
|
|||||||
finalAssaultBot.inventory.items.SecuredContainer.AddRange(tacVestItems);
|
finalAssaultBot.inventory.items.SecuredContainer.AddRange(tacVestItems);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AddPocketLoot(Bot finalBot, Datum bot)
|
private void AddSpecialLoot(Bot botToUpdate)
|
||||||
{
|
{
|
||||||
// pocket loot
|
botToUpdate.specialLoot.AddRange(SpecialLootHelper.GetSpecialLootForBotType(botToUpdate.botType));
|
||||||
foreach (var lootItem in bot.Inventory.items.Where(x => x?.slotId?.StartsWith("pocket") == true))
|
|
||||||
{
|
|
||||||
finalBot.inventory.items.Pockets.AddUnique(lootItem._tpl);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<string> GetItemsStoredInEquipmentItem(List<Datum> bots, string containerName)
|
private List<string> GetItemsStoredInEquipmentItem(List<Datum> bots, string containerName)
|
||||||
|
64
Generator/Helpers/Gear/SpecialLootHelper.cs
Normal file
64
Generator/Helpers/Gear/SpecialLootHelper.cs
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -13,6 +13,7 @@ namespace Generator.Models.Output
|
|||||||
health = new Health();
|
health = new Health();
|
||||||
skills = new Skills();
|
skills = new Skills();
|
||||||
inventory = new Inventory();
|
inventory = new Inventory();
|
||||||
|
specialLoot = new List<string>();
|
||||||
firstName = new List<string>();
|
firstName = new List<string>();
|
||||||
lastName = new List<string>();
|
lastName = new List<string>();
|
||||||
difficulty = new Difficulty.Difficulty();
|
difficulty = new Difficulty.Difficulty();
|
||||||
@ -27,6 +28,7 @@ namespace Generator.Models.Output
|
|||||||
public Health health { get; set; }
|
public Health health { get; set; }
|
||||||
public Skills skills { get; set; }
|
public Skills skills { get; set; }
|
||||||
public Inventory inventory { get; set; }
|
public Inventory inventory { get; set; }
|
||||||
|
public List<string> specialLoot { get; set; }
|
||||||
public List<string> firstName { get; set; }
|
public List<string> firstName { get; set; }
|
||||||
public List<string> lastName { get; set; }
|
public List<string> lastName { get; set; }
|
||||||
public Difficulty.Difficulty difficulty { get; set;}
|
public Difficulty.Difficulty difficulty { get; set;}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user