From b77e6f92b741a20adfd539d8fdbaf183fcbe8d13 Mon Sep 17 00:00:00 2001 From: StanR Date: Wed, 19 Jan 2022 22:31:11 +0300 Subject: [PATCH] Fix touch device difficulty reduction not affecting star rating --- .../Difficulty/OsuDifficultyCalculator.cs | 4 ++++ .../Difficulty/OsuPerformanceCalculator.cs | 7 +------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Difficulty/OsuDifficultyCalculator.cs b/osu.Game.Rulesets.Osu/Difficulty/OsuDifficultyCalculator.cs index c5b1baaad1..537d63356b 100644 --- a/osu.Game.Rulesets.Osu/Difficulty/OsuDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Osu/Difficulty/OsuDifficultyCalculator.cs @@ -40,6 +40,9 @@ protected override DifficultyAttributes CreateDifficultyAttributes(IBeatmap beat double sliderFactor = aimRating > 0 ? aimRatingNoSliders / aimRating : 1; + if (mods.Any(m => m is OsuModTouchDevice)) + aimRating = Math.Pow(aimRating, 0.8); + if (mods.Any(h => h is OsuModRelax)) speedRating = 0.0; @@ -120,6 +123,7 @@ protected override Skill[] CreateSkills(IBeatmap beatmap, Mod[] mods, double clo protected override Mod[] DifficultyAdjustmentMods => new Mod[] { + new OsuModTouchDevice(), new OsuModDoubleTime(), new OsuModHalfTime(), new OsuModEasy(), diff --git a/osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceCalculator.cs b/osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceCalculator.cs index 604ab73454..07be3571f6 100644 --- a/osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceCalculator.cs +++ b/osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceCalculator.cs @@ -84,12 +84,7 @@ public override PerformanceAttributes Calculate() private double computeAimValue() { - double rawAim = Attributes.AimDifficulty; - - if (mods.Any(m => m is OsuModTouchDevice)) - rawAim = Math.Pow(rawAim, 0.8); - - double aimValue = Math.Pow(5.0 * Math.Max(1.0, rawAim / 0.0675) - 4.0, 3.0) / 100000.0; + double aimValue = Math.Pow(5.0 * Math.Max(1.0, Attributes.AimDifficulty / 0.0675) - 4.0, 3.0) / 100000.0; double lengthBonus = 0.95 + 0.4 * Math.Min(1.0, totalHits / 2000.0) + (totalHits > 2000 ? Math.Log10(totalHits / 2000.0) * 0.5 : 0.0);