Skip to content

Commit

Permalink
Feat: Add mismatched ascended trinkets (#581)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcustyphoon authored Aug 5, 2023
1 parent 23ae3bb commit 86bba33
Show file tree
Hide file tree
Showing 8 changed files with 206 additions and 7 deletions.
3 changes: 3 additions & 0 deletions locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@
"affix_Apothecary": "Apothecary",
"affix_Assassin": "Assassin",
"affix_Berserker": "Berserker",
"affix_BerserkerValkyrie": "BerserkerValkyrie",
"affix_Bringer": "Bringer",
"affix_Carrion": "Carrion",
"affix_Cavalier": "Cavalier",
Expand All @@ -215,6 +216,7 @@
"affix_Crusader": "Crusader",
"affix_Custom": "Custom",
"affix_Dire": "Dire",
"affix_DireRabid": "DireRabid",
"affix_Diviner": "Diviner",
"affix_Dragon": "Dragon",
"affix_Giver": "Giver",
Expand All @@ -228,6 +230,7 @@
"affix_Nomad": "Nomad",
"affix_Plaguedoctor": "Plaguedoctor",
"affix_Rabid": "Rabid",
"affix_RabidApothecary": "RabidApothecary",
"affix_Rampager": "Rampager",
"affix_Ritualist": "Ritualist",
"affix_Sentinel": "Sentinel",
Expand Down
2 changes: 1 addition & 1 deletion src/components/baseComponents/AffixesSelect.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const AffixesSelect = ({ name, multiple, onChange, value: affixes }) => {
)}
</Box>
)}
{option.label === 'Custom' ? (
{option.label === 'Custom' || /[a-z][A-Z]/.test(option.label) ? (
<Item
id={mistBandId}
disableIcon
Expand Down
10 changes: 9 additions & 1 deletion src/components/sections/results/table/ResultTableRow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ const ResultTableRow = ({
textDecoration = 'underline dotted #ffa405';
if (!exoticRarity(affix, index) && mostCommonRarity !== 'ascended')
textDecoration = 'underline dotted #fb3e8d';

const affixFragments = affix.split(/(?=[A-Z])/).filter((fragment) => fragment !== 'And');
const multiWordAffix = affixFragments.length > 1;

const shortAffix = affixFragments
.map((fragment) => fragment.slice(0, multiWordAffix ? 3 : 4))
.join('');

return (
// eslint-disable-next-line react/no-array-index-key
<TableCell align="center" key={affix + index} padding="none">
Expand All @@ -92,7 +100,7 @@ const ResultTableRow = ({
color: mostCommonAffix && mostCommonAffix !== affix ? '#00cccc' : 'inherit',
}}
>
{affix.slice(0, 4)}
{shortAffix}
</Typography>
</TableCell>
);
Expand Down
3 changes: 3 additions & 0 deletions src/components/url-state/schema/SchemaDicts.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ export const gearDict = [
'Ritualist',
'Dragon',
'Custom',
'BerserkerValkyrie',
'RabidApothecary',
'DireRabid',
];

export const professionDict = [
Expand Down
2 changes: 1 addition & 1 deletion src/state/optimizer/optimizerSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ export function setupCombinations(reduxState: any) {
number,
][];
for (const [type, bonus] of bonuses) {
for (const stat of Affix[affix].bonuses[type]) {
for (const stat of Affix[affix].bonuses[type] ?? []) {
statTotals[stat] = (statTotals[stat] || 0) + bonus;
}
}
Expand Down
Loading

0 comments on commit 86bba33

Please sign in to comment.