1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-06 23:12:54 +08:00

initial commit

This commit is contained in:
Givikap120 2024-10-12 02:39:14 +03:00
parent 3a8ed889b5
commit 340116148f

View File

@ -295,12 +295,11 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Preprocessing
for (int i = 1; i < nestedObjects.Count; i++) for (int i = 1; i < nestedObjects.Count; i++)
{ {
var currMovementObj = (OsuHitObject)nestedObjects[i]; var currMovementObj = (OsuHitObject)nestedObjects[i];
Vector2 currMovementObjPosition = currMovementObj.StackedPosition;
Vector2 currMovement = Vector2.Subtract(currMovementObj.StackedPosition, currCursorPosition); double currDistance = scalingFactor * Vector2.Distance(currMovementObjPosition, currCursorPosition);
double currMovementLength = scalingFactor * currMovement.Length;
// Amount of movement required so that the cursor position needs to be updated. // Amount of movement required so that the cursor position needs to be updated.
double requiredMovement = assumed_slider_radius; double requiredDistance = assumed_slider_radius;
if (i == nestedObjects.Count - 1) if (i == nestedObjects.Count - 1)
{ {
@ -308,25 +307,24 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Preprocessing
// There is both a lazy end position as well as the actual end slider position. We assume the player takes the simpler movement. // There is both a lazy end position as well as the actual end slider position. We assume the player takes the simpler movement.
// For sliders that are circular, the lazy end position may actually be farther away than the sliders true end. // For sliders that are circular, the lazy end position may actually be farther away than the sliders true end.
// This code is designed to prevent buffing situations where lazy end is actually a less efficient movement. // This code is designed to prevent buffing situations where lazy end is actually a less efficient movement.
Vector2 lazyMovement = Vector2.Subtract((Vector2)slider.LazyEndPosition, currCursorPosition); double lazyDistance = Vector2.Distance((Vector2)slider.LazyEndPosition, currCursorPosition) * scalingFactor;
if (lazyMovement.Length < currMovement.Length) if (lazyDistance < currDistance)
currMovement = lazyMovement; currDistance = lazyDistance;
currMovementLength = scalingFactor * currMovement.Length;
} }
else if (currMovementObj is SliderRepeat) else if (currMovementObj is SliderRepeat)
{ {
// For a slider repeat, assume a tighter movement threshold to better assess repeat sliders. // For a slider repeat, assume a tighter movement threshold to better assess repeat sliders.
requiredMovement = NORMALISED_RADIUS; requiredDistance = NORMALISED_RADIUS;
} }
if (currMovementLength > requiredMovement) if (currDistance > requiredDistance)
{ {
double currMovement = currDistance - requiredDistance;
slider.LazyTravelDistance += (float)currMovement;
// this finds the positional delta from the required radius and the current position, and updates the currCursorPosition accordingly, as well as rewarding distance. // this finds the positional delta from the required radius and the current position, and updates the currCursorPosition accordingly, as well as rewarding distance.
currCursorPosition = Vector2.Add(currCursorPosition, Vector2.Multiply(currMovement, (float)((currMovementLength - requiredMovement) / currMovementLength))); currCursorPosition = Vector2.Lerp(currCursorPosition, currMovementObjPosition, (float)(currMovement / currDistance));
currMovementLength *= (currMovementLength - requiredMovement) / currMovementLength;
slider.LazyTravelDistance += (float)currMovementLength;
} }
if (i == nestedObjects.Count - 1) if (i == nestedObjects.Count - 1)