poi-plugin-quest-info-2 0.12.0 → 0.12.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/CHANGELOG.md +12 -0
- package/build/kcQuestsData/DATA_VERSION +1 -1
- package/build/kcQuestsData/index.ts +1 -1
- package/build/kcQuestsData/quests-scn.json +2 -1
- package/build/prePostQuest.json +3 -1
- package/package.json +1 -1
- package/src/__tests__/kcwikiData.spec.ts +1 -1
- package/src/questHelper.ts +9 -0
- package/src/store/gameQuest.tsx +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
5f441167d25695fe9ba0b81e9cf3d3725cc01e2f
|
|
@@ -5077,7 +5077,8 @@
|
|
|
5077
5077
|
"memo2": "含有翔鹤、瑞鹤、胧、秋云的舰队分别出击 3-5,5-2,7-2P2,6-5 并取得 S 胜。",
|
|
5078
5078
|
"name": "「第五航空战队」、纵横无尽",
|
|
5079
5079
|
"pre": [
|
|
5080
|
-
"D21"
|
|
5080
|
+
"D21",
|
|
5081
|
+
"B15"
|
|
5081
5082
|
],
|
|
5082
5083
|
"rewards": "奖励:以下奖励三选一: 洋上补给 ×2 高速修复材 ×6 25mm 三连装机铳 ×2 以下奖励二选一: 試製東海 试制景云 (舰侦型)"
|
|
5083
5084
|
},
|
package/build/prePostQuest.json
CHANGED
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@ import newQuestData from '../../build/kcQuestsData/quests-scn-new.json'
|
|
|
4
4
|
describe('should version correct', () => {
|
|
5
5
|
test('should KcwikiQuestData Game data version correct', () => {
|
|
6
6
|
expect(version).toMatchInlineSnapshot(
|
|
7
|
-
`"
|
|
7
|
+
`"5f441167d25695fe9ba0b81e9cf3d3725cc01e2f"`,
|
|
8
8
|
)
|
|
9
9
|
})
|
|
10
10
|
|
package/src/questHelper.ts
CHANGED
|
@@ -356,6 +356,15 @@ export const getCompletedQuest = moize(
|
|
|
356
356
|
export const getLockedQuest = moize(
|
|
357
357
|
(inProgressQuest: number[]) => {
|
|
358
358
|
const lockedQuest = calcQuestMap(inProgressQuest, getPostQuestIds)
|
|
359
|
+
|
|
360
|
+
// Fix https://github.com/lawvs/poi-plugin-quest-2/issues/87
|
|
361
|
+
// Since we check the quest chain in getCompletedQuest, we need to remove the completed quest from lockedQuest
|
|
362
|
+
const completedQuest = getCompletedQuest(inProgressQuest)
|
|
363
|
+
Object.keys(lockedQuest).forEach((gameId) => {
|
|
364
|
+
if (completedQuest[+gameId]) {
|
|
365
|
+
delete lockedQuest[+gameId]
|
|
366
|
+
}
|
|
367
|
+
})
|
|
359
368
|
return lockedQuest
|
|
360
369
|
},
|
|
361
370
|
{
|
package/src/store/gameQuest.tsx
CHANGED
|
@@ -3,10 +3,10 @@ import React, { createContext, useContext } from 'react'
|
|
|
3
3
|
import { useGameQuest } from '../poi/hooks'
|
|
4
4
|
import { GameQuest } from '../poi/types'
|
|
5
5
|
import {
|
|
6
|
+
QUEST_STATUS,
|
|
6
7
|
getCompletedQuest,
|
|
7
8
|
getLockedQuest,
|
|
8
9
|
questApiStateToQuestStatus,
|
|
9
|
-
QUEST_STATUS,
|
|
10
10
|
} from '../questHelper'
|
|
11
11
|
|
|
12
12
|
export const GameQuestContext = createContext<{
|
|
@@ -47,12 +47,12 @@ const useQuestStatusQuery = (inProgressQuests: GameQuest[]) => {
|
|
|
47
47
|
return questApiStateToQuestStatus(theGameQuest.api_state)
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
if (gameId in lockedQuest) {
|
|
51
|
-
return QUEST_STATUS.LOCKED
|
|
52
|
-
}
|
|
53
50
|
if (gameId in alreadyCompletedQuest) {
|
|
54
51
|
return QUEST_STATUS.ALREADY_COMPLETED
|
|
55
52
|
}
|
|
53
|
+
if (gameId in lockedQuest) {
|
|
54
|
+
return QUEST_STATUS.LOCKED
|
|
55
|
+
}
|
|
56
56
|
return QUEST_STATUS.UNKNOWN
|
|
57
57
|
},
|
|
58
58
|
}
|