fix: show endless relic rewards in EOM screen #2813
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -54,6 +54,9 @@ export const crackRelic = async (
|
|||||||
(await handleStoreItemAcquisition(reward.type, inventory, reward.itemCount)).InventoryChanges
|
(await handleStoreItemAcquisition(reward.type, inventory, reward.itemCount)).InventoryChanges
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Client has picked its own reward (for lack of choice)
|
||||||
|
participant.ChosenRewardOwner = participant.AccountId;
|
||||||
|
|
||||||
return reward;
|
return reward;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -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 rewards 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
|
||||||
@ -1835,6 +1838,7 @@ inventorySchema.set("toJSON", {
|
|||||||
delete returnedObject._id;
|
delete returnedObject._id;
|
||||||
delete returnedObject.__v;
|
delete returnedObject.__v;
|
||||||
delete returnedObject.accountOwnerId;
|
delete returnedObject.accountOwnerId;
|
||||||
|
delete returnedObject.MissionRelicRewards;
|
||||||
|
|
||||||
const inventoryDatabase = returnedObject as Partial<IInventoryDatabase>;
|
const inventoryDatabase = returnedObject as Partial<IInventoryDatabase>;
|
||||||
const inventoryResponse = returnedObject as IInventoryClient;
|
const inventoryResponse = returnedObject as IInventoryClient;
|
||||||
|
|||||||
@ -1299,13 +1299,21 @@ 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 if (inventory.MissionRelicRewards) {
|
||||||
MissionRewards.push({ StoreItem: reward.type, ItemCount: reward.itemCount });
|
// endless fissure; already gave reward(s) but should still show in EOM screen
|
||||||
|
for (const reward of inventory.MissionRelicRewards) {
|
||||||
|
MissionRewards.push({
|
||||||
|
StoreItem: reward.ItemType,
|
||||||
|
ItemCount: reward.ItemCount
|
||||||
|
});
|
||||||
|
}
|
||||||
|
inventory.MissionRelicRewards = undefined;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strippedItems) {
|
if (strippedItems) {
|
||||||
|
|||||||
@ -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 {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user