1
mirror of https://github.com/thepeacockproject/Peacock synced 2024-12-05 20:15:16 +01:00
Peacock/components/ownership.ts
moonysolari 3adb4b1f67
Fix a number of bugs on progression, entitlements, and warning logs (#75)
* Fix "Contract undefined not found!" warnings

* Implement support for /GetContractOpportunities

* Add OpportunityData to MissionManifestMetadata

* Resolved a ts-expect-error by providing types

* Fix requiem unlockables pistol

* Adjust max player level
2023-01-10 17:29:54 -05:00

235 lines
7.6 KiB
TypeScript

/*
* The Peacock Project - a HITMAN server replacement.
* Copyright (C) 2021-2022 The Peacock Project Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import type { GameVersion } from "./types/types"
export const H1_GOTY_UNLOCKABLES = [
"TOKEN_OUTFIT_HERO_SANTACLAUS_SUIT",
"TOKEN_OUTFIT_PARIS_CLOWN",
"TOKEN_OUTFIT_HOKKAIDO_COWBOY",
"PROP_MELEE_A_NEW_BAT",
"FIREARMS_SNIPER_SIEGER_300_GHOST",
"FIREARMS_PISTOL_STRIKER",
"TOKEN_OUTFIT_MARRAKESH_DARK_SNIPER",
]
export const H1_REQUIEM_UNLOCKABLES = [
"TOKEN_OUTFIT_LEGACY_HERO_REQUIEMSUIT",
"PROP_DEVICE_SONYPREORDER_WHITE_RUBBERDUCK_REMOTE_EXPLOSIVE",
"FIREARMS_HERO_PISTOL_TACTICAL_015_SU_SKIN05",
]
export const H2_RACCOON_STINGRAY_UNLOCKABLES = [
"FIREARMS_HERO_SHOTGUN_BARTOLI_12G_SAWED_OFF",
"TOKEN_OUTFIT_GREEDY_HERO_GREEDYSUIT",
"TOKEN_OUTFIT_OPULENT_HERO_OPULENTSUIT",
"PROP_TOOL_GOLD_BAR_SMALL",
"PROP_MELEE_PIRATE_SABRE",
"FIREARMS_SNIPER_JAEGER_7_TUATARA",
"TOKEN_OUTFIT_HERO_PIRATE_SUIT",
"PROP_DEVICE_ICA_REMOTE_GAS_EMETIC",
]
export const LEGACY_UNLOCKABLES = [
"TOKEN_OUTFIT_PARIS_HERO_PARISSUIT",
"TOKEN_OUTFIT_GREENLAND_HERO_TRAININGSUIT",
"TOKEN_OUTFIT_SAPIENZA_HERO_SAPIENZASUIT",
"TOKEN_OUTFIT_SAPIENZA_HERO_SAPIENZASUIT_NOGLASSES",
"TOKEN_OUTFIT_MARRAKESH_HERO_MARRAKESHSUIT",
"TOKEN_OUTFIT_BANGKOK_HERO_BANGKOKSUIT",
"TOKEN_OUTFIT_HOKKAIDO_HERO_FLUSUIT",
"TOKEN_OUTFIT_COLORADO_HERO_COLORADOSUIT",
"TOKEN_OUTFIT_HOKKAIDO_HERO_HOKKAIDOSUIT",
"TOKEN_OUTFIT_HOKKAIDO_HERO_NINJASUIT",
"PROP_MELEE_COMBAT_KNIFE",
"PROP_MELEE_SHURIKEN",
"PROP_MELEE_HIDDEN_BLADE",
"PROP_MELEE_JAPANESE_BASEBALLBAT",
"PROP_MELEE_NINJATONFA",
"PROP_MELEE_EXPANDABLE_BATON",
"PROP_MELEE_CRYSTALBALL",
"PROP_MELEE_MODERN_HAMMER",
"FIREARMS_HERO_PISTOL_HWK_21",
"FIREARMS_HERO_SHOTGUN_SEMIAUTO_ENRAM_HV",
"FIREARMS_HERO_RIFLE_FULLAUTO_TAC_4_AUTO",
"FIREARMS_HERO_SMG_TAC_SMG",
"FIREARMS_HERO_PISTOL_TACTICAL_SILVERBALLER",
"FIREARMS_HERO_PISTOL_CUSTOM5MM",
"FIREARMS_HERO_PISTOL_TACTICAL_ICA_19_FA",
"FIREARMS_HERO_PISTOL_LIGHT_HWK_21_COVERT",
"FIREARMS_HERO_RIFLE_FULLAUTO_TAC_4_AR_STEALTH",
"FIREARMS_HERO_SHOTGUN_SEMIAUTO_ENRAM_HV_CM",
"FIREARMS_HERO_SNIPER_HEAVY_JAEAGER_LANCER",
"FIREARMS_HERO_SNIPER_MEDIUM_SIEGER_300",
"FIREARMS_HERO_SHOTGUN_SEMIAUTO_ENRAM_HV_COVERT",
"FIREARMS_HERO_SNIPER_HEAVY_JAEGER_TIGER",
"FIREARMS_HERO_PISTOL_KRUGERMEIER",
"FIREARMS_HERO_SNIPER_JAEGER",
"PROP_DEVICE_ICA_MODULAR_PROXIMITY_EXPLOSIVE",
"PROP_DEVICE_ICA_MODULAR_REMOTE_AUDIODISTRACTION",
"PROP_DEVICE_ICA_MODULAR_REMOTE_MUSICDISTRACTION",
"PROP_DEVICE_ICA_MODULAR_REMOTE_EXPLOSIVE",
"PROP_DEVICE_ACTIONFIGURE_PROXIMITY_EXPLOSIVE",
"PROP_DEVICE_NAPOLEON_FIGURE_REMOTE_EXPLOSIVE",
"PROP_DEVICE_ICA_RUBBERDUCK_REMOTE_EXPLOSIVE",
"PROP_DEVICE_ICA_C4_PROXIMITY_EXPLOSIVE",
"PROP_DEVICE_ICA_C4_REMOTE_EXPLOSIVE",
"PROP_DEVICE_ICA_MODULAR_REMOTE_BREACHCHARGE",
"PROP_DEVICE_ICA_PHONE_EXPLOSIVE",
"PROP_EXPLOSIVE_EXPLOSIVE_COMPOUND",
"PROP_DISTRACTION_FIRECRACKER",
"PROP_MELEE_ANTIQUE_SYRINGE_EMETIC",
"PROP_MELEE_SYRINGE_SEDATIVE",
"PROP_MELEE_ANTIQUE_SYRINGE_LETHAL",
"PROP_MELEE_SYRINGE_EMETIC",
"PROP_DEVICE_ICA_PROXIMITY_SEMTEX_BLOCK",
"PROP_DEVICE_ICA_REMOTE_SEMTEX_BLOCK",
"FIREARMS_PISTOL_CLASSIC_SILVERBALLER",
]
export const WINTERSPORTS_UNLOCKABLES = [
"TOKEN_OUTFIT_ARCTICPACK_SUIT",
"PROP_CONTAINER_SUITCASE_ARCTIC_TOOL_BOX",
"PROP_MELEE_SNOWBALL",
"PROP_MELEE_QUICKDRAW",
"PROP_MELEE_PITON",
]
export const EXECUTIVE_UNLOCKABLES = [
"FIREARMS_HERO_PISTOL_TACTICAL_ICA_19_BLACK_LILLY",
"TOKEN_OUTFIT_MIDNIGHT_BLACK_COLLECTORS",
"PROP_CONTAINER_SUITCASE_ICA_DELUXE",
]
export const DELUXE_UNLOCKABLES = [
// dubai
"PROP_CONTAINER_SUITCASE_GOLDEN",
"TOKEN_OUTFIT_HERO_GOLDEN_DEVIL_SUIT",
"FIREARMS_SMG_TACTICAL_DAK_DTI_GOLD_COVERT",
// dartmoor
"HUNTING_SHOTGUN_REWARD_DELUXE",
"TOKEN_OUTFIT_HERO_HUNTING_SUIT",
"PROP_CONTAINER_SUITCASE_HUNTING",
// berlin
"FIREARMS_PISTOL_DARTGUN_SEDATIVE_ASYLUM",
"PROP_MELEE_LEATHERBELT_ASYLUM",
"TOKEN_OUTFIT_HERO_ASYLUM_SUIT",
// chongkoats
"TOKEN_OUTFIT_HERO_CHINESE_SUIT",
"FIREARMS_SNIPER_CHINESE_DRAGON",
"PROP_CONTAINER_SUITCASE_CHINESE",
// mendozer
"TOKEN_OUTFIT_HERO_GURU_SUIT",
"PROP_EMETIC_POISON_PEN_SYRINGE_GURU",
"PROP_GAS_GRENADE_EMETIC_GURU",
// *throws up* romania
"FIREARMS_SNIPER_SIEGER_300_WHITE_NINJA",
"PROP_MELEE_KATANA_WHITE_NINJA",
"TOKEN_OUTFIT_HERO_WHITE_NINJA_SUIT",
]
export const SIN_GREED_UNLOCKABLES = [
"PROP_MELEE_CANE_GREED",
"PROP_TOOL_GREED_COIN",
"TOKEN_OUTFIT_HERO_GREED_SUIT",
]
export const SIN_PRIDE_UNLOCKABLES = [
"PROP_MELEE_PRIDE_SABER",
"FIREARMS_SNIPER_PRIDE",
"TOKEN_OUTFIT_HERO_PRIDE_SUIT",
]
export const SIN_SLOTH_UNLOCKABLES = [
"PROP_DEVICE_AUDIO_SEDATIVE_MINE_SLOTH",
"FIREARMS_HERO_SMG_DAKX2_COVERT_SLOTH",
"TOKEN_OUTFIT_HERO_SLOTH_SUIT",
]
export const SIN_LUST_UNLOCKABLES = [
"TOKEN_OUTFIT_HERO_LUST_SUIT",
"PROP_DEVICE_REMOTE_EXPLOSIVE_LUST",
"FIREARMS_PISTOL_DARTGUN_BLINDING_LUST",
]
export const SIN_GLUTTONY_UNLOCKABLES = [
"TOKEN_OUTFIT_HERO_GLUTTONY_SUIT",
"PROP_POISON_SEDATIVE_GUM_GLUTTONY",
"FIREARMS_HERO_SHOTGUN_SAWED_OFF_GLUTTONY",
]
export const SIN_ENVY_UNLOCKABLES = [
"TOKEN_OUTFIT_HERO_ENVY_SUIT",
"FIREARMS_SNIPER_JAEGER_7_TUATARA_ENVY",
"PROP_MELEE_DAGGER_ENVY",
]
export const SIN_WRATH_UNLOCKABLES = [
"TOKEN_OUTFIT_HERO_WRATH_SUIT",
"PROP_DEVICE_PROXIMITY_FLASH_WRATH",
"FIREARMS_HERO_RIFLE_SHASKA_A33_WRATH",
]
export const TRINITY_UNLOCKABLES = [
"TOKEN_OUTFIT_HERO_BIRTH_SUIT",
"FIREARMS_PISTOL_BIRTH_BALLER",
"PROP_CONTAINER_SUITCASE_BIRTH",
"TOKEN_OUTFIT_HERO_LIFE_SUIT",
"FIREARMS_PISTOL_LIFE_BALLER",
"PROP_CONTAINER_SUITCASE_LIFE",
"FIREARMS_PISTOL_DEATH_BALLER",
"TOKEN_OUTFIT_HERO_DEATH_SUIT",
"PROP_CONTAINER_SUITCASE_DEATH",
]
export const brokenItems = [
// duped dart gun (thanks IOI)
"835ad050-6d19-4e94-80b1-f5cec9815ba3",
// broken blood money suit
"051825b9-44f2-4b3d-8ab1-8d4a07393c76",
// eiffel tower melee weapon
"a8a8f0da-a69b-428d-b8c1-faf8660ec318",
]
/**
* Translates entitlements from HITMAN 3's values to an older game's values.
*
* @param newGameVersion Either "h1" or "h2".
* @param entitlements The entitlements array.
* @returns The translated entitlements.
*/
export function translateEntitlements(
newGameVersion: GameVersion,
entitlements: string[] | undefined,
): string[] {
const newEntitlements: string[] = []
if (!Array.isArray(entitlements)) {
return []
}
if (
newGameVersion === "h1" &&
entitlements.includes("H1_LEGACY_EXPANSION")
) {
newEntitlements.push("GOTY_PATIENT_ZERO")
}
return newEntitlements
}