61 lines
1.9 KiB
TypeScript
Raw Normal View History

2023-09-03 21:25:54 +04:00
import Items, { Category, Item, Warframe, Weapon } from "warframe-items";
type MinWeapon = Omit<Weapon, "patchlogs">;
type MinItem = Omit<Item, "patchlogs">;
export const weapons: MinWeapon[] = (new Items({ category: ["Primary", "Secondary", "Melee"] }) as Weapon[]).map(
item => {
const next = { ...item };
delete next.patchlogs;
return next;
}
);
export const items: MinItem[] = new Items({ category: ["All"] }).map(item => {
const next = { ...item };
delete next.patchlogs;
return next;
});
2023-09-03 21:25:54 +04:00
const getNamesObj = (category: Category) =>
2023-09-05 19:23:17 +04:00
new Items({ category: [category] }).reduce((acc, item) => {
acc[item.name!.replace("'S", "'s")] = item.uniqueName!;
2023-09-03 21:25:54 +04:00
return acc;
}, {} as ImportAssertions);
export const modNames = getNamesObj("Mods");
export const resourceNames = getNamesObj("Resources");
export const miscNames = getNamesObj("Misc");
export const relicNames = getNamesObj("Relics");
export const skinNames = getNamesObj("Skins");
export const arcaneNames = getNamesObj("Arcanes");
export const gearNames = getNamesObj("Gear");
export const craftNames: ImportAssertions = Object.fromEntries(
(
new Items({
category: [
"Warframes",
"Gear",
"Melee",
"Primary",
"Secondary",
"Sentinels",
"Misc",
"Arch-Gun",
"Arch-Melee"
]
}) as Warframe[]
)
2023-09-05 19:23:17 +04:00
.flatMap(item => item.components || [])
.filter(item => item.drops && item.drops[0])
.map(item => [item.drops![0].type, item.uniqueName])
2023-09-03 21:25:54 +04:00
);
2023-09-05 19:23:17 +04:00
craftNames["Forma Blueprint"] = "/Lotus/Types/Recipes/Components/FormaBlueprint";
2023-09-05 02:03:00 +04:00
export const blueprintNames: ImportAssertions = Object.fromEntries(
Object.keys(craftNames)
2023-09-05 19:23:17 +04:00
.filter(name => name.includes("Blueprint"))
.map(name => [name, craftNames[name]])
2023-09-05 02:03:00 +04:00
);