1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 13:32:54 +08:00

xmldoc and refactoring

This commit is contained in:
emu1337 2021-06-17 21:41:06 +02:00
parent 2665a873f8
commit 8c4e60e5cc

View File

@ -12,8 +12,20 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
{
public abstract class OsuStrainSkill : StrainSkill
{
/// <summary>
/// The number of sections with the highest strains, which the peak strain reductions will apply to.
/// This is done in order to decrease their impact on the overall difficulty of the map for this skill.
/// </summary>
protected virtual int ReducedSectionCount => 10;
/// <summary>
/// The baseline multiplier applied to the section with the biggest strain.
/// </summary>
protected virtual double ReducedStrainBaseline => 0.75;
/// <summary>
/// The final multiplier to be applied to <see cref="DifficultyValue"/> after all other calculations.
/// </summary>
protected virtual double DifficultyMultiplier => 1.06;
protected OsuStrainSkill(Mod[] mods)
@ -31,9 +43,8 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
// We are reducing the highest strains first to account for extreme difficulty spikes
for (int i = 0; i < Math.Min(strains.Count, ReducedSectionCount); i++)
{
strains[i] *= ReducedStrainBaseline
+ Math.Log10(Interpolation.Lerp(1, 10, Math.Clamp((float)i / ReducedSectionCount, 0, 1)))
* (1.0 - ReducedStrainBaseline);
double scale = Math.Log10(Interpolation.Lerp(1, 10, Math.Clamp((float)i / ReducedSectionCount, 0, 1)));
strains[i] *= Interpolation.Lerp(ReducedStrainBaseline, 1.0, scale);
}
// Difficulty is the weighted sum of the highest strains from every section.