@rian8337/osu-rebalance-difficulty-calculator 4.0.0-beta.95 → 4.0.0-beta.96
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +35 -13
- package/package.json +3 -3
- package/typings/index.d.ts +4 -0
package/dist/index.js
CHANGED
|
@@ -533,16 +533,16 @@ class DroidSnapAimEvaluator {
|
|
|
533
533
|
const radius = current.normalizedRadius;
|
|
534
534
|
const diameter = current.normalizedDiameter;
|
|
535
535
|
// Calculate the velocity to the current hitobject, which starts with a base distance / time assuming the last object is a hitcircle.
|
|
536
|
-
const currentDistance = withSliders
|
|
536
|
+
const currentDistance = withSliders && !current.is2BSlider
|
|
537
537
|
? current.lazyJumpDistance
|
|
538
538
|
: current.jumpDistance;
|
|
539
539
|
let currentVelocity = currentDistance / current.strainTime;
|
|
540
540
|
// But if the last object is a slider, then we extend the travel velocity through the slider into the current object.
|
|
541
|
-
if (last.object instanceof osuBase.Slider && withSliders) {
|
|
541
|
+
if (last.object instanceof osuBase.Slider && !last.is2BSlider && withSliders) {
|
|
542
542
|
const sliderDistance = last.lazyTravelDistance + current.lazyJumpDistance;
|
|
543
543
|
currentVelocity = Math.max(currentVelocity, sliderDistance / current.strainTime);
|
|
544
544
|
}
|
|
545
|
-
const prevDistance = withSliders
|
|
545
|
+
const prevDistance = withSliders && !last.is2BSlider
|
|
546
546
|
? last.lazyJumpDistance
|
|
547
547
|
: last.jumpDistance;
|
|
548
548
|
const prevVelocity = prevDistance / last.strainTime;
|
|
@@ -716,14 +716,14 @@ class DroidFlowAimEvaluator {
|
|
|
716
716
|
}
|
|
717
717
|
const last = current.previous(0);
|
|
718
718
|
const lastLast = current.previous(1);
|
|
719
|
-
const currentDistance = withSliders
|
|
719
|
+
const currentDistance = withSliders && !current.is2BSlider
|
|
720
720
|
? current.lazyJumpDistance
|
|
721
721
|
: current.jumpDistance;
|
|
722
|
-
const prevDistance = withSliders
|
|
722
|
+
const prevDistance = withSliders && !last.is2BSlider
|
|
723
723
|
? last.lazyJumpDistance
|
|
724
724
|
: last.jumpDistance;
|
|
725
725
|
let currentVelocity = currentDistance / current.strainTime;
|
|
726
|
-
if (last.object instanceof osuBase.Slider && withSliders) {
|
|
726
|
+
if (last.object instanceof osuBase.Slider && !last.is2BSlider && withSliders) {
|
|
727
727
|
// If the last object is a slider, then we extend the travel velocity through the slider into the current object.
|
|
728
728
|
const sliderDistance = last.lazyTravelDistance + current.lazyJumpDistance;
|
|
729
729
|
currentVelocity = Math.max(currentVelocity, sliderDistance / current.strainTime);
|
|
@@ -1812,20 +1812,29 @@ class DroidTapEvaluator {
|
|
|
1812
1812
|
current.isOverlapping(false)) {
|
|
1813
1813
|
return 0;
|
|
1814
1814
|
}
|
|
1815
|
+
let { strainTime } = current;
|
|
1816
|
+
// Nerf doubletappable doubles.
|
|
1815
1817
|
const doubletapness = considerCheesability
|
|
1816
1818
|
? 1 - current.getDoubletapness(current.next(0))
|
|
1817
1819
|
: 1;
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1820
|
+
// Cap deltatime to the OD 300 hitwindow.
|
|
1821
|
+
// 0.63 is derived from making sure 200 BPM 1/4 OD8 streams aren't nerfed harshly, whilst 0.92 limits the effect of the cap.
|
|
1822
|
+
strainTime /= osuBase.MathUtils.clamp(strainTime / current.hitWindowFor(osuBase.HitResult.Great) / 0.63, 0.92, 1);
|
|
1823
|
+
// speedBonus will be 0 for BPM < 200
|
|
1824
|
+
let speedBonus = 0;
|
|
1825
|
+
// Add additional scaling bonus for streams/bursts higher than 200bpm
|
|
1826
|
+
if (osuBase.MathUtils.millisecondsToBPM(strainTime) > this.minSpeedBonus) {
|
|
1827
|
+
speedBonus =
|
|
1821
1828
|
0.75 *
|
|
1822
1829
|
Math.pow(osuBase.ErrorFunction.erf((osuBase.MathUtils.bpmToMilliseconds(this.minSpeedBonus) -
|
|
1823
|
-
|
|
1830
|
+
strainTime) /
|
|
1824
1831
|
40), 2);
|
|
1825
1832
|
}
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1833
|
+
// Base difficulty with all bonuses
|
|
1834
|
+
let difficulty = ((1 + speedBonus) * 1000) / strainTime;
|
|
1835
|
+
difficulty *= this.highBpmBonus(current.strainTime);
|
|
1836
|
+
// Apply penalty if there's doubletappable doubles
|
|
1837
|
+
return difficulty * doubletapness;
|
|
1829
1838
|
}
|
|
1830
1839
|
static highBpmBonus(ms) {
|
|
1831
1840
|
return 1 / (1 - Math.pow(0.3, ms / 1000));
|
|
@@ -2493,6 +2502,19 @@ class DifficultyHitObject {
|
|
|
2493
2502
|
get angle() {
|
|
2494
2503
|
return this.angleSigned !== null ? Math.abs(this.angleSigned) : null;
|
|
2495
2504
|
}
|
|
2505
|
+
/**
|
|
2506
|
+
* Whether this hitobject is a 2B slider.
|
|
2507
|
+
*/
|
|
2508
|
+
get is2BSlider() {
|
|
2509
|
+
if (!(this.object instanceof osuBase.Slider)) {
|
|
2510
|
+
return false;
|
|
2511
|
+
}
|
|
2512
|
+
const next = this.next(0);
|
|
2513
|
+
if (!next) {
|
|
2514
|
+
return false;
|
|
2515
|
+
}
|
|
2516
|
+
return this.endTime - this.startTime > next.strainTime;
|
|
2517
|
+
}
|
|
2496
2518
|
/**
|
|
2497
2519
|
* The normalized diameter of the hitobject.
|
|
2498
2520
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rian8337/osu-rebalance-difficulty-calculator",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.96",
|
|
4
4
|
"description": "A module for calculating osu!standard beatmap difficulty and performance value with respect to the latest osu!lazer difficulty and performance algorithm.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"osu",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"url": "https://github.com/Rian8337/osu-droid-module/issues"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@rian8337/osu-base": "4.0.0-beta.
|
|
36
|
+
"@rian8337/osu-base": "4.0.0-beta.96"
|
|
37
37
|
},
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "13af8d35ad74141c270c6b985941b5f2a14e248b"
|
|
42
42
|
}
|
package/typings/index.d.ts
CHANGED
|
@@ -130,6 +130,10 @@ declare abstract class DifficultyHitObject {
|
|
|
130
130
|
* The beatmap clock rate.
|
|
131
131
|
*/
|
|
132
132
|
readonly clockRate: number;
|
|
133
|
+
/**
|
|
134
|
+
* Whether this hitobject is a 2B slider.
|
|
135
|
+
*/
|
|
136
|
+
get is2BSlider(): boolean;
|
|
133
137
|
/**
|
|
134
138
|
* Selective bonus for beatmaps with higher circle size.
|
|
135
139
|
*/
|