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

SpaceNinjaServer

A simple server for a small space ninja game

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

XFEstudio/SpaceNinjaServer

feat: somatic bearers memorial email (#3818)

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

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

代码差异

2 个文件 +40 -0
Modified src/controllers/api/inventoryController.ts +2 -0
@@ -28,6 +28,7 @@ import {
28 28 createLibraryDailyTask,
29 29 ensureUserHasFounderHonoria,
30 30 getCalendarProgress,
31 handleTauMemories,
31 32 PRE_U40_MAX_KUBROW_EGGS
32 33 } from "../../services/inventoryService.ts";
33 34 import { logger } from "../../utils/logger.ts";
@@ -328,6 +329,7 @@ export const inventoryController: RequestHandler = async (request, response) =>
328 329 if (inventory.QuestKeys.some(x => x.ItemType.endsWith("KubrowQuestKeyChain") && x.Completed)) {
329 330 inventory.KubrowPets.forEach(item => item.Details && (item.Details.HasCollar = true));
330 331 }
332 await handleTauMemories(inventory);
331 333 await inventory.save();
332 334
333 335 response.json(
Modified src/services/inventoryService.ts +38 -0
@@ -3064,3 +3064,41 @@ export const ensureUserHasFounderHonoria = async (inventory: TInventoryDatabaseD
3064 3064 ]);
3065 3065 }
3066 3066 };
3067
3068 export const handleTauMemories = async (inventory: TInventoryDatabaseDocument): Promise<void> => {
3069 const oldPeace = inventory.QuestKeys.find(
3070 x => x.ItemType == "/Lotus/Types/Keys/TauPrequel/TauPrequelQuestKeyChain"
3071 );
3072 if (oldPeace?.Completed) {
3073 oldPeace.CustomData ||= `{"ChosenMemories":{"TauPrequelStage11_PoolA":{"Name":"cat0","Choice":1},"TauPrequelStage13_PoolA":{"Name":"cat1","Choice":1},"TauPrequelStage14_PoolA":{"Name":"cat2","Choice":1}}}`;
3074 const customData = JSON.parse(oldPeace.CustomData) as {
3075 ChosenMemories: { InboxMessageSent?: boolean } & Record<string, { Name: string; Choice: number }>;
3076 };
3077 if (!customData.ChosenMemories.InboxMessageSent) {
3078 customData.ChosenMemories.InboxMessageSent = true;
3079 oldPeace.CustomData = JSON.stringify(customData);
3080 const playerNames = [];
3081 for (const memory of Object.values(customData.ChosenMemories)) {
3082 if (typeof memory == "object") {
3083 playerNames.push(memory.Name);
3084 }
3085 }
3086 await createMessage(inventory.accountOwnerId, [
3087 {
3088 sndr: "/Lotus/Language/Menu/Mailbox_WarframeSender_PostWar",
3089 msg: "/Lotus/Language/TauPrequel/TauPrequelFinal/PostQuestSomaticBearersInboxBody",
3090 arg: [
3091 {
3092 Key: "PLAYER_NAMES",
3093 Tag: playerNames.join(",")
3094 }
3095 ],
3096 att: ["/Lotus/Types/Items/ShipDecos/Tau/LisetPropSomaticBearerFlowerPostQuestItem"],
3097 sub: "/Lotus/Language/TauPrequel/TauPrequelFinal/PostQuestSomaticBearersInboxTitle",
3098 icon: "/Lotus/Interface/Icons/Npcs/Lotus_d.png",
3099 highPriority: true
3100 }
3101 ]);
3102 }
3103 }
3104 };