Skip to content
Draft
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
2 changes: 2 additions & 0 deletions locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"DPSType_Poison": "Poison DPS",
"DPSType_Power": "Power DPS",
"DPSType_Power2": "Power2 DPS",
"DPSType_Reflect": "Reflect",
"DPSType_Torment": "Torment DPS",
"Damage": "Damage",
"Damage Change from ±5 Stat:": "Damage Change from ±5 Stat:",
Expand Down Expand Up @@ -152,6 +153,7 @@
"Raids": "Raids",
"Raids/Strikes": "Raids/Strikes",
"Reapply template?": "Reapply template?",
"Reflect": "Reflect",
"Relevant for condi optimizations; enter boss attack rate and movement uptime for approximating confusion/torment condition damage.": "Relevant for condi optimizations; enter boss attack rate and movement uptime for approximating confusion/torment condition damage.",
"Relics": "Relics",
"Result Display Settings:": "Result Display Settings:",
Expand Down
2 changes: 1 addition & 1 deletion src/assets/presetdata/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export interface Credit {
log?: string;
}
export type PresetDistributionEntry = PresetEntry & {
value: { values2: Distribution };
value: { values2: Omit<Distribution, 'Reflect'> };
noCreditOkay?: true;
credit?: Credit[];
};
Expand Down
32 changes: 22 additions & 10 deletions src/components/sections/distribution/DamageDistribution.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const DISTRIBUTION_NAMES = [
{ name: 'Poisoned', min: 0, max: 60, step: 0.1 },
{ name: 'Torment', min: 0, max: 60, step: 0.1 },
{ name: 'Confusion', min: 0, max: 60, step: 0.1 },
{ name: 'Reflect', min: 0, max: 6000, step: 10, color: '#b1b1b5' },
] as const;

const DamageDistribution = () => {
Expand Down Expand Up @@ -73,22 +74,33 @@ const DamageDistribution = () => {
<Box>
<FormControl className={classes.textbox} variant="standard">
<InputLabel htmlFor={`input-with-icon-adornment-${index}`}>
{dist.name === 'Power' || dist.name === 'Power2' ? (
<Attribute
name="Power"
disableLink
text={dist.name === 'Power2' ? alternativeDamageLabel : undefined}
/>
) : (
<Condition name={dist.name} disableLink />
)}
{
// eslint-disable-next-line no-nested-ternary
dist.name === 'Power' || dist.name === 'Power2' ? (
<Attribute
name="Power"
disableLink
text={dist.name === 'Power2' ? alternativeDamageLabel : undefined}
/>
) : dist.name === 'Reflect' ? (
<Attribute
name="Power"
disableLink
disableTooltip
// todo: translate this
text="Opponent-Power Reflect"
/>
) : (
<Condition name={dist.name} disableLink />
)
}
</InputLabel>
<Input
id={`input-with-icon-adornment-${index}`}
value={textBoxes[dist.name]}
endAdornment={
<InputAdornment position="end">
{dist.name === 'Power' || dist.name === 'Power2' ? (
{dist.name === 'Power' || dist.name === 'Power2' || dist.name === 'Reflect' ? (
<Attribute name="Power" disableLink disableText />
) : (
<Condition name={dist.name} disableLink disableText />
Expand Down
4 changes: 3 additions & 1 deletion src/components/sections/results/OutputDistribution.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const OutputDistribution = ({ character }: { character: Character }) => {
Power: t('Power'),
Power2: alternativeDamageLabel,
Siphon: t('Life Siphon'),
Reflect: t('Reflect'),
Flat: t('Other'),
};

Expand Down Expand Up @@ -63,7 +64,8 @@ const OutputDistribution = ({ character }: { character: Character }) => {
// eslint-disable-next-line no-nested-ternary
damageType.name === 'Power' ||
damageType.name === 'Power2' ||
damageType.name === 'Siphon' ? (
damageType.name === 'Siphon' ||
damageType.name === 'Reflect' ? (
<Attribute
name="Power"
className={classes.gw2Item}
Expand Down
2 changes: 1 addition & 1 deletion src/components/sections/results/TemplateHelper.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ const TemplateHelper = ({ character }) => {
{data.map(({ key }) => (
<td key={key}>
{
// i18next-extract-mark-context-next-line ["Power","Power2","Burning","Bleeding","Poison","Torment", "Confusion"]
// i18next-extract-mark-context-next-line ["Power","Power2","Burning","Bleeding","Poison","Torment", "Confusion","Reflect"]
t('DPSType', { context: key })
}
</td>
Expand Down
10 changes: 10 additions & 0 deletions src/state/optimizer/optimizerCore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,16 @@ export class OptimizerCore {

attributes['Power DPS'] = powerDamage;

const reflectEffectivePower = 1000 * (1 + critChance * (critDmg - 1));

const reflectPowerDamage =
(attributes['Reflect Coefficient'] / 2597) *
reflectEffectivePower *
damageMultiplier['Outgoing Strike Damage'];

attributes['Reflect DPS'] = reflectPowerDamage;
powerDamage += reflectPowerDamage;

if (attributes['Power2 Coefficient']) {
if (settings.profession === 'Mesmer') {
// mesmer illusions: special bonuses are INSTEAD OF player attributes
Expand Down
1 change: 1 addition & 0 deletions src/state/optimizer/optimizerSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,7 @@ export function createSettingsPerCombination(

'Power Coefficient': distribution.Power,
'Power2 Coefficient': distribution.Power2,
'Reflect Coefficient': distribution.Reflect,
'Burning Coefficient': distribution.Burning,
'Bleeding Coefficient': distribution.Bleeding,
'Poison Coefficient': distribution.Poisoned, // renamed
Expand Down
6 changes: 4 additions & 2 deletions src/state/optimizer/types/optimizerSetupTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,17 @@ export type DistributionNameUI =
| 'Bleeding'
| 'Poisoned'
| 'Torment'
| 'Confusion';
| 'Confusion'
| 'Reflect';
export type DistributionNameInternal =
| 'Power'
| 'Power2'
| 'Burning'
| 'Bleeding'
| 'Poison'
| 'Torment'
| 'Confusion';
| 'Confusion'
| 'Reflect';

interface MultiplierBreakdown {
mult: number;
Expand Down
16 changes: 11 additions & 5 deletions src/state/slices/distribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export interface Distribution {
Poisoned: number;
Torment: number;
Confusion: number;
Reflect: number;
}

interface DistributionText {
Expand All @@ -26,6 +27,7 @@ interface DistributionText {
Poisoned: string | number;
Torment: string | number;
Confusion: string | number;
Reflect: string | number;
}

const initialState: {
Expand All @@ -46,6 +48,7 @@ const initialState: {
Poisoned: 0,
Torment: 0,
Confusion: 0,
Reflect: 0,
},
textBoxes: {
Power: '3000',
Expand All @@ -55,6 +58,7 @@ const initialState: {
Poisoned: '0',
Torment: '0',
Confusion: '0',
Reflect: '0',
},
};

Expand Down Expand Up @@ -87,15 +91,15 @@ export const distributionSlice = createSlice({
},
changeAllDistributions: (
state,
action: PayloadAction<{ name: string; value: { values2: Distribution } }>,
action: PayloadAction<{ name: string; value: { values2: Omit<Distribution, 'Reflect'> } }>,
) => {
const { name, value: distributionPreset } = action.payload;
try {
return {
...state,
selectedDistribution: name,
values2: distributionPreset.values2,
textBoxes: distributionPreset.values2,
values2: { Reflect: 0, ...distributionPreset.values2 },
textBoxes: { Reflect: 0, ...distributionPreset.values2 },
};
} catch (e) {
console.error(e);
Expand All @@ -110,6 +114,8 @@ export const distributionSlice = createSlice({
const newState = clone(action.payload.form.distribution);
newState.values2.Power2 ??= 0;
newState.textBoxes.Power2 ??= '0';
newState.values2.Reflect ??= 0;
newState.textBoxes.Reflect ??= '0';

return { ...state, ...newState };
}
Expand All @@ -123,8 +129,8 @@ export const distributionSlice = createSlice({
selectedDistribution,
version: 2,
values1: {},
values2: distributionPreset.values2,
textBoxes: distributionPreset.values2,
values2: { Reflect: 0, ...distributionPreset.values2 },
textBoxes: { Reflect: 0, ...distributionPreset.values2 },
};
}
return state;
Expand Down
8 changes: 8 additions & 0 deletions src/utils/gw2-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1700,6 +1700,13 @@ export const siphonAttributes = [
] as const;
export type SiphonAttributeName = (typeof siphonAttributes)[number];

export const reflectAttributes = [
'Reflect Coefficient',
'Reflect Base Coefficient',
'Reflect DPS',
] as const;
export type ReflectAttributeName = (typeof reflectAttributes)[number];

export const miscAttributes = [
'Maximum Health',
'Outgoing Healing',
Expand Down Expand Up @@ -1728,6 +1735,7 @@ export type AttributeName =
| AlternativeAttributeName
| ProfessionAttributeName
| SiphonAttributeName
| ReflectAttributeName
| MiscAttributeName;

export type GearAttributeName = PrimaryAttributeName | SecondaryAttributeName;
Expand Down