Change property naming to be more consistent (#578)
This commit is contained in:
@@ -1137,7 +1137,7 @@ public class BotEquipmentModGenerator(
|
||||
}
|
||||
|
||||
// Filter modpool to only items that appear in parents allowed list
|
||||
preFilteredModPool = preFilteredModPool.Where(tpl => parentSlot.Props.Filters.First().Filter.Contains(tpl)).ToHashSet();
|
||||
preFilteredModPool = preFilteredModPool.Where(tpl => parentSlot.Properties.Filters.First().Filter.Contains(tpl)).ToHashSet();
|
||||
if (preFilteredModPool.Count == 0)
|
||||
{
|
||||
return new ChooseRandomCompatibleModResult
|
||||
@@ -1326,7 +1326,7 @@ public class BotEquipmentModGenerator(
|
||||
.ParentTemplate.Properties.Slots?.FirstOrDefault(slot =>
|
||||
string.Equals(slot.Name.ToLowerInvariant(), request.ModSlot.ToLowerInvariant(), StringComparison.Ordinal)
|
||||
)
|
||||
?.Props.Filters?.First()
|
||||
?.Properties.Filters?.First()
|
||||
.Filter;
|
||||
|
||||
// Mod isn't in existing pool, only add if it has no children and exists inside parent filter
|
||||
@@ -1476,7 +1476,7 @@ public class BotEquipmentModGenerator(
|
||||
public MongoId? GetRandomModTplFromItemDb(MongoId fallbackModTpl, Slot parentSlot, string modSlot, IEnumerable<Item> items)
|
||||
{
|
||||
// Find compatible mods and make an array of them
|
||||
var allowedItems = parentSlot.Props.Filters.First().Filter;
|
||||
var allowedItems = parentSlot.Properties.Filters.First().Filter;
|
||||
|
||||
// Find mod item that fits slot from sorted mod array
|
||||
var exhaustableModPool = CreateExhaustableArray(allowedItems);
|
||||
@@ -1573,7 +1573,7 @@ public class BotEquipmentModGenerator(
|
||||
{
|
||||
var desiredSlotObject = modTemplate.Properties?.Slots?.FirstOrDefault(slot => slot.Name.Contains(desiredSlotName));
|
||||
|
||||
var supportedSubMods = desiredSlotObject?.Props?.Filters?.FirstOrDefault()?.Filter;
|
||||
var supportedSubMods = desiredSlotObject?.Properties?.Filters?.FirstOrDefault()?.Filter;
|
||||
if (supportedSubMods is null)
|
||||
{
|
||||
return;
|
||||
@@ -1689,7 +1689,7 @@ public class BotEquipmentModGenerator(
|
||||
modPool[cylinderMagTemplate.Id] = new Dictionary<string, HashSet<MongoId>>();
|
||||
foreach (var camora in camoraSlots)
|
||||
{
|
||||
modPool[cylinderMagTemplate.Id][camora.Name] = camora.Props.Filters.First().Filter.ToHashSet();
|
||||
modPool[cylinderMagTemplate.Id][camora.Name] = camora.Properties.Filters.First().Filter.ToHashSet();
|
||||
}
|
||||
|
||||
itemModPool = modPool[cylinderMagTemplate.Id];
|
||||
@@ -1818,7 +1818,7 @@ public class BotEquipmentModGenerator(
|
||||
// Mods scope slot found must allow ALL whitelisted scope types OR be a mount
|
||||
if (
|
||||
scopeSlot?.All(slot =>
|
||||
slot.Props.Filters.FirstOrDefault()
|
||||
slot.Properties.Filters.FirstOrDefault()
|
||||
.Filter.All(tpl =>
|
||||
itemHelper.IsOfBaseclasses(tpl, whitelistedSightTypes) || itemHelper.IsOfBaseclass(tpl, BaseClasses.MOUNT)
|
||||
)
|
||||
|
||||
@@ -204,7 +204,7 @@ public class BotWeaponGenerator(
|
||||
// Add cartridge(s) to gun chamber(s)
|
||||
if (
|
||||
(weaponItemTemplate.Properties?.Chambers).Any()
|
||||
&& weaponItemTemplate.Properties.Chambers.FirstOrDefault().Props.Filters.FirstOrDefault().Filter.Contains(ammoTpl)
|
||||
&& weaponItemTemplate.Properties.Chambers.FirstOrDefault().Properties.Filters.FirstOrDefault().Filter.Contains(ammoTpl)
|
||||
)
|
||||
{
|
||||
// Guns have variety of possible Chamber ids, patron_in_weapon/patron_in_weapon_000/patron_in_weapon_001
|
||||
@@ -671,7 +671,7 @@ public class BotWeaponGenerator(
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(weaponTemplate);
|
||||
|
||||
var cartridges = weaponTemplate.Properties?.Chambers?.FirstOrDefault()?.Props?.Filters?.First().Filter;
|
||||
var cartridges = weaponTemplate.Properties?.Chambers?.FirstOrDefault()?.Properties?.Filters?.First().Filter;
|
||||
if (cartridges is not null)
|
||||
{
|
||||
return cartridges;
|
||||
@@ -699,7 +699,7 @@ public class BotWeaponGenerator(
|
||||
}
|
||||
|
||||
var magazineTemplate = itemHelper.GetItem(
|
||||
magazineSlot.Props?.Filters.FirstOrDefault()?.Filter?.FirstOrDefault() ?? new MongoId(null)
|
||||
magazineSlot.Properties?.Filters.FirstOrDefault()?.Filter?.FirstOrDefault() ?? new MongoId(null)
|
||||
);
|
||||
if (!magazineTemplate.Key)
|
||||
{
|
||||
@@ -708,10 +708,8 @@ public class BotWeaponGenerator(
|
||||
|
||||
// Try to get cartridges from slots array first, if none found, try Cartridges array
|
||||
var cartridges =
|
||||
magazineTemplate.Value.Properties.Slots.FirstOrDefault()?.Props?.Filters.FirstOrDefault()?.Filter ?? magazineTemplate
|
||||
.Value.Properties.Cartridges.FirstOrDefault()
|
||||
?.Props?.Filters.FirstOrDefault()
|
||||
?.Filter;
|
||||
magazineTemplate.Value.Properties.Slots.FirstOrDefault()?.Properties?.Filters.FirstOrDefault()?.Filter
|
||||
?? magazineTemplate.Value.Properties.Cartridges.FirstOrDefault()?.Properties?.Filters.FirstOrDefault()?.Filter;
|
||||
|
||||
return cartridges ?? [];
|
||||
}
|
||||
@@ -737,7 +735,7 @@ public class BotWeaponGenerator(
|
||||
if (!string.IsNullOrEmpty(weaponTemplate.Properties.LinkedWeapon))
|
||||
{
|
||||
var ammoInChamber = itemHelper.GetItem(
|
||||
weaponTemplate.Properties.Chambers.First().Props.Filters.First().Filter.FirstOrDefault()
|
||||
weaponTemplate.Properties.Chambers.First().Properties.Filters.First().Filter.FirstOrDefault()
|
||||
);
|
||||
return !ammoInChamber.Key ? null : ammoInChamber.Value.Properties.Caliber;
|
||||
}
|
||||
|
||||
@@ -209,7 +209,7 @@ public class FenceBaseAssortGenerator(
|
||||
if (itemHelper.IsOfBaseclass(rootItemDb.Id, BaseClasses.AMMO_BOX))
|
||||
{
|
||||
// Get the cartridge tpl found inside ammo box
|
||||
var cartridgeTplInBox = rootItemDb.Properties.StackSlots.First().Props.Filters.First().Filter.FirstOrDefault();
|
||||
var cartridgeTplInBox = rootItemDb.Properties.StackSlots.First().Properties.Filters.First().Filter.FirstOrDefault();
|
||||
|
||||
// Look up cartridge tpl in db
|
||||
var ammoItemDb = itemHelper.GetItem(cartridgeTplInBox);
|
||||
@@ -253,8 +253,8 @@ public class FenceBaseAssortGenerator(
|
||||
{
|
||||
foreach (var requiredSlot in requiredSlots)
|
||||
{
|
||||
var modItemDbDetails = itemHelper.GetItem(requiredSlot.Props.Filters.First().Plate.Value).Value;
|
||||
var plateTpl = requiredSlot.Props.Filters.First().Plate; // `Plate` property appears to be the 'default' item for slot
|
||||
var modItemDbDetails = itemHelper.GetItem(requiredSlot.Properties.Filters.First().Plate.Value).Value;
|
||||
var plateTpl = requiredSlot.Properties.Filters.First().Plate; // `Plate` property appears to be the 'default' item for slot
|
||||
if (plateTpl is null || plateTpl.Value.IsEmpty)
|
||||
// Some bsg plate properties are empty, skip mod
|
||||
{
|
||||
@@ -287,7 +287,7 @@ public class FenceBaseAssortGenerator(
|
||||
{
|
||||
foreach (var plateSlot in plateSlots)
|
||||
{
|
||||
var plateTpl = plateSlot.Props.Filters.First().Plate;
|
||||
var plateTpl = plateSlot.Properties.Filters.First().Plate;
|
||||
if (string.IsNullOrEmpty(plateTpl))
|
||||
// Bsg data lacks a default plate, skip adding mod
|
||||
{
|
||||
@@ -299,7 +299,7 @@ public class FenceBaseAssortGenerator(
|
||||
new Item
|
||||
{
|
||||
Id = new MongoId(),
|
||||
Template = plateSlot.Props.Filters.First().Plate.Value, // `Plate` property appears to be the 'default' item for slot
|
||||
Template = plateSlot.Properties.Filters.First().Plate.Value, // `Plate` property appears to be the 'default' item for slot
|
||||
ParentId = armor[0].Id,
|
||||
SlotId = plateSlot.Name,
|
||||
Upd = new Upd
|
||||
|
||||
+1
-1
@@ -177,7 +177,7 @@ public class ExternalInventoryMagGen(
|
||||
|
||||
// All possible mags that fit into the weapon excluding blacklisted
|
||||
var magazinePool = magSlot
|
||||
.Props.Filters.First()
|
||||
.Properties.Filters.First()
|
||||
.Filter.Where(x => !magazineBlacklist.Contains(x))
|
||||
.Select(x => itemHelper.GetItem(x).Value);
|
||||
if (magazinePool is null)
|
||||
|
||||
Reference in New Issue
Block a user