Skip to content

Commit

Permalink
Merge pull request #922 from wowsims/fix/demo-lock-mastery-breakpoints
Browse files Browse the repository at this point in the history
[WARLOCK] Visual Mastery breakpoints
  • Loading branch information
1337LutZ authored Aug 8, 2024
2 parents e4af386 + 0fb7a84 commit 7abb23b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
16 changes: 11 additions & 5 deletions ui/core/components/suggest_reforges_action.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,18 @@ export class ReforgeOptimizer {
</tr>
{breakpoints.map((breakpoint, breakpointIndex) => (
<tr>
<td>{Math.round(breakpoint)}</td>
<td>
{Math.ceil(
stat === Stat.StatMastery
? breakpoint - this.player.getBaseMastery() * Mechanics.MASTERY_RATING_PER_MASTERY_POINT
: breakpoint,
)}
</td>
<td className="text-end">
{stat === Stat.StatMastery
? (
(statToPercentageOrPoints(stat, breakpoint, new Stats()) + this.player.getBaseMastery()) *
this.player.getMasteryPerPointModifier()
).toFixed(2)
? (statToPercentageOrPoints(stat, breakpoint, new Stats()) * this.player.getMasteryPerPointModifier()).toFixed(
2,
)
: statToPercentageOrPoints(stat, breakpoint, new Stats()).toFixed(2)}
</td>
<td className="text-end">{capType === StatCapType.TypeThreshold ? postCapEPs[0] : postCapEPs[breakpointIndex]}</td>
Expand Down Expand Up @@ -667,6 +672,7 @@ export class ReforgeOptimizer {
this.player.setGear(TypedEvent.nextEventID(), gear);
await this.sim.updateCharacterStats(TypedEvent.nextEventID());
let baseStats = Stats.fromProto(this.player.getCurrentStats().finalStats);
baseStats = baseStats.addStat(Stat.StatMastery, this.player.getBaseMastery() * Mechanics.MASTERY_RATING_PER_MASTERY_POINT);
if (this.updateGearStatsModifier) baseStats = this.updateGearStatsModifier(baseStats);
return baseStats.withHasteMultipliers(this.playerClass);
}
Expand Down
2 changes: 1 addition & 1 deletion ui/warlock/affliction/sim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const SPEC_CONFIG = registerSpecConfig(Spec.SpecAfflictionWarlock, {
const masteryRatingBreakpoints = [];
const masteryPercentPerPoint = Mechanics.masteryPercentPerPoint.get(Spec.SpecAfflictionWarlock)!;

for (let masteryPercent = 1; masteryPercent <= 200; masteryPercent++) {
for (let masteryPercent = 14; masteryPercent <= 200; masteryPercent++) {
masteryRatingBreakpoints.push((masteryPercent / masteryPercentPerPoint) * Mechanics.MASTERY_RATING_PER_MASTERY_POINT);
}

Expand Down
7 changes: 2 additions & 5 deletions ui/warlock/demonology/sim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,8 @@ const SPEC_CONFIG = registerSpecConfig(Spec.SpecDemonologyWarlock, {
// continuous goes live!
const masteryRatingBreakpoints = [];
const masteryPercentPerPoint = Mechanics.masteryPercentPerPoint.get(Spec.SpecDemonologyWarlock)!;
const initialMasteryOffset = Math.round((Mechanics.MASTERY_RATING_PER_MASTERY_POINT / masteryPercentPerPoint) * 0.6);
for (let masteryPercent = 0; masteryPercent <= 200; masteryPercent++) {
masteryRatingBreakpoints.push(
Math.round(initialMasteryOffset + masteryPercent * (Mechanics.MASTERY_RATING_PER_MASTERY_POINT / masteryPercentPerPoint)),
);
for (let masteryPercent = 19; masteryPercent <= 200; masteryPercent++) {
masteryRatingBreakpoints.push((masteryPercent / masteryPercentPerPoint) * Mechanics.MASTERY_RATING_PER_MASTERY_POINT);
}

const masterySoftCapConfig = {
Expand Down

0 comments on commit 7abb23b

Please sign in to comment.