@rian8337/osu-rebalance-difficulty-calculator 1.4.12-alpha.2 → 1.4.12-alpha.3
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.
|
@@ -93,6 +93,10 @@ class DifficultyHitObject {
|
|
|
93
93
|
* Adjusted start time of the hitobject, taking speed multiplier into account.
|
|
94
94
|
*/
|
|
95
95
|
this.startTime = 0;
|
|
96
|
+
/**
|
|
97
|
+
* Adjusted end time of the hitobject, taking speed multiplier into account.
|
|
98
|
+
*/
|
|
99
|
+
this.endTime = 0;
|
|
96
100
|
/**
|
|
97
101
|
* The note density of the hitobject.
|
|
98
102
|
*/
|
|
@@ -55,6 +55,7 @@ class DifficultyHitObjectCreator {
|
|
|
55
55
|
const lastObject = difficultyObjects[i - 1];
|
|
56
56
|
const lastLastObject = difficultyObjects[i - 2];
|
|
57
57
|
object.startTime = object.object.startTime / params.speedMultiplier;
|
|
58
|
+
object.endTime = object.object.endTime / params.speedMultiplier;
|
|
58
59
|
if (!lastObject) {
|
|
59
60
|
difficultyObjects.push(object);
|
|
60
61
|
continue;
|
|
@@ -66,11 +67,26 @@ class DifficultyHitObjectCreator {
|
|
|
66
67
|
object.strainTime = Math.max(this.minDeltaTime, object.deltaTime);
|
|
67
68
|
const visibleObjects = params.objects.filter((o) => o.startTime / params.speedMultiplier > object.startTime &&
|
|
68
69
|
o.startTime / params.speedMultiplier <=
|
|
69
|
-
object.
|
|
70
|
+
object.endTime + params.preempt);
|
|
70
71
|
object.noteDensity = 1;
|
|
71
72
|
for (const hitObject of visibleObjects) {
|
|
72
|
-
|
|
73
|
+
// Calculate delta time assuming the current object is a circle.
|
|
74
|
+
let deltaTime = Math.abs(hitObject.startTime / params.speedMultiplier -
|
|
73
75
|
object.startTime);
|
|
76
|
+
// But if the current object is a slider, then we alter the delta time to account for slider end time.
|
|
77
|
+
if (object.object instanceof osu_base_1.Slider) {
|
|
78
|
+
if (object.object.startTime >= hitObject.startTime &&
|
|
79
|
+
object.object.endTime <= hitObject.startTime) {
|
|
80
|
+
// If the object starts when the slider is active, then the slider is technically still visible.
|
|
81
|
+
// Set delta time to 0.
|
|
82
|
+
deltaTime = 0;
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
// Otherwise, we take the delta time from the slider head or tail, whichever is smaller as it's the closest time.
|
|
86
|
+
deltaTime = Math.min(deltaTime, Math.abs(hitObject.startTime / params.speedMultiplier -
|
|
87
|
+
object.endTime));
|
|
88
|
+
}
|
|
89
|
+
}
|
|
74
90
|
object.noteDensity += 1 - deltaTime / params.preempt;
|
|
75
91
|
if (!(hitObject instanceof osu_base_1.Spinner)) {
|
|
76
92
|
object.overlappingFactor +=
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rian8337/osu-rebalance-difficulty-calculator",
|
|
3
|
-
"version": "1.4.12-alpha.
|
|
3
|
+
"version": "1.4.12-alpha.3",
|
|
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",
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"access": "public"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "ffaf0faa1963b88275a70d90116f1f7ed0a2c474"
|
|
39
39
|
}
|
package/typings/index.d.ts
CHANGED
|
@@ -105,6 +105,10 @@ declare module "@rian8337/osu-rebalance-difficulty-calculator" {
|
|
|
105
105
|
* Adjusted start time of the hitobject, taking speed multiplier into account.
|
|
106
106
|
*/
|
|
107
107
|
startTime: number;
|
|
108
|
+
/**
|
|
109
|
+
* Adjusted end time of the hitobject, taking speed multiplier into account.
|
|
110
|
+
*/
|
|
111
|
+
endTime: number;
|
|
108
112
|
/**
|
|
109
113
|
* The note density of the hitobject.
|
|
110
114
|
*/
|