gotta show all relic rewards at EOM to be faithful
All checks were successful
Build / build (pull_request) Successful in 1m10s

This commit is contained in:
Sainan 2025-09-25 19:35:35 +02:00
parent 25f19c196e
commit 900bffb153
5 changed files with 19 additions and 14 deletions

View File

@ -11,7 +11,11 @@ export const getVoidProjectionRewardsController: RequestHandler = async (req, re
if (data.ParticipantInfo.QualifiesForReward && !data.ParticipantInfo.HaveRewardResponse) {
const inventory = await getInventory(accountId);
await crackRelic(inventory, data.ParticipantInfo);
const reward = await crackRelic(inventory, data.ParticipantInfo);
if (!inventory.MissionRelicRewards || inventory.MissionRelicRewards.length >= data.CurrentWave) {
inventory.MissionRelicRewards = [];
}
inventory.MissionRelicRewards.push({ ItemType: reward.type, ItemCount: reward.itemCount });
await inventory.save();
}

View File

@ -60,12 +60,6 @@ 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,

View File

@ -1467,6 +1467,9 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
SubscribedToEmailsPersonalized: { type: Number, default: 0 },
RewardSeed: BigInt,
// Temporary data so we can show all relic reward from an endless mission at EOM
MissionRelicRewards: { type: [typeCountSchema], default: undefined },
//Credit
RegularCredits: { type: Number, default: 0 },
//Platinum

View File

@ -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, getRelicRewardCount } from "../helpers/relicHelper.ts";
import { crackRelic } 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" };
@ -1304,13 +1304,16 @@ export const addMissionRewards = async (
// 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
} else if (inventory.MissionRelicRewards) {
// endless fissure; already gave reward(s) but should still in EOM screen
for (const reward of inventory.MissionRelicRewards) {
MissionRewards.push({
StoreItem: voidTearWave.Participants[0].Reward,
ItemCount: getRelicRewardCount(voidTearWave.Participants[0])
StoreItem: reward.ItemType,
ItemCount: reward.ItemCount
});
}
inventory.MissionRelicRewards = undefined;
}
}
if (strippedItems) {

View File

@ -141,6 +141,7 @@ export interface IInventoryDatabase
LastInventorySync?: Types.ObjectId;
EndlessXP?: IEndlessXpProgressDatabase[];
PersonalGoalProgress?: IGoalProgressDatabase[];
MissionRelicRewards?: ITypeCount[];
}
export interface IQuestKeyDatabase {