From 3bfe2ba7fc468e7f676c69daf5287bdd905997c5 Mon Sep 17 00:00:00 2001 From: AnthonyFuller <24512050+AnthonyFuller@users.noreply.github.com> Date: Sat, 4 Jan 2025 01:32:04 +0000 Subject: [PATCH 1/7] refactor: game versioned missionsInLocations and fix certain contracts when resolved Fixes #510 #505 #504 --- components/candle/challengeService.ts | 20 +- .../escalations/escalationService.ts | 14 - components/contracts/hitsCategoryService.ts | 2 +- components/contracts/missionsInLocation.ts | 906 ++++++++++++------ components/controller.ts | 87 +- components/menus/destinations.ts | 113 +-- components/smfSupport.ts | 7 +- components/types/types.ts | 9 + 8 files changed, 757 insertions(+), 401 deletions(-) diff --git a/components/candle/challengeService.ts b/components/candle/challengeService.ts index d439f44b..5bdbd1a8 100644 --- a/components/candle/challengeService.ts +++ b/components/candle/challengeService.ts @@ -959,15 +959,21 @@ export class ChallengeService extends ChallengeRegistry { let contracts = isSniperLocation(child) ? // @ts-expect-error This is fine - we know it will be there - this.controller.missionsInLocations.sniper[child] - : // @ts-expect-error This is fine - we know it will be there - (this.controller.missionsInLocations[child] ?? []) + this.controller.missionsInLocations[gameVersion].sniper[child] + : // @ts-expect-error This is fine - we can index this + (this.controller.missionsInLocations[gameVersion][child] ?? []) .concat( - // @ts-expect-error This is fine - we know it will be there - this.controller.missionsInLocations.escalations[child], + // @ts-expect-error This is fine - we can index this + this.controller.missionsInLocations[gameVersion] + .escalations[child] ?? [], + ) + .concat( + gameVersion === "h3" + ? // @ts-expect-error This is fine - we know it will be there + this.controller.missionsInLocations[gameVersion] + .arcade[child] + : [], ) - // @ts-expect-error This is fine - we know it will be there - .concat(this.controller.missionsInLocations.arcade[child]) if (!contracts) { contracts = [] diff --git a/components/contracts/escalations/escalationService.ts b/components/contracts/escalations/escalationService.ts index 4c5d41f1..3fe87628 100644 --- a/components/contracts/escalations/escalationService.ts +++ b/components/contracts/escalations/escalationService.ts @@ -27,20 +27,6 @@ import type { import { getUserData } from "../../databaseHandler" import { log, LogLevel } from "../../loggingInterop" -/** - * Put a group id in here to hide it from the menus on 2016. - * This should only be used if: - * - The content is custom. - * - The content is on a 2016 map. - */ -export const no2016 = [ - "0cceeecb-c8fe-42a4-aee4-d7b575f56a1b", - "9e0188e8-bdad-476c-b4ce-2faa5d2be56c", - "115425b1-e797-47bf-b517-410dc7507397", - "74415eca-d01e-4070-9bc9-5ef9b4e8f7d2", - "07bbf22b-d6ae-4883-bec2-122eeeb7b665", -] - /** * An array of contract types to determine whether the escalation service * should be used. diff --git a/components/contracts/hitsCategoryService.ts b/components/contracts/hitsCategoryService.ts index 297edfab..7e4a9bab 100644 --- a/components/contracts/hitsCategoryService.ts +++ b/components/contracts/hitsCategoryService.ts @@ -240,7 +240,7 @@ export class HitsCategoryService { const nEscalations: string[] = [] for (const escalations of Object.values( - missionsInLocations.escalations, + missionsInLocations[gameVersion].escalations, )) { for (const id of escalations) { const contract = controller.resolveContract( diff --git a/components/contracts/missionsInLocation.ts b/components/contracts/missionsInLocation.ts index 6b96a28b..631334a9 100644 --- a/components/contracts/missionsInLocation.ts +++ b/components/contracts/missionsInLocation.ts @@ -16,310 +16,634 @@ * along with this program. If not, see . */ +import { MissionsInLocation } from "../types/types" + /** * A mapping of location ID to an array of missions IDs. + * + * @since v8.0.0 these are separated by game version. */ export const missionsInLocations = { - LOCATION_ICA_FACILITY_ARRIVAL: ["1436cbe4-164b-450f-ad2c-77dec88f53dd"], - LOCATION_ICA_FACILITY_SHIP: [ - "1d241b00-f585-4e3d-bc61-3095af1b96e2", - "b573932d-7a34-44f1-bcf4-ea8f79f75710", - ], - LOCATION_ICA_FACILITY: ["ada5f2b1-8529-48bb-a596-717f75f5eacb"], - LOCATION_PARIS: ["00000000-0000-0000-0000-000000000200"], - LOCATION_PARIS_NOEL: ["4e45e91a-94ca-4d89-89fc-1b250e608e73"], - LOCATION_COASTALTOWN: ["00000000-0000-0000-0000-000000000600"], - LOCATION_COASTALTOWN_NIGHT: ["00000000-0000-0000-0001-000000000005"], - LOCATION_COASTALTOWN_EBOLA: ["7e3f758a-2435-42de-93bd-d8f0b72c63a4"], - LOCATION_COASTALTOWN_MOVIESET: ["00000000-0000-0000-0001-000000000006"], - LOCATION_MARRAKECH: ["00000000-0000-0000-0000-000000000400"], - LOCATION_MARRAKECH_NIGHT: ["ced93d8f-9535-425a-beb9-ef219e781e81"], - LOCATION_BANGKOK: ["db341d9f-58a4-411d-be57-0bc4ed85646b"], - LOCATION_BANGKOK_ZIKA: ["024b6964-a3bb-4457-b085-08f9a7dc7fb7"], - LOCATION_COLORADO: ["42bac555-bbb9-429d-a8ce-f1ffdf94211c"], - LOCATION_COLORADO_RABIES: ["ada6205e-6ee8-4189-9cdb-4947cccd84f4"], - LOCATION_HOKKAIDO: ["0e81a82e-b409-41e9-9e3b-5f82e57f7a12"], - LOCATION_HOKKAIDO_MAMUSHI: ["c414a084-a7b9-43ce-b6ca-590620acd87e"], - LOCATION_HOKKAIDO_FLU: ["a2befcec-7799-4987-9215-6a152cb6a320"], - LOCATION_NEWZEALAND: ["c65019e5-43a8-4a33-8a2a-84c750a5eeb3"], - LOCATION_MIAMI: ["c1d015b4-be08-4e44-808e-ada0f387656f"], - LOCATION_MIAMI_COTTONMOUTH: ["f1ba328f-e3dd-4ef8-bb26-0363499fdd95"], - LOCATION_COLOMBIA: ["422519be-ed2e-44df-9dac-18f739d44fd9"], - LOCATION_COLOMBIA_ANACONDA: ["179563a4-727a-4072-b354-c9fff4e8bff0"], - LOCATION_MUMBAI: ["0fad48d7-3d0f-4c66-8605-6cbe9c3a46d7"], - LOCATION_MUMBAI_KINGCOBRA: ["a8036782-de0a-4353-b522-0ab7a384bade"], - LOCATION_NORTHAMERICA: ["82f55837-e26c-41bf-bc6e-fa97b7981fbc"], - LOCATION_NORTHAMERICA_GARTERSNAKE: ["0b616e62-af0c-495b-82e3-b778e82b5912"], - LOCATION_NORTHSEA: ["0d225edf-40cd-4f20-a30f-b62a373801d3"], - LOCATION_GREEDY_RACCOON: ["7a03a97d-238c-48bd-bda0-e5f279569cce"], - LOCATION_OPULENT_STINGRAY: ["095261b5-e15b-4ca1-9bb7-001fb85c5aaa"], - LOCATION_GOLDEN_GECKO: ["7d85f2b0-80ca-49be-a2b7-d56f67faf252"], - LOCATION_ANCESTRAL_BULLDOG: ["755984a8-fb0b-4673-8637-95cfe7d34e0f"], - LOCATION_EDGY_FOX: ["ebcd14b2-0786-4ceb-a2a4-e771f60d0125"], - LOCATION_WET_RAT: ["3d0cbb8c-2a80-442a-896b-fea00e98768c"], - LOCATION_ELEGANT_LLAMA: ["d42f850f-ca55-4fc9-9766-8c6a2b5c3129"], - LOCATION_TRAPPED_WOLVERINE: ["a3e19d55-64a6-4282-bb3c-d18c3f3e6e29"], - LOCATION_ROCKY_DUGONG: ["b2aac100-dfc7-4f85-b9cd-528114436f6c"], - LOCATION_SNUG: ["f8ec92c2-4fa2-471e-ae08-545480c746ee"], - escalations: { - LOCATION_ICA_FACILITY_SHIP: ["aee6a16f-6525-4d63-a37f-225e293c6118"], - LOCATION_ICA_FACILITY: ["c469d91d-01fc-4314-b22c-71cb804e92c0"], - LOCATION_PARIS: [ - "4f6ee6ec-b6d7-4958-9838-0352c10294a0", - "e6be23e8-8602-42c8-a014-17ffbfa053f5", - "e01113e6-f27d-4ea1-a8ba-93062335bbf5", - "0e5c23b1-4678-458b-ad98-8b55c268e90a", - "c1db299f-3037-4726-b9fc-5cd951c45812", - "bfb0d544-b4c9-4533-bed4-4562a43a3f40", - "51038604-c3f4-41e9-889b-25d9d5de93c6", - "162e9039-cb05-418c-ba8f-792fc6cc5165", - "e75663c8-afca-45a1-af18-25fe3e663848", - "ebf8e5b5-3bf0-487e-8d1b-9473aee61291", - "39f03892-a841-4775-91ac-f8c91b485505", - "54e6c794-2855-4ecf-acc2-d7710d5d96d1", - "a1e7fdb4-88a4-4dbd-9ef2-d9bd1762cec2", - "2e365b7c-817d-4213-8fb1-496fa8067e7b", - "edeca4db-7394-4e93-9b6d-00581f16d6c1", - "5746f21e-efa1-4787-a9ca-99a5f233f507", - "77c7b56f-2410-4919-a4bc-64435c6cff55", - "d6961637-effe-4c39-b99a-f2df4402657d", - "ced3ecb8-70ab-40b0-b033-6f6235c61900", - ], - LOCATION_PARIS_NOEL: ["07bbf22b-d6ae-4883-bec2-122eeeb7b665"], - LOCATION_COASTALTOWN: [ - "9e0188e8-bdad-476c-b4ce-2faa5d2be56c", - "74415eca-d01e-4070-9bc9-5ef9b4e8f7d2", - "4b6739eb-bcdb-48ad-8c45-a829794175e1", - "5a8bdb42-b11e-47d1-bc57-b4bf7efa9eda", - "641656f8-ab16-49c5-a09b-952738154b64", - "ee7e831b-f7ea-4803-8eba-80b42d020a7c", - "95bb86f8-fbbf-4eb0-b2fa-bd379c0a4878", - "0c4c6ce2-09d5-4fff-a946-099ced0558ea", - "d43600cd-1128-4d59-bf87-075c73ae9776", - "3d9dcf91-1708-4e22-88b3-41d184bcc8c3", - "525bd318-04e6-4672-9d01-6bba74362fc5", - "994540ee-3900-4a41-9544-17b2196a4b1a", - "fab808f9-e88b-4775-aadb-a462c86bf2d9", - "f08934c0-73f3-460c-a612-231035131c96", - ], - LOCATION_COASTALTOWN_MOVIESET: ["74739eda-6ed5-4318-a501-2fa0bd53ef5a"], - LOCATION_COASTALTOWN_NIGHT: ["8dec1e62-bbf9-438c-8495-24559c884466"], - LOCATION_COASTALTOWN_EBOLA: ["0cceeecb-c8fe-42a4-aee4-d7b575f56a1b"], - LOCATION_MARRAKECH: [ - "19660896-fc1f-49f9-b56b-2059137530e4", - "11c93649-6b00-46ac-bf2d-a3599a6ab3a9", - "ebf8ab97-6ff3-4063-9737-c6f237031de7", - "c67a1ead-7489-4d88-bbd2-c68d735e5df0", - "896233eb-e7c5-4915-bf2b-5867799d8bb4", - "45e6d255-f8e4-4170-ad7e-3416ab8a881d", - "c949817b-5212-42e8-9b06-9a2eb83de167", - "e359075e-a510-4b7c-a461-477b789ca7e4", - ], - LOCATION_MARRAKECH_NIGHT: [ - "b49de2a1-fe8e-49c4-8331-17aaa9d65d32", - "c2e16fb7-d49f-49ef-9d76-46b8b31b3389", - ], - LOCATION_BANGKOK: [ - "f425e64f-99df-4ebf-9f7d-909a65a26aef", - "ccbde3e2-67e7-4534-95ec-e9bd7ef65273", - "1f785def-03b7-4340-af7e-2f5831e77eb5", - "45c831c4-b455-4d21-90f3-6f09b28ee01b", - ], - LOCATION_BANGKOK_ZIKA: [], - LOCATION_COLORADO: [ - "e6f4d3a4-9a33-4bd9-b761-da297069cf8c", - "c5d88e8c-437b-476b-afe2-d94aa4293502", - "4186dd23-1cfc-4ba0-9863-9f19f7cba249", - ], - LOCATION_COLORADO_RABIES: [], - LOCATION_HOKKAIDO: [ - "115425b1-e797-47bf-b517-410dc7507397", - "e96fb040-a13f-466c-9d96-c8f3b2b8a09a", - "a1e5f4f4-ea9c-4a42-b826-50a212026d50", - "85a2b618-2e3c-444f-931c-b89d566e45f7", - "88451dd9-4b57-441e-9eab-e20b9879bafa", - ], - LOCATION_HOKKAIDO_MAMUSHI: [], - LOCATION_HOKKAIDO_FLU: [], - LOCATION_NEWZEALAND: [ - "e1e86206-d3f0-a819-e477-3d80e55e8a40", - "3efc73f9-33f0-4af6-9508-7208e6851394", - ], - LOCATION_MIAMI: [ - "719ee044-4b05-4bd9-b2bb-75029f6d2a35", - "5284cb9f-9bdd-4b00-99c3-0b5939b01818", - "d0f44e71-6eab-4af4-9484-78d61dbe376a", - "fca539ff-1b1a-4c04-93e0-03b9b902f86c", - "782a2849-14a2-4cd4-99fc-ddacaeaba2dd", - "be3ea01f-ec56-4fcb-95ec-164a1d9980f3", - "066ce378-0418-452a-b02e-a5e4ee711096", - ], - LOCATION_COLOMBIA: [ - "390ba7b6-de27-464a-b8af-6d0ff54c2aec", - "70150cd2-ef76-4ba8-80cc-b1e63871b030", - "be567ad3-23f4-4d0b-9d2e-b261ea845ef0", - "a5e81878-0eae-4bcf-af9b-9a7e7833f85d", - "757fd132-0300-45ec-b5bd-bdd48c543b5c", - "41ecf8ce-dfd4-4c08-8f44-52dedc3f089a", - "d336d894-024a-4cd4-9867-dee7de70ee79", - ], - LOCATION_MUMBAI: [ - "667f48a3-7f6b-486e-8f6b-2f782a5c4857", - "9badee3e-0014-46b1-9ef6-edf8858ba038", - "b6a6330a-301a-4e8e-a26f-0f3e0ea809b5", - "4a62b328-dfe7-4956-ac0f-a3a8990fce26", - "a10472e4-0eb3-451d-814d-38837dd0f407", - "ae0bd6cd-7062-4336-8cb0-5fafad3d0f4f", - "b47f34cb-6537-421c-8fc8-720a4a118540", - ], - LOCATION_NORTHAMERICA: [ - "218302a3-f682-46f9-9ffd-bb3e82487b7c", - "d1b9250b-33f6-4712-831b-f33fa11ee4d8", - "1d5dcf3e-9682-4e32-ac11-ad6586daa456", - "74e6b561-ff1a-4742-9a7b-890b7818c796", - "15b7ad4e-565a-4fdb-b669-c9a68176e665", - "fe088a10-5dbf-460f-bbe2-6b55e7a66253", - ], - LOCATION_NORTHSEA: [ - "e63eeb62-29ef-428d-b003-ea043b1f11f9", - "b66f151d-47a7-4681-a403-c48a46916224", - "dbb0e22d-084b-4b57-8616-42290982fd90", - "4fbfae2e-a5e7-4b79-b008-94f6cbcb13cb", - "3721e543-b5e6-4af8-a4fc-c92e9a4453bd", - "8c6daf5e-5974-4438-af20-71ff570c7ff3", + h1: { + LOCATION_ICA_FACILITY: [ + "1436cbe4-164b-450f-ad2c-77dec88f53dd", + "1d241b00-f585-4e3d-bc61-3095af1b96e2", + "b573932d-7a34-44f1-bcf4-ea8f79f75710", + "ada5f2b1-8529-48bb-a596-717f75f5eacb", ], - LOCATION_GREEDY_RACCOON: [ - "9a461f89-86c5-44e4-998e-f2f66b496aa7", - "55063d85-e84a-4c76-8bf7-e70fe2cab651", - ], - LOCATION_OPULENT_STINGRAY: [ - "f19f7ac8-39ec-498b-aa23-44c8e75d8693", - "35f1f534-ae2d-42be-8472-dd55e96625ea", - "83d4e87e-2f47-4c81-b831-30bd13a29b05", - ], - LOCATION_GOLDEN_GECKO: [ - "8885eeda-ad64-44fa-a944-1438b36c670c", - "ae04c7a0-4028-4524-b27f-6a62f020fdca", - "9448d91d-f7df-4b5a-8ea3-91f1233f644a", - "89305766-199e-43eb-9fcb-29e6f2b6e9ab", - "a9dc4bf9-d277-4115-8dac-6c665cd68168", - ], - LOCATION_ANCESTRAL_BULLDOG: [ - "78628e05-93ce-4f87-8a17-b910d32df51f", - "8e95dcd0-704f-4121-8be6-088a3812f838", - "a838c4b0-7db5-4ac7-8d52-e8c5b82aa376", - "b12d08ea-c842-498a-82ea-889653588592", - "4689ef5e-0ddd-44b3-adca-aebf3293d9e1", - ], - LOCATION_ANCESTRAL_SMOOTHSNAKE: [ - "5680108a-19dc-4448-9344-3d0290217162", - ], - LOCATION_EDGY_FOX: [ - "ccdc7043-62af-44e8-a5fc-38b008c2044e", - "9d88605f-6871-46a8-bd46-9804ea04fca9", - "12d83cb0-a2d6-4c01-b9d8-675ac635ee61", - "e3b65e65-636b-4dfd-bb42-65a18c5dce4a", - "079876de-ddd7-47aa-8719-abe97d82fc12", - "5bb29a6b-7384-4641-944c-3540fa5cd8aa", - ], - LOCATION_WET_RAT: [ - "07ffa72a-bbac-45ca-8c9f-b9c1b526153a", - "5121acde-313d-4517-ae70-6a54ca5d775a", - "494d97a6-9e31-45e0-9dae-f3793c731336", - "542108f2-f82f-4a04-bfec-efa92785fec1", - "84bf03cc-3055-4fd4-a691-d8b0ac61a51f", - ], - LOCATION_ELEGANT_LLAMA: [ - "1e4423b7-d4ff-448f-a8a8-4bb600cab7e3", - "edbacf4b-e402-4548-b723-cd4351571537", - "8c8ed496-948f-4672-879b-4d9575406577", - "14a21819-f81f-453d-8734-a3aab528fa62", - "72aaaa7b-4386-4ee7-9e9e-73fb8ff8e416", + LOCATION_PARIS: [ + "00000000-0000-0000-0000-000000000200", + "4e45e91a-94ca-4d89-89fc-1b250e608e73", ], - LOCATION_TRAPPED_WOLVERINE: ["078a50d1-6427-4fc3-9099-e46390e637a0"], - LOCATION_ROCKY_DUGONG: ["50fa5e99-0b51-45d4-9062-cd46dd928461"], + LOCATION_COASTALTOWN: ["00000000-0000-0000-0000-000000000600"], + LOCATION_COASTALTOWN_NIGHT: ["00000000-0000-0000-0001-000000000005"], + LOCATION_COASTALTOWN_EBOLA: ["7e3f758a-2435-42de-93bd-d8f0b72c63a4"], + LOCATION_COASTALTOWN_MOVIESET: ["00000000-0000-0000-0001-000000000006"], + LOCATION_MARRAKECH: ["00000000-0000-0000-0000-000000000400"], + LOCATION_MARRAKECH_NIGHT: ["ced93d8f-9535-425a-beb9-ef219e781e81"], + LOCATION_BANGKOK: ["db341d9f-58a4-411d-be57-0bc4ed85646b"], + LOCATION_BANGKOK_ZIKA: ["024b6964-a3bb-4457-b085-08f9a7dc7fb7"], + LOCATION_COLORADO: ["42bac555-bbb9-429d-a8ce-f1ffdf94211c"], + LOCATION_COLORADO_RABIES: ["ada6205e-6ee8-4189-9cdb-4947cccd84f4"], + LOCATION_HOKKAIDO: ["0e81a82e-b409-41e9-9e3b-5f82e57f7a12"], + LOCATION_HOKKAIDO_FLU: ["a2befcec-7799-4987-9215-6a152cb6a320"], + escalations: { + LOCATION_ICA_FACILITY: [ + "aee6a16f-6525-4d63-a37f-225e293c6118", + "c469d91d-01fc-4314-b22c-71cb804e92c0", + ], + LOCATION_PARIS: [ + "4f6ee6ec-b6d7-4958-9838-0352c10294a0", + "e6be23e8-8602-42c8-a014-17ffbfa053f5", + "e01113e6-f27d-4ea1-a8ba-93062335bbf5", + "0e5c23b1-4678-458b-ad98-8b55c268e90a", + "c1db299f-3037-4726-b9fc-5cd951c45812", + "bfb0d544-b4c9-4533-bed4-4562a43a3f40", + "51038604-c3f4-41e9-889b-25d9d5de93c6", + "162e9039-cb05-418c-ba8f-792fc6cc5165", + "e75663c8-afca-45a1-af18-25fe3e663848", + "ebf8e5b5-3bf0-487e-8d1b-9473aee61291", + "39f03892-a841-4775-91ac-f8c91b485505", + "54e6c794-2855-4ecf-acc2-d7710d5d96d1", + "a1e7fdb4-88a4-4dbd-9ef2-d9bd1762cec2", + "2e365b7c-817d-4213-8fb1-496fa8067e7b", + "edeca4db-7394-4e93-9b6d-00581f16d6c1", + "5746f21e-efa1-4787-a9ca-99a5f233f507", + "77c7b56f-2410-4919-a4bc-64435c6cff55", + "d6961637-effe-4c39-b99a-f2df4402657d", + "ced3ecb8-70ab-40b0-b033-6f6235c61900", + ], + LOCATION_COASTALTOWN: [ + "4b6739eb-bcdb-48ad-8c45-a829794175e1", + "5a8bdb42-b11e-47d1-bc57-b4bf7efa9eda", + "641656f8-ab16-49c5-a09b-952738154b64", + "ee7e831b-f7ea-4803-8eba-80b42d020a7c", + "95bb86f8-fbbf-4eb0-b2fa-bd379c0a4878", + "0c4c6ce2-09d5-4fff-a946-099ced0558ea", + "d43600cd-1128-4d59-bf87-075c73ae9776", + "3d9dcf91-1708-4e22-88b3-41d184bcc8c3", + "525bd318-04e6-4672-9d01-6bba74362fc5", + "994540ee-3900-4a41-9544-17b2196a4b1a", + "fab808f9-e88b-4775-aadb-a462c86bf2d9", + "f08934c0-73f3-460c-a612-231035131c96", + ], + LOCATION_COASTALTOWN_MOVIESET: [ + "74739eda-6ed5-4318-a501-2fa0bd53ef5a", + ], + LOCATION_COASTALTOWN_NIGHT: [ + "8dec1e62-bbf9-438c-8495-24559c884466", + ], + LOCATION_COASTALTOWN_EBOLA: [], + LOCATION_MARRAKECH: [ + "19660896-fc1f-49f9-b56b-2059137530e4", + "11c93649-6b00-46ac-bf2d-a3599a6ab3a9", + "ebf8ab97-6ff3-4063-9737-c6f237031de7", + "c67a1ead-7489-4d88-bbd2-c68d735e5df0", + "896233eb-e7c5-4915-bf2b-5867799d8bb4", + "45e6d255-f8e4-4170-ad7e-3416ab8a881d", + "c949817b-5212-42e8-9b06-9a2eb83de167", + "e359075e-a510-4b7c-a461-477b789ca7e4", + ], + LOCATION_MARRAKECH_NIGHT: [ + "b49de2a1-fe8e-49c4-8331-17aaa9d65d32", + "c2e16fb7-d49f-49ef-9d76-46b8b31b3389", + ], + LOCATION_BANGKOK: [ + "f425e64f-99df-4ebf-9f7d-909a65a26aef", + "ccbde3e2-67e7-4534-95ec-e9bd7ef65273", + "1f785def-03b7-4340-af7e-2f5831e77eb5", + "45c831c4-b455-4d21-90f3-6f09b28ee01b", + ], + LOCATION_BANGKOK_ZIKA: [], + LOCATION_COLORADO: [ + "e6f4d3a4-9a33-4bd9-b761-da297069cf8c", + "c5d88e8c-437b-476b-afe2-d94aa4293502", + "4186dd23-1cfc-4ba0-9863-9f19f7cba249", + ], + LOCATION_COLORADO_RABIES: [], + LOCATION_HOKKAIDO: [ + "e96fb040-a13f-466c-9d96-c8f3b2b8a09a", + "a1e5f4f4-ea9c-4a42-b826-50a212026d50", + "85a2b618-2e3c-444f-931c-b89d566e45f7", + "88451dd9-4b57-441e-9eab-e20b9879bafa", + ], + LOCATION_HOKKAIDO_FLU: [], + }, + elusive: {}, + sarajevo: {}, + /** + * Special property for pro mode missions (2016 exclusive). + * Mapping of location parent to pro mode contract ID, instead of the typical mission array. + */ + pro1: { + LOCATION_PARENT_PARIS: "5ee4d771-6ab3-41fa-ab4f-04970d0ca327", + LOCATION_PARENT_COASTALTOWN: "644d36bd-1f88-44f9-9fed-14a51e5e3f6b", + LOCATION_PARENT_MARRAKECH: "7b2d5500-7853-4ad0-b68a-14be791cfba2", + LOCATION_PARENT_BANGKOK: "ad5f9051-045d-4b8e-8a4d-d84429f467f8", + LOCATION_PARENT_COLORADO: "69b58abc-6535-4092-9afe-c046b26303e6", + LOCATION_PARENT_HOKKAIDO: "3d885714-fa9a-4438-9e0f-c58dbcaab8b8", + }, }, - arcade: { - LOCATION_NORTHSEA: [ - "b9f55fc3-c53f-4661-a4b6-9956303422aa", - "6de90688-ad4c-457e-ae25-c4bbc8f55196", - "07bc9bbf-7cba-4cdf-92bb-3ab57f09b1cc", - "09a40d33-4820-454b-89af-a10e0b8d3e08", - "74278853-5990-4058-8972-1f10ad12b6d8", - "b1fb40d7-c013-4c9f-bb8a-8782e980b11a", - ], - LOCATION_COLOMBIA: ["90121ee0-0431-4a97-9bc8-8a7e2ca30d65"], - LOCATION_ANCESTRAL_BULLDOG: [ - "bfb56fe6-06db-440a-aafe-42eeeb223fa1", - "80cf04de-8e0b-4f38-b094-600753e2ac24", - "85a67f31-75ce-40f5-a281-7765791f58ca", - ], - LOCATION_EDGY_FOX: [ - "d21e2e91-602c-49d2-9d42-e8bcfb810e9a", - "be787ec9-e7b9-4984-bb39-fda4c71705ec", - "e4b29c19-13b4-471b-b188-cd9c0a788cd0", - "797e204a-ef3d-463b-a386-57df0fe29b8f", - "f1e3dcdc-2247-4da8-bf8e-856f5fd23888", + h2: { + LOCATION_ICA_FACILITY_ARRIVAL: ["1436cbe4-164b-450f-ad2c-77dec88f53dd"], + LOCATION_ICA_FACILITY_SHIP: [ + "1d241b00-f585-4e3d-bc61-3095af1b96e2", + "b573932d-7a34-44f1-bcf4-ea8f79f75710", ], + LOCATION_ICA_FACILITY: ["ada5f2b1-8529-48bb-a596-717f75f5eacb"], LOCATION_PARIS: [ - "7886bed7-3805-46c6-a792-4a0d55758934", - "06f99231-9b1e-483f-8a72-f91efcc2fd2b", - "6516174c-abe0-4cd7-acdb-7cda4c9b5016", - "223aa1f3-64a1-43c0-b3c8-36aebd7998e4", - "7569d5e4-5270-4b69-96c8-e47b99876390", - "479ec396-b96f-4e01-94d9-aedaa0582ed9", - "09ea9b32-dc85-4633-9f6a-c5c4bfded5ac", + "00000000-0000-0000-0000-000000000200", + "4e45e91a-94ca-4d89-89fc-1b250e608e73", ], - LOCATION_ELEGANT_LLAMA: [ - "17027c6f-7010-43b8-bb42-1a6846fc0b7b", - "a79640cb-331a-41af-abaf-58e629fe0a04", - "2c2afdfe-d396-451a-a6a3-52aca4ea4f1f", - "afb4ce18-bf9d-443d-85a8-207df9011792", - ], - LOCATION_COLORADO: [ - "ff5b4e53-49ea-4d85-b94e-d3c8b3fc7ab3", - "b4d555eb-e2c9-40c2-b155-328a7019fd28", + LOCATION_COASTALTOWN: ["00000000-0000-0000-0000-000000000600"], + LOCATION_COASTALTOWN_NIGHT: ["00000000-0000-0000-0001-000000000005"], + LOCATION_COASTALTOWN_EBOLA: ["7e3f758a-2435-42de-93bd-d8f0b72c63a4"], + LOCATION_COASTALTOWN_MOVIESET: ["00000000-0000-0000-0001-000000000006"], + LOCATION_MARRAKECH: ["00000000-0000-0000-0000-000000000400"], + LOCATION_MARRAKECH_NIGHT: ["ced93d8f-9535-425a-beb9-ef219e781e81"], + LOCATION_BANGKOK: ["db341d9f-58a4-411d-be57-0bc4ed85646b"], + LOCATION_BANGKOK_ZIKA: ["024b6964-a3bb-4457-b085-08f9a7dc7fb7"], + LOCATION_COLORADO: ["42bac555-bbb9-429d-a8ce-f1ffdf94211c"], + LOCATION_COLORADO_RABIES: ["ada6205e-6ee8-4189-9cdb-4947cccd84f4"], + LOCATION_HOKKAIDO: [ + "0e81a82e-b409-41e9-9e3b-5f82e57f7a12", + "c414a084-a7b9-43ce-b6ca-590620acd87e", ], - LOCATION_COASTALTOWN: [ - "8db8fa33-cb41-4a0d-a2de-e30d884afb95", - "9e469023-e0c4-42bf-8527-f9fcaf624421", + LOCATION_HOKKAIDO_FLU: ["a2befcec-7799-4987-9215-6a152cb6a320"], + LOCATION_NEWZEALAND: ["c65019e5-43a8-4a33-8a2a-84c750a5eeb3"], + LOCATION_MIAMI: ["c1d015b4-be08-4e44-808e-ada0f387656f"], + LOCATION_MIAMI_COTTONMOUTH: ["f1ba328f-e3dd-4ef8-bb26-0363499fdd95"], + LOCATION_COLOMBIA: ["422519be-ed2e-44df-9dac-18f739d44fd9"], + LOCATION_COLOMBIA_ANACONDA: ["179563a4-727a-4072-b354-c9fff4e8bff0"], + LOCATION_MUMBAI: ["0fad48d7-3d0f-4c66-8605-6cbe9c3a46d7"], + LOCATION_MUMBAI_KINGCOBRA: ["a8036782-de0a-4353-b522-0ab7a384bade"], + LOCATION_NORTHAMERICA: ["82f55837-e26c-41bf-bc6e-fa97b7981fbc"], + LOCATION_NORTHAMERICA_GARTERSNAKE: [ + "0b616e62-af0c-495b-82e3-b778e82b5912", ], - LOCATION_NEWZEALAND: ["39cc0603-4348-4dbf-9bd3-733cadf2913c"], - LOCATION_NORTHAMERICA: [ - "5081776a-86b6-4935-a83e-631a65ba8ee8", - "cab4293f-e359-419d-aa6f-83d91a158cf5", + LOCATION_NORTHSEA: ["0d225edf-40cd-4f20-a30f-b62a373801d3"], + LOCATION_GREEDY_RACCOON: ["7a03a97d-238c-48bd-bda0-e5f279569cce"], + LOCATION_OPULENT_STINGRAY: ["095261b5-e15b-4ca1-9bb7-001fb85c5aaa"], + escalations: { + LOCATION_ICA_FACILITY_SHIP: [ + "aee6a16f-6525-4d63-a37f-225e293c6118", + ], + LOCATION_ICA_FACILITY: ["c469d91d-01fc-4314-b22c-71cb804e92c0"], + LOCATION_PARIS: [ + "07bbf22b-d6ae-4883-bec2-122eeeb7b665", + "4f6ee6ec-b6d7-4958-9838-0352c10294a0", + "e6be23e8-8602-42c8-a014-17ffbfa053f5", + "e01113e6-f27d-4ea1-a8ba-93062335bbf5", + "0e5c23b1-4678-458b-ad98-8b55c268e90a", + "c1db299f-3037-4726-b9fc-5cd951c45812", + "bfb0d544-b4c9-4533-bed4-4562a43a3f40", + "51038604-c3f4-41e9-889b-25d9d5de93c6", + "162e9039-cb05-418c-ba8f-792fc6cc5165", + "e75663c8-afca-45a1-af18-25fe3e663848", + "ebf8e5b5-3bf0-487e-8d1b-9473aee61291", + "39f03892-a841-4775-91ac-f8c91b485505", + "54e6c794-2855-4ecf-acc2-d7710d5d96d1", + "a1e7fdb4-88a4-4dbd-9ef2-d9bd1762cec2", + "2e365b7c-817d-4213-8fb1-496fa8067e7b", + "edeca4db-7394-4e93-9b6d-00581f16d6c1", + "5746f21e-efa1-4787-a9ca-99a5f233f507", + "77c7b56f-2410-4919-a4bc-64435c6cff55", + "d6961637-effe-4c39-b99a-f2df4402657d", + "ced3ecb8-70ab-40b0-b033-6f6235c61900", + ], + LOCATION_COASTALTOWN: [ + "9e0188e8-bdad-476c-b4ce-2faa5d2be56c", + "74415eca-d01e-4070-9bc9-5ef9b4e8f7d2", + "4b6739eb-bcdb-48ad-8c45-a829794175e1", + "5a8bdb42-b11e-47d1-bc57-b4bf7efa9eda", + "641656f8-ab16-49c5-a09b-952738154b64", + "ee7e831b-f7ea-4803-8eba-80b42d020a7c", + "95bb86f8-fbbf-4eb0-b2fa-bd379c0a4878", + "0c4c6ce2-09d5-4fff-a946-099ced0558ea", + "d43600cd-1128-4d59-bf87-075c73ae9776", + "3d9dcf91-1708-4e22-88b3-41d184bcc8c3", + "525bd318-04e6-4672-9d01-6bba74362fc5", + "994540ee-3900-4a41-9544-17b2196a4b1a", + "fab808f9-e88b-4775-aadb-a462c86bf2d9", + "f08934c0-73f3-460c-a612-231035131c96", + ], + LOCATION_COASTALTOWN_MOVIESET: [ + "74739eda-6ed5-4318-a501-2fa0bd53ef5a", + ], + LOCATION_COASTALTOWN_NIGHT: [ + "8dec1e62-bbf9-438c-8495-24559c884466", + ], + LOCATION_COASTALTOWN_EBOLA: [ + "0cceeecb-c8fe-42a4-aee4-d7b575f56a1b", + ], + LOCATION_MARRAKECH: [ + "19660896-fc1f-49f9-b56b-2059137530e4", + "11c93649-6b00-46ac-bf2d-a3599a6ab3a9", + "ebf8ab97-6ff3-4063-9737-c6f237031de7", + "c67a1ead-7489-4d88-bbd2-c68d735e5df0", + "896233eb-e7c5-4915-bf2b-5867799d8bb4", + "45e6d255-f8e4-4170-ad7e-3416ab8a881d", + "c949817b-5212-42e8-9b06-9a2eb83de167", + "e359075e-a510-4b7c-a461-477b789ca7e4", + ], + LOCATION_MARRAKECH_NIGHT: [ + "b49de2a1-fe8e-49c4-8331-17aaa9d65d32", + "c2e16fb7-d49f-49ef-9d76-46b8b31b3389", + ], + LOCATION_BANGKOK: [ + "f425e64f-99df-4ebf-9f7d-909a65a26aef", + "ccbde3e2-67e7-4534-95ec-e9bd7ef65273", + "1f785def-03b7-4340-af7e-2f5831e77eb5", + "45c831c4-b455-4d21-90f3-6f09b28ee01b", + ], + LOCATION_BANGKOK_ZIKA: [], + LOCATION_COLORADO: [ + "e6f4d3a4-9a33-4bd9-b761-da297069cf8c", + "c5d88e8c-437b-476b-afe2-d94aa4293502", + "4186dd23-1cfc-4ba0-9863-9f19f7cba249", + ], + LOCATION_COLORADO_RABIES: [], + LOCATION_HOKKAIDO: [ + "115425b1-e797-47bf-b517-410dc7507397", + "e96fb040-a13f-466c-9d96-c8f3b2b8a09a", + "a1e5f4f4-ea9c-4a42-b826-50a212026d50", + "85a2b618-2e3c-444f-931c-b89d566e45f7", + "88451dd9-4b57-441e-9eab-e20b9879bafa", + ], + LOCATION_HOKKAIDO_FLU: [], + LOCATION_NEWZEALAND: [ + "e1e86206-d3f0-a819-e477-3d80e55e8a40", + "3efc73f9-33f0-4af6-9508-7208e6851394", + ], + LOCATION_MIAMI: [ + "719ee044-4b05-4bd9-b2bb-75029f6d2a35", + "5284cb9f-9bdd-4b00-99c3-0b5939b01818", + "d0f44e71-6eab-4af4-9484-78d61dbe376a", + "fca539ff-1b1a-4c04-93e0-03b9b902f86c", + "782a2849-14a2-4cd4-99fc-ddacaeaba2dd", + "be3ea01f-ec56-4fcb-95ec-164a1d9980f3", + "066ce378-0418-452a-b02e-a5e4ee711096", + ], + LOCATION_COLOMBIA: [ + "390ba7b6-de27-464a-b8af-6d0ff54c2aec", + "70150cd2-ef76-4ba8-80cc-b1e63871b030", + "be567ad3-23f4-4d0b-9d2e-b261ea845ef0", + "a5e81878-0eae-4bcf-af9b-9a7e7833f85d", + "757fd132-0300-45ec-b5bd-bdd48c543b5c", + "41ecf8ce-dfd4-4c08-8f44-52dedc3f089a", + "d336d894-024a-4cd4-9867-dee7de70ee79", + ], + LOCATION_MUMBAI: [ + "667f48a3-7f6b-486e-8f6b-2f782a5c4857", + "9badee3e-0014-46b1-9ef6-edf8858ba038", + "b6a6330a-301a-4e8e-a26f-0f3e0ea809b5", + "4a62b328-dfe7-4956-ac0f-a3a8990fce26", + "a10472e4-0eb3-451d-814d-38837dd0f407", + "ae0bd6cd-7062-4336-8cb0-5fafad3d0f4f", + "b47f34cb-6537-421c-8fc8-720a4a118540", + ], + LOCATION_NORTHAMERICA: [ + "218302a3-f682-46f9-9ffd-bb3e82487b7c", + "d1b9250b-33f6-4712-831b-f33fa11ee4d8", + "1d5dcf3e-9682-4e32-ac11-ad6586daa456", + "74e6b561-ff1a-4742-9a7b-890b7818c796", + "15b7ad4e-565a-4fdb-b669-c9a68176e665", + "fe088a10-5dbf-460f-bbe2-6b55e7a66253", + ], + LOCATION_NORTHSEA: [ + "e63eeb62-29ef-428d-b003-ea043b1f11f9", + "b66f151d-47a7-4681-a403-c48a46916224", + "dbb0e22d-084b-4b57-8616-42290982fd90", + "4fbfae2e-a5e7-4b79-b008-94f6cbcb13cb", + "3721e543-b5e6-4af8-a4fc-c92e9a4453bd", + "8c6daf5e-5974-4438-af20-71ff570c7ff3", + ], + LOCATION_GREEDY_RACCOON: [ + "9a461f89-86c5-44e4-998e-f2f66b496aa7", + "55063d85-e84a-4c76-8bf7-e70fe2cab651", + ], + LOCATION_OPULENT_STINGRAY: [ + "f19f7ac8-39ec-498b-aa23-44c8e75d8693", + "35f1f534-ae2d-42be-8472-dd55e96625ea", + "83d4e87e-2f47-4c81-b831-30bd13a29b05", + ], + }, + sniper: { + LOCATION_AUSTRIA: ["ff9f46cf-00bd-4c12-b887-eac491c3a96d"], + LOCATION_SALTY_SEAGULL: ["00e57709-e049-44c9-a2c3-7655e19884fb"], + LOCATION_CAGED_FALCON: ["25b20d86-bb5a-4ebd-b6bb-81ed2779c180"], + }, + elusive: {}, + sarajevo: {}, + }, + h3: { + LOCATION_ICA_FACILITY_ARRIVAL: ["1436cbe4-164b-450f-ad2c-77dec88f53dd"], + LOCATION_ICA_FACILITY_SHIP: [ + "1d241b00-f585-4e3d-bc61-3095af1b96e2", + "b573932d-7a34-44f1-bcf4-ea8f79f75710", ], - LOCATION_WET_RAT: [ - "dd68d30f-3900-415f-bb17-84681a2cd4fc", - "9cbdb972-95df-4e0a-be77-7937ec6f2fb0", - "e9168f42-882e-4c7e-8353-33d2bd8bb864", + LOCATION_ICA_FACILITY: ["ada5f2b1-8529-48bb-a596-717f75f5eacb"], + LOCATION_PARIS: ["00000000-0000-0000-0000-000000000200"], + LOCATION_PARIS_NOEL: ["4e45e91a-94ca-4d89-89fc-1b250e608e73"], + LOCATION_COASTALTOWN: ["00000000-0000-0000-0000-000000000600"], + LOCATION_COASTALTOWN_NIGHT: ["00000000-0000-0000-0001-000000000005"], + LOCATION_COASTALTOWN_EBOLA: ["7e3f758a-2435-42de-93bd-d8f0b72c63a4"], + LOCATION_COASTALTOWN_MOVIESET: ["00000000-0000-0000-0001-000000000006"], + LOCATION_MARRAKECH: ["00000000-0000-0000-0000-000000000400"], + LOCATION_MARRAKECH_NIGHT: ["ced93d8f-9535-425a-beb9-ef219e781e81"], + LOCATION_BANGKOK: ["db341d9f-58a4-411d-be57-0bc4ed85646b"], + LOCATION_BANGKOK_ZIKA: ["024b6964-a3bb-4457-b085-08f9a7dc7fb7"], + LOCATION_COLORADO: ["42bac555-bbb9-429d-a8ce-f1ffdf94211c"], + LOCATION_COLORADO_RABIES: ["ada6205e-6ee8-4189-9cdb-4947cccd84f4"], + LOCATION_HOKKAIDO: ["0e81a82e-b409-41e9-9e3b-5f82e57f7a12"], + LOCATION_HOKKAIDO_MAMUSHI: ["c414a084-a7b9-43ce-b6ca-590620acd87e"], + LOCATION_HOKKAIDO_FLU: ["a2befcec-7799-4987-9215-6a152cb6a320"], + LOCATION_NEWZEALAND: ["c65019e5-43a8-4a33-8a2a-84c750a5eeb3"], + LOCATION_MIAMI: ["c1d015b4-be08-4e44-808e-ada0f387656f"], + LOCATION_MIAMI_COTTONMOUTH: ["f1ba328f-e3dd-4ef8-bb26-0363499fdd95"], + LOCATION_COLOMBIA: ["422519be-ed2e-44df-9dac-18f739d44fd9"], + LOCATION_COLOMBIA_ANACONDA: ["179563a4-727a-4072-b354-c9fff4e8bff0"], + LOCATION_MUMBAI: ["0fad48d7-3d0f-4c66-8605-6cbe9c3a46d7"], + LOCATION_MUMBAI_KINGCOBRA: ["a8036782-de0a-4353-b522-0ab7a384bade"], + LOCATION_NORTHAMERICA: ["82f55837-e26c-41bf-bc6e-fa97b7981fbc"], + LOCATION_NORTHAMERICA_GARTERSNAKE: [ + "0b616e62-af0c-495b-82e3-b778e82b5912", ], - LOCATION_MIAMI: ["de9788cc-b9c4-47fc-b5df-86451cd82c43"], - }, - sniper: { - LOCATION_AUSTRIA: ["ff9f46cf-00bd-4c12-b887-eac491c3a96d"], - LOCATION_SALTY_SEAGULL: ["00e57709-e049-44c9-a2c3-7655e19884fb"], - LOCATION_CAGED_FALCON: ["25b20d86-bb5a-4ebd-b6bb-81ed2779c180"], - }, - elusive: {}, - sarajevo: { - LOCATION_PARIS: ["dd906289-7c32-427f-b689-98ae645b407f"], - LOCATION_COASTALTOWN: ["350ceea9-cfa9-4639-a66b-0d4de586eeee"], - LOCATION_MARRAKECH: ["59966a7f-3348-48da-a56c-4447aa548c85"], - LOCATION_BANGKOK: ["30c3546d-9881-45fa-8c7a-8b2c76b03e59"], - LOCATION_COLORADO: ["1c82c1e3-fe61-4001-a173-81fa11023460"], - LOCATION_HOKKAIDO: ["781c68ca-9318-40bf-9cc1-232007be02bf"], + LOCATION_NORTHSEA: ["0d225edf-40cd-4f20-a30f-b62a373801d3"], + LOCATION_GREEDY_RACCOON: ["7a03a97d-238c-48bd-bda0-e5f279569cce"], + LOCATION_OPULENT_STINGRAY: ["095261b5-e15b-4ca1-9bb7-001fb85c5aaa"], + LOCATION_GOLDEN_GECKO: ["7d85f2b0-80ca-49be-a2b7-d56f67faf252"], + LOCATION_ANCESTRAL_BULLDOG: ["755984a8-fb0b-4673-8637-95cfe7d34e0f"], + LOCATION_EDGY_FOX: ["ebcd14b2-0786-4ceb-a2a4-e771f60d0125"], + LOCATION_WET_RAT: ["3d0cbb8c-2a80-442a-896b-fea00e98768c"], + LOCATION_ELEGANT_LLAMA: ["d42f850f-ca55-4fc9-9766-8c6a2b5c3129"], + LOCATION_TRAPPED_WOLVERINE: ["a3e19d55-64a6-4282-bb3c-d18c3f3e6e29"], + LOCATION_ROCKY_DUGONG: ["b2aac100-dfc7-4f85-b9cd-528114436f6c"], + LOCATION_SNUG: ["f8ec92c2-4fa2-471e-ae08-545480c746ee"], + escalations: { + LOCATION_ICA_FACILITY_SHIP: [ + "aee6a16f-6525-4d63-a37f-225e293c6118", + ], + LOCATION_ICA_FACILITY: ["c469d91d-01fc-4314-b22c-71cb804e92c0"], + LOCATION_PARIS: [ + "4f6ee6ec-b6d7-4958-9838-0352c10294a0", + "e6be23e8-8602-42c8-a014-17ffbfa053f5", + "e01113e6-f27d-4ea1-a8ba-93062335bbf5", + "0e5c23b1-4678-458b-ad98-8b55c268e90a", + "c1db299f-3037-4726-b9fc-5cd951c45812", + "bfb0d544-b4c9-4533-bed4-4562a43a3f40", + "51038604-c3f4-41e9-889b-25d9d5de93c6", + "162e9039-cb05-418c-ba8f-792fc6cc5165", + "e75663c8-afca-45a1-af18-25fe3e663848", + "ebf8e5b5-3bf0-487e-8d1b-9473aee61291", + "39f03892-a841-4775-91ac-f8c91b485505", + "54e6c794-2855-4ecf-acc2-d7710d5d96d1", + "a1e7fdb4-88a4-4dbd-9ef2-d9bd1762cec2", + "2e365b7c-817d-4213-8fb1-496fa8067e7b", + "edeca4db-7394-4e93-9b6d-00581f16d6c1", + "5746f21e-efa1-4787-a9ca-99a5f233f507", + "77c7b56f-2410-4919-a4bc-64435c6cff55", + "d6961637-effe-4c39-b99a-f2df4402657d", + "ced3ecb8-70ab-40b0-b033-6f6235c61900", + ], + LOCATION_PARIS_NOEL: ["07bbf22b-d6ae-4883-bec2-122eeeb7b665"], + LOCATION_COASTALTOWN: [ + "9e0188e8-bdad-476c-b4ce-2faa5d2be56c", + "74415eca-d01e-4070-9bc9-5ef9b4e8f7d2", + "4b6739eb-bcdb-48ad-8c45-a829794175e1", + "5a8bdb42-b11e-47d1-bc57-b4bf7efa9eda", + "641656f8-ab16-49c5-a09b-952738154b64", + "ee7e831b-f7ea-4803-8eba-80b42d020a7c", + "95bb86f8-fbbf-4eb0-b2fa-bd379c0a4878", + "0c4c6ce2-09d5-4fff-a946-099ced0558ea", + "d43600cd-1128-4d59-bf87-075c73ae9776", + "3d9dcf91-1708-4e22-88b3-41d184bcc8c3", + "525bd318-04e6-4672-9d01-6bba74362fc5", + "994540ee-3900-4a41-9544-17b2196a4b1a", + "fab808f9-e88b-4775-aadb-a462c86bf2d9", + "f08934c0-73f3-460c-a612-231035131c96", + ], + LOCATION_COASTALTOWN_MOVIESET: [ + "74739eda-6ed5-4318-a501-2fa0bd53ef5a", + ], + LOCATION_COASTALTOWN_NIGHT: [ + "8dec1e62-bbf9-438c-8495-24559c884466", + ], + LOCATION_COASTALTOWN_EBOLA: [ + "0cceeecb-c8fe-42a4-aee4-d7b575f56a1b", + ], + LOCATION_MARRAKECH: [ + "19660896-fc1f-49f9-b56b-2059137530e4", + "11c93649-6b00-46ac-bf2d-a3599a6ab3a9", + "ebf8ab97-6ff3-4063-9737-c6f237031de7", + "c67a1ead-7489-4d88-bbd2-c68d735e5df0", + "896233eb-e7c5-4915-bf2b-5867799d8bb4", + "45e6d255-f8e4-4170-ad7e-3416ab8a881d", + "c949817b-5212-42e8-9b06-9a2eb83de167", + "e359075e-a510-4b7c-a461-477b789ca7e4", + ], + LOCATION_MARRAKECH_NIGHT: [ + "b49de2a1-fe8e-49c4-8331-17aaa9d65d32", + "c2e16fb7-d49f-49ef-9d76-46b8b31b3389", + ], + LOCATION_BANGKOK: [ + "f425e64f-99df-4ebf-9f7d-909a65a26aef", + "ccbde3e2-67e7-4534-95ec-e9bd7ef65273", + "1f785def-03b7-4340-af7e-2f5831e77eb5", + "45c831c4-b455-4d21-90f3-6f09b28ee01b", + ], + LOCATION_BANGKOK_ZIKA: [], + LOCATION_COLORADO: [ + "e6f4d3a4-9a33-4bd9-b761-da297069cf8c", + "c5d88e8c-437b-476b-afe2-d94aa4293502", + "4186dd23-1cfc-4ba0-9863-9f19f7cba249", + ], + LOCATION_COLORADO_RABIES: [], + LOCATION_HOKKAIDO: [ + "115425b1-e797-47bf-b517-410dc7507397", + "e96fb040-a13f-466c-9d96-c8f3b2b8a09a", + "a1e5f4f4-ea9c-4a42-b826-50a212026d50", + "85a2b618-2e3c-444f-931c-b89d566e45f7", + "88451dd9-4b57-441e-9eab-e20b9879bafa", + ], + LOCATION_HOKKAIDO_MAMUSHI: [], + LOCATION_HOKKAIDO_FLU: [], + LOCATION_NEWZEALAND: [ + "e1e86206-d3f0-a819-e477-3d80e55e8a40", + "3efc73f9-33f0-4af6-9508-7208e6851394", + ], + LOCATION_MIAMI: [ + "719ee044-4b05-4bd9-b2bb-75029f6d2a35", + "5284cb9f-9bdd-4b00-99c3-0b5939b01818", + "d0f44e71-6eab-4af4-9484-78d61dbe376a", + "fca539ff-1b1a-4c04-93e0-03b9b902f86c", + "782a2849-14a2-4cd4-99fc-ddacaeaba2dd", + "be3ea01f-ec56-4fcb-95ec-164a1d9980f3", + "066ce378-0418-452a-b02e-a5e4ee711096", + ], + LOCATION_COLOMBIA: [ + "390ba7b6-de27-464a-b8af-6d0ff54c2aec", + "70150cd2-ef76-4ba8-80cc-b1e63871b030", + "be567ad3-23f4-4d0b-9d2e-b261ea845ef0", + "a5e81878-0eae-4bcf-af9b-9a7e7833f85d", + "757fd132-0300-45ec-b5bd-bdd48c543b5c", + "41ecf8ce-dfd4-4c08-8f44-52dedc3f089a", + "d336d894-024a-4cd4-9867-dee7de70ee79", + ], + LOCATION_MUMBAI: [ + "667f48a3-7f6b-486e-8f6b-2f782a5c4857", + "9badee3e-0014-46b1-9ef6-edf8858ba038", + "b6a6330a-301a-4e8e-a26f-0f3e0ea809b5", + "4a62b328-dfe7-4956-ac0f-a3a8990fce26", + "a10472e4-0eb3-451d-814d-38837dd0f407", + "ae0bd6cd-7062-4336-8cb0-5fafad3d0f4f", + "b47f34cb-6537-421c-8fc8-720a4a118540", + ], + LOCATION_NORTHAMERICA: [ + "218302a3-f682-46f9-9ffd-bb3e82487b7c", + "d1b9250b-33f6-4712-831b-f33fa11ee4d8", + "1d5dcf3e-9682-4e32-ac11-ad6586daa456", + "74e6b561-ff1a-4742-9a7b-890b7818c796", + "15b7ad4e-565a-4fdb-b669-c9a68176e665", + "fe088a10-5dbf-460f-bbe2-6b55e7a66253", + ], + LOCATION_NORTHSEA: [ + "e63eeb62-29ef-428d-b003-ea043b1f11f9", + "b66f151d-47a7-4681-a403-c48a46916224", + "dbb0e22d-084b-4b57-8616-42290982fd90", + "4fbfae2e-a5e7-4b79-b008-94f6cbcb13cb", + "3721e543-b5e6-4af8-a4fc-c92e9a4453bd", + "8c6daf5e-5974-4438-af20-71ff570c7ff3", + ], + LOCATION_GREEDY_RACCOON: [ + "9a461f89-86c5-44e4-998e-f2f66b496aa7", + "55063d85-e84a-4c76-8bf7-e70fe2cab651", + ], + LOCATION_OPULENT_STINGRAY: [ + "f19f7ac8-39ec-498b-aa23-44c8e75d8693", + "35f1f534-ae2d-42be-8472-dd55e96625ea", + "83d4e87e-2f47-4c81-b831-30bd13a29b05", + ], + LOCATION_GOLDEN_GECKO: [ + "8885eeda-ad64-44fa-a944-1438b36c670c", + "ae04c7a0-4028-4524-b27f-6a62f020fdca", + "9448d91d-f7df-4b5a-8ea3-91f1233f644a", + "89305766-199e-43eb-9fcb-29e6f2b6e9ab", + "a9dc4bf9-d277-4115-8dac-6c665cd68168", + ], + LOCATION_ANCESTRAL_BULLDOG: [ + "78628e05-93ce-4f87-8a17-b910d32df51f", + "8e95dcd0-704f-4121-8be6-088a3812f838", + "a838c4b0-7db5-4ac7-8d52-e8c5b82aa376", + "b12d08ea-c842-498a-82ea-889653588592", + "4689ef5e-0ddd-44b3-adca-aebf3293d9e1", + ], + LOCATION_ANCESTRAL_SMOOTHSNAKE: [ + "5680108a-19dc-4448-9344-3d0290217162", + ], + LOCATION_EDGY_FOX: [ + "ccdc7043-62af-44e8-a5fc-38b008c2044e", + "9d88605f-6871-46a8-bd46-9804ea04fca9", + "12d83cb0-a2d6-4c01-b9d8-675ac635ee61", + "e3b65e65-636b-4dfd-bb42-65a18c5dce4a", + "079876de-ddd7-47aa-8719-abe97d82fc12", + "5bb29a6b-7384-4641-944c-3540fa5cd8aa", + ], + LOCATION_WET_RAT: [ + "07ffa72a-bbac-45ca-8c9f-b9c1b526153a", + "5121acde-313d-4517-ae70-6a54ca5d775a", + "494d97a6-9e31-45e0-9dae-f3793c731336", + "542108f2-f82f-4a04-bfec-efa92785fec1", + "84bf03cc-3055-4fd4-a691-d8b0ac61a51f", + ], + LOCATION_ELEGANT_LLAMA: [ + "1e4423b7-d4ff-448f-a8a8-4bb600cab7e3", + "edbacf4b-e402-4548-b723-cd4351571537", + "8c8ed496-948f-4672-879b-4d9575406577", + "14a21819-f81f-453d-8734-a3aab528fa62", + "72aaaa7b-4386-4ee7-9e9e-73fb8ff8e416", + ], + LOCATION_TRAPPED_WOLVERINE: [ + "078a50d1-6427-4fc3-9099-e46390e637a0", + ], + LOCATION_ROCKY_DUGONG: ["50fa5e99-0b51-45d4-9062-cd46dd928461"], + }, + arcade: { + LOCATION_PARIS: [ + "7886bed7-3805-46c6-a792-4a0d55758934", + "06f99231-9b1e-483f-8a72-f91efcc2fd2b", + "6516174c-abe0-4cd7-acdb-7cda4c9b5016", + "223aa1f3-64a1-43c0-b3c8-36aebd7998e4", + "7569d5e4-5270-4b69-96c8-e47b99876390", + "479ec396-b96f-4e01-94d9-aedaa0582ed9", + "09ea9b32-dc85-4633-9f6a-c5c4bfded5ac", + ], + LOCATION_COASTALTOWN: [ + "8db8fa33-cb41-4a0d-a2de-e30d884afb95", + "9e469023-e0c4-42bf-8527-f9fcaf624421", + ], + LOCATION_COLORADO: [ + "ff5b4e53-49ea-4d85-b94e-d3c8b3fc7ab3", + "b4d555eb-e2c9-40c2-b155-328a7019fd28", + ], + LOCATION_NEWZEALAND: ["39cc0603-4348-4dbf-9bd3-733cadf2913c"], + LOCATION_MIAMI: ["de9788cc-b9c4-47fc-b5df-86451cd82c43"], + LOCATION_COLOMBIA: ["90121ee0-0431-4a97-9bc8-8a7e2ca30d65"], + LOCATION_NORTHAMERICA: [ + "5081776a-86b6-4935-a83e-631a65ba8ee8", + "cab4293f-e359-419d-aa6f-83d91a158cf5", + ], + LOCATION_NORTHSEA: [ + "b9f55fc3-c53f-4661-a4b6-9956303422aa", + "6de90688-ad4c-457e-ae25-c4bbc8f55196", + "07bc9bbf-7cba-4cdf-92bb-3ab57f09b1cc", + "09a40d33-4820-454b-89af-a10e0b8d3e08", + "74278853-5990-4058-8972-1f10ad12b6d8", + "b1fb40d7-c013-4c9f-bb8a-8782e980b11a", + ], + LOCATION_ANCESTRAL_BULLDOG: [ + "bfb56fe6-06db-440a-aafe-42eeeb223fa1", + "80cf04de-8e0b-4f38-b094-600753e2ac24", + "85a67f31-75ce-40f5-a281-7765791f58ca", + ], + LOCATION_EDGY_FOX: [ + "d21e2e91-602c-49d2-9d42-e8bcfb810e9a", + "be787ec9-e7b9-4984-bb39-fda4c71705ec", + "e4b29c19-13b4-471b-b188-cd9c0a788cd0", + "797e204a-ef3d-463b-a386-57df0fe29b8f", + "f1e3dcdc-2247-4da8-bf8e-856f5fd23888", + ], + LOCATION_WET_RAT: [ + "dd68d30f-3900-415f-bb17-84681a2cd4fc", + "9cbdb972-95df-4e0a-be77-7937ec6f2fb0", + "e9168f42-882e-4c7e-8353-33d2bd8bb864", + ], + LOCATION_ELEGANT_LLAMA: [ + "17027c6f-7010-43b8-bb42-1a6846fc0b7b", + "a79640cb-331a-41af-abaf-58e629fe0a04", + "2c2afdfe-d396-451a-a6a3-52aca4ea4f1f", + "afb4ce18-bf9d-443d-85a8-207df9011792", + ], + }, + sniper: { + LOCATION_AUSTRIA: ["ff9f46cf-00bd-4c12-b887-eac491c3a96d"], + LOCATION_SALTY_SEAGULL: ["00e57709-e049-44c9-a2c3-7655e19884fb"], + LOCATION_CAGED_FALCON: ["25b20d86-bb5a-4ebd-b6bb-81ed2779c180"], + }, + elusive: {}, + sarajevo: { + LOCATION_PARIS: ["dd906289-7c32-427f-b689-98ae645b407f"], + LOCATION_COASTALTOWN: ["350ceea9-cfa9-4639-a66b-0d4de586eeee"], + LOCATION_MARRAKECH: ["59966a7f-3348-48da-a56c-4447aa548c85"], + LOCATION_BANGKOK: ["30c3546d-9881-45fa-8c7a-8b2c76b03e59"], + LOCATION_COLORADO: ["1c82c1e3-fe61-4001-a173-81fa11023460"], + LOCATION_HOKKAIDO: ["781c68ca-9318-40bf-9cc1-232007be02bf"], + }, }, - /** - * Special property for pro mode missions (2016 exclusive). - * Mapping of location parent to pro mode contract ID, instead of the typical mission array. - */ - pro1: { - LOCATION_PARENT_PARIS: "5ee4d771-6ab3-41fa-ab4f-04970d0ca327", - LOCATION_PARENT_COASTALTOWN: "644d36bd-1f88-44f9-9fed-14a51e5e3f6b", - LOCATION_PARENT_MARRAKECH: "7b2d5500-7853-4ad0-b68a-14be791cfba2", - LOCATION_PARENT_BANGKOK: "ad5f9051-045d-4b8e-8a4d-d84429f467f8", - LOCATION_PARENT_COLORADO: "69b58abc-6535-4092-9afe-c046b26303e6", - LOCATION_PARENT_HOKKAIDO: "3d885714-fa9a-4438-9e0f-c58dbcaab8b8", + scpc: { + escalations: {}, + sniper: { + LOCATION_AUSTRIA: ["ff9f46cf-00bd-4c12-b887-eac491c3a96d"], + }, }, -} +} satisfies MissionsInLocation diff --git a/components/controller.ts b/components/controller.ts index 2224f12b..03a1b92d 100644 --- a/components/controller.ts +++ b/components/controller.ts @@ -626,6 +626,47 @@ export class Controller { return json } + /** + * Fixes a contract based on game version. + * + * An example of this is the location for Holiday Hoarders changing in + * HITMAN 3 thus breaking the contract in standalone 2016. + * + * @param contract The contract to fix. + * @param gameVersion The game version. + * @returns The fixed contract. + * @private + */ + private fixContract( + contract: MissionManifest, + gameVersion: GameVersion, + ): MissionManifest { + switch (gameVersion) { + case "h1": { + if (contract.Metadata.Location === "LOCATION_PARIS_NOEL") + contract.Metadata.Location = "LOCATION_PARIS" + + break + } + case "h2": { + if (contract.Metadata.Location === "LOCATION_PARIS_NOEL") + contract.Metadata.Location = "LOCATION_PARIS" + + if (contract.Metadata.Location === "LOCATION_HOKKAIDO_MAMUSHI") + contract.Metadata.Location = "LOCATION_HOKKAIDO" + + // Fix The Jeffrey Consolation + if (contract.Data.Bricks) + contract.Data.Bricks = contract.Data.Bricks.filter( + (brick) => + !brick.includes("override_constantjeff.brick"), + ) + } + } + + return contract + } + /** * Get a contract by its ID. * @@ -669,6 +710,7 @@ export class Controller { ) if (optionalPluginJson) { + // We skip fixing plugins as we assume they know what they're doing. return fastClone( getGroup ? this.getGroupContract(optionalPluginJson, gameVersion) @@ -679,10 +721,13 @@ export class Controller { const registryJson: MissionManifest | undefined = internalContracts[id] if (registryJson) { - return fastClone( - getGroup - ? this.getGroupContract(registryJson, gameVersion) - : registryJson, + return this.fixContract( + fastClone( + getGroup + ? this.getGroupContract(registryJson, gameVersion) + : registryJson, + ), + gameVersion, ) } @@ -691,10 +736,13 @@ export class Controller { : undefined if (openCtJson) { - return fastClone( - getGroup - ? this.getGroupContract(openCtJson, gameVersion) - : openCtJson, + return this.fixContract( + fastClone( + getGroup + ? this.getGroupContract(openCtJson, gameVersion) + : openCtJson, + ), + gameVersion, ) } @@ -703,10 +751,13 @@ export class Controller { : undefined if (officialJson) { - return fastClone( - getGroup - ? this.getGroupContract(officialJson, gameVersion) - : officialJson, + return this.fixContract( + fastClone( + getGroup + ? this.getGroupContract(officialJson, gameVersion) + : officialJson, + ), + gameVersion, ) } @@ -738,11 +789,13 @@ export class Controller { * * @param groupContract The escalation group contract, ALL levels must have the Id of this in Metadata.InGroup * @param locationId The location of the escalation's ID. + * @param gameVersion The game version to add the escalation to. * @param levels The escalation's levels. */ public addEscalation( groupContract: MissionManifest, locationId: string, + gameVersion: GameVersion, ...levels: MissionManifest[] ): void { const fixedLevels = [...levels].filter(Boolean) @@ -750,12 +803,14 @@ export class Controller { this.addMission(groupContract) fixedLevels.forEach((level) => this.addMission(level)) - type K = keyof typeof this.missionsInLocations.escalations + type K = + keyof (typeof this.missionsInLocations)[GameVersion]["escalations"] - // eslint-disable-next-line @typescript-eslint/no-explicit-any - this.missionsInLocations.escalations[locationId as K] ??= [] + // @ts-expect-error This is fine. + this.missionsInLocations[gameVersion].escalations[locationId as K] ??= + [] - const a = this.missionsInLocations.escalations[ + const a = this.missionsInLocations[gameVersion].escalations[ locationId as K ] as string[] diff --git a/components/menus/destinations.ts b/components/menus/destinations.ts index 0efe7ef0..e6ba7e78 100644 --- a/components/menus/destinations.ts +++ b/components/menus/destinations.ts @@ -37,8 +37,6 @@ import { ChallengeFilterType, Pro1FilterType } from "../candle/challengeHelpers" import { GetDestinationQuery } from "../types/gameSchemas" import { createInventory } from "../inventory" import { log, LogLevel } from "../loggingInterop" -import { no2016 } from "../contracts/escalations/escalationService" -import { missionsInLocations } from "../contracts/missionsInLocation" import assert from "assert" import { translateEntitlements } from "../ownership" @@ -420,13 +418,18 @@ export function getDestination( (subLocation) => subLocation.Properties.ParentLocation === LOCATION, ) - if (query.difficulty === "pro1") { - type Cast = keyof typeof controller.missionsInLocations.pro1 + // I know it's redundant to check game version here, but it's just for typescript. + if (query.difficulty === "pro1" && gameVersion === "h1") { + type Cast = keyof (typeof controller.missionsInLocations)["h1"]["pro1"] const obj: LocationMissionData = { Location: locationData, SubLocation: locationData, - Missions: [controller.missionsInLocations.pro1[LOCATION as Cast]] + Missions: [ + controller.missionsInLocations[gameVersion].pro1[ + LOCATION as Cast + ], + ] .map((id) => contractIdToHitObject(id, gameVersion, userId)) .filter(Boolean) as Hit[], SarajevoSixMissions: [], @@ -452,27 +455,16 @@ export function getDestination( const escalations: Hit[] = [] - type ECast = keyof typeof controller.missionsInLocations.escalations + type ECast = + keyof (typeof controller.missionsInLocations)[GameVersion]["escalations"] // every unique escalation from the sublocation - const allUniqueEscalations: string[] = [ - ...(gameVersion === "h1" && e.Id === "LOCATION_ICA_FACILITY" - ? controller.missionsInLocations.escalations[ - "LOCATION_ICA_FACILITY_SHIP" - ] - : []), - ...new Set( - controller.missionsInLocations.escalations[e.Id as ECast] || [], - ), - ] + const escalationIds: string[] = + controller.missionsInLocations[gameVersion].escalations[ + e.Id as ECast + ] ?? [] - for (const escalation of allUniqueEscalations) { - if (gameVersion === "h1" && no2016.includes(escalation)) continue - - const details = contractIdToHitObject( - escalation, - gameVersion, - userId, - ) + for (const id of escalationIds) { + const details = contractIdToHitObject(id, gameVersion, userId) if (details) { escalations.push(details) @@ -480,18 +472,24 @@ export function getDestination( } const sniperMissions: Hit[] = [] - type SCast = keyof typeof controller.missionsInLocations.sniper - for (const sniperMission of controller.missionsInLocations.sniper[ - e.Id as SCast - ] ?? []) { - const hit = contractIdToHitObject( - sniperMission, - gameVersion, - userId, - ) + if (gameVersion !== "h1") { + type SCast = keyof (typeof controller.missionsInLocations)[Exclude< + GameVersion, + "h1" + >]["sniper"] + + for (const sniperMission of controller.missionsInLocations[ + gameVersion + ].sniper[e.Id as SCast] ?? []) { + const hit = contractIdToHitObject( + sniperMission, + gameVersion, + userId, + ) - if (hit) sniperMissions.push(hit) + if (hit) sniperMissions.push(hit) + } } const obj = { @@ -508,49 +506,24 @@ export function getDestination( } const types = [ - ...((gameVersion === "h1" && - // @ts-expect-error Hack. - missionsInLocations.sarajevo["h2016enabled"]) || - gameVersion === "h3" - ? [["sarajevo", "SarajevoSixMissions"]] - : []), [undefined, "Missions"], ["elusive", "ElusiveMissions"], + ["sarajevo", "SarajevoSixMissions"], ] + type TCast = keyof (typeof controller.missionsInLocations)[GameVersion] + for (const t of types) { - let theMissions: string[] | undefined = !t[0] // no specific type - ? // @ts-expect-error Yup. - controller.missionsInLocations[e.Id] - : // @ts-expect-error Yup. - controller.missionsInLocations[t[0]][e.Id] - - // edge case: ica facility in h1 was only 1 sublocation, so we merge - // these into a single array - if ( - gameVersion === "h1" && - !t[0] && - LOCATION === "LOCATION_PARENT_ICA_FACILITY" - ) { - theMissions = [ - ...controller.missionsInLocations - .LOCATION_ICA_FACILITY_ARRIVAL, - ...controller.missionsInLocations - .LOCATION_ICA_FACILITY_SHIP, - ...controller.missionsInLocations.LOCATION_ICA_FACILITY, - ] - } + const theMissions: string[] | undefined = ( + !t[0] // no specific type + ? controller.missionsInLocations[gameVersion][e.Id as ECast] + : controller.missionsInLocations[gameVersion][ + t[0] as TCast + ][e.Id as ECast] + ) as string[] | undefined if (theMissions) { - for (const c of theMissions.filter( - // removes snow festival on h1 - (m) => - m && - !( - gameVersion === "h1" && - m === "c414a084-a7b9-43ce-b6ca-590620acd87e" - ), - )) { + for (const c of theMissions) { const mission = contractIdToHitObject( c, gameVersion, diff --git a/components/smfSupport.ts b/components/smfSupport.ts index 3d1126ca..619e694b 100644 --- a/components/smfSupport.ts +++ b/components/smfSupport.ts @@ -156,9 +156,12 @@ export class SMFSupport { const placeBefore = contractData.SMF?.destinations.placeBefore const placeAfter = contractData.SMF?.destinations.placeAfter // @ts-expect-error I know what I'm doing. - const inLocation = (this.controller.missionsInLocations[location] ?? + const inLocation = (this.controller.missionsInLocations["h3"][ + location + ] ?? // @ts-expect-error I know what I'm doing. - (this.controller.missionsInLocations[location] = [])) as string[] + (this.controller.missionsInLocations["h3"][location] = + [])) as string[] if (placeBefore) { const index = inLocation.indexOf(placeBefore) diff --git a/components/types/types.ts b/components/types/types.ts index 1b08ad9f..b9660b32 100644 --- a/components/types/types.ts +++ b/components/types/types.ts @@ -1615,3 +1615,12 @@ export type OfficialSublocation = { Xp: number ActionXp: number } + +export type MILLocations = { + [location in `LOCATION_${string}`]: string[] | string +} + +export type MissionsInLocation = Record< + GameVersion, + MILLocations & { [key: string]: MILLocations | string[] } +> From 46516ca588dfde749b888a51303ac9ff47f9781f Mon Sep 17 00:00:00 2001 From: AnthonyFuller <24512050+AnthonyFuller@users.noreply.github.com> Date: Sat, 4 Jan 2025 01:36:06 +0000 Subject: [PATCH 2/7] refactor: rename missionsInLocations to missionsInLocation As it always should have been. --- components/candle/challengeService.ts | 8 ++++---- components/contracts/hitsCategoryService.ts | 4 ++-- components/contracts/missionsInLocation.ts | 2 +- components/controller.ts | 11 +++++------ components/menus/destinations.ts | 22 ++++++++++----------- components/smfSupport.ts | 4 ++-- 6 files changed, 25 insertions(+), 26 deletions(-) diff --git a/components/candle/challengeService.ts b/components/candle/challengeService.ts index 5bdbd1a8..cf3ed8a1 100644 --- a/components/candle/challengeService.ts +++ b/components/candle/challengeService.ts @@ -959,18 +959,18 @@ export class ChallengeService extends ChallengeRegistry { let contracts = isSniperLocation(child) ? // @ts-expect-error This is fine - we know it will be there - this.controller.missionsInLocations[gameVersion].sniper[child] + this.controller.missionsInLocation[gameVersion].sniper[child] : // @ts-expect-error This is fine - we can index this - (this.controller.missionsInLocations[gameVersion][child] ?? []) + (this.controller.missionsInLocation[gameVersion][child] ?? []) .concat( // @ts-expect-error This is fine - we can index this - this.controller.missionsInLocations[gameVersion] + this.controller.missionsInLocation[gameVersion] .escalations[child] ?? [], ) .concat( gameVersion === "h3" ? // @ts-expect-error This is fine - we know it will be there - this.controller.missionsInLocations[gameVersion] + this.controller.missionsInLocation[gameVersion] .arcade[child] : [], ) diff --git a/components/contracts/hitsCategoryService.ts b/components/contracts/hitsCategoryService.ts index 7e4a9bab..52defa75 100644 --- a/components/contracts/hitsCategoryService.ts +++ b/components/contracts/hitsCategoryService.ts @@ -35,7 +35,7 @@ import { userAuths } from "../officialServerAuth" import { log, LogLevel } from "../loggingInterop" import { fastClone, getRemoteService } from "../utils" import { orderedETAs } from "./elusiveTargetArcades" -import { missionsInLocations } from "./missionsInLocation" +import { missionsInLocation } from "./missionsInLocation" import assert from "assert" /** @@ -240,7 +240,7 @@ export class HitsCategoryService { const nEscalations: string[] = [] for (const escalations of Object.values( - missionsInLocations[gameVersion].escalations, + missionsInLocation[gameVersion].escalations, )) { for (const id of escalations) { const contract = controller.resolveContract( diff --git a/components/contracts/missionsInLocation.ts b/components/contracts/missionsInLocation.ts index 631334a9..fe9780e1 100644 --- a/components/contracts/missionsInLocation.ts +++ b/components/contracts/missionsInLocation.ts @@ -23,7 +23,7 @@ import { MissionsInLocation } from "../types/types" * * @since v8.0.0 these are separated by game version. */ -export const missionsInLocations = { +export const missionsInLocation = { h1: { LOCATION_ICA_FACILITY: [ "1436cbe4-164b-450f-ad2c-77dec88f53dd", diff --git a/components/controller.ts b/components/controller.ts index 03a1b92d..56afd9ca 100644 --- a/components/controller.ts +++ b/components/controller.ts @@ -57,7 +57,7 @@ import { parse } from "json5" import { userAuths } from "./officialServerAuth" // @ts-expect-error Ignore JSON import import LEGACYFF from "../contractdata/COLORADO/FREEDOMFIGHTERSLEGACY.json" -import { missionsInLocations } from "./contracts/missionsInLocation" +import { missionsInLocation } from "./contracts/missionsInLocation" import { createContext, Script } from "vm" import { ChallengeService } from "./candle/challengeService" import { getFlag } from "./flags" @@ -358,7 +358,7 @@ export class Controller { configs, getVersionedConfig, } - public missionsInLocations = missionsInLocations + public missionsInLocation = missionsInLocation /** * Note: if you are adding a contract, please use {@link addMission}! */ @@ -804,13 +804,12 @@ export class Controller { fixedLevels.forEach((level) => this.addMission(level)) type K = - keyof (typeof this.missionsInLocations)[GameVersion]["escalations"] + keyof (typeof this.missionsInLocation)[GameVersion]["escalations"] // @ts-expect-error This is fine. - this.missionsInLocations[gameVersion].escalations[locationId as K] ??= - [] + this.missionsInLocation[gameVersion].escalations[locationId as K] ??= [] - const a = this.missionsInLocations[gameVersion].escalations[ + const a = this.missionsInLocation[gameVersion].escalations[ locationId as K ] as string[] diff --git a/components/menus/destinations.ts b/components/menus/destinations.ts index e6ba7e78..ce6e5bc6 100644 --- a/components/menus/destinations.ts +++ b/components/menus/destinations.ts @@ -420,13 +420,13 @@ export function getDestination( // I know it's redundant to check game version here, but it's just for typescript. if (query.difficulty === "pro1" && gameVersion === "h1") { - type Cast = keyof (typeof controller.missionsInLocations)["h1"]["pro1"] + type Cast = keyof (typeof controller.missionsInLocation)["h1"]["pro1"] const obj: LocationMissionData = { Location: locationData, SubLocation: locationData, Missions: [ - controller.missionsInLocations[gameVersion].pro1[ + controller.missionsInLocation[gameVersion].pro1[ LOCATION as Cast ], ] @@ -456,10 +456,10 @@ export function getDestination( const escalations: Hit[] = [] type ECast = - keyof (typeof controller.missionsInLocations)[GameVersion]["escalations"] + keyof (typeof controller.missionsInLocation)[GameVersion]["escalations"] // every unique escalation from the sublocation const escalationIds: string[] = - controller.missionsInLocations[gameVersion].escalations[ + controller.missionsInLocation[gameVersion].escalations[ e.Id as ECast ] ?? [] @@ -474,12 +474,12 @@ export function getDestination( const sniperMissions: Hit[] = [] if (gameVersion !== "h1") { - type SCast = keyof (typeof controller.missionsInLocations)[Exclude< + type SCast = keyof (typeof controller.missionsInLocation)[Exclude< GameVersion, "h1" >]["sniper"] - for (const sniperMission of controller.missionsInLocations[ + for (const sniperMission of controller.missionsInLocation[ gameVersion ].sniper[e.Id as SCast] ?? []) { const hit = contractIdToHitObject( @@ -511,15 +511,15 @@ export function getDestination( ["sarajevo", "SarajevoSixMissions"], ] - type TCast = keyof (typeof controller.missionsInLocations)[GameVersion] + type TCast = keyof (typeof controller.missionsInLocation)[GameVersion] for (const t of types) { const theMissions: string[] | undefined = ( !t[0] // no specific type - ? controller.missionsInLocations[gameVersion][e.Id as ECast] - : controller.missionsInLocations[gameVersion][ - t[0] as TCast - ][e.Id as ECast] + ? controller.missionsInLocation[gameVersion][e.Id as ECast] + : controller.missionsInLocation[gameVersion][t[0] as TCast][ + e.Id as ECast + ] ) as string[] | undefined if (theMissions) { diff --git a/components/smfSupport.ts b/components/smfSupport.ts index 619e694b..58585141 100644 --- a/components/smfSupport.ts +++ b/components/smfSupport.ts @@ -156,11 +156,11 @@ export class SMFSupport { const placeBefore = contractData.SMF?.destinations.placeBefore const placeAfter = contractData.SMF?.destinations.placeAfter // @ts-expect-error I know what I'm doing. - const inLocation = (this.controller.missionsInLocations["h3"][ + const inLocation = (this.controller.missionsInLocation["h3"][ location ] ?? // @ts-expect-error I know what I'm doing. - (this.controller.missionsInLocations["h3"][location] = + (this.controller.missionsInLocation["h3"][location] = [])) as string[] if (placeBefore) { From b50f7fca7ea63a7cee5413d5972bbecdea6a583e Mon Sep 17 00:00:00 2001 From: AnthonyFuller <24512050+AnthonyFuller@users.noreply.github.com> Date: Sat, 4 Jan 2025 01:37:51 +0000 Subject: [PATCH 3/7] refactor(hitsCategory): use controller.missionsInLocation --- components/contracts/hitsCategoryService.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/components/contracts/hitsCategoryService.ts b/components/contracts/hitsCategoryService.ts index 52defa75..45de1de9 100644 --- a/components/contracts/hitsCategoryService.ts +++ b/components/contracts/hitsCategoryService.ts @@ -35,7 +35,6 @@ import { userAuths } from "../officialServerAuth" import { log, LogLevel } from "../loggingInterop" import { fastClone, getRemoteService } from "../utils" import { orderedETAs } from "./elusiveTargetArcades" -import { missionsInLocation } from "./missionsInLocation" import assert from "assert" /** @@ -240,7 +239,7 @@ export class HitsCategoryService { const nEscalations: string[] = [] for (const escalations of Object.values( - missionsInLocation[gameVersion].escalations, + controller.missionsInLocation[gameVersion].escalations, )) { for (const id of escalations) { const contract = controller.resolveContract( From 51bcc4ec786a956a5893c0b598b8d95d488696c7 Mon Sep 17 00:00:00 2001 From: AnthonyFuller <24512050+AnthonyFuller@users.noreply.github.com> Date: Sat, 4 Jan 2025 18:33:05 +0000 Subject: [PATCH 4/7] refactor(destinations): assert that the game version is h1 if pro1 is requested --- components/menus/destinations.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/components/menus/destinations.ts b/components/menus/destinations.ts index ce6e5bc6..260d05d3 100644 --- a/components/menus/destinations.ts +++ b/components/menus/destinations.ts @@ -418,8 +418,11 @@ export function getDestination( (subLocation) => subLocation.Properties.ParentLocation === LOCATION, ) - // I know it's redundant to check game version here, but it's just for typescript. - if (query.difficulty === "pro1" && gameVersion === "h1") { + if (query.difficulty === "pro1") { + assert( + gameVersion === "h1", + `${gameVersion} has requested a pro1 difficulty destination!`, + ) type Cast = keyof (typeof controller.missionsInLocation)["h1"]["pro1"] const obj: LocationMissionData = { From 8755458c1e26c4d59d8d29bd67623b06b0a93648 Mon Sep 17 00:00:00 2001 From: AnthonyFuller <24512050+AnthonyFuller@users.noreply.github.com> Date: Sat, 4 Jan 2025 19:36:29 +0000 Subject: [PATCH 5/7] chore: remove tapable --- package.json | 3 +-- yarn.lock | 8 -------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/package.json b/package.json index 5e1a33c9..94e6390a 100644 --- a/package.json +++ b/package.json @@ -69,8 +69,7 @@ "random": "^4.1.0", "semver": "^7.6.2", "send": "0.18.0", - "serve-static": "^1.15.0", - "tapable": "^2.2.1" + "serve-static": "^1.15.0" }, "devDependencies": { "@eslint/compat": "^1.0.3", diff --git a/yarn.lock b/yarn.lock index 4b54f240..21dac57b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -568,7 +568,6 @@ __metadata: semver: "npm:^7.6.2" send: "npm:0.18.0" serve-static: "npm:^1.15.0" - tapable: "npm:^2.2.1" terser: "npm:^5.31.1" typescript: "npm:5.4.5" winston: "npm:^3.13.0" @@ -5223,13 +5222,6 @@ __metadata: languageName: node linkType: hard -"tapable@npm:^2.2.1": - version: 2.2.1 - resolution: "tapable@npm:2.2.1" - checksum: 10/1769336dd21481ae6347611ca5fca47add0962fd8e80466515032125eca0084a4f0ede11e65341b9c0018ef4e1cf1ad820adbb0fba7cc99865c6005734000b0a - languageName: node - linkType: hard - "tar@npm:^6.1.11, tar@npm:^6.1.2": version: 6.2.1 resolution: "tar@npm:6.2.1" From 35dcf171bbefab9f85e7cb32ba70f546d23f4cf6 Mon Sep 17 00:00:00 2001 From: AnthonyFuller <24512050+AnthonyFuller@users.noreply.github.com> Date: Sat, 4 Jan 2025 19:36:49 +0000 Subject: [PATCH 6/7] feat(controller): add fixContract hook --- components/controller.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/components/controller.ts b/components/controller.ts index 56afd9ca..ef86b9fd 100644 --- a/components/controller.ts +++ b/components/controller.ts @@ -333,6 +333,9 @@ export class Controller { [contractId: string, gameVersion: GameVersion, isGroup: boolean], MissionManifest | undefined > + fixContract: SyncHook< + [contract: MissionManifest, gameVersion: GameVersion] + > getContractIdsForGroupDiscovery: SyncHook<[string[]]> contributeCampaigns: SyncHook< [ @@ -391,6 +394,7 @@ export class Controller { newEvent: new SyncHook(), newMetricsEvent: new SyncHook(), getContractManifest: new SyncBailHook(), + fixContract: new SyncHook(), getContractIdsForGroupDiscovery: new SyncHook(), contributeCampaigns: new SyncHook(), getSearchResults: new AsyncSeriesHook(), @@ -664,6 +668,9 @@ export class Controller { } } + // See if any plugins want to make any changes + this.hooks.fixContract.call(contract, gameVersion) + return contract } From 73991fe063effa368ae1bc72d3f8a57316aed416 Mon Sep 17 00:00:00 2001 From: Anthony Fuller Date: Sun, 5 Jan 2025 21:06:20 +0000 Subject: [PATCH 7/7] chore: remove @private from comment Co-authored-by: Reece Dunham --- components/controller.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/components/controller.ts b/components/controller.ts index ef86b9fd..b6407d63 100644 --- a/components/controller.ts +++ b/components/controller.ts @@ -639,7 +639,6 @@ export class Controller { * @param contract The contract to fix. * @param gameVersion The game version. * @returns The fixed contract. - * @private */ private fixContract( contract: MissionManifest,