Skip to content

Commit

Permalink
Merge pull request #547 from DestinyItemManager/unstackable
Browse files Browse the repository at this point in the history
  • Loading branch information
bhollis authored Dec 21, 2023
2 parents d0b2e51 + 410a345 commit 1e944b5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
12 changes: 12 additions & 0 deletions output/unstackable-mods.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,22 @@
579997810,
688956976,
802695661,
865380761,
877723168,
1097608874,
1125986156,
1170405455,
1301391064,
1305848463,
1389309840,
1560574695,
1565861116,
1627901452,
1909657913,
1947468772,
1996040463,
2023980600,
2045123179,
2158846614,
2175577211,
2199590568,
Expand All @@ -23,8 +30,11 @@
2649291407,
2734674728,
2815817957,
2874957617,
3064687909,
3174771856,
3736152098,
3829100654,
3994043492,
4004774872,
4004774873,
Expand All @@ -33,5 +43,7 @@
4004774876,
4004774877,
4081595582,
4134680615,
4193902249,
4243059257
]
10 changes: 7 additions & 3 deletions src/generate-unstackable-mods.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
import { getAllDefs } from '@d2api/manifest-node';
import { getAllDefs, getDef } from '@d2api/manifest-node';
import { writeFile } from './helpers.js';

const inventoryItems = getAllDefs('InventoryItem');

function findAllUnstackableMods() {
const unstackableModHashes = new Set<number>();

for (const { tooltipNotifications, hash, displayProperties } of inventoryItems) {
for (const { tooltipNotifications, hash, displayProperties, perks } of inventoryItems) {
if (
tooltipNotifications &&
(tooltipNotifications[0]?.displayString.includes('no benefit') ||
displayProperties.description.includes('will not improve')) &&
displayProperties.description.includes('will not improve') ||
(perks[0]?.perkHash &&
getDef('SandboxPerk', perks[0].perkHash)?.displayProperties.description.includes(
'does not stack'
))) &&
!displayProperties.name.includes('Deprecated Armor Mod')
) {
unstackableModHashes.add(hash);
Expand Down

0 comments on commit 1e944b5

Please sign in to comment.