Commit 6562d05 Chomp
committed
1 parent 016fc2a commit 6562d05 Copy full SHA for 6562d05
File tree 2 files changed +25
-6
lines changed
2 files changed +25
-6
lines changed Original file line number Diff line number Diff line change @@ -287,17 +287,17 @@ export class ProfileFixerService {
287
287
}
288
288
289
289
// For started or successful quests, check for unlocks in the `Started` rewards
290
- if ( profileQuest . status == QuestStatus . Started || profileQuest . status == QuestStatus . Success ) {
290
+ if ( profileQuest . status === QuestStatus . Started || profileQuest . status = == QuestStatus . Success ) {
291
291
const productionRewards = quest . rewards . Started ?. filter (
292
- ( reward ) => reward . type == QuestRewardType . PRODUCTIONS_SCHEME ,
292
+ ( reward ) => reward . type === QuestRewardType . PRODUCTIONS_SCHEME ,
293
293
) ;
294
294
productionRewards ?. forEach ( ( reward ) => this . verifyQuestProductionUnlock ( pmcProfile , reward , quest ) ) ;
295
295
}
296
296
297
297
// For successful quests, check for unlocks in the `Success` rewards
298
298
if ( profileQuest . status == QuestStatus . Success ) {
299
299
const productionRewards = quest . rewards . Success ?. filter (
300
- ( reward ) => reward . type == QuestRewardType . PRODUCTIONS_SCHEME ,
300
+ ( reward ) => reward . type === QuestRewardType . PRODUCTIONS_SCHEME ,
301
301
) ;
302
302
productionRewards ?. forEach ( ( reward ) => this . verifyQuestProductionUnlock ( pmcProfile , reward , quest ) ) ;
303
303
}
Original file line number Diff line number Diff line change @@ -501,10 +501,29 @@ export class SeasonalEventService {
501
501
this . databaseService . getLocation ( locationId ) . base . waves = [ ] ;
502
502
}
503
503
504
- const activeMaps = Object . keys ( zombieSettings . mapInfectionAmount ) . filter (
505
- ( locationId ) => zombieSettings . mapInfectionAmount [ locationId ] > 0 ,
504
+ const locationsWithActiveInfection = this . getLocationsWithZombies ( zombieSettings . mapInfectionAmount ) ;
505
+ this . addEventBossesToMaps ( "halloweenzombies" , locationsWithActiveInfection ) ;
506
+ }
507
+
508
+ /**
509
+ * Get location ids of maps with an infection above 0
510
+ * @param locationInfections Dict of locations with their infection percentage
511
+ * @returns Array of location ids
512
+ */
513
+ protected getLocationsWithZombies ( locationInfections : Record < string , number > ) : string [ ] {
514
+ const result : string [ ] = [ ] ;
515
+
516
+ // Get only the locations with an infection above 0
517
+ const infectionKeys = Object . keys ( locationInfections ) . filter (
518
+ ( locationId ) => locationInfections [ locationId ] > 0 ,
506
519
) ;
507
- this . addEventBossesToMaps ( "halloweenzombies" , activeMaps ) ;
520
+
521
+ // Convert the infected location id into its generic location id
522
+ for ( const locationkey of infectionKeys ) {
523
+ result . push ( ...this . getLocationFromInfectedLocation ( locationkey ) ) ;
524
+ }
525
+
526
+ return result ;
508
527
}
509
528
510
529
/**
You can’t perform that action at this time.
0 commit comments