forked from OpenWF/SpaceNinjaServer
		
	fix: show multiplied relic reward amount on eom screen (#2437)
Reviewed-on: OpenWF/SpaceNinjaServer#2437 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
This commit is contained in:
		
							parent
							
								
									b410f6b554
								
							
						
					
					
						commit
						7aa1b12306
					
				@ -23,10 +23,16 @@ export const crackRelic = async (
 | 
				
			|||||||
        weights = { COMMON: 0, UNCOMMON: 0, RARE: 1, LEGENDARY: 0 };
 | 
					        weights = { COMMON: 0, UNCOMMON: 0, RARE: 1, LEGENDARY: 0 };
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    logger.debug(`opening a relic of quality ${relic.quality}; rarity weights are`, weights);
 | 
					    logger.debug(`opening a relic of quality ${relic.quality}; rarity weights are`, weights);
 | 
				
			||||||
    const reward = getRandomWeightedReward(
 | 
					    let reward = getRandomWeightedReward(
 | 
				
			||||||
        ExportRewards[relic.rewardManifest][0] as { type: string; itemCount: number; rarity: TRarity }[], // rarity is nullable in PE+ typings, but always present for relics
 | 
					        ExportRewards[relic.rewardManifest][0] as { type: string; itemCount: number; rarity: TRarity }[], // rarity is nullable in PE+ typings, but always present for relics
 | 
				
			||||||
        weights
 | 
					        weights
 | 
				
			||||||
    )!;
 | 
					    )!;
 | 
				
			||||||
 | 
					    if (config.relicRewardItemCountMultiplier !== undefined && (config.relicRewardItemCountMultiplier ?? 1) != 1) {
 | 
				
			||||||
 | 
					        reward = {
 | 
				
			||||||
 | 
					            ...reward,
 | 
				
			||||||
 | 
					            itemCount: reward.itemCount * config.relicRewardItemCountMultiplier
 | 
				
			||||||
 | 
					        };
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    logger.debug(`relic rolled`, reward);
 | 
					    logger.debug(`relic rolled`, reward);
 | 
				
			||||||
    participant.Reward = reward.type;
 | 
					    participant.Reward = reward.type;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -43,13 +49,7 @@ export const crackRelic = async (
 | 
				
			|||||||
    // Give reward
 | 
					    // Give reward
 | 
				
			||||||
    combineInventoryChanges(
 | 
					    combineInventoryChanges(
 | 
				
			||||||
        inventoryChanges,
 | 
					        inventoryChanges,
 | 
				
			||||||
        (
 | 
					        (await handleStoreItemAcquisition(reward.type, inventory, reward.itemCount)).InventoryChanges
 | 
				
			||||||
            await handleStoreItemAcquisition(
 | 
					 | 
				
			||||||
                reward.type,
 | 
					 | 
				
			||||||
                inventory,
 | 
					 | 
				
			||||||
                reward.itemCount * (config.relicRewardItemCountMultiplier ?? 1)
 | 
					 | 
				
			||||||
            )
 | 
					 | 
				
			||||||
        ).InventoryChanges
 | 
					 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return reward;
 | 
					    return reward;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user