fix: give non-exalted additional items when acquiring warframe #1408

Merged
Sainan merged 2 commits from warframe-additionals into main 2025-03-31 09:18:26 -07:00
Showing only changes of commit f56c451827 - Show all commits

View File

@ -506,12 +506,12 @@ export const addItem = async (
}
case "EntratiMech": {
return {
...addMechSuit(
...(await addMechSuit(
inventory,
typeName,
{},
premiumPurchase ? EquipmentFeatures.DOUBLE_CAPACITY : undefined
),
)),
...occupySlot(inventory, InventorySlot.MECHSUITS, premiumPurchase)
};
}
@ -731,17 +731,23 @@ export const addPowerSuit = async (
return inventoryChanges;
};
export const addMechSuit = (
export const addMechSuit = async (
inventory: TInventoryDatabaseDocument,
mechsuitName: string,
inventoryChanges: IInventoryChanges = {},
features: number | undefined = undefined
): IInventoryChanges => {
): Promise<IInventoryChanges> => {
const powersuit = ExportWarframes[mechsuitName] as IPowersuit | undefined;
if (powersuit?.exalted) {
for (const specialItem of powersuit.exalted) {
const exalted = powersuit?.exalted ?? [];
for (const specialItem of exalted) {
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 =
inventory.MechSuits.push({