fix: show endless relic rewards in EOM screen
All checks were successful
Build / build (pull_request) Successful in 1m11s
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:
parent
ef0062ce9f
commit
25f19c196e
@ -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,
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user