Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Introduce Peacock exclusive (escalation) track #531

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions components/candle/challengeHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ export type ChallengeFilterOptions =
locationId: string
gameVersion: GameVersion
isFeatured?: boolean
isPeacockExclusive?: boolean
difficulty: number
pro1Filter: Pro1FilterType
}
Expand Down
45 changes: 45 additions & 0 deletions components/candle/challengeService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,10 @@ export abstract class ChallengeRegistry {
return gameGroups.get("GLOBAL_ESCALATION_CHALLENGES")?.get(groupId)
}

if (groupId?.includes("peacock")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worried this might conflict with Paris

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Challenge groups don't have any location-specific titles in there.

return gameGroups.get("GLOBAL_PEACOCK_CHALLENGES")?.get(groupId)
}

// Global merge groups are included by default. Filtered later.

const globalGroup = this.globalMergeGroups.get(groupId)
Expand Down Expand Up @@ -471,6 +475,10 @@ export abstract class ChallengeRegistry {
return gameChalGC.get("GLOBAL_ESCALATION_CHALLENGES")?.get(groupId)
}

if (groupId?.includes("peacock")) {
return gameChalGC.get("GLOBAL_PEACOCK_CHALLENGES")?.get(groupId)
}

// Global merge groups are included by default. Filtered later.

const globalGroup = this.globalMergeGroups.get(groupId)
Expand Down Expand Up @@ -780,6 +788,18 @@ export class ChallengeService extends ChallengeRegistry {
)
}

if (
filter.type === ChallengeFilterType.Contract &&
filter.isPeacockExclusive
) {
this.getGroupedChallengesByLoc(
filter,
"GLOBAL_PEACOCK_CHALLENGES",
challenges,
gameVersion,
)
}

this.getGroupedChallengesByLoc(
filter,
"GLOBAL_ARCADE_CHALLENGES",
Expand Down Expand Up @@ -880,6 +900,26 @@ export class ChallengeService extends ChallengeRegistry {

assert.ok(levelParentLocation)

const PeacockEscalations: string[] = []
const allLocationArrays = Object.values(
controller.configManager.configs.EscalationCodenames,
) as Array<
Array<{
codename: string
name: string
id: string
isPeacock?: boolean
}>
>

for (const parentlocation of allLocationArrays) {
for (const e of parentlocation) {
if (e?.isPeacock === true) {
PeacockEscalations.push(e.id)
}
}
}

return this.getGroupedChallengeLists(
{
type: ChallengeFilterType.Contract,
Expand All @@ -892,6 +932,11 @@ export class ChallengeService extends ChallengeRegistry {
: contract.Metadata.Location,
gameVersion,
isFeatured: contractGroup.Metadata.Type === "featured",
isPeacockExclusive:
PeacockEscalations.includes(contractGroup.Metadata.Id) ||
PeacockEscalations.includes(
String(contractGroup.Metadata?.InGroup),
),
pro1Filter:
contract.Metadata.Difficulty === "pro1"
? Pro1FilterType.Only
Expand Down
Loading