feat: conquest research points #1796
@ -75,8 +75,6 @@ export const missionInventoryUpdateController: RequestHandler = async (req, res)
|
|||||||
const { MissionRewards, inventoryChanges, credits, AffiliationMods, SyndicateXPItemReward } =
|
const { MissionRewards, inventoryChanges, credits, AffiliationMods, SyndicateXPItemReward } =
|
||||||
await addMissionRewards(inventory, missionReport, firstCompletion);
|
await addMissionRewards(inventory, missionReport, firstCompletion);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//TODO: figure out when to send inventory. it is needed for many cases.
|
//TODO: figure out when to send inventory. it is needed for many cases.
|
||||||
const response: IMissionInventoryUpdateResponse = {
|
const response: IMissionInventoryUpdateResponse = {
|
||||||
InventoryChanges: inventoryChanges,
|
InventoryChanges: inventoryChanges,
|
||||||
@ -92,38 +90,34 @@ export const missionInventoryUpdateController: RequestHandler = async (req, res)
|
|||||||
response.ConquestCompletedMissionsCount =
|
response.ConquestCompletedMissionsCount =
|
||||||
missionReport.ConquestMissionsCompleted == 2 ? 0 : missionReport.ConquestMissionsCompleted + 1;
|
missionReport.ConquestMissionsCompleted == 2 ? 0 : missionReport.ConquestMissionsCompleted + 1;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let score = 1;
|
let score = 1;
|
||||||
if(missionReport.RewardInfo?.ConquestHardModeActive === 1)
|
if (missionReport.RewardInfo?.ConquestHardModeActive === 1) score += 3;
|
||||||
score += 3
|
|
||||||
|
|
||||||
if (missionReport.RewardInfo?.ConquestPersonalModifiersActive !== undefined)
|
if (missionReport.RewardInfo?.ConquestPersonalModifiersActive !== undefined)
|
||||||
Sainan marked this conversation as resolved
|
|||||||
score += missionReport.RewardInfo?.ConquestPersonalModifiersActive;
|
score += missionReport.RewardInfo?.ConquestPersonalModifiersActive;
|
||||||
if (missionReport.RewardInfo?.ConquestEquipmentSuggestionsFulfilled !== undefined)
|
if (missionReport.RewardInfo?.ConquestEquipmentSuggestionsFulfilled !== undefined)
|
||||||
score += missionReport.RewardInfo?.ConquestEquipmentSuggestionsFulfilled;
|
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;
|
score += 1;
|
||||||
|
|
||||||
const conquestType = missionReport.RewardInfo?.ConquestType;
|
const conquestType = missionReport.RewardInfo?.ConquestType;
|
||||||
const conquestNode = conquestType == "HexConquest" ? "EchoesHexConquestHardModeUnlocked" : "EntratiLabConquestHardModeUnlocked";
|
const conquestNode =
|
||||||
if(score >= 25 && inventory.NodeIntrosCompleted.find(x => x == conquestNode) === undefined)
|
conquestType == "HexConquest" ? "EchoesHexConquestHardModeUnlocked" : "EntratiLabConquestHardModeUnlocked";
|
||||||
|
if (score >= 25 && inventory.NodeIntrosCompleted.find(x => x == conquestNode) === undefined)
|
||||||
inventory.NodeIntrosCompleted.push(conquestNode);
|
inventory.NodeIntrosCompleted.push(conquestNode);
|
||||||
|
|
||||||
if(conquestType == "HexConquest")
|
if (conquestType == "HexConquest") {
|
||||||
{
|
|
||||||
inventory.EchoesHexConquestCacheScoreMission ??= 0;
|
inventory.EchoesHexConquestCacheScoreMission ??= 0;
|
||||||
|
|
||||||
if(score > inventory.EchoesHexConquestCacheScoreMission )
|
if (score > inventory.EchoesHexConquestCacheScoreMission)
|
||||||
inventory.EchoesHexConquestCacheScoreMission = score;
|
inventory.EchoesHexConquestCacheScoreMission = score;
|
||||||
}else
|
} else {
|
||||||
{
|
|
||||||
inventory.EntratiLabConquestCacheScoreMission ??= 0;
|
inventory.EntratiLabConquestCacheScoreMission ??= 0;
|
||||||
|
|
||||||
if(score > inventory.EntratiLabConquestCacheScoreMission )
|
if (score > inventory.EntratiLabConquestCacheScoreMission)
|
||||||
inventory.EntratiLabConquestCacheScoreMission = score;
|
inventory.EntratiLabConquestCacheScoreMission = score;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user
I'd add
satisfies IMissionInventoryUpdateResponse