Skip to content

Commit

Permalink
Merge pull request #10718 from FlaminSarge/enhancement-search
Browse files Browse the repository at this point in the history
Update enhanced/enhanceable keywords
  • Loading branch information
bhollis committed Sep 6, 2024
2 parents 90ab82f + b30d100 commit 33459ea
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 17 deletions.
2 changes: 1 addition & 1 deletion config/i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@
"Energy": "Shows items that have energy capacity (Armor 2.0).",
"Engrams": "Shows engrams.",
"EnhancedPerk": "Shows weapons that have the specified number of enhanced perks.",
"Enhanced": "Shows weapons that have been enhanced.",
"Enhanced": "Shows weapons based on their enhancement tier.",
"Enhanceable": "Shows weapons that can be enhanced.",
"Equipment": "Items that can be equipped.",
"Equipped": "Items that are currently equipped on a character.",
Expand Down
3 changes: 3 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

* In the item picker, you can long-press or shift-click an item to see its item details. A regular click still pulls that item.
* `breaker:` searches now match items that can have that breaker type granted by this season's artifact (whether or not the correct artifact mods are enabled). The effective breaker type from artifact mods also now shows up on item tiles and in the Armory.
* Add Enhancement tier to weapon level bar.
* Update `enhanced` search keyword to allow range of values (0/1/2/3). Old `is:enhanced` behavior is now `enhanced:3`.
* Update `is:enhanceable` search keyword to exclude Tier 3 Enhanced items.

## 8.35.1 <span class="changelog-date">(2024-09-01)</span>

Expand Down
1 change: 1 addition & 0 deletions src/app/search/__snapshots__/search-config.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ exports[`buildSearchConfig generates a reasonable filter map: key-value filters
"deepsight",
"description",
"energycapacity",
"enhanced",
"enhancedperk",
"exactname",
"exactperk",
Expand Down
34 changes: 18 additions & 16 deletions src/app/search/items/search-filters/sockets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,28 +312,30 @@ const socketFilters: ItemFilterDefinition[] = [
destinyVersion: 2,
filter: () => (item) =>
Boolean(
item.sockets?.allSockets.some(
(s) =>
s.plugged?.plugDef.plug.plugCategoryHash ===
PlugCategoryHashes.CraftingPlugsWeaponsModsEnhancers,
),
(item.craftedInfo?.enhancementTier || 0) < 3 &&
item.sockets?.allSockets.some(
(s) =>
s.plugged?.plugDef.plug.plugCategoryHash ===
PlugCategoryHashes.CraftingPlugsWeaponsModsEnhancers,
),
),
},
{
// this currently tests for full enhancedness, returning false for partially-enhanced items
keywords: 'enhanced',
description: tl('Filter.Enhanced'),
destinyVersion: 2,
format: ['simple'], // TO-DO: add 'range' here
filter:
({ lhs }) =>
(item) => {
if (lhs === 'is') {
// rules out partially-enhanced items
// the game explicitly warns you that partially-enhanced items stop looking masterworked
return item.crafted === 'enhanced' && item.masterwork;
}
},
format: ['simple', 'range'],
filter: ({ lhs, compare }) => {
if (compare) {
return (item) => compare(item.craftedInfo?.enhancementTier || 0);
}
if (lhs === 'is') {
return (item) =>
item.crafted === 'enhanced' && (item.craftedInfo?.enhancementTier || 0) > 0;
}
// shouldn't ever get here but need the default case
return (_item) => false;
},
},
{
keywords: 'retiredperk',
Expand Down

0 comments on commit 33459ea

Please sign in to comment.