1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 05:22:54 +08:00

initial commit

This commit is contained in:
Givikap120 2024-11-14 08:59:03 +02:00
parent 5cc1cbe880
commit 9fcf8342f0

View File

@ -23,8 +23,6 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
/// </summary>
protected virtual double ReducedStrainBaseline => 0.75;
protected double Difficulty;
protected OsuStrainSkill(Mod[] mods)
: base(mods)
{
@ -32,7 +30,6 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
public override double DifficultyValue()
{
Difficulty = 0;
double weight = 1;
// Sections with 0 strain are excluded to avoid worst-case time complexity of the following sort (e.g. /b/2351871).
@ -48,15 +45,17 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
strains[i] *= Interpolation.Lerp(ReducedStrainBaseline, 1.0, scale);
}
double difficulty = 0;
// Difficulty is the weighted sum of the highest strains from every section.
// We're sorting from highest to lowest strain.
foreach (double strain in strains.OrderDescending())
{
Difficulty += strain * weight;
difficulty += strain * weight;
weight *= DecayWeight;
}
return Difficulty;
return difficulty;
}
public static double DifficultyToPerformance(double difficulty) => Math.Pow(5.0 * Math.Max(1.0, difficulty / 0.0675) - 4.0, 3.0) / 100000.0;