Skip to content

Commit

Permalink
Merge pull request #3776 from 1337LutZ/feature/remove-arms-expertise-…
Browse files Browse the repository at this point in the history
…suggest

Add option to disable auto-gemming expertise
  • Loading branch information
TheGroxEmpire authored Sep 29, 2023
2 parents 8b6e8f0 + a3a08c0 commit b1fedac
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
15 changes: 15 additions & 0 deletions ui/core/player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ export class Player<SpecType extends Spec> {
private distanceFromTarget: number = 0;
private healingModel: HealingModel = HealingModel.create();
private healingEnabled: boolean = false;
private disableExpertiseGemming: boolean = false;

private autoRotationGenerator: AutoRotationGenerator<SpecType> | null = null;
private simpleRotationGenerator: SimpleRotationGenerator<SpecType> | null = null;
Expand Down Expand Up @@ -253,6 +254,7 @@ export class Player<SpecType extends Spec> {
readonly inFrontOfTargetChangeEmitter = new TypedEvent<void>('PlayerInFrontOfTarget');
readonly distanceFromTargetChangeEmitter = new TypedEvent<void>('PlayerDistanceFromTarget');
readonly healingModelChangeEmitter = new TypedEvent<void>('PlayerHealingModel');
readonly disableExpertiseGemmingChangeEmitter = new TypedEvent<void>('DisableExpertiseGemming');
readonly epWeightsChangeEmitter = new TypedEvent<void>('PlayerEpWeights');
readonly miscOptionsChangeEmitter = new TypedEvent<void>('PlayerMiscOptions');

Expand Down Expand Up @@ -295,6 +297,7 @@ export class Player<SpecType extends Spec> {
this.inFrontOfTargetChangeEmitter,
this.distanceFromTargetChangeEmitter,
this.healingModelChangeEmitter,
this.disableExpertiseGemmingChangeEmitter,
this.epWeightsChangeEmitter,
this.epRatiosChangeEmitter,
this.epRefStatChangeEmitter,
Expand Down Expand Up @@ -905,6 +908,18 @@ export class Player<SpecType extends Spec> {
this.healingModelChangeEmitter.emit(eventID);
}

getDisableExpertiseGemming(): boolean {
return this.disableExpertiseGemming;
}

setDisableExpertiseGemming(eventID: EventID, newDisableExpertiseGemming: boolean) {
if (newDisableExpertiseGemming == this.disableExpertiseGemming)
return;

this.disableExpertiseGemming = newDisableExpertiseGemming;
this.disableExpertiseGemmingChangeEmitter.emit(eventID);
}

computeStatsEP(stats?: Stats): number {
if (stats == undefined) {
return 0;
Expand Down
13 changes: 13 additions & 0 deletions ui/warrior/inputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,19 @@ export const StartingRage = InputHelpers.makeSpecOptionsNumberInput<Spec.SpecWar
labelTooltip: 'Initial rage at the start of each iteration.',
});

// Allows for auto gemming whilst ignoring expertise cap
// (Useful for Arms)
export const DisableExpertiseGemming = {
type: 'boolean' as const,
label: 'Disable expertise gemming',
labelTooltip: 'Disables auto gemming for expertise',
changedEvent: (player: Player<any>) => player.disableExpertiseGemmingChangeEmitter,
getValue: (player: Player<any>) => player.getDisableExpertiseGemming(),
setValue: (eventID: EventID, player: Player<any>, newValue: boolean) => {
player.setDisableExpertiseGemming(eventID, newValue);
},
};

export const StanceSnapshot = InputHelpers.makeSpecOptionsBooleanInput<Spec.SpecWarrior>({
fieldName: 'stanceSnapshot',
label: 'Stance Snapshot',
Expand Down
11 changes: 9 additions & 2 deletions ui/warrior/sim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ export class WarriorSimUI extends IndividualSimUI<Spec.SpecWarrior> {
inputs: [
WarriorInputs.StartingRage,
WarriorInputs.StanceSnapshot,
WarriorInputs.DisableExpertiseGemming,
OtherInputs.TankAssignment,
OtherInputs.InFrontOfTarget,
],
Expand Down Expand Up @@ -210,8 +211,12 @@ 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)]);
// Should we gem expertise?
const enableExpertiseGemming = !this.player.getDisableExpertiseGemming()
const expCap = this.calcExpCap();
redGemCaps.push([40118, expCap]);
if(enableExpertiseGemming){
redGemCaps.push([40118, expCap]);
}
const critCap = this.calcCritCap(optimizedGear);
redGemCaps.push([40111, new Stats()]);

Expand All @@ -231,7 +236,9 @@ export class WarriorSimUI extends IndividualSimUI<Spec.SpecWarrior> {
const yellowGemCaps = new Array<[number, Stats]>();
const hitCap = new Stats().withStat(Stat.StatMeleeHit, 8. * 32.79 + 4);
yellowGemCaps.push([40125, hitCap]);
yellowGemCaps.push([40162, hitCap.add(expCap)]);
if(enableExpertiseGemming){
yellowGemCaps.push([40162, hitCap.add(expCap)]);
}
yellowGemCaps.push([40143, hitCap]);
yellowGemCaps.push([40142, critCap]);
await this.fillGemsToCaps(optimizedGear, yellowSockets, yellowGemCaps, 0, 0);
Expand Down

0 comments on commit b1fedac

Please sign in to comment.