This commit is contained in:
		
							parent
							
								
									568b2913ba
								
							
						
					
					
						commit
						7e23810cad
					
				@ -75,8 +75,6 @@ export const missionInventoryUpdateController: RequestHandler = async (req, res)
 | 
			
		||||
    const { MissionRewards, inventoryChanges, credits, AffiliationMods, SyndicateXPItemReward } =
 | 
			
		||||
        await addMissionRewards(inventory, missionReport, firstCompletion);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    //TODO: figure out when to send inventory. it is needed for many cases.
 | 
			
		||||
    const response: IMissionInventoryUpdateResponse = {
 | 
			
		||||
        InventoryChanges: inventoryChanges,
 | 
			
		||||
@ -92,45 +90,41 @@ export const missionInventoryUpdateController: RequestHandler = async (req, res)
 | 
			
		||||
        response.ConquestCompletedMissionsCount =
 | 
			
		||||
            missionReport.ConquestMissionsCompleted == 2 ? 0 : missionReport.ConquestMissionsCompleted + 1;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        let score = 1;
 | 
			
		||||
        if(missionReport.RewardInfo?.ConquestHardModeActive === 1)
 | 
			
		||||
            score += 3
 | 
			
		||||
        if (missionReport.RewardInfo?.ConquestHardModeActive === 1) score += 3;
 | 
			
		||||
 | 
			
		||||
        if (missionReport.RewardInfo?.ConquestPersonalModifiersActive !== undefined)
 | 
			
		||||
            score += missionReport.RewardInfo?.ConquestPersonalModifiersActive;
 | 
			
		||||
        if (missionReport.RewardInfo?.ConquestEquipmentSuggestionsFulfilled !== undefined)
 | 
			
		||||
            score += missionReport.RewardInfo?.ConquestEquipmentSuggestionsFulfilled;
 | 
			
		||||
 | 
			
		||||
        score *= missionReport.ConquestMissionsCompleted + 1
 | 
			
		||||
        score *= missionReport.ConquestMissionsCompleted + 1;
 | 
			
		||||
 | 
			
		||||
        if(missionReport.ConquestMissionsCompleted == 2 && missionReport.RewardInfo?.ConquestHardModeActive === 1)
 | 
			
		||||
        if (missionReport.ConquestMissionsCompleted == 2 && missionReport.RewardInfo?.ConquestHardModeActive === 1)
 | 
			
		||||
            score += 1;
 | 
			
		||||
 | 
			
		||||
        const conquestType = missionReport.RewardInfo?.ConquestType;
 | 
			
		||||
        const conquestNode = conquestType == "HexConquest" ? "EchoesHexConquestHardModeUnlocked" : "EntratiLabConquestHardModeUnlocked";
 | 
			
		||||
        if(score >= 25 && inventory.NodeIntrosCompleted.find(x => x == conquestNode) === undefined)
 | 
			
		||||
        const conquestNode =
 | 
			
		||||
            conquestType == "HexConquest" ? "EchoesHexConquestHardModeUnlocked" : "EntratiLabConquestHardModeUnlocked";
 | 
			
		||||
        if (score >= 25 && inventory.NodeIntrosCompleted.find(x => x == conquestNode) === undefined)
 | 
			
		||||
            inventory.NodeIntrosCompleted.push(conquestNode);
 | 
			
		||||
        
 | 
			
		||||
        if(conquestType == "HexConquest")
 | 
			
		||||
        {
 | 
			
		||||
 | 
			
		||||
        if (conquestType == "HexConquest") {
 | 
			
		||||
            inventory.EchoesHexConquestCacheScoreMission ??= 0;
 | 
			
		||||
 | 
			
		||||
            if(score > inventory.EchoesHexConquestCacheScoreMission )
 | 
			
		||||
            if (score > inventory.EchoesHexConquestCacheScoreMission)
 | 
			
		||||
                inventory.EchoesHexConquestCacheScoreMission = score;
 | 
			
		||||
        }else
 | 
			
		||||
        {
 | 
			
		||||
        } else {
 | 
			
		||||
            inventory.EntratiLabConquestCacheScoreMission ??= 0;
 | 
			
		||||
    
 | 
			
		||||
            if(score > inventory.EntratiLabConquestCacheScoreMission )
 | 
			
		||||
 | 
			
		||||
            if (score > inventory.EntratiLabConquestCacheScoreMission)
 | 
			
		||||
                inventory.EntratiLabConquestCacheScoreMission = score;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    await inventory.save();
 | 
			
		||||
    const inventoryResponse = await getInventoryResponse(inventory, true);
 | 
			
		||||
    response.InventoryJson =  JSON.stringify(inventoryResponse);
 | 
			
		||||
    response.InventoryJson = JSON.stringify(inventoryResponse);
 | 
			
		||||
    res.json(response);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user