Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add super subclass plugs. #627

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 24 additions & 24 deletions SEASONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,29 @@

| Season | Start Date | End Date | DLC Name | Season of |
| :----: | ---------- | --------- | --------------- | --------------- |
| 1 | 06SEP2017 | 04DEC2017 | Red War | |
| 2 | 05DEC2017 | 07MAY2018 | Curse of Osiris | |
| 3 | 08MAY2018 | 03SEP2018 | Warmind | Resurgence |
| 4 | 04SEP2018 | 26NOV2018 | Forsaken | the Outlaw |
| 5 | 27NOV2018 | 04MAR2019 | Black Armory | the Forge |
| 6 | 05MAR2019 | 03JUN2019 | Joker's Wild | the Drifter |
| 7 | 04JUN2019 | 30SEP2019 | Penumbra | Opulence |
| 8 | 01OCT2019 | 09DEC2019 | Shadowkeep | the Undying |
| 9 | 10DEC2019 | 09MAR2020 | | Dawn |
| 10 | 10MAR2020 | 08JUN2020 | | the Worthy |
| 11 | 09JUN2020 | 09NOV2020 | | the Arrival |
| 12 | 10NOV2020 | 08FEB2021 | Beyond Light | the Hunt |
| 13 | 09FEB2021 | 10MAY2021 | | the Chosen |
| 14 | 11MAY2021 | 23AUG2021 | | the Splicer |
| 15 | 24AUG2021 | 21FEB2022 | | the Lost |
| 16 | 22FEB2022 | 23MAY2022 | Witch Queen | the Risen |
| 17 | 24MAY2022 | 22AUG2022 | | the Haunted |
| 18 | 23AUG2022 | 05DEC2022 | | Plunder |
| 19 | 06DEC2022 | 27FEB2023 | | the Seraph |
| 20 | 28FEB2023 | 22MAY2023 | Lightfall | Defiance |
| 21 | 23MAY2023 | 21AUG2023 | | the Deep |
| 22 | 22AUG2023 | 27NOV2023 | | the Witch |
| 23 | 28NOV2023 | 03JUN2024 | | the Wish |
| 24 | 04JUN2024 | 07OCT2024 | The Final Shape | Episode: Echoes |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The script that generates these should probably use UTC...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for that, hard reverted the change but yeah we should probably fix that one

| 1 | 06SEP2017 | 05DEC2017 | Red War | |
| 2 | 06DEC2017 | 08MAY2018 | Curse of Osiris | |
| 3 | 09MAY2018 | 04SEP2018 | Warmind | Resurgence |
| 4 | 05SEP2018 | 27NOV2018 | Forsaken | the Outlaw |
| 5 | 28NOV2018 | 05MAR2019 | Black Armory | the Forge |
| 6 | 06MAR2019 | 04JUN2019 | Joker's Wild | the Drifter |
| 7 | 05JUN2019 | 01OCT2019 | Penumbra | Opulence |
| 8 | 02OCT2019 | 10DEC2019 | Shadowkeep | the Undying |
| 9 | 11DEC2019 | 10MAR2020 | | Dawn |
| 10 | 11MAR2020 | 09JUN2020 | | the Worthy |
| 11 | 10JUN2020 | 10NOV2020 | | the Arrival |
| 12 | 11NOV2020 | 09FEB2021 | Beyond Light | the Hunt |
| 13 | 10FEB2021 | 11MAY2021 | | the Chosen |
| 14 | 12MAY2021 | 24AUG2021 | | the Splicer |
| 15 | 25AUG2021 | 22FEB2022 | | the Lost |
| 16 | 23FEB2022 | 24MAY2022 | Witch Queen | the Risen |
| 17 | 25MAY2022 | 23AUG2022 | | the Haunted |
| 18 | 24AUG2022 | 06DEC2022 | | Plunder |
| 19 | 07DEC2022 | 28FEB2023 | | the Seraph |
| 20 | 01MAR2023 | 23MAY2023 | Lightfall | Defiance |
| 21 | 24MAY2023 | 22AUG2023 | | the Deep |
| 22 | 23AUG2023 | 28NOV2023 | | the Witch |
| 23 | 29NOV2023 | 04JUN2024 | | the Wish |
| 24 | 05JUN2024 | 08OCT2024 | The Final Shape | Episode: Echoes |

- \*denotes best guess dates
51 changes: 0 additions & 51 deletions output/subclass-plug-category-hashes.json

This file was deleted.

17 changes: 17 additions & 0 deletions output/subclass-super-plug-category-hashes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

README.md documents these output files in a table, wouldn't hurt to add this one too.

144959979,
180411040,
902963970,
1080622901,
1684765285,
1774026300,
1861253111,
2285394316,
2613010961,
2850085618,
2997411645,
3151809860,
3468785159,
4141244538,
4145425829
]
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
/**
* Collect all the subclass plug plugCategoryHashes. These are
* abilities, aspects, and fragments found on subclasses with
* pluggable sockets.
* Collect all the subclass super plug plugCategoryHashes.
*/
import { getAllDefs, getDef } from '@d2api/manifest-node';
import { uniqAndSortArray, writeFile } from './helpers.js';
import { infoLog, infoTable } from './log.js';

const TAG = 'SUBCLASS-PLUG';
const DEBUG = false;
const DEBUG = true;

const getItem = (hash: number) => getDef('InventoryItem', hash);
const getPlugSet = (hash: number) => getDef('PlugSet', hash);
Expand All @@ -17,21 +15,9 @@ const allItems = getAllDefs('InventoryItem');

const classBucketHash = 3284755031;

// Socket category hashes
const abilitiesSocketCategoryHash = 309722977;
const aspectsSocketCategoryHash = 2140934067;
const fragmentsSocketCategoryHash = 1313488945;
// Not currently used but if we get super choices this will be needed
const superSocketCategoryHash = 457473665;

const wantedCategoryHashes = [
abilitiesSocketCategoryHash,
aspectsSocketCategoryHash,
fragmentsSocketCategoryHash,
superSocketCategoryHash,
];

function findAllSubclassPlugs() {
function findAllSubclassSuperPlugs() {
const plugTracker: Record<string, number> = {};

for (const item of allItems) {
Expand All @@ -40,7 +26,7 @@ function findAllSubclassPlugs() {

// get all the socket indexes that have the right category hash
for (const socketCategory of item.sockets.socketCategories) {
if (wantedCategoryHashes.includes(socketCategory.socketCategoryHash)) {
if (socketCategory.socketCategoryHash === superSocketCategoryHash) {
for (const index of socketCategory.socketIndexes) {
indexes.push(index);
}
Expand All @@ -57,7 +43,9 @@ function findAllSubclassPlugs() {
for (const plugItem of plugItems) {
const plugCategoryHash = plugItem?.plug?.plugCategoryHash;
if (plugCategoryHash) {
plugTracker[plugItem.displayProperties.name] = plugCategoryHash;
plugTracker[
`${plugItem.plug.plugCategoryIdentifier} - ${plugItem.displayProperties.name}`
] = plugCategoryHash;
}
}
}
Expand All @@ -66,12 +54,12 @@ function findAllSubclassPlugs() {

// Log this to make debugging easier
if (DEBUG) {
infoLog(TAG, 'Subclass plugs found');
infoLog(TAG, 'Subclass super plugs found');
infoTable(plugTracker);
}
return Array.from(new Set(Object.values(plugTracker)));
}

const subclassPlugs = uniqAndSortArray(findAllSubclassPlugs());
const subclassPlugs = uniqAndSortArray(findAllSubclassSuperPlugs());

writeFile('./output/subclass-plug-category-hashes.json', subclassPlugs);
writeFile('./output/subclass-super-plug-category-hashes.json', subclassPlugs);
Loading