poi-plugin-quest-info-2 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/assets.ts +2 -1
- package/build/kcQuestsData/DATA_VERSION +1 -1
- package/build/kcQuestsData/index.ts +1 -1
- package/build/kcQuestsData/quests-scn.json +10 -10
- package/build/questCategory.json +600 -0
- package/i18n/en-US.json +2 -1
- package/i18n/ja-JP.json +1 -0
- package/i18n/zh-CN.json +1 -0
- package/i18n/zh-TW.json +1 -0
- package/package.json +3 -2
- package/scripts/convertAssets.ts +3 -2
- package/scripts/genQuestCategory.ts +58 -0
- package/src/__tests__/__snapshots__/questCategory.spec.ts.snap +582 -0
- package/src/__tests__/kcwikiData.spec.ts +1 -1
- package/src/__tests__/questCategory.spec.ts +37 -0
- package/src/questHelper.ts +23 -18
- package/src/store/quest.ts +3 -0
- package/src/tags.ts +2 -1
package/src/questHelper.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import questCategory from '../build/questCategory.json'
|
|
2
2
|
import { GameQuest, QUEST_API_STATE } from './poi/types'
|
|
3
3
|
|
|
4
4
|
type DocQuest = {
|
|
@@ -6,8 +6,17 @@ type DocQuest = {
|
|
|
6
6
|
name: string
|
|
7
7
|
desc: string
|
|
8
8
|
memo?: string
|
|
9
|
+
/**
|
|
10
|
+
* Only in kcanotify
|
|
11
|
+
*/
|
|
9
12
|
unlock?: number[]
|
|
13
|
+
/**
|
|
14
|
+
* Only in kcanotify
|
|
15
|
+
*/
|
|
10
16
|
tracking?: number[][]
|
|
17
|
+
/**
|
|
18
|
+
* Only in KcWiki
|
|
19
|
+
*/
|
|
11
20
|
pre?: string[]
|
|
12
21
|
}
|
|
13
22
|
|
|
@@ -17,31 +26,27 @@ export type UnionQuest = {
|
|
|
17
26
|
docQuest: DocQuest
|
|
18
27
|
}
|
|
19
28
|
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
export const weeklyQuest = questStartsFilter('(周任)')
|
|
27
|
-
export const monthlyQuest = questStartsFilter('(月任)')
|
|
28
|
-
export const quarterlyQuest = questStartsFilter('(季任)')
|
|
29
|
-
// (年任) (年任 / x 月)
|
|
30
|
-
export const yearlyQuest = questStartsFilter('(年任')
|
|
29
|
+
const dailyQuest = new Set(questCategory.dailyQuest)
|
|
30
|
+
const weeklyQuest = new Set(questCategory.weeklyQuest)
|
|
31
|
+
const monthlyQuest = new Set(questCategory.monthlyQuest)
|
|
32
|
+
const quarterlyQuest = new Set(questCategory.quarterlyQuest)
|
|
33
|
+
const yearlyQuest = new Set(questCategory.yearlyQuest)
|
|
34
|
+
const singleQuest = new Set(questCategory.singleQuest)
|
|
31
35
|
|
|
32
36
|
export const isInProgressQuest = (quest: UnionQuest) =>
|
|
33
37
|
quest.gameQuest?.api_state === QUEST_API_STATE.IN_PROGRESS ||
|
|
34
38
|
quest.gameQuest?.api_state === QUEST_API_STATE.COMPLETED
|
|
35
|
-
export const isDailyQuest = (quest: UnionQuest) =>
|
|
36
|
-
dailyQuest.includes(quest.gameId)
|
|
39
|
+
export const isDailyQuest = (quest: UnionQuest) => dailyQuest.has(quest.gameId)
|
|
37
40
|
export const isWeeklyQuest = (quest: UnionQuest) =>
|
|
38
|
-
weeklyQuest.
|
|
41
|
+
weeklyQuest.has(quest.gameId)
|
|
39
42
|
export const isMonthlyQuest = (quest: UnionQuest) =>
|
|
40
|
-
monthlyQuest.
|
|
43
|
+
monthlyQuest.has(quest.gameId)
|
|
41
44
|
export const isQuarterlyQuest = (quest: UnionQuest) =>
|
|
42
|
-
quarterlyQuest.
|
|
45
|
+
quarterlyQuest.has(quest.gameId)
|
|
43
46
|
export const isYearlyQuest = (quest: UnionQuest) =>
|
|
44
|
-
yearlyQuest.
|
|
47
|
+
yearlyQuest.has(quest.gameId)
|
|
48
|
+
export const isSingleQuest = (quest: UnionQuest) =>
|
|
49
|
+
singleQuest.has(quest.gameId)
|
|
45
50
|
|
|
46
51
|
export enum QUEST_CATEGORY {
|
|
47
52
|
Composition = '1',
|
package/src/store/quest.ts
CHANGED
package/src/tags.ts
CHANGED
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
isModernizationQuest,
|
|
15
15
|
isUnknownCategoryQuest,
|
|
16
16
|
isInProgressQuest,
|
|
17
|
+
isSingleQuest,
|
|
17
18
|
} from './questHelper'
|
|
18
19
|
import type { UnionQuest } from './questHelper'
|
|
19
20
|
|
|
@@ -51,7 +52,7 @@ export const TYPE_TAGS = [
|
|
|
51
52
|
{ name: 'Monthly', filter: isMonthlyQuest },
|
|
52
53
|
{ name: 'Quarterly', filter: isQuarterlyQuest },
|
|
53
54
|
{ name: 'Yearly', filter: isYearlyQuest },
|
|
54
|
-
|
|
55
|
+
{ name: 'One-time', filter: isSingleQuest },
|
|
55
56
|
] as const
|
|
56
57
|
|
|
57
58
|
// TODO tag In Progress / Lock / Completed
|