From 7880b221774925625007bc63c8c7d2e0edd54d5e Mon Sep 17 00:00:00 2001 From: Givikap120 Date: Thu, 14 Nov 2024 08:42:52 +0200 Subject: [PATCH] Update Skill.cs --- osu.Game/Rulesets/Difficulty/Skills/Skill.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/osu.Game/Rulesets/Difficulty/Skills/Skill.cs b/osu.Game/Rulesets/Difficulty/Skills/Skill.cs index 4f81183b1f..0b1809b21c 100644 --- a/osu.Game/Rulesets/Difficulty/Skills/Skill.cs +++ b/osu.Game/Rulesets/Difficulty/Skills/Skill.cs @@ -30,7 +30,6 @@ namespace osu.Game.Rulesets.Difficulty.Skills } protected List ObjectStrains = new List(); - protected double Difficulty; /// /// Process a . @@ -44,15 +43,15 @@ namespace osu.Game.Rulesets.Difficulty.Skills public abstract double DifficultyValue(); /// - /// Returns the number of strains weighted against the top strain. + /// Calculates the number of strains weighted against the top strain. /// The result is scaled by clock rate as it affects the total number of strains. /// - public double CountDifficultStrains() + public virtual double CountTopWeightedStrains() { - if (Difficulty == 0) + if (ObjectStrains.Count == 0) return 0.0; - double consistentTopStrain = Difficulty / 10; // What would the top strain be if all strain values were identical + double consistentTopStrain = DifficultyValue() / 10; // What would the top strain be if all strain values were identical // Use a weighted sum of all strains. Constants are arbitrary and give nice values return ObjectStrains.Sum(s => 1.1 / (1 + Math.Exp(-10 * (s / consistentTopStrain - 0.88)))); }