From c97f5c23273938683781e2d6bb0bd723318af2c3 Mon Sep 17 00:00:00 2001 From: Dev Date: Thu, 17 Oct 2024 14:49:39 +0100 Subject: [PATCH] Added 0.01 rep gain when successfully exiting a raid as a scav Fixed incorrect check of rep on pmc profile Renamed inraid config property from `scavExtractGain` to `scavExtractStandingGain` --- project/assets/configs/inraid.json | 2 +- project/src/models/spt/config/IInRaidConfig.ts | 2 +- .../src/services/LocationLifecycleService.ts | 17 +++++++++++------ 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/project/assets/configs/inraid.json b/project/assets/configs/inraid.json index f5ab6e72..8ee39cdf 100644 --- a/project/assets/configs/inraid.json +++ b/project/assets/configs/inraid.json @@ -24,7 +24,7 @@ ], "carExtractBaseStandingGain": 0.2, "coopExtractBaseStandingGain": 0.25, - "scavExtractGain": 0.01, + "scavExtractStandingGain": 0.01, "pmcKillProbabilityForScavGain": 0.2, "keepFiRSecureContainerOnDeath": false, "alwaysKeepFoundInRaidonRaidEnd": false, diff --git a/project/src/models/spt/config/IInRaidConfig.ts b/project/src/models/spt/config/IInRaidConfig.ts index 28ea94f7..7b220970 100644 --- a/project/src/models/spt/config/IInRaidConfig.ts +++ b/project/src/models/spt/config/IInRaidConfig.ts @@ -15,7 +15,7 @@ export interface IInRaidConfig extends IBaseConfig { /** Fence rep gain from a single coop extract */ coopExtractBaseStandingGain: number; /** Fence rep gain when successfully extracting as pscav */ - scavExtractGain: number; + scavExtractStandingGain: number; /** The likelihood of PMC eliminating a minimum of 2 scavs while you engage them as a pscav. */ pmcKillProbabilityForScavGain: number; /** On death should items in your secure keep their Find in raid status regardless of how you finished the raid */ diff --git a/project/src/services/LocationLifecycleService.ts b/project/src/services/LocationLifecycleService.ts index 41774853..cb1a309b 100644 --- a/project/src/services/LocationLifecycleService.ts +++ b/project/src/services/LocationLifecycleService.ts @@ -19,6 +19,7 @@ import { import { IStartLocalRaidRequestData } from "@spt/models/eft/match/IStartLocalRaidRequestData"; import { IStartLocalRaidResponseData } from "@spt/models/eft/match/IStartLocalRaidResponseData"; import { ConfigTypes } from "@spt/models/enums/ConfigTypes"; +import { ExitStatus } from "@spt/models/enums/ExitStatis"; import { MessageType } from "@spt/models/enums/MessageType"; import { QuestStatus } from "@spt/models/enums/QuestStatus"; import { Traders } from "@spt/models/enums/Traders"; @@ -566,13 +567,17 @@ export class LocationLifecycleService { this.applyTraderStandingAdjustments(scavProfile.TradersInfo, request.results.profile.TradersInfo); - // Clamp fence standing - const fenceId = Traders.FENCE; - const currentFenceStanding = request.results.profile.TradersInfo[fenceId].standing; - pmcProfile.TradersInfo[fenceId].standing = Math.min(Math.max(currentFenceStanding, -7), 15); // Ensure it stays between -7 and 15 + // Clamp fence standing within -7 to 15 range + const currentFenceStanding = request.results.profile.TradersInfo[Traders.FENCE].standing; + scavProfile.TradersInfo[Traders.FENCE].standing = Math.min(Math.max(currentFenceStanding, -7), 15); - // Copy fence values to PMC - pmcProfile.TradersInfo[fenceId] = scavProfile.TradersInfo[fenceId]; + // Successful extract as scav, give some rep + if (request.results.ExitStatus === ExitStatus.SURVIVED) { + scavProfile.TradersInfo[Traders.FENCE].standing += this.inRaidConfig.scavExtractStandingGain; + } + + // Copy scav fence values to PMC profile + pmcProfile.TradersInfo[Traders.FENCE] = scavProfile.TradersInfo[Traders.FENCE]; // Must occur after encyclopedia updated this.mergePmcAndScavEncyclopedias(scavProfile, pmcProfile);