diff --git a/README.md b/README.md index 13f797ce..0e1f9b3d 100644 --- a/README.md +++ b/README.md @@ -60,10 +60,8 @@ | seasons.json | a listing of item hashes to season, this does not include items that the season can be deduced another way (e.g. displayVersionWatermarkIcons or sources with a season) | | source-info.ts | a listing between tags and the sources associated with them | | sources.json | a listing containing source hash to source description | -| specialty-modslot-metadata.ts | deprecated specialty modslot metadata | | spider-mats.json | an array of item hashes containing materials Spider (now Rahool) used to posses for purchase | | spider-purchaseables-to-mats.json | Vendor item hashes to actual item hashes for Spider (now Rahool) | -| stat-effects.ts | a most likely outdated listing between tiers and associated cooldowns | | subclass-plug-category-hashes.json | an array of subclass plug category hashes | | symbol-name-sources.ts | well-known and useful Destiny 2 font symbols together with a way to retrieve localized names from the definitions | | trait-to-enhanced-trait.json | a mapping between normal trait and its enhanced variant | diff --git a/data/stat-effects.ts b/data/stat-effects.ts deleted file mode 100644 index 21794284..00000000 --- a/data/stat-effects.ts +++ /dev/null @@ -1,332 +0,0 @@ -export const statEffects = { - warlock: { - light: { - discipline: [ - '1:43', - '1:33', - '1:25', - '1:22', - '1:08', - '0:59', - '0:51', - '0:45', - '0:41', - '0:37', - '0:32', - ], - strength: [ - '1:43', - '1:33', - '1:25', - '1:22', - '1:08', - '0:59', - '0:51', - '0:45', - '0:41', - '0:37', - '0:32', - ], - intellect: [ - '7:12', - '6:22', - '5:43', - '5:00', - '4:45', - '4:31', - '4:18', - '4:07', - '4:00', - '3:52', - '3:48', - ], - recovery: [ - '1:57', - '1:43', - '1:31', - '1:22', - '1:15', - '1:08', - '1:03', - '0:59', - '0:51', - '0:46', - '0:41', - ], - }, - dark: { - discipline: [ - '2:25', - '2:14', - '2:05', - '1:57', - '1:50', - '1:33', - '1:20', - '1:11', - '1:04', - '0:58', - '0:53', - ], - strength: [ - '1:58', - '1:49', - '1:42', - '1:35', - '1:29', - '1:16', - '1:06', - '0:58', - '0:52', - '0:47', - '0:43', - ], - intellect: [ - '7:01', - '6:23', - '5:51', - '5:23', - '5:00', - '4:47', - '4:35', - '4:24', - '4:14', - '4:05', - '3:56', - ], - recovery: [ - '1:57', - '1:43', - '1:31', - '1:22', - '1:15', - '1:08', - '1:03', - '0:59', - '0:51', - '0:46', - '0:41', - ], - }, - }, - hunter: { - light: { - discipline: [ - '1:43', - '1:33', - '1:25', - '1:22', - '1:08', - '0:59', - '0:51', - '0:45', - '0:41', - '0:37', - '0:32', - ], - strength: [ - '2:00', - '1:49', - '1:40', - '1:36', - '1:20', - '1:09', - '1:00', - '0:53', - '0:48', - '0:44', - '0:37', - ], - intellect: [ - '7:12', - '6:22', - '5:43', - '5:00', - '4:45', - '4:31', - '4:18', - '4:07', - '4:00', - '3:52', - '3:48', - ], - mobility: [ - '0:34', - '0:32', - '0:30', - '0:29', - '0:26', - '0:24', - '0:22', - '0:19', - '0:16', - '0:14', - '0:11', - ], - }, - dark: { - discipline: [ - '2:25', - '2:14', - '2:05', - '1:57', - '1:50', - '1:33', - '1:20', - '1:11', - '1:04', - '0:58', - '0:53', - ], - strength: [ - '1:58', - '1:49', - '1:42', - '1:35', - '1:29', - '1:16', - '1:06', - '0:58', - '0:52', - '0:47', - '0:43', - ], - intellect: [ - '7:01', - '6:23', - '5:51', - '5:23', - '5:00', - '4:47', - '4:35', - '4:24', - '4:14', - '4:05', - '3:56', - ], - mobility: [ - '0:34', - '0:32', - '0:30', - '0:29', - '0:26', - '0:24', - '0:22', - '0:19', - '0:16', - '0:14', - '0:11', - ], - }, - }, - titan: { - light: { - discipline: [ - '1:43', - '1:33', - '1:25', - '1:22', - '1:08', - '0:59', - '0:51', - '0:45', - '0:41', - '0:37', - '0:32', - ], - strength: [ - '1:43', - '1:33', - '1:25', - '1:22', - '1:08', - '0:59', - '0:51', - '0:45', - '0:41', - '0:37', - '0:32', - ], - intellect: [ - '7:12', - '6:22', - '5:43', - '5:00', - '4:45', - '4:31', - '4:18', - '4:07', - '4:00', - '3:52', - '3:48', - ], - resilience: [ - '0:52', - '0:46', - '0:41', - '0:37', - '0:33', - '0:30', - '0:28', - '0:25', - '0:21', - '0:17', - '0:14', - ], - }, - dark: { - discipline: [ - '2:25', - '2:14', - '2:05', - '1:57', - '1:50', - '1:33', - '1:20', - '1:11', - '1:04', - '0:58', - '0:53', - ], - strength: [ - '1:37', - '1:30', - '1:24', - '1:19', - '1:14', - '0:59', - '0:51', - '0:46', - '0:41', - '0:37', - '0:32', - ], - intellect: [ - '7:01', - '6:23', - '5:51', - '5:23', - '5:00', - '4:47', - '4:35', - '4:24', - '4:14', - '4:05', - '3:56', - ], - resilience: [ - '0:52', - '0:46', - '0:41', - '0:37', - '0:33', - '0:30', - '0:28', - '0:25', - '0:21', - '0:17', - '0:14', - ], - }, - }, -} as const; diff --git a/output/crafting-resonant-elements.ts b/output/crafting-resonant-elements.ts deleted file mode 100644 index e20eda90..00000000 --- a/output/crafting-resonant-elements.ts +++ /dev/null @@ -1,7 +0,0 @@ -export const resonantElementTagsByObjectiveHash: Record = {} as const; - -export const resonantMaterialStringVarHashes: { - currentCountHash: number; - maxCapacityHash: number; - materialHash: number; -}[] = []; diff --git a/output/specialty-modslot-metadata.ts b/output/specialty-modslot-metadata.ts deleted file mode 100644 index cfc4a9b6..00000000 --- a/output/specialty-modslot-metadata.ts +++ /dev/null @@ -1,28 +0,0 @@ -export interface ModSocketMetadata { - /** this allows us to sort mods chronologically for LO purposes */ - season: number; - /** we use these two to match with search filters */ - tag: string; - compatibleTags: string[]; - /** an item's socket's socketTypeHash is used to look up ModSocketMetadata */ - socketTypeHash: number; - /** - * mods don't inherently point back to their compatible slot, - * they just have a plugCategoryHash. - * a socket points to a socketType which refers to multiple plugCategoryHashes - * so here is a more direct way, if you have a plugCategoryHash, - * to find ModSocketMetadata without doing definition lookups and finds - */ - plugCategoryHashes: number[]; - /** - * hashes are used for faster lookups in loadout organizer, - * they correspond directly to info found inside individual mod - */ - compatiblePlugCategoryHashes: number[]; - /** this helps us look up the "empty socket" definition, for its icon/name */ - emptyModSocketHash: number; -} - -const modSocketMetadata: ModSocketMetadata[] = []; - -export default modSocketMetadata; diff --git a/output/stat-effects.ts b/output/stat-effects.ts deleted file mode 100644 index 21794284..00000000 --- a/output/stat-effects.ts +++ /dev/null @@ -1,332 +0,0 @@ -export const statEffects = { - warlock: { - light: { - discipline: [ - '1:43', - '1:33', - '1:25', - '1:22', - '1:08', - '0:59', - '0:51', - '0:45', - '0:41', - '0:37', - '0:32', - ], - strength: [ - '1:43', - '1:33', - '1:25', - '1:22', - '1:08', - '0:59', - '0:51', - '0:45', - '0:41', - '0:37', - '0:32', - ], - intellect: [ - '7:12', - '6:22', - '5:43', - '5:00', - '4:45', - '4:31', - '4:18', - '4:07', - '4:00', - '3:52', - '3:48', - ], - recovery: [ - '1:57', - '1:43', - '1:31', - '1:22', - '1:15', - '1:08', - '1:03', - '0:59', - '0:51', - '0:46', - '0:41', - ], - }, - dark: { - discipline: [ - '2:25', - '2:14', - '2:05', - '1:57', - '1:50', - '1:33', - '1:20', - '1:11', - '1:04', - '0:58', - '0:53', - ], - strength: [ - '1:58', - '1:49', - '1:42', - '1:35', - '1:29', - '1:16', - '1:06', - '0:58', - '0:52', - '0:47', - '0:43', - ], - intellect: [ - '7:01', - '6:23', - '5:51', - '5:23', - '5:00', - '4:47', - '4:35', - '4:24', - '4:14', - '4:05', - '3:56', - ], - recovery: [ - '1:57', - '1:43', - '1:31', - '1:22', - '1:15', - '1:08', - '1:03', - '0:59', - '0:51', - '0:46', - '0:41', - ], - }, - }, - hunter: { - light: { - discipline: [ - '1:43', - '1:33', - '1:25', - '1:22', - '1:08', - '0:59', - '0:51', - '0:45', - '0:41', - '0:37', - '0:32', - ], - strength: [ - '2:00', - '1:49', - '1:40', - '1:36', - '1:20', - '1:09', - '1:00', - '0:53', - '0:48', - '0:44', - '0:37', - ], - intellect: [ - '7:12', - '6:22', - '5:43', - '5:00', - '4:45', - '4:31', - '4:18', - '4:07', - '4:00', - '3:52', - '3:48', - ], - mobility: [ - '0:34', - '0:32', - '0:30', - '0:29', - '0:26', - '0:24', - '0:22', - '0:19', - '0:16', - '0:14', - '0:11', - ], - }, - dark: { - discipline: [ - '2:25', - '2:14', - '2:05', - '1:57', - '1:50', - '1:33', - '1:20', - '1:11', - '1:04', - '0:58', - '0:53', - ], - strength: [ - '1:58', - '1:49', - '1:42', - '1:35', - '1:29', - '1:16', - '1:06', - '0:58', - '0:52', - '0:47', - '0:43', - ], - intellect: [ - '7:01', - '6:23', - '5:51', - '5:23', - '5:00', - '4:47', - '4:35', - '4:24', - '4:14', - '4:05', - '3:56', - ], - mobility: [ - '0:34', - '0:32', - '0:30', - '0:29', - '0:26', - '0:24', - '0:22', - '0:19', - '0:16', - '0:14', - '0:11', - ], - }, - }, - titan: { - light: { - discipline: [ - '1:43', - '1:33', - '1:25', - '1:22', - '1:08', - '0:59', - '0:51', - '0:45', - '0:41', - '0:37', - '0:32', - ], - strength: [ - '1:43', - '1:33', - '1:25', - '1:22', - '1:08', - '0:59', - '0:51', - '0:45', - '0:41', - '0:37', - '0:32', - ], - intellect: [ - '7:12', - '6:22', - '5:43', - '5:00', - '4:45', - '4:31', - '4:18', - '4:07', - '4:00', - '3:52', - '3:48', - ], - resilience: [ - '0:52', - '0:46', - '0:41', - '0:37', - '0:33', - '0:30', - '0:28', - '0:25', - '0:21', - '0:17', - '0:14', - ], - }, - dark: { - discipline: [ - '2:25', - '2:14', - '2:05', - '1:57', - '1:50', - '1:33', - '1:20', - '1:11', - '1:04', - '0:58', - '0:53', - ], - strength: [ - '1:37', - '1:30', - '1:24', - '1:19', - '1:14', - '0:59', - '0:51', - '0:46', - '0:41', - '0:37', - '0:32', - ], - intellect: [ - '7:01', - '6:23', - '5:51', - '5:23', - '5:00', - '4:47', - '4:35', - '4:24', - '4:14', - '4:05', - '3:56', - ], - resilience: [ - '0:52', - '0:46', - '0:41', - '0:37', - '0:33', - '0:30', - '0:28', - '0:25', - '0:21', - '0:17', - '0:14', - ], - }, - }, -} as const; diff --git a/package.json b/package.json index 338be77f..1fca5855 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,6 @@ "generate:enums": "dotenv node built/src/generate-enums.js && tsc", "generate:season-info": "dotenv node built/src/generate-season-info.js && tsc", "generate:season-source": "dotenv node built/src/generate-season-to-source.js", - "generate:mod-slot": "dotenv node built/src/generate-mod-slot-data.js", "generate:source-info": "dotenv node built/src/generate-source-info.js && tsc", "generate:event": "dotenv node built/src/generate-event-info.js", "generate:ghost": "dotenv node built/src/generate-ghost-data.js", @@ -42,7 +41,6 @@ "generate:subclass-plug-category-hashes": "dotenv node built/src/generate-subclass-plug-category-hashes.js", "generate:glyph-enums": "dotenv node built/src/generate-font-glyph-enums.js && tsc", "generate:legacy-triumphs": "fse copy --quiet data/legacy-triumphs.json output/legacy-triumphs.json", - "generate:stat-effects": "fse copy --quiet data/stat-effects.ts output/stat-effects.ts", "generate:trials-objectives": "dotenv node built/src/generate-trials-objectives.js", "generate:crafting-enhanced-intrinsics": "dotenv node built/src/generate-crafting-enhanced-intrinsics.js", "generate:trait-enhanced-trait": "dotenv node built/src/generate-trait-enhanced-trait-lookup.js", diff --git a/src/generate-mod-slot-data.ts b/src/generate-mod-slot-data.ts deleted file mode 100644 index d91285eb..00000000 --- a/src/generate-mod-slot-data.ts +++ /dev/null @@ -1,174 +0,0 @@ -import { getAllDefs, getDef, loadLocal } from '@d2api/manifest-node'; -import { DestinyInventoryItemDefinition } from 'bungie-api-ts/destiny2'; -import stringifyObject from 'stringify-object'; -import { D2CalculatedSeason } from './generate-season-info.js'; -import { writeFile } from './helpers.js'; - -loadLocal(); - -const inventoryItems = getAllDefs('InventoryItem'); - -const namedSeasonExceptions: Record = { - 420: 'outlaw', - 430: 'forge', - 450: 'opulence', - 460: 'maverick', -}; - -// pre-generate a table using an assumption based on existing pattern of plugCategoryIdentifier names -const seasonNumberByPlugCategoryIdentifier: Record = {}; -for (let season = 4; season <= D2CalculatedSeason; season++) { - seasonNumberByPlugCategoryIdentifier[getSeasonID(season)] = season; -} - -interface ModSocketMetadata { - /** this allows us to sort mods chronologically for LO purposes */ - season: number; - /** we use these two to match with search filters */ - tag: string; - compatibleTags: string[]; - /** an item's socket's socketTypeHash is used to look up ModSocketMetadata */ - socketTypeHash: number; - /** - * mods don't inherently point back to their compatible slot, - * they just have a plugCategoryHash. - * a socket points to a socketType which refers to multiple plugCategoryHashes - * so here is a more direct way, if you have a plugCategoryHash, - * to find ModSocketMetadata without doing definition lookups and finds - */ - plugCategoryHashes: number[]; - /** - * hashes are used for faster lookups in loadout organizer, - * they correspond directly to info found inside individual mod - */ - compatiblePlugCategoryHashes: number[]; - /** this helps us look up the "empty socket" definition, for its icon/name */ - emptyModSocketHash: number; -} - -const seasonalPlugCategoryIdentifier = 'enhancements.season_'; - -const emptySeasonalModSockets = inventoryItems.filter( - (item) => - item.displayProperties.name === 'Empty Mod Socket' && - item.plug!.plugCategoryIdentifier.startsWith(seasonalPlugCategoryIdentifier) -); - -const modMetadatas: ModSocketMetadata[] = emptySeasonalModSockets - .map((emptyModSocket) => { - // this socket type's itemTypeDisplayName - const itemTypeDisplayName = emptyModSocket.itemTypeDisplayName; - - // the season associated with this mod slot - const season = - seasonNumberByPlugCategoryIdentifier[emptyModSocket.plug!.plugCategoryIdentifier]; - - // a short name for the season - const tag = seasonTagFromMod(emptyModSocket); - - // an example armor piece that has this empty socket - const exampleArmorSocketEntry = findExampleSocketByEmptyModHash(emptyModSocket.hash); - if (!exampleArmorSocketEntry) { - return undefined; - } - // all mods that could go into this empty mod socket - const compatibleTags = arrayUniq( - getDef('PlugSet', exampleArmorSocketEntry?.reusablePlugSetHash)?.reusablePlugItems.map( - (plugItem) => seasonTagFromMod(getDef('InventoryItem', plugItem.plugItemHash)!) - ) || [] - ); - - // this emptyModSocket's socketType - const socketTypeHash = exampleArmorSocketEntry.socketTypeHash; - - // plugCategoryHashes whose native slot is this one - const plugCategoryHashes = arrayUniq( - inventoryItems - .filter((item) => item.itemTypeDisplayName === itemTypeDisplayName) - .map((item) => item.plug?.plugCategoryHash || 0) - .filter(Boolean) - ); - - // plugCategoryHashes supported by this SocketType - const compatiblePlugCategoryHashes = getDef('SocketType', socketTypeHash)!.plugWhitelist.map( - (plugType) => plugType.categoryHash - ); - - return { - season, - tag, - compatibleTags, - socketTypeHash, - plugCategoryHashes, - compatiblePlugCategoryHashes, - emptyModSocketHash: emptyModSocket.hash, - }; - }) - .filter(Boolean) as ModSocketMetadata[]; -modMetadatas.sort((mod1, mod2) => mod1.season - mod2.season); - -const seasonNameOrder = modMetadatas.map((m) => m.tag); -modMetadatas.forEach((m) => { - m.compatiblePlugCategoryHashes.sort(); - m.plugCategoryHashes.sort(); - m.compatibleTags.sort( - (tag1, tag2) => seasonNameOrder.indexOf(tag1) - seasonNameOrder.indexOf(tag2) - ); -}); - -function findExampleSocketByEmptyModHash(emptyModSocketHash: number) { - return inventoryItems - .find((item) => - item.sockets?.socketEntries.find( - (socket) => socket.singleInitialItemHash === emptyModSocketHash - ) - ) - ?.sockets?.socketEntries.find((socket) => socket.singleInitialItemHash === emptyModSocketHash); -} - -const pretty = ` -export interface ModSocketMetadata { - /** this allows us to sort mods chronologically for LO purposes */ - season: number; - /** we use these two to match with search filters */ - tag: string; - compatibleTags: string[]; - /** an item's socket's socketTypeHash is used to look up ModSocketMetadata */ - socketTypeHash: number; - /** - * mods don't inherently point back to their compatible slot, - * they just have a plugCategoryHash. - * a socket points to a socketType which refers to multiple plugCategoryHashes - * so here is a more direct way, if you have a plugCategoryHash, - * to find ModSocketMetadata without doing definition lookups and finds - */ - plugCategoryHashes: number[]; - /** - * hashes are used for faster lookups in loadout organizer, - * they correspond directly to info found inside individual mod - */ - compatiblePlugCategoryHashes: number[]; - /** this helps us look up the "empty socket" definition, for its icon/name */ - emptyModSocketHash: number; -} - -const modSocketMetadata: ModSocketMetadata[] = ${stringifyObject([], { - indent: ' ', -})};\n\nexport default modSocketMetadata;`; - -writeFile('./output/specialty-modslot-metadata.ts', pretty); - -/** i.e. "Opulent Armor Mod" ---> "opulent" */ -function seasonTagFromMod(item: DestinyInventoryItemDefinition) { - return item.itemTypeDisplayName.toLowerCase().split(' ')[0]; -} - -/** i.e. "4" ---> "420" ---> "outlaw"*/ -function getSeasonID(season: number) { - const id = 420 + 10 * (season - 4); - return `enhancements.season_${namedSeasonExceptions[id] ?? `v${id}`}`; -} - -export function arrayUniq(array: T[]): T[] { - return [...new Set(array)]; -}