poi-plugin-quest-info-2 0.11.0 → 0.12.1
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 +16 -0
- package/build/kcQuestsData/DATA_VERSION +1 -1
- package/build/kcQuestsData/index.ts +1 -1
- package/build/kcQuestsData/quests-scn-new.json +5 -0
- package/build/kcQuestsData/quests-scn.json +54 -1
- package/build/prePostQuest.json +47 -3
- package/build/questCodeMap.json +5 -0
- package/package.json +1 -1
- package/src/__tests__/__snapshots__/questHelper.spec.ts.snap +4 -0
- package/src/__tests__/kcwikiData.spec.ts +1 -1
- package/src/__tests__/questHelper.spec.ts +9 -2
- package/src/questHelper.ts +100 -1
- package/src/store/gameQuest.tsx +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# poi-plugin-quest-info-2
|
|
2
2
|
|
|
3
|
+
## 0.12.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 8224a06: Fix locked quest status bug
|
|
8
|
+
|
|
9
|
+
## 0.12.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 7ba3993: Check the quest chain full completed
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- d80267b: Update quest data
|
|
18
|
+
|
|
3
19
|
## 0.11.0
|
|
4
20
|
|
|
5
21
|
### Minor Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
5f441167d25695fe9ba0b81e9cf3d3725cc01e2f
|
|
@@ -2503,6 +2503,16 @@
|
|
|
2503
2503
|
],
|
|
2504
2504
|
"rewards": "奖励:以下奖励三选一: 伊良湖 高速修复材 ×3 开发资材 ×3 以下奖励三选一: 「12.7cm 连装炮 C 型改二」 新型兵装资材 ×2 「强化型舰本式缶」×3"
|
|
2505
2505
|
},
|
|
2506
|
+
"370": {
|
|
2507
|
+
"code": "2311C2",
|
|
2508
|
+
"desc": "以包含「鹿岛」、「択捉」、「松轮」、「佐渡」、「福江」、「鹈来」、「岸波」、「早波」、「谷风」、「江风」、「山云」、「朝云」、「山汐丸」以及丁型海防舰中的至少 4 艘舰艇组成舰队,在本周内进行演习,取得 5 次【A 胜】以上!",
|
|
2509
|
+
"memo2": "每周任务 演习舰队中包括【鹿岛、択捉、松轮、佐渡、福江、鹈来、岸波、早波、谷风、江风、山云、朝云、山汐丸】以及丁型海防舰(第四、二十二、三〇号海防舰)中至少 4 艘,本周演习 A 胜以上 5 次。",
|
|
2510
|
+
"name": "【Xmas 限定】圣诞夜海上护卫队演习",
|
|
2511
|
+
"pre": [
|
|
2512
|
+
"B6"
|
|
2513
|
+
],
|
|
2514
|
+
"rewards": "奖励:以下奖励二选一: 伊良湖 ×1 开发资材 ×3 以下奖励二选一: 改修资材 ×2 高速修复材 ×3"
|
|
2515
|
+
},
|
|
2506
2516
|
"401": {
|
|
2507
2517
|
"code": "D1",
|
|
2508
2518
|
"desc": "舰队出发「远征」!",
|
|
@@ -5067,7 +5077,8 @@
|
|
|
5067
5077
|
"memo2": "含有翔鹤、瑞鹤、胧、秋云的舰队分别出击 3-5,5-2,7-2P2,6-5 并取得 S 胜。",
|
|
5068
5078
|
"name": "「第五航空战队」、纵横无尽",
|
|
5069
5079
|
"pre": [
|
|
5070
|
-
"D21"
|
|
5080
|
+
"D21",
|
|
5081
|
+
"B15"
|
|
5071
5082
|
],
|
|
5072
5083
|
"rewards": "奖励:以下奖励三选一: 洋上补给 ×2 高速修复材 ×6 25mm 三连装机铳 ×2 以下奖励二选一: 試製東海 试制景云 (舰侦型)"
|
|
5073
5084
|
},
|
|
@@ -5459,6 +5470,48 @@
|
|
|
5459
5470
|
],
|
|
5460
5471
|
"rewards": "奖励:以下奖励三选一: 特制家具职人 新型火炮兵装资材 ×2 改修资材 ×5 \n以下奖励三选一:' 61cm 四連装 (酸素) 魚雷後期型 新型兵装资材 ×4 战斗详报"
|
|
5461
5472
|
},
|
|
5473
|
+
"962": {
|
|
5474
|
+
"code": "2311B6",
|
|
5475
|
+
"desc": "【圣诞限定任务】以包含「夕云」、「早波」、「浜波」、「卷波」、「朧」、「漣」、「潮」、「曙」中至少 4 艘舰艇组成的舰队,在镇守府正面海域、炼油厂地带沿岸、南西群岛防卫线及镇守府近海进行反复出击!驱逐敌人!",
|
|
5476
|
+
"memo2": "舰队包含【夕云 / 早波 / 滨波 / 卷波 / 胧 / 涟 / 潮 / 曙】中的 4 艘,取得 1-1、1-3、1-4、1-5 各 S 胜 2 次。",
|
|
5477
|
+
"name": "【圣诞快乐】驱逐舰队,出击!",
|
|
5478
|
+
"pre": [
|
|
5479
|
+
"B2",
|
|
5480
|
+
"D1"
|
|
5481
|
+
],
|
|
5482
|
+
"rewards": "奖励:礼物箱 ×1 以下奖励三选一: 开发资材 ×10 改修资材 ×4 特制家具职人 ×1 "
|
|
5483
|
+
},
|
|
5484
|
+
"963": {
|
|
5485
|
+
"code": "2311B7",
|
|
5486
|
+
"desc": "【圣诞限定任务】以旗舰和僚舰为「大淀」「那珂」「酒匂」「矢矧改二 / 乙」「谢菲尔德」「德・鲁伊特」「哥特兰」的舰队,反复歼灭东部奥廖尔海和冲之岛海域的敌人!",
|
|
5487
|
+
"memo2": "在【大淀 / 那珂 / 酒匂 / 矢矧改二 (乙)/Sheffield/De Ruyter/Gotland】中任选 2 艘(并将其中之一设置为旗舰)。取得 2-3、2-4 各 S 胜 2 次。",
|
|
5488
|
+
"name": "【圣诞限定】圣夜的轻巡,拔锚!",
|
|
5489
|
+
"pre": [
|
|
5490
|
+
"2311B6"
|
|
5491
|
+
],
|
|
5492
|
+
"rewards": "奖励:以下奖励三选一: 「新型高温高压缶」★+2 新型火炮兵装资材 ×2 高速修复材 ×6 以下奖励三选一: 「15.2cm 连装炮改」★+4 「8cm 高角炮」★+8 勋章 ×1 "
|
|
5493
|
+
},
|
|
5494
|
+
"964": {
|
|
5495
|
+
"code": "2311B8",
|
|
5496
|
+
"desc": "以旗舰和僚舰为「神威」「瑞穗」「迅鲸」「长鲸」「明石」「塔斯特司令官」「内华达」「鹿岛」「宗谷」的舰队,在爪姆岛近海、马绍尔群岛近海和古阿诺环礁海域海域反复取得 S 胜利!",
|
|
5497
|
+
"memo2": "在【神威 / 瑞穂 / 速吸 / 迅鯨 / 長鯨 / 明石 / 朝日 / Commandant Teste/Nevada/ 鹿島 / 宗谷】中任选 2 艘(并将其中之一设置为旗舰)。取得 4-1、6-2、6-3 各 S 胜 2 次。",
|
|
5498
|
+
"name": "【圣诞扩张作战 I】圣诞特务舰,作战开始!",
|
|
5499
|
+
"pre": [
|
|
5500
|
+
"2311B7",
|
|
5501
|
+
"D18"
|
|
5502
|
+
],
|
|
5503
|
+
"rewards": "奖励:以下奖励三选一: 熟练搭乘员 ×2 「14cm 连装炮改二」 改修资材 ×6 以下奖励三选一: 新型火炮兵装资材 ×3 新型兵装资材 ×3 「Barracuda Mk.II」 "
|
|
5504
|
+
},
|
|
5505
|
+
"965": {
|
|
5506
|
+
"code": "2311B9",
|
|
5507
|
+
"desc": "以包含「厌战」「谢菲尔德」「休斯顿」「铃谷」「熊野」「衣笠」之中 3 艘以上的圣诞合同舰队,反复出击咖喱洋里兰卡岛海域、萨部岛近海海域和中部北海域孔雀岛近海!歼灭敌人!",
|
|
5508
|
+
"memo2": "舰队包括【Warspite/Sheffield/Houston/ 鈴谷 / 熊野 / 衣笠】中选择 3 艘,取得 4-5、5-3、6-4 各 S 胜 2 次。",
|
|
5509
|
+
"name": "【圣诞扩张作战 II】圣诞最终决战,发动!",
|
|
5510
|
+
"pre": [
|
|
5511
|
+
"2311B8"
|
|
5512
|
+
],
|
|
5513
|
+
"rewards": "奖励:以下奖励三选一: 「一式陆攻二二型甲」×2 「银河」 「Barracuda Mk.II」×2 以下奖励三选一: 新型航空兵装资材 ×3 勋章 ×2 Ne 式引擎 "
|
|
5514
|
+
},
|
|
5462
5515
|
"966": {
|
|
5463
5516
|
"code": "B175",
|
|
5464
5517
|
"desc": "击破南西诸岛近海,巴士海峡,东部奥廖尔海,槟榔屿深部的敌舰队!经由昭南本土航路于台湾停泊。准备「设营队」×1,在当地展开可用于空中掩护的南西海域「基地航空队」!",
|
package/build/prePostQuest.json
CHANGED
|
@@ -884,7 +884,8 @@
|
|
|
884
884
|
"post": [
|
|
885
885
|
"B4",
|
|
886
886
|
"E1",
|
|
887
|
-
"E2"
|
|
887
|
+
"E2",
|
|
888
|
+
"2311B6"
|
|
888
889
|
]
|
|
889
890
|
},
|
|
890
891
|
"204": {
|
|
@@ -921,6 +922,7 @@
|
|
|
921
922
|
"C15",
|
|
922
923
|
"Cs5",
|
|
923
924
|
"C32",
|
|
925
|
+
"2311C2",
|
|
924
926
|
"F73",
|
|
925
927
|
"B67",
|
|
926
928
|
"B82",
|
|
@@ -1128,7 +1130,8 @@
|
|
|
1128
1130
|
],
|
|
1129
1131
|
"post": [
|
|
1130
1132
|
"A78",
|
|
1131
|
-
"F80"
|
|
1133
|
+
"F80",
|
|
1134
|
+
"B143"
|
|
1132
1135
|
]
|
|
1133
1136
|
},
|
|
1134
1137
|
"226": {
|
|
@@ -2210,6 +2213,12 @@
|
|
|
2210
2213
|
"2307B1"
|
|
2211
2214
|
]
|
|
2212
2215
|
},
|
|
2216
|
+
"370": {
|
|
2217
|
+
"pre": [
|
|
2218
|
+
"B6"
|
|
2219
|
+
],
|
|
2220
|
+
"post": []
|
|
2221
|
+
},
|
|
2213
2222
|
"401": {
|
|
2214
2223
|
"pre": [
|
|
2215
2224
|
"A5"
|
|
@@ -2217,7 +2226,8 @@
|
|
|
2217
2226
|
"post": [
|
|
2218
2227
|
"Dd1",
|
|
2219
2228
|
"Dw1",
|
|
2220
|
-
"B107"
|
|
2229
|
+
"B107",
|
|
2230
|
+
"2311B6"
|
|
2221
2231
|
]
|
|
2222
2232
|
},
|
|
2223
2233
|
"402": {
|
|
@@ -2358,6 +2368,7 @@
|
|
|
2358
2368
|
],
|
|
2359
2369
|
"post": [
|
|
2360
2370
|
"Dm1",
|
|
2371
|
+
"2311B8",
|
|
2361
2372
|
"B186"
|
|
2362
2373
|
]
|
|
2363
2374
|
},
|
|
@@ -4235,6 +4246,7 @@
|
|
|
4235
4246
|
},
|
|
4236
4247
|
"913": {
|
|
4237
4248
|
"pre": [
|
|
4249
|
+
"B15",
|
|
4238
4250
|
"D21"
|
|
4239
4251
|
],
|
|
4240
4252
|
"post": []
|
|
@@ -4529,6 +4541,38 @@
|
|
|
4529
4541
|
"B184"
|
|
4530
4542
|
]
|
|
4531
4543
|
},
|
|
4544
|
+
"962": {
|
|
4545
|
+
"pre": [
|
|
4546
|
+
"B2",
|
|
4547
|
+
"D1"
|
|
4548
|
+
],
|
|
4549
|
+
"post": [
|
|
4550
|
+
"2311B7"
|
|
4551
|
+
]
|
|
4552
|
+
},
|
|
4553
|
+
"963": {
|
|
4554
|
+
"pre": [
|
|
4555
|
+
"2311B6"
|
|
4556
|
+
],
|
|
4557
|
+
"post": [
|
|
4558
|
+
"2311B8"
|
|
4559
|
+
]
|
|
4560
|
+
},
|
|
4561
|
+
"964": {
|
|
4562
|
+
"pre": [
|
|
4563
|
+
"D18",
|
|
4564
|
+
"2311B7"
|
|
4565
|
+
],
|
|
4566
|
+
"post": [
|
|
4567
|
+
"2311B9"
|
|
4568
|
+
]
|
|
4569
|
+
},
|
|
4570
|
+
"965": {
|
|
4571
|
+
"pre": [
|
|
4572
|
+
"2311B8"
|
|
4573
|
+
],
|
|
4574
|
+
"post": []
|
|
4575
|
+
},
|
|
4532
4576
|
"966": {
|
|
4533
4577
|
"pre": [
|
|
4534
4578
|
"B113",
|
package/build/questCodeMap.json
CHANGED
|
@@ -248,6 +248,7 @@
|
|
|
248
248
|
"C75": 365,
|
|
249
249
|
"C76": 366,
|
|
250
250
|
"Cy11": 368,
|
|
251
|
+
"2311C2": 370,
|
|
251
252
|
"D1": 401,
|
|
252
253
|
"Dd1": 402,
|
|
253
254
|
"Dd2": 403,
|
|
@@ -531,6 +532,10 @@
|
|
|
531
532
|
"B172": 957,
|
|
532
533
|
"B173": 958,
|
|
533
534
|
"B174": 961,
|
|
535
|
+
"2311B6": 962,
|
|
536
|
+
"2311B7": 963,
|
|
537
|
+
"2311B8": 964,
|
|
538
|
+
"2311B9": 965,
|
|
534
539
|
"B175": 966,
|
|
535
540
|
"B176": 967,
|
|
536
541
|
"B177": 968,
|
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
|
+
`"53b0db6d5a521bcf934878d07918e06b9fceaef1"`,
|
|
8
8
|
)
|
|
9
9
|
})
|
|
10
10
|
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
|
+
calcQuestMap,
|
|
2
3
|
getCompletedQuest,
|
|
3
4
|
getLockedQuest,
|
|
4
5
|
getPostQuestIds,
|
|
5
6
|
getPreQuestIds,
|
|
7
|
+
getQuestCodeByGameId,
|
|
6
8
|
} from '../questHelper'
|
|
7
9
|
|
|
8
10
|
describe('questHelper', () => {
|
|
11
|
+
test('should getQuestCodeByGameId correct', () => {
|
|
12
|
+
expect(getQuestCodeByGameId(0)).toEqual(null)
|
|
13
|
+
expect(getQuestCodeByGameId(101)).toEqual('A1')
|
|
14
|
+
})
|
|
15
|
+
|
|
9
16
|
test('should getPreQuestIds correct', () => {
|
|
10
17
|
expect(getPreQuestIds(101)).toEqual([])
|
|
11
18
|
expect(getPreQuestIds(102)).toEqual([101])
|
|
@@ -23,11 +30,11 @@ describe('questHelper', () => {
|
|
|
23
30
|
})
|
|
24
31
|
|
|
25
32
|
test('should getCompletedQuest quest match snapshot', () => {
|
|
26
|
-
expect(
|
|
33
|
+
expect(calcQuestMap([817], getPreQuestIds)).toMatchSnapshot()
|
|
27
34
|
})
|
|
28
35
|
|
|
29
36
|
test('should 236 getCompletedQuest correct', () => {
|
|
30
|
-
expect(
|
|
37
|
+
expect(calcQuestMap([236], getPreQuestIds)).toMatchSnapshot()
|
|
31
38
|
})
|
|
32
39
|
|
|
33
40
|
test('should 101 locked quests match snapshot', () => {
|
package/src/questHelper.ts
CHANGED
|
@@ -211,6 +211,24 @@ export const getQuestPrePost = (gameId: number) => {
|
|
|
211
211
|
return prePostQuest[String(gameId) as keyof typeof prePostQuest]
|
|
212
212
|
}
|
|
213
213
|
|
|
214
|
+
const getNoPostQuestIds = (): number[] => {
|
|
215
|
+
const noPostQuestIds = []
|
|
216
|
+
for (const [gameId, { post }] of Object.entries(prePostQuest)) {
|
|
217
|
+
if (!post.length) {
|
|
218
|
+
noPostQuestIds.push(+gameId)
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
return noPostQuestIds
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Get quest id by quest code
|
|
226
|
+
*
|
|
227
|
+
* @example
|
|
228
|
+
* ```ts
|
|
229
|
+
* getQuestIdByCode('A1') // 101
|
|
230
|
+
* ```
|
|
231
|
+
*/
|
|
214
232
|
export const getQuestIdByCode = (code: string) => {
|
|
215
233
|
if (code in questCodeMap) {
|
|
216
234
|
return questCodeMap[code as keyof typeof questCodeMap]
|
|
@@ -218,17 +236,62 @@ export const getQuestIdByCode = (code: string) => {
|
|
|
218
236
|
return null
|
|
219
237
|
}
|
|
220
238
|
|
|
239
|
+
export const getQuestCodeByGameId = (gameId: number) => {
|
|
240
|
+
const questCode = Object.entries(questCodeMap).find(([, id]) => id === gameId)
|
|
241
|
+
if (!questCode) {
|
|
242
|
+
return null
|
|
243
|
+
}
|
|
244
|
+
return questCode[0]
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Get pre quest ids by quest id
|
|
249
|
+
*
|
|
250
|
+
* @example
|
|
251
|
+
* ```ts
|
|
252
|
+
* // Quest id A2's pre quest id is A1
|
|
253
|
+
* getPreQuestIds(102) // [101]
|
|
254
|
+
* ```
|
|
255
|
+
*/
|
|
221
256
|
export const getPreQuestIds = (gameId: number): number[] =>
|
|
222
257
|
getQuestPrePost(gameId)
|
|
223
258
|
.pre.map((code) => getQuestIdByCode(code))
|
|
224
259
|
.filter(Boolean) as number[]
|
|
225
260
|
|
|
261
|
+
const getAllPreQuestIds = (gameId: number): number[] => {
|
|
262
|
+
const set = new Set<number>()
|
|
263
|
+
const queue = [gameId]
|
|
264
|
+
while (queue.length) {
|
|
265
|
+
const gameId = queue.shift()!
|
|
266
|
+
getPreQuestIds(gameId).forEach((preGameId) => {
|
|
267
|
+
if (set.has(preGameId)) {
|
|
268
|
+
return
|
|
269
|
+
}
|
|
270
|
+
set.add(preGameId)
|
|
271
|
+
queue.push(preGameId)
|
|
272
|
+
})
|
|
273
|
+
}
|
|
274
|
+
return Array.from(set)
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Get post quest ids by quest id
|
|
279
|
+
*
|
|
280
|
+
* @example
|
|
281
|
+
* ```ts
|
|
282
|
+
* // Quest id A1's post quest id is A2
|
|
283
|
+
* getPreQuestIds(101) // [102]
|
|
284
|
+
* ```
|
|
285
|
+
*/
|
|
226
286
|
export const getPostQuestIds = (gameId: number): number[] =>
|
|
227
287
|
getQuestPrePost(gameId)
|
|
228
288
|
.post.map((code) => getQuestIdByCode(code))
|
|
229
289
|
.filter(Boolean) as number[]
|
|
230
290
|
|
|
231
|
-
|
|
291
|
+
/**
|
|
292
|
+
* @internal Export for test
|
|
293
|
+
*/
|
|
294
|
+
export const calcQuestMap = (
|
|
232
295
|
inProgressQuests: number[],
|
|
233
296
|
next: (gameId: number) => number[],
|
|
234
297
|
) => {
|
|
@@ -251,6 +314,33 @@ const calcQuestMap = (
|
|
|
251
314
|
export const getCompletedQuest = moize(
|
|
252
315
|
(inProgressQuest: number[]) => {
|
|
253
316
|
const completedQuest = calcQuestMap(inProgressQuest, getPreQuestIds)
|
|
317
|
+
// Check if the quest chain had completed
|
|
318
|
+
// See https://github.com/lawvs/poi-plugin-quest-2/issues/83
|
|
319
|
+
const noPostQuestIds = getNoPostQuestIds()
|
|
320
|
+
noPostQuestIds.forEach((gameId) => {
|
|
321
|
+
if (inProgressQuest.includes(gameId) || completedQuest[gameId]) {
|
|
322
|
+
return
|
|
323
|
+
}
|
|
324
|
+
const preQuestIds = getAllPreQuestIds(gameId)
|
|
325
|
+
const hasInProgressPreQuest = preQuestIds.some((preGameId) =>
|
|
326
|
+
inProgressQuest.includes(preGameId),
|
|
327
|
+
)
|
|
328
|
+
if (hasInProgressPreQuest) {
|
|
329
|
+
// The quest chain is not completed
|
|
330
|
+
return
|
|
331
|
+
}
|
|
332
|
+
const hasCompletedPreQuest = preQuestIds.some(
|
|
333
|
+
(preGameId) => completedQuest[preGameId],
|
|
334
|
+
)
|
|
335
|
+
if (!hasCompletedPreQuest) {
|
|
336
|
+
// The quest chain is not unlocked
|
|
337
|
+
return
|
|
338
|
+
}
|
|
339
|
+
preQuestIds.forEach((preGameId) => {
|
|
340
|
+
completedQuest[preGameId] = true
|
|
341
|
+
})
|
|
342
|
+
completedQuest[gameId] = true
|
|
343
|
+
})
|
|
254
344
|
return completedQuest
|
|
255
345
|
},
|
|
256
346
|
{
|
|
@@ -266,6 +356,15 @@ export const getCompletedQuest = moize(
|
|
|
266
356
|
export const getLockedQuest = moize(
|
|
267
357
|
(inProgressQuest: number[]) => {
|
|
268
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
|
+
})
|
|
269
368
|
return lockedQuest
|
|
270
369
|
},
|
|
271
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
|
}
|