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: show multiplied relic reward amount on eom screen (#2437)

Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/2437 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>

7aa1b123
Sainan <63328889+Sainan@users.noreply.github.com>
提交于

代码差异

1 个文件 +8 -8
Modified src/helpers/relicHelper.ts +8 -8
@@ -23,10 +23,16 @@ export const crackRelic = async (
23 23 weights = { COMMON: 0, UNCOMMON: 0, RARE: 1, LEGENDARY: 0 };
24 24 }
25 25 logger.debug(`opening a relic of quality ${relic.quality}; rarity weights are`, weights);
26 const reward = getRandomWeightedReward(
26 let reward = getRandomWeightedReward(
27 27 ExportRewards[relic.rewardManifest][0] as { type: string; itemCount: number; rarity: TRarity }[], // rarity is nullable in PE+ typings, but always present for relics
28 28 weights
29 29 )!;
30 if (config.relicRewardItemCountMultiplier !== undefined && (config.relicRewardItemCountMultiplier ?? 1) != 1) {
31 reward = {
32 ...reward,
33 itemCount: reward.itemCount * config.relicRewardItemCountMultiplier
34 };
35 }
30 36 logger.debug(`relic rolled`, reward);
31 37 participant.Reward = reward.type;
32 38
@@ -43,13 +49,7 @@ export const crackRelic = async (
43 49 // Give reward
44 50 combineInventoryChanges(
45 51 inventoryChanges,
46 (
47 await handleStoreItemAcquisition(
48 reward.type,
49 inventory,
50 reward.itemCount * (config.relicRewardItemCountMultiplier ?? 1)
51 )
52 ).InventoryChanges
52 (await handleStoreItemAcquisition(reward.type, inventory, reward.itemCount)).InventoryChanges
53 53 );
54 54
55 55 return reward;