diff --git a/osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceAttributes.cs b/osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceAttributes.cs index 5616ae72e4..542be51b6d 100644 --- a/osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceAttributes.cs +++ b/osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceAttributes.cs @@ -18,6 +18,9 @@ namespace osu.Game.Rulesets.Osu.Difficulty [JsonProperty("accuracy")] public double Accuracy { get; set; } + [JsonProperty("flashlight")] + public double Flashlight { get; set; } + [JsonProperty("cognition")] public double Cognition { get; set; } diff --git a/osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceCalculator.cs b/osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceCalculator.cs index 9a65ddc15c..6d53b0c38f 100644 --- a/osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceCalculator.cs +++ b/osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceCalculator.cs @@ -100,12 +100,23 @@ namespace osu.Game.Rulesets.Osu.Difficulty (Math.Pow(Math.Pow(mechanicalValue, power) + Math.Pow(accuracyValue, power), 1.0 / power) + cognitionValue) * multiplier; + // Fancy stuff for better visual display of FL pp + double flashlightPortion = Math.Pow(flashlightValue, flPower) / Math.Pow(flashlightARValue, flPower); + double flashlightARPortion = flashlightARValue / (flashlightARValue + readingHDValue); + + // Filter reading difficulty out of FL + double visualFlashlightValue = cognitionValue * flashlightARPortion * flashlightPortion; + + // Calculate reading difficulty as there was no FL in the first place + double visualCognitionValue = AdjustCognitionPerformance(readingARValue + readingHDValue, mechanicalValue, potentialHiddenFlashlightValue); + return new OsuPerformanceAttributes { Aim = aimValue, Speed = speedValue, Accuracy = accuracyValue, - Cognition = cognitionValue, + Flashlight = visualFlashlightValue, + Cognition = visualCognitionValue, EffectiveMissCount = effectiveMissCount, Total = totalValue };