Skip to content

Commit e6895e6

Browse files
authored
Merge pull request #1742 from ThingEngineering/main
Deploy
2 parents 1e0eaa3 + 43e7fbe commit e6895e6

20 files changed

Lines changed: 193 additions & 64 deletions

File tree

apps/frontend/components/achievements/Category.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@
176176
>
177177
</button>
178178

179-
{#if category && userState.achievements.categories[category.id].totalPoints}
179+
{#if category && userState.achievements.categories[category.id]?.totalPoints}
180180
<div class="progress-bar new-group">
181181
<ProgressBar
182182
title="Points"

apps/frontend/components/achievements/CriteriaTree.svelte

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,21 @@
3939
description = criteriaTree.description;
4040
4141
if (achievement.isAccountWide) {
42-
const maxCharacter =
43-
criteriaCharacters?.[criteriaTree?.criteriaId || -1]?.[0]?.[1] || 0;
44-
have = maxCharacter > 0 && maxCharacter >= criteriaTree.amount;
42+
if (criteriaTree?.operator === CriteriaTreeOperator.Any) {
43+
let anyCount = 0;
44+
for (const childCriteriaTreeId of criteriaTree.children) {
45+
const childCriteriaTree =
46+
wowthingData.achievements.criteriaTreeById.get(childCriteriaTreeId);
47+
const childMaxCharacter =
48+
criteriaCharacters?.[childCriteriaTree?.criteriaId || -1]?.[0]?.[1] || 0;
49+
anyCount += childMaxCharacter;
50+
}
51+
have = anyCount >= criteriaTree.amount;
52+
} else {
53+
const maxCharacter =
54+
criteriaCharacters?.[criteriaTree?.criteriaId || -1]?.[0]?.[1] || 0;
55+
have = maxCharacter > 0 && maxCharacter >= criteriaTree.amount;
56+
}
4557
} else {
4658
let maybeCriteria: number[][];
4759
maybeCriteria = criteriaCharacters[criteria?.id] || [[0, 0]];

apps/frontend/components/achievements/get-account-data.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import type { UserQuestData } from '@/types/data';
1212
import { CriteriaTreeOperator } from '@/enums/wow';
1313
import { userState } from '@/user-home/state/user';
1414

15-
const debugId = 42315;
15+
const debugId = 13638;
1616

1717
export function getAccountData(
1818
achievementData: AchievementData,

apps/frontend/components/achievements/get-achievement-data.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import type {
1414
import type { UserQuestData } from '@/types/data';
1515
import type { AchievementStatus } from './types';
1616

17-
const debugId = 42315;
17+
const debugId = 13638;
1818

1919
export function getAchievementStatus(
2020
userAchievementData: UserAchievementData,

apps/frontend/data/achievements.ts

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ type ExtraAchievementCategory = {
8383
targetSlug: string;
8484

8585
achievementIds?: (number | number[])[];
86+
onlyAchievementIds?: boolean;
8687
overrideName?: string;
8788
overrideSlug?: string;
8889
}[];
@@ -356,7 +357,45 @@ export const extraCategories: ExtraAchievementCategory[] = [
356357
],
357358
},
358359
null,
359-
{ targetSlug: 'expansion-features/skyriding', nameType: 2 },
360+
{
361+
targetSlug: 'expansion-features/skyriding',
362+
nameType: 2,
363+
onlyAchievementIds: true,
364+
achievementIds: [
365+
// Meta
366+
19478,
367+
// Glyph Hunter
368+
16575, 16576, 16577, 16578, 17411,
369+
// Waking Shores
370+
15915, 15916, 15917, 15927, 15928, 15929, 17195, 17196, 17197,
371+
// Ohn'ahran Plains
372+
15918, 15919, 15920, 15930, 15931, 15932, 17198, 17199, 17200,
373+
// Azure Span
374+
15921, 15922, 15923, 15933, 15934, 15935, 17201, 17202, 17203,
375+
// Thaldraszus
376+
15924, 15925, 15926, 15936, 15937, 15938, 17204, 17205, 17206,
377+
// Completionist
378+
15939, 15940, 15941, 17330, 17331, 17332,
379+
// Forbidden Reach
380+
17279, 17280, 17281, 17284, 17286, 17287, 17288, 17289, 17290,
381+
// Forbidden Reach Completionist
382+
17294, 17296, 17298,
383+
// Zaralek Cavern
384+
17483, 17484, 17485, 17486, 17487, 17488, 17489, 17490, 17491,
385+
// Zaralek Cavern Completionist
386+
17492, 17493, 17494,
387+
// Zaralek Cavern Glyph Hunter
388+
18150,
389+
// Challenge
390+
18790, 18791, 18792,
391+
// Emerald Dream
392+
19109, 19110, 19111, 19112, 19113, 19114, 19115, 19116, 19117,
393+
// Emerald Dream Completionist
394+
19127, 19128, 19129,
395+
// Emerald Dream Glyph Hunter
396+
19306,
397+
],
398+
},
360399
{
361400
targetSlug: 'collections/dragon-isle-drake-cosmetics',
362401
nameType: 3,
@@ -401,6 +440,30 @@ export const extraCategories: ExtraAchievementCategory[] = [
401440
41597, // Glory of the Omega Raider
402441
],
403442
},
443+
null,
444+
{
445+
targetSlug: 'expansion-features/skyriding',
446+
nameType: 2,
447+
onlyAchievementIds: true,
448+
achievementIds: [
449+
// Glyph Hunter
450+
40702, 40166, 40703, 40704, 40705, 42727,
451+
// Isle of Dorn
452+
40316, 40317, 40318, 40139, 40320, 40321, 40322, 40323, 40324,
453+
// Ringing Deeps
454+
40325, 40326, 40327, 40328, 40329, 40330, 40331, 40332, 40333,
455+
// Hallowfall
456+
40334, 40335, 40336, 40337, 40338, 40339, 40340, 40341, 40342,
457+
// Azj-Kahet
458+
40343, 40344, 40345, 40346, 40347, 40348, 40349, 40350, 40351,
459+
// Khaz Algar Completionist
460+
40352, 40353, 40354,
461+
// Undermine Skyrocketing
462+
40936, 40937, 40938,
463+
// Undermine Breaknecking
464+
41081, 41083, 41084,
465+
],
466+
},
404467
],
405468
},
406469
{

apps/frontend/data/currencies.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ export const currencyExtra: Record<number, number[]> = {
193193
126411: [
194194
3310, // Coffer Key Shards
195195
3028, // Restored Coffer Key
196+
3356, // Untainted Mana-Crystals
196197
null,
197198
3378, // Dawnlight Manaflux
198199
3383, // Adventurer Dawncrest

apps/frontend/data/tasks/11-midnight/delves.ts

Lines changed: 44 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,42 @@ export const midDelves: Task = {
2020
questReset: DbResetType.Weekly,
2121
questIds: [93784],
2222
},
23+
{
24+
key: 'repAmani',
25+
name: 'Rep: {faction:2696}',
26+
minimumLevel: 90,
27+
accountWide: true,
28+
alwaysStarted: true,
29+
questReset: DbResetType.Weekly,
30+
questIds: [93819],
31+
},
32+
{
33+
key: 'repHarati',
34+
name: 'Rep: {faction:2704}',
35+
minimumLevel: 90,
36+
accountWide: true,
37+
alwaysStarted: true,
38+
questReset: DbResetType.Weekly,
39+
questIds: [93822],
40+
},
41+
{
42+
key: 'repSilvermoon',
43+
name: 'Rep: {faction:2710}',
44+
minimumLevel: 90,
45+
accountWide: true,
46+
alwaysStarted: true,
47+
questReset: DbResetType.Weekly,
48+
questIds: [93821],
49+
},
50+
{
51+
key: 'repSingularity',
52+
name: 'Rep: {faction:2699}',
53+
minimumLevel: 90,
54+
accountWide: true,
55+
alwaysStarted: true,
56+
questReset: DbResetType.Weekly,
57+
questIds: [93820],
58+
},
2359
null,
2460
{
2561
key: 'bounty',
@@ -31,19 +67,14 @@ export const midDelves: Task = {
3167
questReset: DbResetType.Weekly,
3268
questResetForced: true,
3369
questIds: [86371],
34-
// This seems wrong, I got no tracking quest for using the map or looting the box
35-
// subChores: [
36-
// {
37-
// key: 'get',
38-
// name: 'Get Bounty',
39-
// questIds: [86371],
40-
// },
41-
// {
42-
// key: 'use',
43-
// name: 'Use Bounty',
44-
// questIds: [92887],
45-
// },
46-
// ],
70+
},
71+
{
72+
key: 'nullaeus',
73+
name: 'Nullaeus Invasion',
74+
minimumLevel: 90,
75+
alwaysStarted: true,
76+
questIds: [92887],
77+
questReset: DbResetType.Weekly,
4778
},
4879
{
4980
key: 'gilded',
@@ -65,13 +96,5 @@ export const midDelves: Task = {
6596
},
6697
],
6798
},
68-
// {
69-
// key: 'nullaeus',
70-
// name: "Nullaeus Invasion",
71-
// minimumLevel: 90,
72-
// alwaysStarted: true,
73-
// questIds: [], // ??
74-
// questReset: DbResetType.Weekly,
75-
// },
7699
],
77100
};

apps/frontend/shared/stores/data/achievements/process.ts

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,15 @@ export function processAchievementsData(rawData: RawAchievements): DataAchieveme
110110
childSlug = childSlugOverride;
111111
}
112112

113+
const childAchievementIds = child.achievementIds || [];
114+
113115
category.children.push({
114-
id: childCat2.id,
116+
id: child.onlyAchievementIds ? categoryId++ : childCat2.id,
115117
name: childName,
116118
slug: childSlug,
117-
achievementIds: (child.achievementIds || []).concat(childCat2.achievementIds),
119+
achievementIds: child.onlyAchievementIds
120+
? childAchievementIds
121+
: childAchievementIds.concat(childCat2.achievementIds),
118122
children: [],
119123
});
120124
} else {
@@ -712,7 +716,7 @@ export function processAchievementsData(rawData: RawAchievements): DataAchieveme
712716
name: '[TWW] Worldsoul-Searching',
713717
slug: 'worldsoul-searching',
714718
achievementIds: [
715-
19458, // Worldsoul-Searching
719+
61451, // Worldsoul-Searching
716720

717721
40244, // Nerub-ar Palace
718722
41222, // Liberation of Undermine
@@ -754,10 +758,10 @@ export function processAchievementsData(rawData: RawAchievements): DataAchieveme
754758
41133, // You Xal Not Pass > Isle Remember You
755759

756760
40231, // The War Within Pathfinder
757-
20118, // The War Within Pathfinder > The Isle of Dorn
758-
19560, // The War Within Pathfinder > The Ringing Deeps
759-
20598, // The War Within Pathfinder > Hallowfall
760-
19559, // The War Within Pathfinder > Azj-Kahet
761+
// 20118, // The War Within Pathfinder > The Isle of Dorn
762+
// 19560, // The War Within Pathfinder > The Ringing Deeps
763+
// 20598, // The War Within Pathfinder > Hallowfall
764+
// 19559, // The War Within Pathfinder > Azj-Kahet
761765
40790, // The War Within Pathfinder > Khaz Algar Explorer
762766

763767
// Glory of the Delver
@@ -807,12 +811,19 @@ export function processAchievementsData(rawData: RawAchievements): DataAchieveme
807811

808812
for (const category of ret.categories.filter((cat) => cat?.id >= 100000)) {
809813
for (const maybeArray of category.achievementIds) {
810-
if (Array.isArray(maybeArray)) {
811-
for (const achievementId of maybeArray) {
812-
ret.achievementToCategory[achievementId] ||= category.id;
814+
const achievementIds = Array.isArray(maybeArray) ? maybeArray : [maybeArray];
815+
for (const achievementId of achievementIds) {
816+
(ret.achievementToCategoryIds[achievementId] ||= []).push(category.id);
817+
}
818+
}
819+
820+
const validChildren = (category.children || []).filter((cat) => cat?.id > 100_000);
821+
for (const child of validChildren) {
822+
for (const maybeArray of child.achievementIds) {
823+
const achievementIds = Array.isArray(maybeArray) ? maybeArray : [maybeArray];
824+
for (const achievementId of achievementIds) {
825+
(ret.achievementToCategoryIds[achievementId] ||= []).push(child.id);
813826
}
814-
} else {
815-
ret.achievementToCategory[maybeArray] ||= category.id;
816827
}
817828
}
818829
}

apps/frontend/shared/stores/data/achievements/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ export class DataAchievements {
2323
public criteriaTreeById = new Map<number, AchievementDataCriteriaTree>();
2424
public isHidden: Record<number, boolean> = {};
2525

26-
public achievementToCategory: Record<number, number> = {};
26+
public achievementToCategoryIds: Record<number, number[]> = {};
2727
}

apps/frontend/stores/lazy/achievements.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ class AchievementProcessor {
321321
}
322322
}
323323

324-
const debugId = 42315;
324+
const debugId = 13638;
325325

326326
export function getAccountData(
327327
achievementData: AchievementData,

0 commit comments

Comments
 (0)