handle fusion bundles picked up during mission
This commit is contained in:
parent
bd8b3881bb
commit
08c7a2cac0
@ -54,7 +54,19 @@ const combineRewardAndLootInventory = (
|
||||
const missionCredits = lootInventory.RegularCredits || 0;
|
||||
const creditsBonus = rewardInventory.RegularCredits || 0;
|
||||
const totalCredits = missionCredits + creditsBonus;
|
||||
const FusionPoints = (lootInventory.FusionPoints || 0) + (rewardInventory.FusionPoints || 0);
|
||||
let FusionPoints = rewardInventory.FusionPoints || 0;
|
||||
|
||||
// Discharge Endo picked up during the mission
|
||||
if (lootInventory.FusionBundles) {
|
||||
for (const fusionBundle of lootInventory.FusionBundles) {
|
||||
if (fusionBundle.ItemType in fusionBundles) {
|
||||
FusionPoints += fusionBundles[fusionBundle.ItemType] * fusionBundle.ItemCount;
|
||||
} else {
|
||||
logger.error(`unknown fusion bundle: ${fusionBundle.ItemType}`);
|
||||
}
|
||||
}
|
||||
lootInventory.FusionBundles = undefined;
|
||||
}
|
||||
|
||||
lootInventory.RegularCredits = totalCredits;
|
||||
lootInventory.FusionPoints = FusionPoints;
|
||||
@ -121,8 +133,9 @@ const creditBundles: Record<string, number> = {
|
||||
};
|
||||
|
||||
const fusionBundles: Record<string, number> = {
|
||||
"/Lotus/StoreItems/Upgrades/Mods/FusionBundles/UncommonFusionBundle": 50,
|
||||
"/Lotus/StoreItems/Upgrades/Mods/FusionBundles/RareFusionBundle": 80
|
||||
"/Lotus/Upgrades/Mods/FusionBundles/CommonFusionBundle": 15,
|
||||
"/Lotus/Upgrades/Mods/FusionBundles/UncommonFusionBundle": 50,
|
||||
"/Lotus/Upgrades/Mods/FusionBundles/RareFusionBundle": 80
|
||||
};
|
||||
|
||||
const formatRewardsToInventoryType = (
|
||||
@ -134,12 +147,12 @@ const formatRewardsToInventoryType = (
|
||||
if (reward.type in creditBundles) {
|
||||
InventoryChanges.RegularCredits ??= 0;
|
||||
InventoryChanges.RegularCredits += creditBundles[reward.type] * reward.itemCount;
|
||||
} else if (reward.type in fusionBundles) {
|
||||
InventoryChanges.FusionPoints ??= 0;
|
||||
InventoryChanges.FusionPoints += fusionBundles[reward.type] * reward.itemCount;
|
||||
} else {
|
||||
const type = reward.type.replace("/Lotus/StoreItems/", "/Lotus/");
|
||||
if (type in ExportUpgrades) {
|
||||
if (type in fusionBundles) {
|
||||
InventoryChanges.FusionPoints ??= 0;
|
||||
InventoryChanges.FusionPoints += fusionBundles[type] * reward.itemCount;
|
||||
} else if (type in ExportUpgrades) {
|
||||
addRewardResponse(InventoryChanges, MissionRewards, type, reward.itemCount, "RawUpgrades");
|
||||
} else if (type in ExportGear) {
|
||||
addRewardResponse(InventoryChanges, MissionRewards, type, reward.itemCount, "Consumables");
|
||||
|
@ -7,6 +7,7 @@ import {
|
||||
ICrewShipSalvagedWeaponSkin,
|
||||
IEvolutionProgress,
|
||||
IMiscItem,
|
||||
ITypeCount,
|
||||
IMission,
|
||||
IRawUpgrade,
|
||||
ISeasonChallenge
|
||||
@ -45,6 +46,7 @@ export interface IMissionInventoryUpdateRequest {
|
||||
Pistols?: IEquipmentClient[];
|
||||
Suits?: IEquipmentClient[];
|
||||
Melee?: IEquipmentClient[];
|
||||
FusionBundles?: ITypeCount[];
|
||||
RawUpgrades?: IRawUpgrade[];
|
||||
MiscItems?: IMiscItem[];
|
||||
Consumables?: IConsumable[];
|
||||
@ -52,9 +54,10 @@ export interface IMissionInventoryUpdateRequest {
|
||||
RegularCredits?: number;
|
||||
ChallengeProgress?: IChallengeProgress[];
|
||||
RewardInfo?: IMissionInventoryUpdateRequestRewardInfo;
|
||||
FusionPoints?: number;
|
||||
Missions?: IMission;
|
||||
EvolutionProgress?: IEvolutionProgress[];
|
||||
|
||||
FusionPoints?: number; // Not a part of the request, but we put it in this struct as an intermediate storage.
|
||||
}
|
||||
|
||||
export interface IMissionInventoryUpdateRequestRewardInfo {
|
||||
|
Loading…
x
Reference in New Issue
Block a user