feat: conquest research points (#1796)
All checks were successful
Build / build (push) Successful in 43s
Build / build (pull_request) Successful in 1m32s

Reviewed-on: #1796
Co-authored-by: Jānis <janisslsm@noreply.localhost>
Co-committed-by: Jānis <janisslsm@noreply.localhost>
This commit is contained in:
Jānis 2025-04-22 15:23:28 -07:00 committed by Sainan
parent aaa985e1ae
commit 5da66a1b3b
3 changed files with 62 additions and 13 deletions

View File

@ -72,14 +72,19 @@ export const missionInventoryUpdateController: RequestHandler = async (req, res)
return; return;
} }
const { MissionRewards, inventoryChanges, credits, AffiliationMods, SyndicateXPItemReward } = const {
await addMissionRewards(inventory, missionReport, firstCompletion); MissionRewards,
inventoryChanges,
credits,
AffiliationMods,
SyndicateXPItemReward,
ConquestCompletedMissionsCount
} = await addMissionRewards(inventory, missionReport, firstCompletion);
await inventory.save(); await inventory.save();
const inventoryResponse = await getInventoryResponse(inventory, true); const inventoryResponse = await getInventoryResponse(inventory, true);
//TODO: figure out when to send inventory. it is needed for many cases. res.json({
const response: IMissionInventoryUpdateResponse = {
InventoryJson: JSON.stringify(inventoryResponse), InventoryJson: JSON.stringify(inventoryResponse),
InventoryChanges: inventoryChanges, InventoryChanges: inventoryChanges,
MissionRewards, MissionRewards,
@ -87,13 +92,9 @@ export const missionInventoryUpdateController: RequestHandler = async (req, res)
...inventoryUpdates, ...inventoryUpdates,
//FusionPoints: inventoryChanges?.FusionPoints, // This in combination with InventoryJson or InventoryChanges seems to just double the number of endo shown, so unsure when this is needed. //FusionPoints: inventoryChanges?.FusionPoints, // This in combination with InventoryJson or InventoryChanges seems to just double the number of endo shown, so unsure when this is needed.
SyndicateXPItemReward, SyndicateXPItemReward,
AffiliationMods AffiliationMods,
}; ConquestCompletedMissionsCount
if (missionReport.ConquestMissionsCompleted !== undefined) { } satisfies IMissionInventoryUpdateResponse);
response.ConquestCompletedMissionsCount =
missionReport.ConquestMissionsCompleted == 2 ? 0 : missionReport.ConquestMissionsCompleted + 1;
}
res.json(response);
}; };
/* /*

View File

@ -586,6 +586,7 @@ interface AddMissionRewardsReturnType {
credits?: IMissionCredits; credits?: IMissionCredits;
AffiliationMods?: IAffiliationMods[]; AffiliationMods?: IAffiliationMods[];
SyndicateXPItemReward?: number; SyndicateXPItemReward?: number;
ConquestCompletedMissionsCount?: number;
} }
//TODO: return type of partial missioninventoryupdate response //TODO: return type of partial missioninventoryupdate response
@ -620,6 +621,7 @@ export const addMissionRewards = async (
const inventoryChanges: IInventoryChanges = {}; const inventoryChanges: IInventoryChanges = {};
const AffiliationMods: IAffiliationMods[] = []; const AffiliationMods: IAffiliationMods[] = [];
let SyndicateXPItemReward; let SyndicateXPItemReward;
let ConquestCompletedMissionsCount;
let missionCompletionCredits = 0; let missionCompletionCredits = 0;
//inventory change is what the client has not rewarded itself, also the client needs to know the credit changes for display //inventory change is what the client has not rewarded itself, also the client needs to know the credit changes for display
@ -882,7 +884,48 @@ export const addMissionRewards = async (
} }
} }
return { inventoryChanges, MissionRewards, credits, AffiliationMods, SyndicateXPItemReward }; if (rewardInfo.ConquestCompleted !== undefined) {
let score = 1;
if (rewardInfo.ConquestHardModeActive === 1) score += 3;
if (rewardInfo.ConquestPersonalModifiersActive !== undefined)
score += rewardInfo.ConquestPersonalModifiersActive;
if (rewardInfo.ConquestEquipmentSuggestionsFulfilled !== undefined)
score += rewardInfo.ConquestEquipmentSuggestionsFulfilled;
score *= rewardInfo.ConquestCompleted + 1;
if (rewardInfo.ConquestCompleted == 2 && rewardInfo.ConquestHardModeActive === 1) score += 1;
const conquestType = rewardInfo.ConquestType;
const conquestNode =
conquestType == "HexConquest" ? "EchoesHexConquestHardModeUnlocked" : "EntratiLabConquestHardModeUnlocked";
if (score >= 25 && inventory.NodeIntrosCompleted.find(x => x == conquestNode) === undefined)
inventory.NodeIntrosCompleted.push(conquestNode);
if (conquestType == "HexConquest") {
inventory.EchoesHexConquestCacheScoreMission ??= 0;
if (score > inventory.EchoesHexConquestCacheScoreMission)
inventory.EchoesHexConquestCacheScoreMission = score;
} else {
inventory.EntratiLabConquestCacheScoreMission ??= 0;
if (score > inventory.EntratiLabConquestCacheScoreMission)
inventory.EntratiLabConquestCacheScoreMission = score;
}
ConquestCompletedMissionsCount = rewardInfo.ConquestCompleted == 2 ? 0 : rewardInfo.ConquestCompleted + 1;
}
return {
inventoryChanges,
MissionRewards,
credits,
AffiliationMods,
SyndicateXPItemReward,
ConquestCompletedMissionsCount
};
}; };
//creditBonus is not entirely accurate. //creditBonus is not entirely accurate.

View File

@ -151,7 +151,12 @@ export interface IRewardInfo {
PurgatoryRewardQualifications?: string; PurgatoryRewardQualifications?: string;
rewardSeed?: number | bigint; rewardSeed?: number | bigint;
periodicMissionTag?: string; periodicMissionTag?: string;
ConquestType?: string;
ConquestCompleted?: number;
ConquestEquipmentSuggestionsFulfilled?: number;
ConquestPersonalModifiersActive?: number;
ConquestStickersActive?: number;
ConquestHardModeActive?: number;
// for bounties, only EOM_AFK and node are given from above, plus: // for bounties, only EOM_AFK and node are given from above, plus:
JobTier?: number; JobTier?: number;
jobId?: string; jobId?: string;