diff --git a/project/assets/configs/quest.json b/project/assets/configs/quest.json index 47930545..abbd156f 100644 --- a/project/assets/configs/quest.json +++ b/project/assets/configs/quest.json @@ -15,6 +15,12 @@ "5e4d4ac186f774264f758336", "639136d68ba6894d155e77cf" ], + "profileBlacklist": { + "unheard_edition": ["666314a50aa5c7436c00908a"] + }, + "profileWhitelist": { + "edge_of_darkness": ["666314b4d7f171c4c20226c3"] + }, "questTemplateIds": { "pmc": { "elimination": "616052ea3054fc0e2c24ce6e", diff --git a/project/src/helpers/QuestHelper.ts b/project/src/helpers/QuestHelper.ts index c64691eb..fe996749 100644 --- a/project/src/helpers/QuestHelper.ts +++ b/project/src/helpers/QuestHelper.ts @@ -460,6 +460,14 @@ export class QuestHelper { return false; } + if (this.questIsProfileBlacklisted(profile.Info.GameVersion, quest._id)) { + return false; + } + + if (!this.questIsProfileWhitelisted(profile.Info.GameVersion, quest._id)) { + return false; + } + const standingRequirements = this.questConditionHelper.getStandingConditions( quest.conditions.AvailableForStart, ); @@ -532,18 +540,52 @@ export class QuestHelper { public questIsForOtherSide(playerSide: string, questId: string): boolean { const isUsec = playerSide.toLowerCase() === "usec"; if (isUsec && this.questConfig.bearOnlyQuests.includes(questId)) { - // player is usec and quest is bear only, skip + // Player is usec and quest is bear only, skip return true; } if (!isUsec && this.questConfig.usecOnlyQuests.includes(questId)) { - // player is bear and quest is usec only, skip + // Player is bear and quest is usec only, skip return true; } return false; } + /** + * Is the provided quest prevented from being viewed by the provided game version + * (Inclusive filter) + * @param gameVersion Game version to check against + * @param questId Quest id to check + * @returns True Quest should not be visible to game version + */ + protected questIsProfileBlacklisted(gameVersion: string, questId: string) { + const questBlacklist = this.questConfig.profileBlacklist[gameVersion]; + if (!questBlacklist) { + // Not blacklisted + return false; + } + + return questBlacklist.includes(questId); + } + + /** + * Is the provided quest able to be seen by the provided game version + * (Exclusive filter) + * @param gameVersion Game version to check against + * @param questId Quest id to check + * @returns True Quest should be visible to game version + */ + protected questIsProfileWhitelisted(gameVersion: string, questId: string) { + const questWhitelist = this.questConfig.profileWhitelist[gameVersion]; + if (!questWhitelist) { + // Not on whitelist for this profile + return false; + } + + return questWhitelist.includes(questId); + } + /** * Get quests that can be shown to player after failing a quest * @param failedQuestId Id of the quest failed by player diff --git a/project/src/models/spt/config/IQuestConfig.ts b/project/src/models/spt/config/IQuestConfig.ts index d119b420..aa9f08d4 100644 --- a/project/src/models/spt/config/IQuestConfig.ts +++ b/project/src/models/spt/config/IQuestConfig.ts @@ -15,6 +15,10 @@ export interface IQuestConfig extends IBaseConfig { locationIdMap: Record; bearOnlyQuests: string[]; usecOnlyQuests: string[]; + /** Quests that the keyed game version do not see/access */ + profileBlacklist: Record; + /** Quests that only the keyed game version can see/access */ + profileWhitelist: Record; } export interface IPlayerTypeQuestIds {