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

Fix cooldown times for implied subclass plugs #10104

Merged
merged 1 commit into from
Nov 13, 2023
Merged
Changes from all commits
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
22 changes: 19 additions & 3 deletions src/app/store-stats/CharacterStats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ import { useD2Definitions } from 'app/manifest/selectors';
import { getCharacterProgressions } from 'app/progress/selectors';
import { armorStats } from 'app/search/d2-known-values';
import { RootState } from 'app/store/types';
import {
getDefaultAbilityChoiceHash,
getSocketsByCategoryHash,
subclassAbilitySocketCategoryHashes,
} from 'app/utils/socket-utils';
import clsx from 'clsx';
import { BucketHashes, StatHashes } from 'data/d2/generated-enums';
import _ from 'lodash';
Expand Down Expand Up @@ -228,9 +233,20 @@ export function LoadoutCharacterStats({
// All equipped items
const equippedHashes = new Set(equippedItems.map((i) => i.hash));
// Plus all subclass mods
if (subclass?.loadoutItem.socketOverrides) {
for (const hash of Object.values(subclass?.loadoutItem.socketOverrides)) {
equippedHashes.add(hash);
if (subclass?.item.sockets) {
for (const category of subclass.item.sockets.categories) {
const sockets = getSocketsByCategoryHash(subclass.item.sockets, category.category.hash);
const isAbilityLikeSocket = subclassAbilitySocketCategoryHashes.includes(
category.category.hash,
);
for (const socket of sockets) {
const override = subclass.loadoutItem.socketOverrides?.[socket.socketIndex];
if (override) {
equippedHashes.add(override);
} else if (isAbilityLikeSocket) {
equippedHashes.add(getDefaultAbilityChoiceHash(socket));
}
}
}
}

Expand Down