fix: show endless relic rewards in EOM screen
All checks were successful
Build / build (pull_request) Successful in 1m11s

A bit unsure about multiple relics because we don't have enough info to tell the client anything but the last reward.
This commit is contained in:
Sainan 2025-09-25 19:14:07 +02:00
parent ef0062ce9f
commit 25f19c196e
2 changed files with 19 additions and 8 deletions

View File

@ -60,6 +60,12 @@ export const crackRelic = async (
return reward; 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 = { const refinementToWeights = {
VPQ_BRONZE: { VPQ_BRONZE: {
COMMON: 0.76, COMMON: 0.76,

View File

@ -56,7 +56,7 @@ import type { TInventoryDatabaseDocument } from "../models/inventoryModels/inven
import { getEntriesUnsafe } from "../utils/ts-utils.ts"; import { getEntriesUnsafe } from "../utils/ts-utils.ts";
import { handleStoreItemAcquisition } from "./purchaseService.ts"; import { handleStoreItemAcquisition } from "./purchaseService.ts";
import type { IMissionCredits, IMissionReward } from "../types/missionTypes.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 type { IMessageCreationTemplate } from "./inboxService.ts";
import { createMessage } from "./inboxService.ts"; import { createMessage } from "./inboxService.ts";
import kuriaMessage50 from "../../static/fixed_responses/kuriaMessages/fiftyPercent.json" with { type: "json" }; import kuriaMessage50 from "../../static/fixed_responses/kuriaMessages/fiftyPercent.json" with { type: "json" };
@ -1299,13 +1299,18 @@ export const addMissionRewards = async (
rngRewardCredits: inventoryChanges.RegularCredits ?? 0 rngRewardCredits: inventoryChanges.RegularCredits ?? 0
}); });
if ( if (voidTearWave && voidTearWave.Participants[0].QualifiesForReward) {
voidTearWave && if (!voidTearWave.Participants[0].HaveRewardResponse) {
voidTearWave.Participants[0].QualifiesForReward && // non-endless fissure; giving reward now
!voidTearWave.Participants[0].HaveRewardResponse const reward = await crackRelic(inventory, voidTearWave.Participants[0], inventoryChanges);
) { MissionRewards.push({ StoreItem: reward.type, ItemCount: reward.itemCount });
const reward = await crackRelic(inventory, voidTearWave.Participants[0], inventoryChanges); } else {
MissionRewards.push({ StoreItem: reward.type, ItemCount: reward.itemCount }); // 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) { if (strippedItems) {