diff --git a/src/curve/BeatLeaderCurve.js b/src/curve/BeatLeaderCurve.js index 1099784..ada8605 100644 --- a/src/curve/BeatLeaderCurve.js +++ b/src/curve/BeatLeaderCurve.js @@ -1,3 +1,5 @@ +import Utils from "../utils/utils"; + /** * I'm not even sure what this shit does, ask BL * @see https://github.com/BeatLeader/beatleader-server/blob/16123a792b1a837faf6287e5bcd58e2e06e6a6f0/Utils/ReplayUtils.cs for more info @@ -24,20 +26,25 @@ export function getBeatLeaderPP(acc, stars) { if (stars === undefined || acc === undefined) { return undefined; } - let pp = curve(acc, stars - 0.5) * (stars + 0.5) * 42; + const modifierBonus = Utils.calculateModifierBonus(); + //let rawPP = curve(acc, stars - 0.5) * (stars + 0.5) * 42; + let fullPP = + curve(acc, stars * modifierBonus - 0.5) * + (stars * modifierBonus + 0.5) * + 42; const isNegativeAcc = acc < 0; if (isNegativeAcc) { acc *= -1; } - if (pp == NaN || pp == Infinity) { + if (fullPP == NaN || fullPP == Infinity) { return 1024; } if (isNegativeAcc) { - pp *= -1; + fullPP *= -1; } - return pp; + return fullPP; } diff --git a/src/utils/utils.js b/src/utils/utils.js index 83bc72f..feca23f 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -37,7 +37,7 @@ export default class Utils { return undefined; } if (type === "BeatLeader") { - return getBeatLeaderPP(acc, stars) * (1 + this.calculateModifierBonus()); + return getBeatLeaderPP(acc, stars); } if (type === "ScoreSaber") { return getScoreSaberPP(acc, stars);