string to mongoid conversion
Removed unnecessary nulls Cleaned up access levels for methods in `BotGenerator`
This commit is contained in:
@@ -165,7 +165,6 @@
|
||||
"difficulty": "AsOnline",
|
||||
"botRelativeLevelDeltaMax": 10,
|
||||
"botRelativeLevelDeltaMin": 70,
|
||||
"_isUsec": "Percentage chance PMC will be USEC",
|
||||
"isUsec": 60,
|
||||
"_pmcType": "Controls what bot brain can be chosen for each PMC bot type, the number is the weighting to be picked",
|
||||
"pmcType": {
|
||||
|
||||
@@ -56,7 +56,7 @@ public class BotGenerator(
|
||||
PmcData profile
|
||||
)
|
||||
{
|
||||
var bot = GetCloneOfBotBase();
|
||||
var bot = GetBotBaseClone();
|
||||
bot.Info.Settings.BotDifficulty = difficulty;
|
||||
bot.Info.Settings.Role = role;
|
||||
bot.Info.Side = Sides.Savage;
|
||||
@@ -121,7 +121,7 @@ public class BotGenerator(
|
||||
/// <returns>constructed bot</returns>
|
||||
public BotBase PrepareAndGenerateBot(
|
||||
MongoId sessionId,
|
||||
BotGenerationDetails? botGenerationDetails
|
||||
BotGenerationDetails botGenerationDetails
|
||||
)
|
||||
{
|
||||
var preparedBotBase = GetPreparedBotBase(
|
||||
@@ -152,9 +152,9 @@ public class BotGenerator(
|
||||
/// <param name="botSide">Side bot should have</param>
|
||||
/// <param name="difficulty">Difficult bot should have</param>
|
||||
/// <returns>Cloned bot base</returns>
|
||||
public BotBase GetPreparedBotBase(string botRole, string botSide, string difficulty)
|
||||
protected BotBase GetPreparedBotBase(string botRole, string botSide, string difficulty)
|
||||
{
|
||||
var botBaseClone = GetCloneOfBotBase();
|
||||
var botBaseClone = GetBotBaseClone();
|
||||
botBaseClone.Info.Settings.Role = botRole;
|
||||
botBaseClone.Info.Side = botSide;
|
||||
botBaseClone.Info.Settings.BotDifficulty = difficulty;
|
||||
@@ -166,7 +166,7 @@ public class BotGenerator(
|
||||
/// Get a clone of the database\bots\base.json file
|
||||
/// </summary>
|
||||
/// <returns>BotBase object</returns>
|
||||
public BotBase GetCloneOfBotBase()
|
||||
protected BotBase GetBotBaseClone()
|
||||
{
|
||||
return cloner.Clone(databaseService.GetBots().Base);
|
||||
}
|
||||
@@ -179,7 +179,7 @@ public class BotGenerator(
|
||||
/// <param name="botJsonTemplate">Bot template from db/bots/x.json</param>
|
||||
/// <param name="botGenerationDetails">details on how to generate the bot</param>
|
||||
/// <returns>BotBase object</returns>
|
||||
public BotBase GenerateBot(
|
||||
protected BotBase GenerateBot(
|
||||
MongoId sessionId,
|
||||
BotBase bot,
|
||||
BotType botJsonTemplate,
|
||||
@@ -260,8 +260,7 @@ public class BotGenerator(
|
||||
botGenerationDetails.BotDifficulty,
|
||||
botGenerationDetails.Role
|
||||
);
|
||||
bot.Info.Settings.UseSimpleAnimator =
|
||||
botJsonTemplate.BotExperience.UseSimpleAnimator ?? false;
|
||||
bot.Info.Settings.UseSimpleAnimator = botJsonTemplate.BotExperience.UseSimpleAnimator;
|
||||
var chosenVoiceName = weightedRandomHelper.GetWeightedValue(
|
||||
botJsonTemplate.BotAppearance.Voice
|
||||
);
|
||||
@@ -322,7 +321,7 @@ public class BotGenerator(
|
||||
/// </summary>
|
||||
/// <param name="botRole">Role bot has</param>
|
||||
/// <returns>True if name should be simulated pscav</returns>
|
||||
public bool ShouldSimulatePlayerScav(string botRole)
|
||||
protected bool ShouldSimulatePlayerScav(string botRole)
|
||||
{
|
||||
return botRole == Roles.Assault
|
||||
&& randomUtil.GetChance100(_botConfig.ChanceAssaultScavHasPlayerScavName);
|
||||
@@ -335,7 +334,7 @@ public class BotGenerator(
|
||||
/// <param name="botDifficulty">the killed bots difficulty</param>
|
||||
/// <param name="role">Role of bot (optional, used for error logging)</param>
|
||||
/// <returns>Experience for kill</returns>
|
||||
public int GetExperienceRewardForKillByDifficulty(
|
||||
protected int GetExperienceRewardForKillByDifficulty(
|
||||
Dictionary<string, MinMax<int>> experiences,
|
||||
string botDifficulty,
|
||||
string role
|
||||
@@ -370,7 +369,7 @@ public class BotGenerator(
|
||||
/// <param name="botDifficulty">Difficulty of bot to look up</param>
|
||||
/// <param name="role">Role of bot (optional, used for error logging)</param>
|
||||
/// <returns>Standing change value</returns>
|
||||
public double GetStandingChangeForKillByDifficulty(
|
||||
protected double GetStandingChangeForKillByDifficulty(
|
||||
Dictionary<string, double> standingsForKill,
|
||||
string botDifficulty,
|
||||
string role
|
||||
@@ -395,7 +394,7 @@ public class BotGenerator(
|
||||
/// <param name="botDifficulty">Difficulty of bot to look up</param>
|
||||
/// <param name="role">Role of bot (optional, used for error logging)</param>
|
||||
/// <returns>Standing change value</returns>
|
||||
public double GetAggressorBonusByDifficulty(
|
||||
protected double GetAggressorBonusByDifficulty(
|
||||
Dictionary<string, double> aggressorBonuses,
|
||||
string botDifficulty,
|
||||
string role
|
||||
@@ -417,7 +416,7 @@ public class BotGenerator(
|
||||
/// Unheard PMCs need their pockets expanded
|
||||
/// </summary>
|
||||
/// <param name="botJsonTemplate">Bot data to adjust</param>
|
||||
public void AddAdditionalPocketLootWeightsForUnheardBot(BotType botJsonTemplate)
|
||||
protected void AddAdditionalPocketLootWeightsForUnheardBot(BotType botJsonTemplate)
|
||||
{
|
||||
// Adjust pocket loot weights to allow for 5 or 6 items
|
||||
var pocketWeights = botJsonTemplate.BotGeneration.Items.PocketLoot.Weights;
|
||||
@@ -429,7 +428,7 @@ public class BotGenerator(
|
||||
/// Remove items from item.json/lootableItemBlacklist from bots inventory
|
||||
/// </summary>
|
||||
/// <param name="botInventory">Bot to filter</param>
|
||||
public void RemoveBlacklistedLootFromBotTemplate(BotTypeInventory botInventory)
|
||||
protected void RemoveBlacklistedLootFromBotTemplate(BotTypeInventory botInventory)
|
||||
{
|
||||
var containersToProcess = new List<Dictionary<MongoId, double>>
|
||||
{
|
||||
@@ -466,7 +465,7 @@ public class BotGenerator(
|
||||
/// <param name="bot">Bot to adjust</param>
|
||||
/// <param name="appearance">Appearance settings to choose from</param>
|
||||
/// <param name="botGenerationDetails">Generation details</param>
|
||||
public void SetBotAppearance(
|
||||
protected void SetBotAppearance(
|
||||
BotBase bot,
|
||||
Appearance appearance,
|
||||
BotGenerationDetails botGenerationDetails
|
||||
@@ -496,10 +495,10 @@ public class BotGenerator(
|
||||
/// <param name="healthObj">health object from bot json</param>
|
||||
/// <param name="playerScav">Is a pscav bot being generated</param>
|
||||
/// <returns>Health object</returns>
|
||||
public BotBaseHealth GenerateHealth(BotTypeHealth healthObj, bool playerScav = false)
|
||||
protected BotBaseHealth GenerateHealth(BotTypeHealth healthObj, bool playerScav = false)
|
||||
{
|
||||
var bodyParts = playerScav
|
||||
? GetLowestHpBody(healthObj.BodyParts)
|
||||
? GetLowestHpBodyPart(healthObj.BodyParts)
|
||||
: randomUtil.GetArrayValue(healthObj.BodyParts);
|
||||
|
||||
BotBaseHealth health = new()
|
||||
@@ -632,7 +631,7 @@ public class BotGenerator(
|
||||
/// </summary>
|
||||
/// <param name="bodyParts">Body parts</param>
|
||||
/// <returns>Part with the lowest hp</returns>
|
||||
public BodyPart? GetLowestHpBody(List<BodyPart> bodyParts)
|
||||
protected BodyPart? GetLowestHpBodyPart(List<BodyPart> bodyParts)
|
||||
{
|
||||
if (bodyParts.Count == 0)
|
||||
{
|
||||
@@ -660,7 +659,7 @@ public class BotGenerator(
|
||||
/// </summary>
|
||||
/// <param name="botSkills">Skills that should have their progress value randomised</param>
|
||||
/// <returns>Skills</returns>
|
||||
public Skills GenerateSkills(BotDbSkills botSkills)
|
||||
protected Skills GenerateSkills(BotDbSkills botSkills)
|
||||
{
|
||||
var skillsToReturn = new Skills
|
||||
{
|
||||
@@ -677,15 +676,10 @@ public class BotGenerator(
|
||||
/// </summary>
|
||||
/// <param name="skills">Skills to randomise</param>
|
||||
/// <returns>Skills with randomised progress values as a collection</returns>
|
||||
public List<CommonSkill> GetCommonSkillsWithRandomisedProgressValue(
|
||||
Dictionary<string, MinMax<double>>? skills
|
||||
protected List<CommonSkill> GetCommonSkillsWithRandomisedProgressValue(
|
||||
Dictionary<string, MinMax<double>> skills
|
||||
)
|
||||
{
|
||||
if (skills is null)
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
return skills
|
||||
.Select(kvp =>
|
||||
{
|
||||
@@ -711,18 +705,18 @@ public class BotGenerator(
|
||||
/// <summary>
|
||||
/// Randomise the progress value of passed in skills based on the min/max value
|
||||
/// </summary>
|
||||
/// <param name="skills">Skills to randomise</param>
|
||||
/// <param name="masteringSkills">Skills to randomise</param>
|
||||
/// <returns>Skills with randomised progress values as a collection</returns>
|
||||
public List<MasterySkill> GetMasteringSkillsWithRandomisedProgressValue(
|
||||
Dictionary<string, MinMax<double>>? skills
|
||||
protected List<MasterySkill> GetMasteringSkillsWithRandomisedProgressValue(
|
||||
Dictionary<string, MinMax<double>>? masteringSkills
|
||||
)
|
||||
{
|
||||
if (skills is null)
|
||||
if (masteringSkills is null)
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
return skills
|
||||
return masteringSkills
|
||||
.Select(kvp =>
|
||||
{
|
||||
// Get skill from dict, skip if not found
|
||||
@@ -749,7 +743,7 @@ public class BotGenerator(
|
||||
/// <param name="bot">bot to update</param>
|
||||
/// <param name="botGenerationDetails"></param>
|
||||
/// <returns></returns>
|
||||
public void AddIdsToBot(BotBase bot, BotGenerationDetails botGenerationDetails)
|
||||
protected void AddIdsToBot(BotBase bot, BotGenerationDetails botGenerationDetails)
|
||||
{
|
||||
bot.Id = new MongoId();
|
||||
bot.Aid = botGenerationDetails.IsPmc ? hashUtil.GenerateAccountId() : 0;
|
||||
@@ -760,7 +754,7 @@ public class BotGenerator(
|
||||
/// Update all inventory items that make use of this value too.
|
||||
/// </summary>
|
||||
/// <param name="profile">Profile to update</param>
|
||||
public void GenerateInventoryId(BotBase profile)
|
||||
protected void GenerateInventoryId(BotBase profile)
|
||||
{
|
||||
var newInventoryItemId = new MongoId();
|
||||
|
||||
@@ -799,7 +793,7 @@ public class BotGenerator(
|
||||
/// </summary>
|
||||
/// <param name="botInfo">bot info object to update</param>
|
||||
/// <returns>Chosen game version</returns>
|
||||
public string SetRandomisedGameVersionAndCategory(Info botInfo)
|
||||
protected string SetRandomisedGameVersionAndCategory(Info botInfo)
|
||||
{
|
||||
// Special case
|
||||
if (string.Equals(botInfo.Nickname, "nikita", StringComparison.OrdinalIgnoreCase))
|
||||
@@ -841,7 +835,7 @@ public class BotGenerator(
|
||||
/// </summary>
|
||||
/// <param name="bot">bot to add dogtag to</param>
|
||||
/// <returns></returns>
|
||||
public void AddDogtagToBot(BotBase bot)
|
||||
protected void AddDogtagToBot(BotBase bot)
|
||||
{
|
||||
Item inventoryItem = new()
|
||||
{
|
||||
@@ -861,7 +855,7 @@ public class BotGenerator(
|
||||
/// <param name="side">Usec/Bear</param>
|
||||
/// <param name="gameVersion">edge_of_darkness / standard</param>
|
||||
/// <returns>item tpl</returns>
|
||||
public MongoId GetDogtagTplByGameVersionAndSide(string side, string gameVersion)
|
||||
protected MongoId GetDogtagTplByGameVersionAndSide(string side, string gameVersion)
|
||||
{
|
||||
_pmcConfig.DogtagSettings.TryGetValue(side.ToLower(), out var gameVersionWeights);
|
||||
if (!gameVersionWeights.TryGetValue(gameVersion, out var possibleDogtags))
|
||||
|
||||
@@ -212,11 +212,8 @@ public class BotInventoryGenerator(
|
||||
)
|
||||
// Never let mod chance go outside 0 - 100
|
||||
{
|
||||
randomistionDetails.EquipmentMods[equipment] = Math.Clamp(
|
||||
randomistionDetails.EquipmentMods[equipment] + weight,
|
||||
0,
|
||||
100
|
||||
);
|
||||
var newWeight = weight + randomistionDetails.EquipmentMods[equipment];
|
||||
randomistionDetails.EquipmentMods[equipment] = Math.Clamp(newWeight, 0, 100);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -794,7 +791,7 @@ public class BotInventoryGenerator(
|
||||
sessionId,
|
||||
weaponSlot.Slot.ToString(),
|
||||
templateInventory,
|
||||
botInventory.Equipment,
|
||||
botInventory.Equipment.Value,
|
||||
equipmentChances.WeaponModsChances,
|
||||
botRole,
|
||||
isPmc,
|
||||
|
||||
@@ -411,7 +411,7 @@ public class BotLootGenerator(
|
||||
return null;
|
||||
}
|
||||
|
||||
var matchingValue = _pmcConfig?.LootItemLimitsRub?.FirstOrDefault(minMaxValue =>
|
||||
var matchingValue = _pmcConfig?.LootItemLimitsRub.FirstOrDefault(minMaxValue =>
|
||||
botLevel >= minMaxValue.Min && botLevel <= minMaxValue.Max
|
||||
);
|
||||
|
||||
@@ -753,7 +753,7 @@ public class BotLootGenerator(
|
||||
BotBaseInventory botInventory,
|
||||
EquipmentSlots equipmentSlot,
|
||||
BotTypeInventory? templateInventory,
|
||||
Dictionary<string, double>? modChances,
|
||||
Dictionary<string, double> modChances,
|
||||
string botRole,
|
||||
bool isPmc,
|
||||
int botLevel,
|
||||
@@ -784,7 +784,7 @@ public class BotLootGenerator(
|
||||
sessionId,
|
||||
chosenWeaponType,
|
||||
templateInventory,
|
||||
botInventory.Equipment,
|
||||
botInventory.Equipment.Value,
|
||||
modChances,
|
||||
botRole,
|
||||
isPmc,
|
||||
@@ -795,7 +795,7 @@ public class BotLootGenerator(
|
||||
if (weaponRootItem is null)
|
||||
{
|
||||
logger.Error(
|
||||
$"Generated loose weapon: {chosenWeaponType} for: {botRole} level: {botLevel} was null, skipping"
|
||||
$"Generated null loose weapon: {chosenWeaponType} for: {botRole} level: {botLevel}, skipping"
|
||||
);
|
||||
|
||||
continue;
|
||||
|
||||
@@ -66,7 +66,7 @@ public class BotWeaponGenerator(
|
||||
MongoId sessionId,
|
||||
string equipmentSlot,
|
||||
BotTypeInventory botTemplateInventory,
|
||||
string weaponParentId,
|
||||
MongoId weaponParentId,
|
||||
Dictionary<string, double> modChances,
|
||||
string botRole,
|
||||
bool isPmc,
|
||||
@@ -93,7 +93,7 @@ public class BotWeaponGenerator(
|
||||
/// <param name="equipmentSlot">Primary/secondary/holster</param>
|
||||
/// <param name="botTemplateInventory">e.g. assault.json</param>
|
||||
/// <returns>Weapon template</returns>
|
||||
public string PickWeightedWeaponTemplateFromPool(
|
||||
public MongoId PickWeightedWeaponTemplateFromPool(
|
||||
string equipmentSlot,
|
||||
BotTypeInventory botTemplateInventory
|
||||
)
|
||||
@@ -125,7 +125,7 @@ public class BotWeaponGenerator(
|
||||
MongoId weaponTpl,
|
||||
string slotName,
|
||||
BotTypeInventory botTemplateInventory,
|
||||
string weaponParentId,
|
||||
MongoId weaponParentId,
|
||||
Dictionary<string, double> modChances,
|
||||
string botRole,
|
||||
bool isPmc,
|
||||
|
||||
@@ -441,7 +441,7 @@ public record Skills
|
||||
[JsonExtensionData]
|
||||
public Dictionary<string, object>? ExtensionData { get; set; }
|
||||
|
||||
public List<CommonSkill>? Common { get; set; }
|
||||
public List<CommonSkill> Common { get; set; }
|
||||
|
||||
public List<MasterySkill>? Mastering { get; set; }
|
||||
|
||||
|
||||
@@ -11,34 +11,34 @@ public record BotType
|
||||
public Dictionary<string, object>? ExtensionData { get; set; }
|
||||
|
||||
[JsonPropertyName("appearance")]
|
||||
public Appearance? BotAppearance { get; set; }
|
||||
public Appearance BotAppearance { get; set; }
|
||||
|
||||
[JsonPropertyName("chances")]
|
||||
public Chances? BotChances { get; set; }
|
||||
public Chances BotChances { get; set; }
|
||||
|
||||
[JsonPropertyName("difficulty")]
|
||||
public Dictionary<string, DifficultyCategories>? BotDifficulty { get; set; }
|
||||
public Dictionary<string, DifficultyCategories> BotDifficulty { get; set; }
|
||||
|
||||
[JsonPropertyName("experience")]
|
||||
public Experience? BotExperience { get; set; }
|
||||
public Experience BotExperience { get; set; }
|
||||
|
||||
[JsonPropertyName("firstName")]
|
||||
public List<string>? FirstNames { get; set; }
|
||||
public List<string> FirstNames { get; set; }
|
||||
|
||||
[JsonPropertyName("generation")]
|
||||
public Generation? BotGeneration { get; set; }
|
||||
public Generation BotGeneration { get; set; }
|
||||
|
||||
[JsonPropertyName("health")]
|
||||
public BotTypeHealth? BotHealth { get; set; }
|
||||
public BotTypeHealth BotHealth { get; set; }
|
||||
|
||||
[JsonPropertyName("inventory")]
|
||||
public BotTypeInventory? BotInventory { get; set; }
|
||||
public BotTypeInventory BotInventory { get; set; }
|
||||
|
||||
[JsonPropertyName("lastName")]
|
||||
public List<string>? LastNames { get; set; }
|
||||
public List<string> LastNames { get; set; }
|
||||
|
||||
[JsonPropertyName("skills")]
|
||||
public BotDbSkills? BotSkills { get; set; }
|
||||
public BotDbSkills BotSkills { get; set; }
|
||||
}
|
||||
|
||||
public record Appearance
|
||||
@@ -47,22 +47,22 @@ public record Appearance
|
||||
public Dictionary<string, object>? ExtensionData { get; set; }
|
||||
|
||||
[JsonPropertyName("body")]
|
||||
public Dictionary<MongoId, double>? Body { get; set; }
|
||||
public Dictionary<MongoId, double> Body { get; set; }
|
||||
|
||||
[JsonPropertyName("feet")]
|
||||
public Dictionary<MongoId, double>? Feet { get; set; }
|
||||
public Dictionary<MongoId, double> Feet { get; set; }
|
||||
|
||||
[JsonPropertyName("hands")]
|
||||
[JsonConverter(typeof(ArrayToObjectFactoryConverter))]
|
||||
public Dictionary<MongoId, double>? Hands { get; set; }
|
||||
public Dictionary<MongoId, double> Hands { get; set; }
|
||||
|
||||
[JsonPropertyName("head")]
|
||||
[JsonConverter(typeof(ArrayToObjectFactoryConverter))]
|
||||
public Dictionary<MongoId, double>? Head { get; set; }
|
||||
public Dictionary<MongoId, double> Head { get; set; }
|
||||
|
||||
[JsonPropertyName("voice")]
|
||||
[JsonConverter(typeof(ArrayToObjectFactoryConverter))]
|
||||
public Dictionary<string, double>? Voice { get; set; }
|
||||
public Dictionary<string, double> Voice { get; set; }
|
||||
}
|
||||
|
||||
public record Chances
|
||||
@@ -71,16 +71,13 @@ public record Chances
|
||||
public Dictionary<string, object>? ExtensionData { get; set; }
|
||||
|
||||
[JsonPropertyName("equipment")]
|
||||
public Dictionary<string, double>? EquipmentChances { get; set; }
|
||||
public Dictionary<string, double> EquipmentChances { get; set; }
|
||||
|
||||
[JsonPropertyName("weaponMods")]
|
||||
public Dictionary<string, double>? WeaponModsChances { get; set; }
|
||||
public Dictionary<string, double> WeaponModsChances { get; set; }
|
||||
|
||||
[JsonPropertyName("equipmentMods")]
|
||||
public Dictionary<string, double>? EquipmentModsChances { get; set; }
|
||||
|
||||
[JsonPropertyName("mods")]
|
||||
public Dictionary<string, double>? Mods { get; set; }
|
||||
public Dictionary<string, double> EquipmentModsChances { get; set; }
|
||||
}
|
||||
|
||||
/* record removed in favor of Dictionary<string, double>
|
||||
@@ -257,16 +254,16 @@ public record Difficulties
|
||||
public Dictionary<string, object>? ExtensionData { get; set; }
|
||||
|
||||
[JsonPropertyName("easy")]
|
||||
public DifficultyCategories? Easy { get; set; }
|
||||
public DifficultyCategories Easy { get; set; }
|
||||
|
||||
[JsonPropertyName("normal")]
|
||||
public DifficultyCategories? Normal { get; set; }
|
||||
public DifficultyCategories Normal { get; set; }
|
||||
|
||||
[JsonPropertyName("hard")]
|
||||
public DifficultyCategories? Hard { get; set; }
|
||||
public DifficultyCategories Hard { get; set; }
|
||||
|
||||
[JsonPropertyName("impossible")]
|
||||
public DifficultyCategories? Impossible { get; set; }
|
||||
public DifficultyCategories Impossible { get; set; }
|
||||
}
|
||||
|
||||
public record DifficultyCategories
|
||||
@@ -312,25 +309,25 @@ public record Experience
|
||||
/// key = bot difficulty
|
||||
/// </summary>
|
||||
[JsonPropertyName("aggressorBonus")]
|
||||
public Dictionary<string, double>? AggressorBonus { get; set; }
|
||||
public Dictionary<string, double> AggressorBonus { get; set; }
|
||||
|
||||
[JsonPropertyName("level")]
|
||||
public MinMax<int>? Level { get; set; }
|
||||
public MinMax<int> Level { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// key = bot difficulty
|
||||
/// </summary>
|
||||
[JsonPropertyName("reward")]
|
||||
public Dictionary<string, MinMax<int>>? Reward { get; set; }
|
||||
public Dictionary<string, MinMax<int>> Reward { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// key = bot difficulty
|
||||
/// </summary>
|
||||
[JsonPropertyName("standingForKill")]
|
||||
public Dictionary<string, double>? StandingForKill { get; set; }
|
||||
public Dictionary<string, double> StandingForKill { get; set; }
|
||||
|
||||
[JsonPropertyName("useSimpleAnimator")]
|
||||
public bool? UseSimpleAnimator { get; set; }
|
||||
public bool UseSimpleAnimator { get; set; }
|
||||
}
|
||||
|
||||
public record Generation
|
||||
@@ -339,7 +336,7 @@ public record Generation
|
||||
public Dictionary<string, object>? ExtensionData { get; set; }
|
||||
|
||||
[JsonPropertyName("items")]
|
||||
public GenerationWeightingItems? Items { get; set; }
|
||||
public GenerationWeightingItems Items { get; set; }
|
||||
}
|
||||
|
||||
public record GenerationData
|
||||
@@ -351,14 +348,14 @@ public record GenerationData
|
||||
/// key: number of items, value: weighting
|
||||
/// </summary>
|
||||
[JsonPropertyName("weights")]
|
||||
public Dictionary<double, double>? Weights { get; set; }
|
||||
public Dictionary<double, double> Weights { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Array of item tpls
|
||||
/// </summary>
|
||||
[JsonPropertyName("whitelist")]
|
||||
[JsonConverter(typeof(ArrayToObjectFactoryConverter))]
|
||||
public Dictionary<MongoId, double>? Whitelist { get; set; }
|
||||
public Dictionary<MongoId, double> Whitelist { get; set; }
|
||||
}
|
||||
|
||||
public record GenerationWeightingItems
|
||||
@@ -411,13 +408,13 @@ public record BotTypeHealth
|
||||
[JsonExtensionData]
|
||||
public Dictionary<string, object>? ExtensionData { get; set; }
|
||||
|
||||
public List<BodyPart>? BodyParts { get; set; }
|
||||
public List<BodyPart> BodyParts { get; set; }
|
||||
|
||||
public MinMax<double>? Energy { get; set; }
|
||||
public MinMax<double> Energy { get; set; }
|
||||
|
||||
public MinMax<double>? Hydration { get; set; }
|
||||
public MinMax<double> Hydration { get; set; }
|
||||
|
||||
public MinMax<double>? Temperature { get; set; }
|
||||
public MinMax<double> Temperature { get; set; }
|
||||
}
|
||||
|
||||
public record BodyPart
|
||||
@@ -425,19 +422,19 @@ public record BodyPart
|
||||
[JsonExtensionData]
|
||||
public Dictionary<string, object>? ExtensionData { get; set; }
|
||||
|
||||
public MinMax<double>? Chest { get; set; }
|
||||
public MinMax<double> Chest { get; set; }
|
||||
|
||||
public MinMax<double>? Head { get; set; }
|
||||
public MinMax<double> Head { get; set; }
|
||||
|
||||
public MinMax<double>? LeftArm { get; set; }
|
||||
public MinMax<double> LeftArm { get; set; }
|
||||
|
||||
public MinMax<double>? LeftLeg { get; set; }
|
||||
public MinMax<double> LeftLeg { get; set; }
|
||||
|
||||
public MinMax<double>? RightArm { get; set; }
|
||||
public MinMax<double> RightArm { get; set; }
|
||||
|
||||
public MinMax<double>? RightLeg { get; set; }
|
||||
public MinMax<double> RightLeg { get; set; }
|
||||
|
||||
public MinMax<double>? Stomach { get; set; }
|
||||
public MinMax<double> Stomach { get; set; }
|
||||
}
|
||||
|
||||
public record BotTypeInventory
|
||||
@@ -446,15 +443,15 @@ public record BotTypeInventory
|
||||
public Dictionary<string, object>? ExtensionData { get; set; }
|
||||
|
||||
[JsonPropertyName("equipment")]
|
||||
public Dictionary<EquipmentSlots, Dictionary<MongoId, double>>? Equipment { get; set; }
|
||||
public Dictionary<EquipmentSlots, Dictionary<MongoId, double>> Equipment { get; set; }
|
||||
|
||||
public Dictionary<string, Dictionary<MongoId, double>>? Ammo { get; set; }
|
||||
public Dictionary<string, Dictionary<MongoId, double>> Ammo { get; set; }
|
||||
|
||||
[JsonPropertyName("items")]
|
||||
public ItemPools? Items { get; set; }
|
||||
public ItemPools Items { get; set; }
|
||||
|
||||
[JsonPropertyName("mods")]
|
||||
public GlobalMods? Mods { get; set; }
|
||||
public GlobalMods Mods { get; set; }
|
||||
}
|
||||
|
||||
public record Equipment
|
||||
@@ -496,15 +493,15 @@ public record ItemPools
|
||||
[JsonExtensionData]
|
||||
public Dictionary<string, object>? ExtensionData { get; set; }
|
||||
|
||||
public Dictionary<MongoId, double>? Backpack { get; set; }
|
||||
public Dictionary<MongoId, double> Backpack { get; set; }
|
||||
|
||||
public Dictionary<MongoId, double>? Pockets { get; set; }
|
||||
public Dictionary<MongoId, double> Pockets { get; set; }
|
||||
|
||||
public Dictionary<MongoId, double>? SecuredContainer { get; set; }
|
||||
public Dictionary<MongoId, double> SecuredContainer { get; set; }
|
||||
|
||||
public Dictionary<MongoId, double>? SpecialLoot { get; set; }
|
||||
public Dictionary<MongoId, double> SpecialLoot { get; set; }
|
||||
|
||||
public Dictionary<MongoId, double>? TacticalVest { get; set; }
|
||||
public Dictionary<MongoId, double> TacticalVest { get; set; }
|
||||
}
|
||||
|
||||
public record BotDbSkills
|
||||
@@ -512,7 +509,7 @@ public record BotDbSkills
|
||||
[JsonExtensionData]
|
||||
public Dictionary<string, object>? ExtensionData { get; set; }
|
||||
|
||||
public Dictionary<string, MinMax<double>>? Common { get; set; }
|
||||
public Dictionary<string, MinMax<double>> Common { get; set; }
|
||||
|
||||
public Dictionary<string, MinMax<double>>? Mastering { get; set; }
|
||||
}
|
||||
|
||||
@@ -73,9 +73,6 @@ public record PmcConfig : BaseConfig
|
||||
[JsonPropertyName("looseWeaponInBackpackLootMinMax")]
|
||||
public required MinMax<int> LooseWeaponInBackpackLootMinMax { get; set; }
|
||||
|
||||
[JsonPropertyName("_isUsec")]
|
||||
public string? IsUsecDescription { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Percentage chance PMC will be USEC
|
||||
/// </summary>
|
||||
@@ -143,10 +140,10 @@ public record PmcConfig : BaseConfig
|
||||
public required bool AddSecureContainerLootFromBotConfig { get; set; }
|
||||
|
||||
[JsonPropertyName("lootItemLimitsRub")]
|
||||
public required List<MinMaxLootItemValue>? LootItemLimitsRub { get; set; }
|
||||
public required List<MinMaxLootItemValue> LootItemLimitsRub { get; set; }
|
||||
|
||||
[JsonPropertyName("removeExistingPmcWaves")]
|
||||
public required bool? RemoveExistingPmcWaves { get; set; }
|
||||
public required bool RemoveExistingPmcWaves { get; set; }
|
||||
|
||||
[JsonPropertyName("dogtags")]
|
||||
public required Dictionary<
|
||||
|
||||
@@ -25,7 +25,7 @@ public class BotNameService(
|
||||
protected readonly HashSet<string> _usedNameCache = [];
|
||||
|
||||
/// <summary>
|
||||
/// Clear out any entries in Name Set
|
||||
/// Clear out generated pmc names from cache
|
||||
/// </summary>
|
||||
public void ClearNameCache()
|
||||
{
|
||||
|
||||
@@ -66,7 +66,7 @@ public class PostDbLoadService(
|
||||
openZoneService.ApplyZoneChangesToAllMaps();
|
||||
}
|
||||
|
||||
if (_pmcConfig.RemoveExistingPmcWaves.GetValueOrDefault(false))
|
||||
if (_pmcConfig.RemoveExistingPmcWaves)
|
||||
{
|
||||
RemoveExistingPmcWaves();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user