From 25f19c196e7d568e37ffce4aad45d4be25769a17 Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Thu, 25 Sep 2025 19:14:07 +0200 Subject: [PATCH] fix: show endless relic rewards in EOM screen A bit unsure about multiple relics because we don't have enough info to tell the client anything but the last reward. --- src/helpers/relicHelper.ts | 6 ++++++ src/services/missionInventoryUpdateService.ts | 21 ++++++++++++------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/helpers/relicHelper.ts b/src/helpers/relicHelper.ts index 01d8b354..e7f614d9 100644 --- a/src/helpers/relicHelper.ts +++ b/src/helpers/relicHelper.ts @@ -60,6 +60,12 @@ export const crackRelic = async ( return reward; }; +export const getRelicRewardCount = (participant: IVoidTearParticipantInfo): number => { + const relic = ExportRelics[participant.VoidProjection]; + const rewards = ExportRewards[relic.rewardManifest][0]; + return rewards.find(x => x.type == participant.Reward)!.itemCount * (config.relicRewardItemCountMultiplier ?? 1); +}; + const refinementToWeights = { VPQ_BRONZE: { COMMON: 0.76, diff --git a/src/services/missionInventoryUpdateService.ts b/src/services/missionInventoryUpdateService.ts index 062c0f3e..2242b938 100644 --- a/src/services/missionInventoryUpdateService.ts +++ b/src/services/missionInventoryUpdateService.ts @@ -56,7 +56,7 @@ import type { TInventoryDatabaseDocument } from "../models/inventoryModels/inven import { getEntriesUnsafe } from "../utils/ts-utils.ts"; import { handleStoreItemAcquisition } from "./purchaseService.ts"; import type { IMissionCredits, IMissionReward } from "../types/missionTypes.ts"; -import { crackRelic } from "../helpers/relicHelper.ts"; +import { crackRelic, getRelicRewardCount } from "../helpers/relicHelper.ts"; import type { IMessageCreationTemplate } from "./inboxService.ts"; import { createMessage } from "./inboxService.ts"; import kuriaMessage50 from "../../static/fixed_responses/kuriaMessages/fiftyPercent.json" with { type: "json" }; @@ -1299,13 +1299,18 @@ export const addMissionRewards = async ( rngRewardCredits: inventoryChanges.RegularCredits ?? 0 }); - if ( - voidTearWave && - voidTearWave.Participants[0].QualifiesForReward && - !voidTearWave.Participants[0].HaveRewardResponse - ) { - const reward = await crackRelic(inventory, voidTearWave.Participants[0], inventoryChanges); - MissionRewards.push({ StoreItem: reward.type, ItemCount: reward.itemCount }); + if (voidTearWave && voidTearWave.Participants[0].QualifiesForReward) { + if (!voidTearWave.Participants[0].HaveRewardResponse) { + // non-endless fissure; giving reward now + const reward = await crackRelic(inventory, voidTearWave.Participants[0], inventoryChanges); + MissionRewards.push({ StoreItem: reward.type, ItemCount: reward.itemCount }); + } else { + // endless fissure; already gave reward but should still in EOM screen + MissionRewards.push({ + StoreItem: voidTearWave.Participants[0].Reward, + ItemCount: getRelicRewardCount(voidTearWave.Participants[0]) + }); + } } if (strippedItems) {