Added profile version whitelist and blacklist
Blacklisted `Old Patterns` from Unhead profiles Whitelisted `The Good Times - Part 1` to only Edge of darkness profiles
This commit is contained in:
parent
14a96cb034
commit
5e528d668e
@ -15,6 +15,12 @@
|
||||
"5e4d4ac186f774264f758336",
|
||||
"639136d68ba6894d155e77cf"
|
||||
],
|
||||
"profileBlacklist": {
|
||||
"unheard_edition": ["666314a50aa5c7436c00908a"]
|
||||
},
|
||||
"profileWhitelist": {
|
||||
"edge_of_darkness": ["666314b4d7f171c4c20226c3"]
|
||||
},
|
||||
"questTemplateIds": {
|
||||
"pmc": {
|
||||
"elimination": "616052ea3054fc0e2c24ce6e",
|
||||
|
@ -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
|
||||
|
@ -15,6 +15,10 @@ export interface IQuestConfig extends IBaseConfig {
|
||||
locationIdMap: Record<string, string>;
|
||||
bearOnlyQuests: string[];
|
||||
usecOnlyQuests: string[];
|
||||
/** Quests that the keyed game version do not see/access */
|
||||
profileBlacklist: Record<string, string[]>;
|
||||
/** Quests that only the keyed game version can see/access */
|
||||
profileWhitelist: Record<string, string[]>;
|
||||
}
|
||||
|
||||
export interface IPlayerTypeQuestIds {
|
||||
|
Loading…
Reference in New Issue
Block a user