mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 06:57:39 +08:00
refactoring
This commit is contained in:
parent
3e98c71ece
commit
d9cc497801
@ -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[]
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user