1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-19 01:03:53 +08:00

use difficulty instead of topstrain

This commit is contained in:
TextAdventurer12 2024-02-22 15:14:56 +13:00
parent 23d0c03fc8
commit 7d34542c12

View File

@ -37,6 +37,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
protected virtual double DifficultyMultiplier => DEFAULT_DIFFICULTY_MULTIPLIER; protected virtual double DifficultyMultiplier => DEFAULT_DIFFICULTY_MULTIPLIER;
protected List<double> objectStrains = new List<double>(); protected List<double> objectStrains = new List<double>();
protected double difficulty;
protected OsuStrainSkill(Mod[] mods) protected OsuStrainSkill(Mod[] mods)
: base(mods) : base(mods)
@ -45,7 +46,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
public override double DifficultyValue() public override double DifficultyValue()
{ {
double difficulty = 0; difficulty = 0;
double weight = 1; double weight = 1;
// Sections with 0 strain are excluded to avoid worst-case time complexity of the following sort (e.g. /b/2351871). // Sections with 0 strain are excluded to avoid worst-case time complexity of the following sort (e.g. /b/2351871).
@ -78,9 +79,9 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
/// </summary> /// </summary>
public double CountDifficultStrains() public double CountDifficultStrains()
{ {
double topStrain = objectStrains.Max(); double consistentTopStrain = difficulty / 10; // What would the top strain be if all strain values were identical
return objectStrains.Sum(s => Math.Pow(s / topStrain, 4)); return objectStrains.Sum(s => Math.Pow(1, s / consistentTopStrain, 5));
} }
} }
} }