1
mirror of https://github.com/thepeacockproject/Peacock synced 2024-11-16 11:03:30 +01:00

Handle custom yacht discovery challenge in progression transfer (#470)

* Fix custom yacht discovery challenge progression transfer

* Add Yacht area ids to AreaMap.json

* Fix linting error in webFeatures.ts
This commit is contained in:
Govert de Gans 2024-06-16 20:50:59 +02:00 committed by GitHub
parent e0f9e9212b
commit 553889aaa9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 44 additions and 1 deletions

View File

@ -27,6 +27,7 @@ import {
ProgressionData,
UserProfile,
} from "./types/types"
import { ProfileChallengeData } from "./types/challenges"
import { join } from "path"
import {
getRemoteService,
@ -609,6 +610,43 @@ webFeaturesRouter.post(
] = freelancerSession.data.ContractProgressionData
}
// Set progress for Peacock-exclusive challenges
// _FACILITY_CHALLENGES.json - 2546d4f7-191c-4858-840f-321d31aed410 - "Discover the yacht"
{
const progressionObj: ProfileChallengeData = {
Ticked: false,
Completed: false,
CurrentState: "Start",
State: {
AreaIDs: [],
},
}
for (const areaRepoId of [
"0a4513e4-338c-4328-ad72-82c1b5ff2a73", // AD_YACHT_BAR
"705c3917-9f3d-4444-a268-41e74bc8e4ad", // AD_YACHT_OFFICE
"7cfd6202-b3fb-4c9f-b3c2-c892b8031901", // AD_YACHT_KITCHEN
"ba0fe890-9feb-4991-82f8-5daf7aff3380", // AD_YACHT_BRIDGE
"fa7b2877-3159-454a-82d3-422a0dd7e5da", // AD_YACHT_GARAGE
]) {
if (
userdata.Extensions.gamepersistentdata
?.PersistentBool?.[areaRepoId]
) {
progressionObj.State.AreaIDs.push(areaRepoId)
}
}
if (progressionObj.State.AreaIDs.length === 5) {
progressionObj.Ticked = progressionObj.Completed = true
progressionObj.CurrentState = "Success"
}
userdata.Extensions.ChallengeProgression[
"2546d4f7-191c-4858-840f-321d31aed410"
] = progressionObj
}
userdata.Extensions.LastOfficialSync = new Date().toISOString()
writeUserData(req.query.user, req.query.gv)

View File

@ -668,5 +668,10 @@
"3548a3fb-f278-4e53-b9bb-e87e710525d6": "b749b45d-245a-4410-9e06-af323bf5164a",
"fcf81c3d-7277-4da2-b8f1-d7b4a996e10b": "b749b45d-245a-4410-9e06-af323bf5164a",
"69844629-cfd4-4ffa-9fb0-1d30723b6c1e": "b749b45d-245a-4410-9e06-af323bf5164a",
"32d49faf-0082-4754-a641-a00f1f98a28c": "b749b45d-245a-4410-9e06-af323bf5164a"
"32d49faf-0082-4754-a641-a00f1f98a28c": "b749b45d-245a-4410-9e06-af323bf5164a",
"0a4513e4-338c-4328-ad72-82c1b5ff2a73": "2546d4f7-191c-4858-840f-321d31aed410",
"705c3917-9f3d-4444-a268-41e74bc8e4ad": "2546d4f7-191c-4858-840f-321d31aed410",
"7cfd6202-b3fb-4c9f-b3c2-c892b8031901": "2546d4f7-191c-4858-840f-321d31aed410",
"ba0fe890-9feb-4991-82f8-5daf7aff3380": "2546d4f7-191c-4858-840f-321d31aed410",
"fa7b2877-3159-454a-82d3-422a0dd7e5da": "2546d4f7-191c-4858-840f-321d31aed410"
}