fix: give non-exalted additional items when acquiring warframe #1408
@ -506,12 +506,12 @@ export const addItem = async (
|
|||||||
}
|
}
|
||||||
case "EntratiMech": {
|
case "EntratiMech": {
|
||||||
return {
|
return {
|
||||||
...addMechSuit(
|
...(await addMechSuit(
|
||||||
inventory,
|
inventory,
|
||||||
typeName,
|
typeName,
|
||||||
{},
|
{},
|
||||||
premiumPurchase ? EquipmentFeatures.DOUBLE_CAPACITY : undefined
|
premiumPurchase ? EquipmentFeatures.DOUBLE_CAPACITY : undefined
|
||||||
),
|
)),
|
||||||
...occupySlot(inventory, InventorySlot.MECHSUITS, premiumPurchase)
|
...occupySlot(inventory, InventorySlot.MECHSUITS, premiumPurchase)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -731,16 +731,22 @@ export const addPowerSuit = async (
|
|||||||
return inventoryChanges;
|
return inventoryChanges;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const addMechSuit = (
|
export const addMechSuit = async (
|
||||||
inventory: TInventoryDatabaseDocument,
|
inventory: TInventoryDatabaseDocument,
|
||||||
mechsuitName: string,
|
mechsuitName: string,
|
||||||
inventoryChanges: IInventoryChanges = {},
|
inventoryChanges: IInventoryChanges = {},
|
||||||
features: number | undefined = undefined
|
features: number | undefined = undefined
|
||||||
): IInventoryChanges => {
|
): Promise<IInventoryChanges> => {
|
||||||
const powersuit = ExportWarframes[mechsuitName] as IPowersuit | undefined;
|
const powersuit = ExportWarframes[mechsuitName] as IPowersuit | undefined;
|
||||||
if (powersuit?.exalted) {
|
const exalted = powersuit?.exalted ?? [];
|
||||||
for (const specialItem of powersuit.exalted) {
|
for (const specialItem of exalted) {
|
||||||
addSpecialItem(inventory, specialItem, inventoryChanges);
|
addSpecialItem(inventory, specialItem, inventoryChanges);
|
||||||
|
}
|
||||||
|
if (powersuit?.additionalItems) {
|
||||||
|
for (const item of powersuit.additionalItems) {
|
||||||
|
if (exalted.indexOf(item) == -1) {
|
||||||
|
combineInventoryChanges(inventoryChanges, await addItem(inventory, item, 1));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const suitIndex =
|
const suitIndex =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user