-
-
Notifications
You must be signed in to change notification settings - Fork 642
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 breakermod to match weapons with seasonal artifact breaker mods #8914
Changes from 5 commits
34fa5a5
d71ced8
92bf020
48f7473
bca2cbc
cea58d1
94401d9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
[submodule "destiny-icons"] | ||
path = destiny-icons | ||
url = https://github.com/justrealmilk/destiny-icons | ||
branch = master |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ import { | |
DestinyClass, | ||
DestinyRecordState, | ||
} from 'bungie-api-ts/destiny2'; | ||
import artifactBreakerMods from 'data/d2/artifact-breaker-weapon-types.json'; | ||
import { D2EventEnum, D2EventInfo } from 'data/d2/d2-event-info-v2'; | ||
import focusingOutputs from 'data/d2/focusing-item-outputs.json'; | ||
import { BreakerTypeHashes, ItemCategoryHashes } from 'data/d2/generated-enums'; | ||
|
@@ -228,6 +229,25 @@ const knownValuesFilters: ItemFilterDefinition[] = [ | |
return (item) => breakerType.includes(item.breakerType?.hash as BreakerTypeHashes); | ||
}, | ||
}, | ||
{ | ||
keywords: 'breakermod', | ||
description: tl('Filter.BreakerMod'), | ||
format: 'query', | ||
suggestions: Object.keys(breakerTypes), | ||
destinyVersion: 2, | ||
filter: ({ filterValue }) => { | ||
const breakerType: BreakerTypeHashes[] | undefined = | ||
breakerTypes[filterValue as keyof typeof breakerTypes]; | ||
if (!breakerType) { | ||
throw new Error(`Unknown breaker type ${breakerType as string}`); | ||
} | ||
const breakingIchs = breakerType.flatMap((ty) => artifactBreakerMods[ty] || []); | ||
return (item) => | ||
Boolean( | ||
!item.breakerType && item.itemCategoryHashes.some((ich) => breakingIchs.includes(ich)), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this really be a new search, or should the And then we'd probably want to think about whether to show the breaker icon on the item tooltip. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I'm in favor of combining the logic into I can only think of one scenario where I might want to filter for the difference, and that's where I'm desperately trying to figure out if I can disable/avoid a champion mod and unlock something else without ruining a build... But in practice I tend to treat those seasonal mod choices as mandatory. That said, it may be valuable to expose the breaker-"reason" as something that can be spot-checked on a particular item, such as an icon/tooltip indicating that Le Monarque has Anti-Overload intrinsically, while Hush is getting Anti-Overload from a seasonal mod. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In that case, would you expect the breaker icon to also display on the item tile if an artifact mod could grant it breaker? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yeah, as someone who plays Too Damn Much, all the exotic weapons with breaker-status have permanent names/effects, distinct icons, and tend to get memorized and I don't even look for any icons. So showing permanent and seasonally-conditional results together is more helpful. |
||
); | ||
}, | ||
}, | ||
{ | ||
keywords: 'foundry', | ||
description: tl('Filter.Foundry'), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tricky thing here is that not all of the artifact breaker mods may be active. Do we want to care about that? I assume most folks enable all the breaker mods, at least the basic ones, but then there's always some later column one that I ignore or haven't unlocked...
The tricky part of course being that each character has their own artifact.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the options have problems, but I find thinking "the principle of least surprise": Which model is easiest for users to recognize and understand?
To me, that's the one where the filter is showing consistent breaker potential via mods that may-or-may-not be unlocked yet, as opposed to "works on this character, but not on that character", or "worked yesterday, but not today", etc. In other words, filter results should only change when Bungie alters the seasonal-artifact.