diff --git a/osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceAttributes.cs b/osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceAttributes.cs index de4491a31b..e20931c04f 100644 --- a/osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceAttributes.cs +++ b/osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceAttributes.cs @@ -27,6 +27,12 @@ namespace osu.Game.Rulesets.Osu.Difficulty [JsonProperty("speed_deviation")] public double? SpeedDeviation { get; set; } + [JsonProperty("estimated_aim_sliderbreaks")] + public double EstimatedAimSliderbreaks { get; set; } + + [JsonProperty("estimated_speed_sliderbreaks")] + public double EstimatedSpeedSliderbreaks { get; set; } + public override IEnumerable GetAttributesForDisplay() { foreach (var attribute in base.GetAttributesForDisplay()) diff --git a/osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceCalculator.cs b/osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceCalculator.cs index ea91fbbbfb..93dd9b3ebe 100644 --- a/osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceCalculator.cs +++ b/osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceCalculator.cs @@ -42,6 +42,15 @@ namespace osu.Game.Rulesets.Osu.Difficulty /// private double effectiveMissCount; + /// + /// estimated number of sliderbreaks from aim difficulty + /// + private double estimatedAimSliderbreaks; + /// + /// estimated number of sliderbreaks from speed difficulty + /// + private double estimatedSpeedSliderbreaks; + private double? speedDeviation; public OsuPerformanceCalculator() @@ -93,6 +102,8 @@ namespace osu.Game.Rulesets.Osu.Difficulty effectiveMissCount = Math.Max(countMiss, effectiveMissCount); effectiveMissCount = Math.Min(totalHits, effectiveMissCount); + estimatedAimSliderbreaks = calculateEstimatedSliderbreaks(osuAttributes.AimTopWeightedSliderFactor, osuAttributes); + estimatedSpeedSliderbreaks = calculateEstimatedSliderbreaks(osuAttributes.SpeedTopWeightedSliderFactor, osuAttributes); double multiplier = PERFORMANCE_BASE_MULTIPLIER; @@ -137,6 +148,8 @@ namespace osu.Game.Rulesets.Osu.Difficulty Flashlight = flashlightValue, EffectiveMissCount = effectiveMissCount, SpeedDeviation = speedDeviation, + EstimatedAimSliderbreaks = estimatedAimSliderbreaks, + EstimatedSpeedSliderbreaks = estimatedSpeedSliderbreaks, Total = totalValue }; } @@ -177,8 +190,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty if (effectiveMissCount > 0) { - double estimatedSliderbreaks = calculateEstimatedSliderbreaks(attributes.AimTopWeightedSliderFactor, attributes); - aimValue *= calculateMissPenalty(effectiveMissCount + estimatedSliderbreaks, attributes.AimDifficultStrainCount); + aimValue *= calculateMissPenalty(effectiveMissCount + estimatedAimSliderbreaks, attributes.AimDifficultStrainCount); } double approachRateFactor = 0.0; @@ -220,8 +232,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty if (effectiveMissCount > 0) { - double estimatedSliderbreaks = calculateEstimatedSliderbreaks(attributes.SpeedTopWeightedSliderFactor, attributes); - speedValue *= calculateMissPenalty(effectiveMissCount + estimatedSliderbreaks, attributes.SpeedDifficultStrainCount); + speedValue *= calculateMissPenalty(effectiveMissCount + estimatedSpeedSliderbreaks, attributes.SpeedDifficultStrainCount); } double approachRateFactor = 0.0;