Skip to content

Commit

Permalink
Add seasonal-armor-mods
Browse files Browse the repository at this point in the history
  • Loading branch information
robojumper committed Oct 30, 2023
1 parent 6ac969e commit 5d945be
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
| season-tags.json | a mapping between season name (short) and season number |
| season-to-source.json | a mapping between sources and the season they were introduced in |
| seasonal-challenges.json | a mapping between seasonal challenges and the criteria to complete them |
| seasonal-armor-mods.json | a list of armor mods that might only be available in certain seasons (in addition to the reduced-cost versions in reduced-mod-cost-hashes) |
| seasons_backup.json | a 1:1 listing of every item hash and the season it was introduced |
| 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 |
Expand Down
5 changes: 5 additions & 0 deletions output/seasonal-armor-mods.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[
110793779,
2812559045,
2831374162
]
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"generate:universal-ornament-aux-sets": "dotenv node built/src/generate-universal-ornament-aux-sets.js",
"generate:destiny-symbols": "dotenv node built/src/generate-symbols.js",
"generate:mod-cost-reductions": "dotenv node built/src/generate-mod-cost-reductions.js",
"generate:seasonal-armor-mods": "dotenv node built/src/generate-seasonal-armor-mods.js",
"generate:trait-definition-ids": "dotenv node built/src/generate-trait-definition-ids.js",
"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",
Expand Down
24 changes: 24 additions & 0 deletions src/generate-seasonal-armor-mods.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { getAllDefs, loadLocal } from '@d2api/manifest-node';
import { ItemCategoryHashes } from '../data/generated-enums.js';
import { writeFile } from './helpers.js';
loadLocal();

const inventoryItems = getAllDefs('InventoryItem');

const mods: number[] = [];

const patterns = [/Dual Siphon/, /Siphon Combo/];

for (const item of inventoryItems) {
if (
item.displayProperties?.name &&
item.plug &&
item.plug.energyCost &&
item.itemCategoryHashes?.includes(ItemCategoryHashes.ArmorMods) &&
patterns.some((pat) => item.displayProperties.name.match(pat))
) {
mods.push(item.hash);
}
}

writeFile('./output/seasonal-armor-mods.json', mods);

0 comments on commit 5d945be

Please sign in to comment.