Skip to content

Commit

Permalink
Merge pull request #3775 from 1337LutZ/master
Browse files Browse the repository at this point in the history
Fix warrior suggest gem option with weapon mastery talent
  • Loading branch information
TheGroxEmpire authored Sep 28, 2023
2 parents 344ee8c + 8dc1ff4 commit 8b6e8f0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 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
20 changes: 15 additions & 5 deletions ui/warrior/sim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -213,7 +210,7 @@ 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);
const expCap = this.calcExpCap();
redGemCaps.push([40118, expCap]);
const critCap = this.calcCritCap(optimizedGear);
redGemCaps.push([40111, new Stats()]);
Expand All @@ -240,6 +237,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 8b6e8f0

Please sign in to comment.