From be6ff42dddc6f52d7d12836f4a4a98e5f5307370 Mon Sep 17 00:00:00 2001 From: grs Date: Wed, 22 Nov 2023 18:33:00 -0800 Subject: [PATCH] generate files created --- output/unstackable-mods.json | 37 ++++++++++++++++++++++++++++++++ package.json | 1 + src/generate-unstackable-mods.ts | 27 +++++++++++++++++++++++ 3 files changed, 65 insertions(+) create mode 100644 output/unstackable-mods.json create mode 100644 src/generate-unstackable-mods.ts diff --git a/output/unstackable-mods.json b/output/unstackable-mods.json new file mode 100644 index 00000000..636bb609 --- /dev/null +++ b/output/unstackable-mods.json @@ -0,0 +1,37 @@ +[ + 56663992, + 534479613, + 539051925, + 579997810, + 688956976, + 802695661, + 877723168, + 1097608874, + 1125986156, + 1170405455, + 1301391064, + 1305848463, + 1389309840, + 1627901452, + 1947468772, + 2158846614, + 2175577211, + 2199590568, + 2245839670, + 2257238439, + 2436471653, + 2649291407, + 2734674728, + 2815817957, + 3064687909, + 3174771856, + 3994043492, + 4004774872, + 4004774873, + 4004774874, + 4004774875, + 4004774876, + 4004774877, + 4081595582, + 4243059257 +] diff --git a/package.json b/package.json index 9df5e3af..6fbd0355 100644 --- a/package.json +++ b/package.json @@ -58,6 +58,7 @@ "generate:focusing-item-outputs": "dotenv node built/src/generate-focusing-item-outputs.js", "generate:mutually-exclusive-mods": "dotenv node built/src/generate-mutually-exclusive-mods.js", "generate:unreferenced-collections-items": "dotenv node built/src/generate-unreferenced-collections-items.js", + "generate:unstackable-mods": "dotenv node built/src/generate-unstackable-mods.js", "generate-data": "run-s build generate:*" }, "husky": { diff --git a/src/generate-unstackable-mods.ts b/src/generate-unstackable-mods.ts new file mode 100644 index 00000000..3d9765c1 --- /dev/null +++ b/src/generate-unstackable-mods.ts @@ -0,0 +1,27 @@ +import { getAllDefs, loadLocal } from '@d2api/manifest-node'; +import { writeFile } from './helpers.js'; + +loadLocal(); + +const inventoryItems = getAllDefs('InventoryItem'); + +function findAllUnstackableMods() { + const unstackableModHashes = new Set(); + + for (const { tooltipNotifications, hash, displayProperties } of inventoryItems) { + if ( + tooltipNotifications && + (tooltipNotifications[0]?.displayString.includes('no benefit') || + displayProperties.description.includes('will not improve')) && + !displayProperties.name.includes('Deprecated Armor Mod') + ) { + unstackableModHashes.add(hash); + } + } + + return Array.from(unstackableModHashes); +} + +const unstackModHashes = findAllUnstackableMods(); + +writeFile('./output/unstackable-mods.json', unstackModHashes);