mirror of
https://github.com/osukey/osukey.git
synced 2025-08-08 00:53:56 +09:00
Replace piecewise linear function
This commit is contained in:
@ -1,6 +1,7 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System;
|
||||||
using osu.Game.Rulesets.Osu.Difficulty.Preprocessing;
|
using osu.Game.Rulesets.Osu.Difficulty.Preprocessing;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Osu.Difficulty.Skills
|
namespace osu.Game.Rulesets.Osu.Difficulty.Skills
|
||||||
@ -14,26 +15,11 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
|
|||||||
protected override double StrainDecayBase => 0.3;
|
protected override double StrainDecayBase => 0.3;
|
||||||
|
|
||||||
private const double single_spacing_threshold = 125;
|
private const double single_spacing_threshold = 125;
|
||||||
private const double stream_spacing_threshold = 110;
|
|
||||||
private const double almost_diameter = 90;
|
|
||||||
|
|
||||||
protected override double StrainValueOf(OsuDifficultyHitObject current)
|
protected override double StrainValueOf(OsuDifficultyHitObject current)
|
||||||
{
|
{
|
||||||
double distance = current.TravelDistance + current.JumpDistance;
|
double distance = current.TravelDistance + current.JumpDistance;
|
||||||
|
return (1 + Math.Pow(distance / single_spacing_threshold, 4)) / current.StrainTime;
|
||||||
double speedValue;
|
|
||||||
if (distance > single_spacing_threshold)
|
|
||||||
speedValue = 2.5;
|
|
||||||
else if (distance > stream_spacing_threshold)
|
|
||||||
speedValue = 1.6 + 0.9 * (distance - stream_spacing_threshold) / (single_spacing_threshold - stream_spacing_threshold);
|
|
||||||
else if (distance > almost_diameter)
|
|
||||||
speedValue = 1.2 + 0.4 * (distance - almost_diameter) / (stream_spacing_threshold - almost_diameter);
|
|
||||||
else if (distance > almost_diameter / 2)
|
|
||||||
speedValue = 0.95 + 0.25 * (distance - almost_diameter / 2) / (almost_diameter / 2);
|
|
||||||
else
|
|
||||||
speedValue = 0.95;
|
|
||||||
|
|
||||||
return speedValue / current.StrainTime;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user