refactoring

This commit is contained in:
apollo-dw 2021-09-02 17:02:23 +01:00
parent 3e98c71ece
commit d9cc497801
2 changed files with 6 additions and 6 deletions

View File

@ -82,7 +82,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty
protected override Skill[] CreateSkills(IBeatmap beatmap, Mod[] mods, double clockRate) => new Skill[]
{
new Aim(mods),
new Speed(mods, beatmap, clockRate)
new Speed(mods, beatmap.BeatmapInfo.BaseDifficulty.OverallDifficulty, clockRate),
};
protected override Mod[] DifficultyAdjustmentMods => new Mod[]

View File

@ -30,10 +30,10 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
private const double speed_balancing_factor = 40;
private double greatWindow;
public Speed(Mod[] mods, IBeatmap beatmap, double clockRate)
public Speed(Mod[] mods, float od, double clockRate)
: base(mods)
{
greatWindow = (79 - (beatmap.BeatmapInfo.BaseDifficulty.OverallDifficulty * 6) + 0.5) / clockRate;
greatWindow = (79 - (od * 6) + 0.5) / clockRate;
}
protected override double StrainValueOf(DifficultyHitObject current)
@ -54,8 +54,8 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
// Cap deltatime to the OD 300 hitwindow.
// 0.77 is derived from making sure 260bpm OD8 streams aren't nerfed
var hitWindowNerfRaw = deltaTime / (greatWindow * 2 * 0.77);
var hitWindowNerf = Math.Clamp(hitWindowNerfRaw, 0.85, 1);
var hitWindowNerf = deltaTime / (greatWindow * 2 * 0.77);
deltaTime /= Math.Clamp(hitWindowNerf, 0.92, 1);
double speedBonus = 1.0;
if (deltaTime < min_speed_bonus)
@ -77,7 +77,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
}
}
return (1 + (speedBonus - 1) * 0.75) * angleBonus * (0.95 + speedBonus * Math.Pow(distance / single_spacing_threshold, 3.5)) / (deltaTime / hitWindowNerf);
return (1 + (speedBonus - 1) * 0.75) * angleBonus * (0.95 + speedBonus * Math.Pow(distance / single_spacing_threshold, 3.5)) / deltaTime;
}
}
}