Skip to content

Commit

Permalink
Merge pull request #921 from wowsims/fix/demo-lock-mastery-breakpoints
Browse files Browse the repository at this point in the history
[WARLOCK][DEMO] Fix Mastery flooring breakpoints
  • Loading branch information
1337LutZ authored Aug 8, 2024
2 parents 20007b5 + e953c6b commit e4af386
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
14 changes: 10 additions & 4 deletions ui/core/components/suggest_reforges_action.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -256,17 +256,24 @@ export class ReforgeOptimizer {
{breakpoints.map((breakpoint, breakpointIndex) => (
<tr>
<td>{Math.round(breakpoint)}</td>
<td className="text-end">{statToPercentageOrPoints(stat, breakpoint, new Stats()).toFixed(2)}</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()).toFixed(2)}
</td>
<td className="text-end">{capType === StatCapType.TypeThreshold ? postCapEPs[0] : postCapEPs[breakpointIndex]}</td>
</tr>
))}
{index !== this.softCapsConfig.length - 1 && (
<>
<tr>
<td colSpan={2} className="border-bottom pb-2"></td>
<td colSpan={3} className="border-bottom pb-2"></td>
</tr>
<tr>
<td colSpan={2} className="pb-2"></td>
<td colSpan={3} className="pb-2"></td>
</tr>
</>
)}
Expand Down Expand Up @@ -660,7 +667,6 @@ 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
7 changes: 3 additions & 4 deletions ui/warlock/affliction/sim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,10 @@ const SPEC_CONFIG = registerSpecConfig(Spec.SpecAfflictionWarlock, {
// These should be removed once the bugfix to make Mastery
// continuous goes live!
const masteryRatingBreakpoints = [];
const masteryPercentPerPoint = Mechanics.masteryPercentPerPoint.get(Spec.SpecAfflictionWarlock)!;

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

const masterySoftCapConfig = {
Expand Down
7 changes: 4 additions & 3 deletions ui/warlock/demonology/sim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,11 @@ const SPEC_CONFIG = registerSpecConfig(Spec.SpecDemonologyWarlock, {
// These should be removed once the bugfix to make Mastery
// continuous goes live!
const masteryRatingBreakpoints = [];

for (let masteryPercent = 19; masteryPercent <= 200; masteryPercent++) {
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(
(masteryPercent / Mechanics.masteryPercentPerPoint.get(Spec.SpecDemonologyWarlock)!) * Mechanics.MASTERY_RATING_PER_MASTERY_POINT,
Math.round(initialMasteryOffset + masteryPercent * (Mechanics.MASTERY_RATING_PER_MASTERY_POINT / masteryPercentPerPoint)),
);
}

Expand Down

0 comments on commit e4af386

Please sign in to comment.