XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFESpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 0 Star 0
返回提交历史

XFEstudio/XFESpaceNinjaServer

fix: give quest completion items from cheated completion too (#1376)

Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1376 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>

cfc15246
Sainan <63328889+Sainan@users.noreply.github.com>
提交于

代码差异

2 个文件 +30 -16
Modified src/services/inventoryService.ts +17 -0
@@ -1338,3 +1338,20 @@ const createCalendar = (): ICalendarProgress => {
1338 1338 }
1339 1339 };
1340 1340 };
1341
1342 export const setupKahlSyndicate = (inventory: TInventoryDatabaseDocument): void => {
1343 inventory.Affiliations.push({
1344 Title: 1,
1345 Standing: 1,
1346 WeeklyMissions: [
1347 {
1348 MissionIndex: 0,
1349 CompletedMission: false,
1350 JobManifest: "/Lotus/Syndicates/Kahl/KahlJobManifestVersionThree",
1351 WeekCount: 0,
1352 Challenges: []
1353 }
1354 ],
1355 Tag: "KahlSyndicate"
1356 });
1357 };
Modified src/services/questService.ts +13 -16
@@ -2,7 +2,7 @@ import { IKeyChainRequest } from "@/src/controllers/api/giveKeyChainTriggeredIte
2 2 import { isEmptyObject } from "@/src/helpers/general";
3 3 import { TInventoryDatabaseDocument } from "@/src/models/inventoryModels/inventoryModel";
4 4 import { createMessage } from "@/src/services/inboxService";
5 import { addItem, addItems, addKeyChainItems } from "@/src/services/inventoryService";
5 import { addItem, addItems, addKeyChainItems, setupKahlSyndicate } from "@/src/services/inventoryService";
6 6 import {
7 7 fromStoreItem,
8 8 getKeyChainMessage,
@@ -62,20 +62,7 @@ export const updateQuestKey = async (
62 62 inventory.ActiveQuest = "";
63 63
64 64 if (questKeyUpdate[0].ItemType == "/Lotus/Types/Keys/NewWarQuest/NewWarQuestKeyChain") {
65 inventory.Affiliations.push({
66 Title: 1,
67 Standing: 1,
68 WeeklyMissions: [
69 {
70 MissionIndex: 0,
71 CompletedMission: false,
72 JobManifest: "/Lotus/Syndicates/Kahl/KahlJobManifestVersionThree",
73 WeekCount: 0,
74 Challenges: []
75 }
76 ],
77 Tag: "KahlSyndicate"
78 });
65 setupKahlSyndicate(inventory as TInventoryDatabaseDocument);
79 66 }
80 67 }
81 68 return inventoryChanges;
@@ -211,8 +198,18 @@ export const completeQuest = async (inventory: TInventoryDatabaseDocument, quest
211 198 }
212 199 }
213 200 }
201
202 const questCompletionItems = getQuestCompletionItems(questKey);
203 logger.debug(`quest completion items`, questCompletionItems);
204 if (questCompletionItems) {
205 await addItems(inventory, questCompletionItems);
206 }
207
214 208 inventory.ActiveQuest = "";
215 //TODO: handle quest completion items
209
210 if (questKey == "/Lotus/Types/Keys/NewWarQuest/NewWarQuestKeyChain") {
211 setupKahlSyndicate(inventory);
212 }
216 213 };
217 214
218 215 export const giveKeyChainItem = async (