2019-01-24 16:43:03 +08:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2018-05-15 16:36:29 +08:00
|
|
|
|
using osu.Game.Rulesets.Osu.Difficulty.Preprocessing;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2018-05-15 16:36:29 +08:00
|
|
|
|
namespace osu.Game.Rulesets.Osu.Difficulty.Skills
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Represents the skill required to press keys with regards to keeping up with the speed at which objects need to be hit.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class Speed : Skill
|
|
|
|
|
{
|
|
|
|
|
protected override double SkillMultiplier => 1400;
|
|
|
|
|
protected override double StrainDecayBase => 0.3;
|
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
{
|
2018-10-08 16:37:33 +08:00
|
|
|
|
double distance = current.TravelDistance + current.JumpDistance;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
2018-10-10 17:53:54 +08:00
|
|
|
|
return speedValue / current.StrainTime;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|