Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@
"affix_Berserker": "Berserker",
"affix_BerserkerValkyrie": "BerserkerValkyrie",
"affix_Bringer": "Bringer",
"affix_Captain": "Captain",
"affix_Carrion": "Carrion",
"affix_Cavalier": "Cavalier",
"affix_Celestial": "Celestial",
Expand Down
59 changes: 34 additions & 25 deletions src/components/baseComponents/AffixesSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,24 @@ import Autocomplete from '@mui/material/Autocomplete';
import React from 'react';
import { useTranslation } from 'react-i18next';
import { makeStyles } from 'tss-react/mui';
import type { AffixName } from '../../utils/gw2-data';
import type { AffixDataEntry, AffixName } from '../../utils/gw2-data';
import { Affix } from '../../utils/gw2-data';
import { objectKeys } from '../../utils/usefulFunctions';

const mistBandId = 80793;

const subLabels: Partial<Record<AffixDataEntry['type'], string>> = {
ascendedMismatchedTrinket: '(trinkets only)',
trinketsBackOnly: '(trinkets/back only)',
};

const createOptions = (array: (AffixName | null)[]) =>
array
.filter((affix) => !!affix)
.map((affix) => ({
label: affix,
category: Affix[affix].category,
subLabel: subLabels[Affix[affix].type],
}));
const order = [
'Hybrid',
Expand Down Expand Up @@ -126,30 +132,33 @@ const AffixesSelect = ({ name, multiple, onChange, value: selected }: AffixesSel
<CheckIcon sx={{ fontSize: '1rem' }} />
)}
</Box>
{option.label === 'Custom' || /[a-z][A-Z]/.test(option.label) ? (
<Item
id={mistBandId}
disableIcon
disableLink
text={
// i18next-extract-mark-context-next-line {{affix}}
t('affix', { context: option.label })
}
className={classes.text}
/>
) : (
<CreateItem
stat={option.label}
type="Ring"
disableLink
disableIcon
text={
// i18next-extract-mark-context-next-line {{affix}}
t('affix', { context: option.label })
}
className={classes.text}
/>
)}
<span>
{option.label === 'Custom' || /[a-z][A-Z]/.test(option.label) ? (
<Item
id={mistBandId}
disableIcon
disableLink
text={
// i18next-extract-mark-context-next-line {{affix}}
t('affix', { context: option.label })
}
className={classes.text}
/>
) : (
<CreateItem
stat={option.label}
type="Ring"
disableLink
disableIcon
text={
// i18next-extract-mark-context-next-line {{affix}}
t('affix', { context: option.label })
}
className={classes.text}
/>
)}
{option.subLabel && <Typography variant="caption"> {option.subLabel}</Typography>}
</span>
</li>
)}
renderTags={(value, getTagProps) =>
Expand Down
1 change: 1 addition & 0 deletions src/components/url-state/schema/SchemaDicts.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export const gearDict = [
'RabidApothecary',
'DireRabid',
'Demolisher',
'Captain',
];

export const professionDict = [
Expand Down
107 changes: 106 additions & 1 deletion src/utils/gw2-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,12 @@ export type AffixName =
| 'BerserkerValkyrie'
| 'RabidApothecary'
| 'DireRabid'
| 'Captain'
| 'Custom';

export type AffixDataEntry =
| {
type: 'triple' | 'quadruple';
type: 'triple' | 'quadruple' | 'trinketsBackOnly';
category: string;
bonuses: {
major: GearAttributeName[];
Expand Down Expand Up @@ -510,6 +511,14 @@ export const Affix: Record<AffixName, AffixDataEntry> = {
jewelMinor: ['Toughness', 'Precision'],
},
},
Captain: {
type: 'trinketsBackOnly',
category: 'Power Survivability',
bonuses: {
major: ['Precision'],
minor: ['Power', 'Toughness'],
},
},
};

export const exoticStats = {
Expand All @@ -532,6 +541,10 @@ export const exoticStats = {
jewelMajor: 0,
jewelMinor: 0,
},
trinketsBackOnly: {
major: 0,
minor: 0,
},
},
SHOULDERS: {
triple: {
Expand All @@ -552,6 +565,10 @@ export const exoticStats = {
jewelMajor: 0,
jewelMinor: 0,
},
trinketsBackOnly: {
major: 0,
minor: 0,
},
},
CHEST: {
triple: {
Expand All @@ -572,6 +589,10 @@ export const exoticStats = {
jewelMajor: 0,
jewelMinor: 0,
},
trinketsBackOnly: {
major: 0,
minor: 0,
},
},
GLOVES: {
triple: {
Expand All @@ -592,6 +613,10 @@ export const exoticStats = {
jewelMajor: 0,
jewelMinor: 0,
},
trinketsBackOnly: {
major: 0,
minor: 0,
},
},
LEGGINGS: {
triple: {
Expand All @@ -612,6 +637,10 @@ export const exoticStats = {
jewelMajor: 0,
jewelMinor: 0,
},
trinketsBackOnly: {
major: 0,
minor: 0,
},
},
BOOTS: {
triple: {
Expand All @@ -632,6 +661,10 @@ export const exoticStats = {
jewelMajor: 0,
jewelMinor: 0,
},
trinketsBackOnly: {
major: 0,
minor: 0,
},
},
AMULET: {
triple: {
Expand All @@ -652,6 +685,10 @@ export const exoticStats = {
jewelMajor: 0,
jewelMinor: 0,
},
trinketsBackOnly: {
major: 0,
minor: 0,
},
},
RING: {
triple: {
Expand All @@ -672,6 +709,10 @@ export const exoticStats = {
jewelMajor: 0,
jewelMinor: 0,
},
trinketsBackOnly: {
major: 0,
minor: 0,
},
},
ACCESSORY: {
triple: {
Expand All @@ -692,6 +733,10 @@ export const exoticStats = {
jewelMajor: 0,
jewelMinor: 0,
},
trinketsBackOnly: {
major: 0,
minor: 0,
},
},
BACK_ITEM: {
triple: {
Expand All @@ -712,6 +757,10 @@ export const exoticStats = {
jewelMajor: 0,
jewelMinor: 0,
},
trinketsBackOnly: {
major: 0,
minor: 0,
},
},
ONEHANDED_WEAPON: {
triple: {
Expand All @@ -732,6 +781,10 @@ export const exoticStats = {
jewelMajor: 0,
jewelMinor: 0,
},
trinketsBackOnly: {
major: 0,
minor: 0,
},
},
TWOHANDED_WEAPON: {
triple: {
Expand All @@ -752,6 +805,10 @@ export const exoticStats = {
jewelMajor: 0,
jewelMinor: 0,
},
trinketsBackOnly: {
major: 0,
minor: 0,
},
},
};

Expand All @@ -775,6 +832,10 @@ export const ascendedStats = {
jewelMajor: 0,
jewelMinor: 0,
},
trinketsBackOnly: {
major: 0,
minor: 0,
},
},
SHOULDERS: {
triple: {
Expand All @@ -795,6 +856,10 @@ export const ascendedStats = {
jewelMajor: 0,
jewelMinor: 0,
},
trinketsBackOnly: {
major: 0,
minor: 0,
},
},
CHEST: {
triple: {
Expand All @@ -815,6 +880,10 @@ export const ascendedStats = {
jewelMajor: 0,
jewelMinor: 0,
},
trinketsBackOnly: {
major: 0,
minor: 0,
},
},
GLOVES: {
triple: {
Expand All @@ -835,6 +904,10 @@ export const ascendedStats = {
jewelMajor: 0,
jewelMinor: 0,
},
trinketsBackOnly: {
major: 0,
minor: 0,
},
},
LEGGINGS: {
triple: {
Expand All @@ -855,6 +928,10 @@ export const ascendedStats = {
jewelMajor: 0,
jewelMinor: 0,
},
trinketsBackOnly: {
major: 0,
minor: 0,
},
},
BOOTS: {
triple: {
Expand All @@ -875,6 +952,10 @@ export const ascendedStats = {
jewelMajor: 0,
jewelMinor: 0,
},
trinketsBackOnly: {
major: 0,
minor: 0,
},
},
AMULET: {
triple: {
Expand All @@ -895,6 +976,10 @@ export const ascendedStats = {
jewelMajor: 32,
jewelMinor: 18,
},
trinketsBackOnly: {
major: 157,
minor: 108,
},
},
RING: {
triple: {
Expand All @@ -915,6 +1000,10 @@ export const ascendedStats = {
jewelMajor: 32,
jewelMinor: 18,
},
trinketsBackOnly: {
major: 126,
minor: 85,
},
},
ACCESSORY: {
triple: {
Expand All @@ -935,6 +1024,10 @@ export const ascendedStats = {
jewelMajor: 32,
jewelMinor: 18,
},
trinketsBackOnly: {
major: 110,
minor: 74,
},
},
BACK_ITEM: {
triple: {
Expand All @@ -955,6 +1048,10 @@ export const ascendedStats = {
jewelMajor: 0,
jewelMinor: 0,
},
trinketsBackOnly: {
major: 63,
minor: 40,
},
},
ONEHANDED_WEAPON: {
triple: {
Expand All @@ -975,6 +1072,10 @@ export const ascendedStats = {
jewelMajor: 0,
jewelMinor: 0,
},
trinketsBackOnly: {
major: 0,
minor: 0,
},
},
TWOHANDED_WEAPON: {
triple: {
Expand All @@ -995,6 +1096,10 @@ export const ascendedStats = {
jewelMajor: 0,
jewelMinor: 0,
},
trinketsBackOnly: {
major: 0,
minor: 0,
},
},
};

Expand Down
Loading