.NET Format Style Fixes
This commit is contained in:
@@ -350,7 +350,7 @@ public class LocationLootGenerator(
|
||||
containerDistribution.Add(new ProbabilityObject<string, double>(x, value, value));
|
||||
}
|
||||
|
||||
chosenContainerIds.AddRange(containerDistribution.Draw((int) containerData.ChosenCount));
|
||||
chosenContainerIds.AddRange(containerDistribution.Draw((int)containerData.ChosenCount));
|
||||
|
||||
return chosenContainerIds;
|
||||
}
|
||||
@@ -703,7 +703,8 @@ public class LocationLootGenerator(
|
||||
LooseLoot dynamicLootDist,
|
||||
Dictionary<string, List<StaticAmmoDetails>> staticAmmoDist,
|
||||
string locationName,
|
||||
Dictionary<string, int> spawnLimitedLoot)
|
||||
Dictionary<string, int> spawnLimitedLoot
|
||||
)
|
||||
{
|
||||
List<SpawnpointTemplate> loot = [];
|
||||
List<Spawnpoint> dynamicForcedSpawnPoints = [];
|
||||
@@ -730,7 +731,13 @@ public class LocationLootGenerator(
|
||||
);
|
||||
|
||||
// Add forced loot to results
|
||||
AddForcedLoot(loot, dynamicForcedSpawnPoints, locationName, staticAmmoDist, spawnLimitedLoot);
|
||||
AddForcedLoot(
|
||||
loot,
|
||||
dynamicForcedSpawnPoints,
|
||||
locationName,
|
||||
staticAmmoDist,
|
||||
spawnLimitedLoot
|
||||
);
|
||||
|
||||
// Draw from random distribution
|
||||
var desiredSpawnPointCount = Math.Round(
|
||||
@@ -797,7 +804,7 @@ public class LocationLootGenerator(
|
||||
if (randomSpawnPointCount > 0 && spawnPointArray.Count > 0)
|
||||
// Add randomly chosen spawn points
|
||||
{
|
||||
foreach (var si in spawnPointArray.Draw((int) randomSpawnPointCount, false))
|
||||
foreach (var si in spawnPointArray.Draw((int)randomSpawnPointCount, false))
|
||||
{
|
||||
chosenSpawnPoints.Add(spawnPointArray.Data(si));
|
||||
}
|
||||
@@ -920,7 +927,11 @@ public class LocationLootGenerator(
|
||||
);
|
||||
|
||||
// If count reaches max, skip adding item to loot
|
||||
if (counterTrackerHelper.IncrementCount(createItemResult.Items.FirstOrDefault().Template))
|
||||
if (
|
||||
counterTrackerHelper.IncrementCount(
|
||||
createItemResult.Items.FirstOrDefault().Template
|
||||
)
|
||||
)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -932,7 +943,6 @@ public class LocationLootGenerator(
|
||||
spawnPoint.Template.Items = createItemResult.Items;
|
||||
|
||||
loot.Add(spawnPoint.Template);
|
||||
|
||||
}
|
||||
|
||||
return loot;
|
||||
@@ -951,9 +961,9 @@ public class LocationLootGenerator(
|
||||
List<Spawnpoint> forcedSpawnPoints,
|
||||
string locationName,
|
||||
Dictionary<string, List<StaticAmmoDetails>> staticAmmoDist,
|
||||
Dictionary<string, int> spawnLimitedLoot)
|
||||
Dictionary<string, int> spawnLimitedLoot
|
||||
)
|
||||
{
|
||||
|
||||
if (spawnLimitedLoot is not null)
|
||||
// Process loot items defined as requiring only 1 spawn position as they appear in multiple positions on the map
|
||||
{
|
||||
|
||||
@@ -399,8 +399,8 @@ public class LocationLifecycleService
|
||||
// Adjust raid based on whether this is a scav run
|
||||
LocationConfig? locationConfigClone = null;
|
||||
var raidAdjustments = _profileActivityService
|
||||
.GetProfileActivityRaidData(sessionId)?
|
||||
.RaidAdjustments;
|
||||
.GetProfileActivityRaidData(sessionId)
|
||||
?.RaidAdjustments;
|
||||
if (raidAdjustments is not null)
|
||||
{
|
||||
locationConfigClone = _cloner.Clone(_locationConfig); // Clone values so they can be used to reset originals later
|
||||
@@ -409,7 +409,9 @@ public class LocationLifecycleService
|
||||
|
||||
var staticAmmoDist = _cloner.Clone(location.StaticAmmo);
|
||||
|
||||
var itemsWithSpawnCountLimits = _cloner.Clone(_locationConfig.LootMaxSpawnLimits.GetValueOrDefault(name.ToLower()));
|
||||
var itemsWithSpawnCountLimits = _cloner.Clone(
|
||||
_locationConfig.LootMaxSpawnLimits.GetValueOrDefault(name.ToLower())
|
||||
);
|
||||
|
||||
// Store items with spawn count limits inside so they can be accessed later inside static/dynamic loot spawn methods
|
||||
_counterTrackerHelper.AddDataToTrack(itemsWithSpawnCountLimits);
|
||||
@@ -626,7 +628,7 @@ public class LocationLifecycleService
|
||||
// Check if new standing has leveled up trader
|
||||
_traderHelper.LevelUp(fenceId, pmcData);
|
||||
pmcData.TradersInfo[fenceId].LoyaltyLevel = Math.Max(
|
||||
(int) pmcData.TradersInfo[fenceId].LoyaltyLevel,
|
||||
(int)pmcData.TradersInfo[fenceId].LoyaltyLevel,
|
||||
1
|
||||
);
|
||||
|
||||
@@ -664,7 +666,7 @@ public class LocationLifecycleService
|
||||
// Check if new standing has leveled up trader
|
||||
_traderHelper.LevelUp(fenceId, pmcData);
|
||||
pmcData.TradersInfo[fenceId].LoyaltyLevel = Math.Max(
|
||||
(int) pmcData.TradersInfo[fenceId].LoyaltyLevel,
|
||||
(int)pmcData.TradersInfo[fenceId].LoyaltyLevel,
|
||||
1
|
||||
);
|
||||
|
||||
@@ -696,7 +698,7 @@ public class LocationLifecycleService
|
||||
fenceStanding += Math.Max(baseGain / extractCount, 0.01);
|
||||
|
||||
// Ensure fence loyalty level is not above/below the range -7 to 15
|
||||
var newFenceStanding = Math.Min(Math.Max((double) fenceStanding, -7), 15);
|
||||
var newFenceStanding = Math.Min(Math.Max((double)fenceStanding, -7), 15);
|
||||
_logger.Debug(
|
||||
$"Old vs new fence standing: {pmcData.TradersInfo[fenceId].Standing}, {newFenceStanding}"
|
||||
);
|
||||
@@ -1000,7 +1002,7 @@ public class LocationLifecycleService
|
||||
// Clamp fence standing
|
||||
var currentFenceStanding = postRaidProfile.TradersInfo[fenceId].Standing;
|
||||
pmcProfile.TradersInfo[fenceId].Standing = Math.Min(
|
||||
Math.Max((double) currentFenceStanding, -7),
|
||||
Math.Max((double)currentFenceStanding, -7),
|
||||
15
|
||||
); // Ensure it stays between -7 and 15
|
||||
|
||||
|
||||
Reference in New Issue
Block a user