From df6058abbd17dc7e5b78f2844368163c715235ed Mon Sep 17 00:00:00 2001 From: Rob Jones Date: Sat, 18 May 2024 13:06:05 -0600 Subject: [PATCH] add nadir, cassoid, field-forged, fotc, and tex-mechanica --- output/extended-foundry.json | 138 +++++++++++++++++++++++++++++++ src/generate-extended-foundry.ts | 42 ++++++++-- 2 files changed, 173 insertions(+), 7 deletions(-) diff --git a/output/extended-foundry.json b/output/extended-foundry.json index 22161abe..b77518a1 100644 --- a/output/extended-foundry.json +++ b/output/extended-foundry.json @@ -1,83 +1,218 @@ { "2307365": "suros", + "4425887": "fotc", "20025671": "suros", "62937067": "suros", + "105164264": "nadir", + "137879537": "fotc", + "153979396": "fotc", + "153979397": "fotc", + "153979399": "fotc", "161675590": "veist", + "177568179": "nadir", + "191996029": "fotc", + "192784503": "cassoid", + "195440257": "fotc", "205225492": "omolon", "221737434": "suros", + "253196586": "fotc", + "276918162": "fotc", "294129361": "hakke", + "339163900": "fotc", + "358788212": "cassoid", + "408440598": "fotc", "411397829": "suros", + "413901114": "nadir", + "417474225": "cassoid", "487361141": "suros", "491078457": "omolon", "495940989": "suros", + "496556698": "cassoid", "540880995": "veist", + "542573208": "tex-mechanica", "555148853": "omolon", "566740455": "suros", + "580961571": "fotc", "614140575": "hakke", "632597698": "hakke", "655712834": "hakke", "681067419": "omolon", + "705774642": "cassoid", "711889599": "veist", + "717150101": "cassoid", "772231794": "omolon", + "781498181": "nadir", + "792755504": "fotc", + "806021398": "fotc", + "807192446": "fotc", + "819358961": "fotc", "825554997": "suros", + "834081972": "fotc", "852228780": "omolon", + "888872889": "cassoid", + "930590127": "fotc", + "990416096": "fotc", "1028124540": "suros", + "1048266744": "fotc", "1050806815": "veist", + "1099433612": "fotc", + "1120843239": "fotc", "1136510727": "omolon", + "1137768695": "fotc", "1144014195": "veist", + "1161276682": "fotc", + "1161561386": "nadir", "1172884782": "hakke", "1177293325": "omolon", "1177293326": "omolon", "1177293327": "omolon", + "1189790632": "fotc", + "1200414607": "fotc", + "1281822856": "fotc", "1289324202": "hakke", + "1292594730": "cassoid", + "1296429091": "nadir", + "1325579289": "fotc", + "1377069894": "tex-mechanica", "1386601612": "suros", "1389546626": "omolon", + "1393021134": "cassoid", + "1393021135": "cassoid", + "1401300690": "cassoid", + "1443049976": "cassoid", "1453235079": "omolon", + "1457979868": "field-forged", + "1489452902": "fotc", + "1529450902": "cassoid", + "1531295694": "cassoid", "1547760589": "hakke", "1574601402": "veist", + "1612781792": "nadir", "1619016919": "suros", + "1644162710": "fotc", + "1650442173": "cassoid", + "1650626966": "cassoid", + "1669771782": "cassoid", + "1674742470": "fotc", + "1678957657": "cassoid", + "1719687748": "cassoid", + "1723380073": "fotc", "1757129747": "hakke", + "1760543913": "cassoid", + "1773600468": "fotc", "1775804198": "suros", "1788603939": "hakke", + "1820994983": "cassoid", "1821724780": "suros", "1854753404": "omolon", "1891996599": "omolon", + "1948035256": "cassoid", + "1960218487": "fotc", + "1974641289": "nadir", + "1975125963": "cassoid", + "1988218406": "cassoid", + "1999754402": "nadir", "2009106091": "veist", + "2014642399": "fotc", + "2059255495": "cassoid", "2065081837": "omolon", + "2168486467": "fotc", + "2171006181": "fotc", "2177857341": "hakke", "2185327324": "suros", "2204176450": "hakke", + "2213848860": "cassoid", + "2213848863": "cassoid", + "2257180473": "cassoid", + "2278995296": "fotc", "2287240026": "veist", + "2290863050": "fotc", + "2351747819": "cassoid", "2422664927": "hakke", "2450917538": "omolon", + "2478247171": "cassoid", "2488587246": "suros", + "2502422774": "cassoid", + "2510526114": "nadir", + "2581162758": "fotc", + "2605790033": "cassoid", "2605790034": "omolon", + "2611861926": "fotc", + "2621637518": "fotc", "2653171212": "suros", "2658740569": "hakke", + "2660862359": "fotc", + "2693941407": "cassoid", "2694044461": "omolon", "2728851518": "omolon", + "2742838700": "fotc", "2759590322": "suros", + "2763843899": "fotc", + "2767393525": "cassoid", + "2812672356": "fotc", "2817798849": "suros", "2824241403": "hakke", + "2860172150": "cassoid", "2883684343": "omolon", "2888266564": "omolon", + "2891672170": "cassoid", + "2957542878": "fotc", + "2961807684": "fotc", + "3005879472": "fotc", "3007479950": "omolon", + "3040742682": "fotc", "3098328572": "veist", + "3099084679": "fotc", + "3110698812": "tex-mechanica", "3163061743": "veist", "3165143747": "veist", "3183283212": "omolon", + "3185293912": "cassoid", + "3190698551": "fotc", + "3246523831": "cassoid", + "3337727085": "cassoid", + "3356526253": "fotc", + "3361694400": "cassoid", "3361694403": "omolon", "3371413057": "veist", + "3383958219": "fotc", + "3409645497": "cassoid", + "3435238842": "cassoid", + "3435238843": "cassoid", + "3441197112": "cassoid", + "3441197113": "cassoid", + "3445437901": "fotc", "3461377698": "hakke", + "3493948734": "fotc", "3505958430": "suros", + "3529780349": "fotc", "3559361670": "hakke", "3573686365": "omolon", + "3582424018": "fotc", + "3583275737": "cassoid", + "3637669759": "nadir", + "3662200188": "cassoid", + "3662200189": "cassoid", "3751622019": "suros", + "3757612024": "fotc", + "3826803617": "fotc", "3832743906": "omolon", + "3889907763": "cassoid", + "3890960908": "fotc", + "3896249436": "fotc", + "3906357377": "cassoid", "3915197957": "omolon", "3920872880": "suros", + "3929685100": "fotc", + "3998080529": "nadir", + "4024037919": "fotc", "4028726911": "suros", + "4041111172": "fotc", "4074251943": "omolon", + "4083045006": "fotc", + "4105447486": "cassoid", + "4138415949": "cassoid", + "4138415950": "cassoid", "4148143418": "hakke", "4157959956": "omolon", "4157959958": "omolon", @@ -85,8 +220,11 @@ "4174481098": "suros", "4176633581": "suros", "4186079026": "omolon", + "4193877020": "fotc", "4200654067": "veist", "4220529694": "suros", "4230993599": "suros", + "4238497225": "fotc", + "4272442416": "fotc", "4281371574": "omolon" } diff --git a/src/generate-extended-foundry.ts b/src/generate-extended-foundry.ts index 9f495aa8..0aad1b88 100644 --- a/src/generate-extended-foundry.ts +++ b/src/generate-extended-foundry.ts @@ -11,7 +11,7 @@ const originTraitSocketCategoryHash = 3993098925; const foundryInfo: Record< string, - { traitHash: TraitHashes; originTraitHash: number; icon: string; regex: RegExp } + { traitHash?: TraitHashes; originTraitHash: number; icon: string; regex?: RegExp } > = { hakke: { traitHash: TraitHashes.FoundryHakke, @@ -37,6 +37,30 @@ const foundryInfo: Record< icon: '', regex: /-[0-9][a-z][a-z]?$/, // Taipan-4fr }, + nadir: { + originTraitHash: 2509860981, // InventoryItem "Nadir Focus" + icon: '', + }, + cassoid: { + originTraitHash: 1050127423, // InventoryItem "Wild Card" + icon: '', + regex: / (IX|IV|V?I{0,3})$/, // ends with roman numerals + }, + 'field-forged': { + traitHash: TraitHashes.FoundryFieldForged, + originTraitHash: 43555494, // InventoryItem "Field-Tested" + icon: '', + }, + fotc: { + traitHash: TraitHashes.FoundryFotc, + originTraitHash: 0, + icon: '', + }, + 'tex-mechanica': { + traitHash: TraitHashes.FoundryTexMechanica, + originTraitHash: 2437618208, // InventoryItem "Tex Balanced Stock" + icon: '', + }, }; const foundries = Object.keys(foundryInfo); @@ -67,7 +91,7 @@ function fixMismatchIconFoundry(foundry: string) { const foundryIconMismatchHashes = inventoryItems .filter( (item) => - item.traitHashes?.includes(foundryInfo[foundry].traitHash) && + item.traitHashes?.includes(foundryInfo[foundry]?.traitHash ?? 0) && item.secondaryIcon !== foundryInfo[foundry].icon, ) .map((i) => i.hash); @@ -103,7 +127,7 @@ function fixMismatchIconFoundry(foundry: string) { if ( item.secondaryIcon !== foundryInfo[foundry].icon || - !item.traitHashes.includes(foundryInfo[foundry].traitHash) + !item.traitHashes.includes(foundryInfo[foundry]?.traitHash ?? 0) ) { setExtendedFoundryInfo(hash, foundry); } @@ -116,7 +140,8 @@ function fixMismatchIconFoundry(foundry: string) { function getFoundryIcon(foundry: string) { const foundryIcon = foundryItems .filter( - (item) => item.traitHashes?.includes(foundryInfo[foundry].traitHash) && item.secondaryIcon, + (item) => + item.traitHashes?.includes(foundryInfo[foundry]?.traitHash ?? 0) && item.secondaryIcon, ) .map((i) => i.secondaryIcon); @@ -136,7 +161,8 @@ function getFoundryIcon(foundry: string) { function getMissingFoundryIcons(foundry: string) { const hashes = inventoryItems .filter( - (item) => item.traitHashes?.includes(foundryInfo[foundry].traitHash) && !item.secondaryIcon, + (item) => + item.traitHashes?.includes(foundryInfo[foundry]?.traitHash ?? 0) && !item.secondaryIcon, ) .map((i) => i.hash); hashes.forEach(function (hash) { @@ -154,8 +180,10 @@ function getFoundryInfoViaRegex(foundry: string) { (i) => i.itemCategoryHashes?.includes(ItemCategoryHashes.Weapon) && !i.itemCategoryHashes.includes(ItemCategoryHashes.Dummies) && - i.displayProperties.name.replace(' (Adept)', '').match(foundryInfo[foundry].regex) && - !i.traitHashes?.includes(foundryInfo[foundry].traitHash), + i.displayProperties.name + .replace(' (Adept)', '') + .match(foundryInfo[foundry]?.regex ?? /blahblah/) && + !i.traitHashes?.includes(foundryInfo[foundry]?.traitHash ?? 0), ) .map((i) => i.hash); hashes.forEach(function (hash) {