From 503d6eee599611d5d8f4117d814f9f33fb6ecb2d Mon Sep 17 00:00:00 2001 From: Adrian Klingen Date: Thu, 28 Sep 2023 20:40:01 +0200 Subject: [PATCH 1/2] Fix warrior suggest gem option with weapon mastery talent --- .gitignore | 1 + ui/warrior/sim.ts | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 96129a0df2..5ff1e4bdd0 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ ui/*/index.html # IDE folders .vscode .idea +.history # binaries dist diff --git a/ui/warrior/sim.ts b/ui/warrior/sim.ts index 64457ebeb2..1360e19f61 100644 --- a/ui/warrior/sim.ts +++ b/ui/warrior/sim.ts @@ -213,8 +213,8 @@ export class WarriorSimUI extends IndividualSimUI { // Rank order red gems to use with their associated stat caps const redGemCaps = new Array<[number, Stats]>(); redGemCaps.push([40117, this.calcArpCap(optimizedGear)]); - const expCap = new Stats().withStat(Stat.StatExpertise, 6.5 * 32.79 + 4); - redGemCaps.push([40118, expCap]); + const expCap = this.calcExpCap(); + redGemCaps.push([40118, expCap]); const critCap = this.calcCritCap(optimizedGear); redGemCaps.push([40111, new Stats()]); @@ -240,6 +240,19 @@ export class WarriorSimUI extends IndividualSimUI { await this.fillGemsToCaps(optimizedGear, yellowSockets, yellowGemCaps, 0, 0); } + calcExpCap(): Stats { + let expCap = 6.5 * 32.79 + 4; + const weaponMastery = this.player.getTalents().weaponMastery; + const hasWeaponMasteryTalent = !!weaponMastery; + + if (hasWeaponMasteryTalent) { + expCap -= + weaponMastery * 4 * Mechanics.EXPERTISE_PER_QUARTER_PERCENT_REDUCTION; + } + + return new Stats().withStat(Stat.StatExpertise, expCap); + } + calcArpCap(gear: Gear): Stats { let arpCap = 1404; From 8dc1ff447254000cc3450f0d3a92b194ce330bf6 Mon Sep 17 00:00:00 2001 From: Adrian Klingen Date: Thu, 28 Sep 2023 20:42:24 +0200 Subject: [PATCH 2/2] Remove unused imports and fix tabs --- ui/warrior/sim.ts | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/ui/warrior/sim.ts b/ui/warrior/sim.ts index 1360e19f61..f10754f070 100644 --- a/ui/warrior/sim.ts +++ b/ui/warrior/sim.ts @@ -8,18 +8,15 @@ import { TristateEffect } from '../core/proto/common.js' import { Stats } from '../core/proto_utils/stats.js'; import { Player } from '../core/player.js'; import { IndividualSimUI } from '../core/individual_sim_ui.js'; -import { EventID, TypedEvent } from '../core/typed_event.js'; +import { TypedEvent } from '../core/typed_event.js'; import { Gear } from '../core/proto_utils/gear.js'; import { ItemSlot } from '../core/proto/common.js'; import { GemColor } from '../core/proto/common.js'; import { Profession } from '../core/proto/common.js'; -import { Warrior, Warrior_Rotation as WarriorRotation, WarriorTalents as WarriorTalents, Warrior_Options as WarriorOptions } from '../core/proto/warrior.js'; -import * as IconInputs from '../core/components/icon_inputs.js'; import * as OtherInputs from '../core/components/other_inputs.js'; import * as Mechanics from '../core/constants/mechanics.js'; -import * as Tooltips from '../core/constants/tooltips.js'; import * as WarriorInputs from './inputs.js'; import * as Presets from './presets.js'; @@ -214,7 +211,7 @@ export class WarriorSimUI extends IndividualSimUI { const redGemCaps = new Array<[number, Stats]>(); redGemCaps.push([40117, this.calcArpCap(optimizedGear)]); const expCap = this.calcExpCap(); - redGemCaps.push([40118, expCap]); + redGemCaps.push([40118, expCap]); const critCap = this.calcCritCap(optimizedGear); redGemCaps.push([40111, new Stats()]); @@ -241,17 +238,17 @@ export class WarriorSimUI extends IndividualSimUI { } calcExpCap(): Stats { - let expCap = 6.5 * 32.79 + 4; - const weaponMastery = this.player.getTalents().weaponMastery; - const hasWeaponMasteryTalent = !!weaponMastery; - + let expCap = 6.5 * 32.79 + 4; + const weaponMastery = this.player.getTalents().weaponMastery; + const hasWeaponMasteryTalent = !!weaponMastery; + if (hasWeaponMasteryTalent) { - expCap -= - weaponMastery * 4 * Mechanics.EXPERTISE_PER_QUARTER_PERCENT_REDUCTION; - } + expCap -= + weaponMastery * 4 * Mechanics.EXPERTISE_PER_QUARTER_PERCENT_REDUCTION; + } - return new Stats().withStat(Stat.StatExpertise, expCap); - } + return new Stats().withStat(Stat.StatExpertise, expCap); + } calcArpCap(gear: Gear): Stats { let arpCap = 1404;