@@ -49,7 +49,6 @@ export class ExtractAdjuster {
4949 for ( const locationName of enabledLocations ) {
5050 const location = locations [ locationName ] . base as ILocationBase ;
5151 for ( const extract of location . exits ) {
52- this . commonAdjustments ( extract ) ;
5352 this . enableAllEntryPoints ( extract , location ) ;
5453 this . adjustChanceEnabled ( extract , location ) ;
5554 this . adjustMaximumExtractTime ( extract , location ) ;
@@ -61,6 +60,7 @@ export class ExtractAdjuster {
6160
6261 this . convertCooperationToPayment ( extract , location ) ;
6362 this . adjustVehiclePayment ( extract , location ) ;
63+ this . resetTimerOnLeave ( extract , location ) ;
6464 this . removeBackpackRequirement ( extract , location ) ;
6565 this . removeCliffRequirements ( extract , location ) ;
6666 }
@@ -91,15 +91,6 @@ export class ExtractAdjuster {
9191 ] ) ;
9292 }
9393
94- /**
95- * Performs common adjustments that are applicable to all extracts.
96- */
97- private commonAdjustments ( extract : Exit ) : void {
98- // This is SPT; all extracts should be individual and have no minimum player requirement.
99- extract . ExfiltrationType = "Individual" ;
100- extract . PlayersCount = 0 ;
101- }
102-
10394 /**
10495 * Enables all entry points for a specified extract, making it usable regardless of the player's spawn location.
10596 */
@@ -195,7 +186,7 @@ export class ExtractAdjuster {
195186 return ;
196187 }
197188
198- if ( ! ExtractAdjuster . isCooperationExtract ( extract ) ) {
189+ if ( ! this . isCooperationExtract ( extract ) ) {
199190 // This isn't a cooperation extract;
200191 return ;
201192 }
@@ -219,7 +210,7 @@ export class ExtractAdjuster {
219210 /**
220211 * Determines whether the specified extract is a cooperation extract.
221212 */
222- private static isCooperationExtract ( extract : Exit ) : boolean {
213+ private isCooperationExtract ( extract : Exit ) : boolean {
223214 return extract . PassageRequirement === "ScavCooperation" ;
224215 }
225216
@@ -278,7 +269,7 @@ export class ExtractAdjuster {
278269 return ;
279270 }
280271
281- if ( ! ExtractAdjuster . isCliffExtract ( extract ) ) {
272+ if ( ! this . isCliffExtract ( extract ) ) {
282273 // This isn't a cliff extract.
283274 return ;
284275 }
@@ -300,7 +291,7 @@ export class ExtractAdjuster {
300291 /**
301292 * Determines whether the specified extract is a cliff extract.
302293 */
303- private static isCliffExtract ( extract : Exit ) : boolean {
294+ private isCliffExtract ( extract : Exit ) : boolean {
304295 return extract . Name . trim ( ) . toLowerCase ( ) . includes ( "alp" ) && extract . PassageRequirement === "Reference" ;
305296 }
306297
@@ -373,4 +364,32 @@ export class ExtractAdjuster {
373364 vehicleExtracts . includes ( extract . Name . trim ( ) . toLowerCase ( ) )
374365 ) ;
375366 }
367+
368+ /**
369+ * This will cause the timer for an extract to reset when a player leaves the extract zone.
370+ */
371+ private resetTimerOnLeave ( extract : Exit , location : ILocationBase ) : void {
372+ if ( ! OpenExtracts . config . extracts . resetTimerOnLeave ) {
373+ // Option has been disabled in the configuration file.
374+ return ;
375+ }
376+
377+ if ( ! this . isVehicleExtract ( extract ) && ! this . isCooperationExtract ( extract ) ) {
378+ // This isn't a compatible extract.
379+ return ;
380+ }
381+
382+ extract . ExfiltrationType = "Individual" ;
383+ extract . PlayersCount = 0 ;
384+
385+ if ( OpenExtracts . config . general . debug ) {
386+ OpenExtracts . logger . log (
387+ `OpenExtracts: ${ extract . Name . trim ( ) } on ${ this . getLocationName (
388+ location . Id ,
389+ "human"
390+ ) } will have the extract timer reset on leave.`,
391+ "gray"
392+ ) ;
393+ }
394+ }
376395}
0 commit comments