Skip to content

Commit 2bc51a2

Browse files
authored
Merge pull request #11781 from DestinyItemManager/lo-exotic-tuners
tuned stat fixes for exotics
2 parents e3c6e91 + 2f75837 commit 2bc51a2

4 files changed

Lines changed: 32 additions & 19 deletions

File tree

src/app/inventory/__snapshots__/d2-stores.test.ts.snap

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9167,7 +9167,7 @@ exports[`process stores generates a correct armor CSV export 1`] = `
91679167
"Tier": 5,
91689168
"Total": 81,
91699169
"Total (Base)": 75,
9170-
"Tuning Stat": "health",
9170+
"Tuning Stat": undefined,
91719171
"Type": "Hunter Cloak",
91729172
"Weapons": 25,
91739173
"Weapons (Base)": 25,
@@ -10906,7 +10906,7 @@ exports[`process stores generates a correct armor CSV export 1`] = `
1090610906
"Tier": 5,
1090710907
"Total": 75,
1090810908
"Total (Base)": 75,
10909-
"Tuning Stat": "health",
10909+
"Tuning Stat": undefined,
1091010910
"Type": "Gauntlets",
1091110911
"Weapons": 0,
1091210912
"Weapons (Base)": 0,
@@ -11166,7 +11166,7 @@ exports[`process stores generates a correct armor CSV export 1`] = `
1116611166
"Tier": 5,
1116711167
"Total": 75,
1116811168
"Total (Base)": 75,
11169-
"Tuning Stat": "health",
11169+
"Tuning Stat": undefined,
1117011170
"Type": "Chest Armor",
1117111171
"Weapons": 0,
1117211172
"Weapons (Base)": 0,
@@ -11388,7 +11388,7 @@ exports[`process stores generates a correct armor CSV export 1`] = `
1138811388
"Tier": 5,
1138911389
"Total": 75,
1139011390
"Total (Base)": 75,
11391-
"Tuning Stat": "health",
11391+
"Tuning Stat": undefined,
1139211392
"Type": "Gauntlets",
1139311393
"Weapons": 30,
1139411394
"Weapons (Base)": 30,
@@ -11609,7 +11609,7 @@ exports[`process stores generates a correct armor CSV export 1`] = `
1160911609
"Tier": 5,
1161011610
"Total": 75,
1161111611
"Total (Base)": 75,
11612-
"Tuning Stat": "health",
11612+
"Tuning Stat": undefined,
1161311613
"Type": "Chest Armor",
1161411614
"Weapons": 25,
1161511615
"Weapons (Base)": 25,
@@ -12256,7 +12256,7 @@ exports[`process stores generates a correct armor CSV export 1`] = `
1225612256
"Tier": 5,
1225712257
"Total": 75,
1225812258
"Total (Base)": 75,
12259-
"Tuning Stat": "health",
12259+
"Tuning Stat": undefined,
1226012260
"Type": "Leg Armor",
1226112261
"Weapons": 30,
1226212262
"Weapons (Base)": 30,
@@ -12602,7 +12602,7 @@ exports[`process stores generates a correct armor CSV export 1`] = `
1260212602
"Tier": 5,
1260312603
"Total": 75,
1260412604
"Total (Base)": 75,
12605-
"Tuning Stat": "health",
12605+
"Tuning Stat": undefined,
1260612606
"Type": "Chest Armor",
1260712607
"Weapons": 0,
1260812608
"Weapons (Base)": 0,
@@ -12862,7 +12862,7 @@ exports[`process stores generates a correct armor CSV export 1`] = `
1286212862
"Tier": 5,
1286312863
"Total": 75,
1286412864
"Total (Base)": 75,
12865-
"Tuning Stat": "health",
12865+
"Tuning Stat": undefined,
1286612866
"Type": "Gauntlets",
1286712867
"Weapons": 0,
1286812868
"Weapons (Base)": 0,
@@ -13382,7 +13382,7 @@ exports[`process stores generates a correct armor CSV export 1`] = `
1338213382
"Tier": 5,
1338313383
"Total": 75,
1338413384
"Total (Base)": 75,
13385-
"Tuning Stat": "health",
13385+
"Tuning Stat": undefined,
1338613386
"Type": "Chest Armor",
1338713387
"Weapons": 20,
1338813388
"Weapons (Base)": 20,
@@ -13556,7 +13556,7 @@ exports[`process stores generates a correct armor CSV export 1`] = `
1355613556
"Tier": 5,
1355713557
"Total": 75,
1355813558
"Total (Base)": 75,
13559-
"Tuning Stat": "health",
13559+
"Tuning Stat": undefined,
1356013560
"Type": "Gauntlets",
1356113561
"Weapons": 20,
1356213562
"Weapons (Base)": 20,
@@ -13687,7 +13687,7 @@ exports[`process stores generates a correct armor CSV export 1`] = `
1368713687
"Tier": 5,
1368813688
"Total": 75,
1368913689
"Total (Base)": 75,
13690-
"Tuning Stat": "health",
13690+
"Tuning Stat": undefined,
1369113691
"Type": "Gauntlets",
1369213692
"Weapons": 0,
1369313693
"Weapons (Base)": 0,
@@ -13732,7 +13732,7 @@ exports[`process stores generates a correct armor CSV export 1`] = `
1373213732
"Tier": 5,
1373313733
"Total": 75,
1373413734
"Total (Base)": 75,
13735-
"Tuning Stat": "health",
13735+
"Tuning Stat": undefined,
1373613736
"Type": "Chest Armor",
1373713737
"Weapons": 0,
1373813738
"Weapons (Base)": 0,
@@ -14640,7 +14640,7 @@ exports[`process stores generates a correct armor CSV export 1`] = `
1464014640
"Tier": 5,
1464114641
"Total": 75,
1464214642
"Total (Base)": 75,
14643-
"Tuning Stat": "health",
14643+
"Tuning Stat": undefined,
1464414644
"Type": "Hunter Cloak",
1464514645
"Weapons": 30,
1464614646
"Weapons (Base)": 30,
@@ -14686,7 +14686,7 @@ exports[`process stores generates a correct armor CSV export 1`] = `
1468614686
"Tier": 5,
1468714687
"Total": 75,
1468814688
"Total (Base)": 75,
14689-
"Tuning Stat": "health",
14689+
"Tuning Stat": undefined,
1469014690
"Type": "Hunter Cloak",
1469114691
"Weapons": 20,
1469214692
"Weapons (Base)": 20,

src/app/loadout-builder/process/mappers.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,10 @@ export function mapDimItemToProcessItems({
110110
const tuningSocket = getArmor3TuningSocket(dimItem);
111111

112112
// Make a version of the item for each possible tuning mod that could be applied.
113-
if (autoStatMods && tuningSocket?.reusablePlugItems?.length) {
113+
//
114+
// exclude tuning mods for exotics since they have so many tuning options that it blows up the combinations.
115+
//
116+
if (autoStatMods && !isExotic && tuningSocket?.reusablePlugItems?.length) {
114117
const processItems: ProcessItem[] = [];
115118
const allPlugs = tuningSocket.plugSet?.plugs;
116119
// By default, we'll sacrifice the last ignored stat, or the last from among the lowest maximums

src/app/loadout/mod-assignment-utils.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,10 @@ export function fitMostMods({
383383
// stats), so if we assigned them in a different order than they were chosen
384384
// in the process loop, we might end up with different stats than the user
385385
// expected.
386-
const tuningItems = items.filter((i) => getArmor3TuningStat(i) !== undefined);
386+
//
387+
// Exclude exotics since they blow up the combos since they have all the tuning sockets.
388+
//
389+
const tuningItems = items.filter((i) => !i.isExotic && getArmor3TuningStat(i) !== undefined);
387390
for (const tuningMod of tuningMods) {
388391
// Find the tuning stat hash, which is the stat that gets +5 when this mod
389392
// is applied. For "Balanced Tuning" this should be 0.

src/app/utils/item-utils.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,10 +406,17 @@ export function getArmor3TuningStat(item: DimItem): StatHashes | undefined {
406406
return;
407407
}
408408

409+
let tunedStat: StatHashes | undefined;
409410
for (const { plugItemHash } of reusablePlugItems) {
410-
if (plugItemHash in tuningModToTunedStathash) {
411-
return tuningModToTunedStathash[plugItemHash];
411+
const stat = tuningModToTunedStathash[plugItemHash];
412+
if (stat !== undefined) {
413+
if (tunedStat !== undefined && tunedStat !== stat) {
414+
// Multiple different stat tuners available (e.g. exotics) --
415+
// this item isn't locked to a single tuning stat.
416+
return undefined;
417+
}
418+
tunedStat = stat;
412419
}
413420
}
414-
return undefined;
421+
return tunedStat;
415422
}

0 commit comments

Comments
 (0)