From 14e94dbb8e3036eedffe414dea8c426bbd38cd10 Mon Sep 17 00:00:00 2001 From: Dev Date: Mon, 11 Dec 2023 14:42:04 +0000 Subject: [PATCH] Fix issue where scav raids would generate MORE loot the shorter the raid was --- project/src/services/RaidTimeAdjustmentService.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/project/src/services/RaidTimeAdjustmentService.ts b/project/src/services/RaidTimeAdjustmentService.ts index fbcad8b2..d1c98141 100644 --- a/project/src/services/RaidTimeAdjustmentService.ts +++ b/project/src/services/RaidTimeAdjustmentService.ts @@ -129,6 +129,7 @@ export class RaidTimeAdjustmentService const chosenRaidReductionPercent = Number.parseInt(this.weightedRandomHelper.getWeightedValue( mapSettings.reductionPercentWeights, )); + const raidTimeRemainingPercent = 100 - chosenRaidReductionPercent; // How many minutes raid will last const newRaidTimeMinutes = Math.floor(this.randomUtil.reduceValueByPercent(baseEscapeTimeMinutes, chosenRaidReductionPercent)); @@ -141,8 +142,8 @@ export class RaidTimeAdjustmentService // Store time reduction percent in app context so loot gen can pick it up later this.applicationContext.addValue(ContextVariableType.RAID_ADJUSTMENTS, { - dynamicLootPercent: Math.max(chosenRaidReductionPercent, mapSettings.minDynamicLootPercent), - staticLootPercent: Math.max(chosenRaidReductionPercent, mapSettings.minStaticLootPercent), + dynamicLootPercent: Math.max(raidTimeRemainingPercent, mapSettings.minDynamicLootPercent), + staticLootPercent: Math.max(raidTimeRemainingPercent, mapSettings.minStaticLootPercent), simulatedRaidStartSeconds: simulatedRaidStartTimeMinutes * 60 }); }