XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

SpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 1 Star 0
返回提交历史

XFEstudio/SpaceNinjaServer

fix: propagate relic reward's itemCount (#1030)

Preemptive fix for a visual bug after completing a non-endless fissure. Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1030

08f4137d
Sainan <sainan@calamity.inc>
提交于

代码差异

2 个文件 +6 -4
Modified src/helpers/relicHelper.ts +4 -2
@@ -1,7 +1,7 @@
1 1 import { TInventoryDatabaseDocument } from "@/src/models/inventoryModels/inventoryModel";
2 2 import { IVoidTearParticipantInfo } from "@/src/types/requestTypes";
3 3 import { ExportRelics, ExportRewards, TRarity } from "warframe-public-export-plus";
4 import { getRandomWeightedReward2 } from "@/src/services/rngService";
4 import { getRandomWeightedReward2, IRngResult } from "@/src/services/rngService";
5 5 import { logger } from "@/src/utils/logger";
6 6 import { addMiscItems } from "@/src/services/inventoryService";
7 7 import { handleStoreItemAcquisition } from "@/src/services/purchaseService";
@@ -9,7 +9,7 @@ import { handleStoreItemAcquisition } from "@/src/services/purchaseService";
9 9 export const crackRelic = async (
10 10 inventory: TInventoryDatabaseDocument,
11 11 participant: IVoidTearParticipantInfo
12 ): Promise<void> => {
12 ): Promise<IRngResult> => {
13 13 const relic = ExportRelics[participant.VoidProjection];
14 14 const weights = refinementToWeights[relic.quality];
15 15 logger.debug(`opening a relic of quality ${relic.quality}; rarity weights are`, weights);
@@ -30,6 +30,8 @@ export const crackRelic = async (
30 30
31 31 // Give reward
32 32 await handleStoreItemAcquisition(reward.type, inventory, reward.itemCount);
33
34 return reward;
33 35 };
34 36
35 37 const refinementToWeights = {
Modified src/services/missionInventoryUpdateService.ts +2 -2
@@ -320,8 +320,8 @@ export const addMissionRewards = async (
320 320 voidTearWave.Participants[0].QualifiesForReward &&
321 321 !voidTearWave.Participants[0].HaveRewardResponse
322 322 ) {
323 await crackRelic(inventory, voidTearWave.Participants[0]);
324 MissionRewards.push({ StoreItem: voidTearWave.Participants[0].Reward, ItemCount: 1 });
323 const reward = await crackRelic(inventory, voidTearWave.Participants[0]);
324 MissionRewards.push({ StoreItem: reward.type, ItemCount: reward.itemCount });
325 325 }
326 326
327 327 return { inventoryChanges, MissionRewards, credits };