1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 16:47:29 +08:00

fixed burst nerf

and now nerf works for last object in the map too
This commit is contained in:
Givikap120 2024-06-26 17:09:59 +03:00
parent ed42366e63
commit dccd10e9e4

View File

@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text.
using System;
using osu.Framework.Extensions.ObjectExtensions;
using osu.Game.Rulesets.Difficulty.Preprocessing;
using osu.Game.Rulesets.Osu.Difficulty.Preprocessing;
using osu.Game.Rulesets.Osu.Objects;
@ -33,17 +34,13 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Evaluators
var osuNextObj = (OsuDifficultyHitObject?)current.Next(0);
double strainTime = osuCurrObj.StrainTime;
double doubletapness = 1;
// Nerf doubletappable doubles.
if (osuNextObj != null)
{
double currDeltaTime = Math.Max(1, osuCurrObj.DeltaTime);
double nextDeltaTime = Math.Max(1, osuNextObj.DeltaTime);
double deltaDifference = Math.Abs(nextDeltaTime - currDeltaTime);
// It's easier to gallop if you have more time between doubles
double speedRatio = currDeltaTime / Math.Max(currDeltaTime, deltaDifference);
// Get max between next and prev ratio to avoid nerfing triples
double speedRatio = Math.Max(getSpeedRatio(osuCurrObj, osuPrevObj), getSpeedRatio(osuCurrObj, osuNextObj));
// Can't doubletap if circles don't intersect
double normalizedDistance = Math.Min(1, osuCurrObj.LazyJumpDistance / (OsuDifficultyHitObject.NORMALISED_RADIUS * 2));
@ -58,8 +55,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Evaluators
if (windowRatio < halfPoint)
windowRatio *= windowRatio / halfPoint;
doubletapness = Math.Pow(speedRatio, distanceFactor * (1 - windowRatio));
}
double doubletapness = Math.Pow(speedRatio, distanceFactor * (1 - windowRatio));
// Cap deltatime to the OD 300 hitwindow.
// 0.93 is derived from making sure 260bpm OD8 streams aren't nerfed harshly, whilst 0.92 limits the effect of the cap.
@ -76,5 +72,18 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Evaluators
return (speedBonus + speedBonus * Math.Pow(distance / single_spacing_threshold, 3.5)) * doubletapness / strainTime;
}
private static double getSpeedRatio(OsuDifficultyHitObject current, OsuDifficultyHitObject? other)
{
if (other.IsNull())
return 0;
double currDeltaTime = Math.Max(1, current.DeltaTime);
double otherDeltaTime = Math.Max(1, other.DeltaTime);
double deltaDifference = Math.Abs(currDeltaTime - otherDeltaTime);
return currDeltaTime / Math.Max(currDeltaTime, deltaDifference);
}
}
}