Skip to content

Commit

Permalink
Fix warrior suggest gem option with weapon mastery talent
Browse files Browse the repository at this point in the history
  • Loading branch information
1337LutZ committed Sep 28, 2023
1 parent 344ee8c commit 503d6ee
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ ui/*/index.html
# IDE folders
.vscode
.idea
.history

# binaries
dist
Expand Down
17 changes: 15 additions & 2 deletions ui/warrior/sim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ export class WarriorSimUI extends IndividualSimUI<Spec.SpecWarrior> {
// 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()]);

Expand All @@ -240,6 +240,19 @@ export class WarriorSimUI extends IndividualSimUI<Spec.SpecWarrior> {
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;

Expand Down

0 comments on commit 503d6ee

Please sign in to comment.