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) { if (data.ParticipantInfo.QualifiesForReward && !data.ParticipantInfo.HaveRewardResponse) {
const inventory = await getInventory(accountId); 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(); await inventory.save();
} }

View File

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

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

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

View File

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