Files
osukey/osu.Game.Rulesets.Osu/Difficulty/Skills/Aim.cs
2018-12-19 13:45:33 +09:00

42 lines
1.4 KiB
C#

// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using osu.Game.Rulesets.Osu.Difficulty.Preprocessing;
namespace osu.Game.Rulesets.Osu.Difficulty.Skills
{
/// <summary>
/// Represents the skill required to correctly aim at every object in the map with a uniform CircleSize and normalized distances.
/// </summary>
public class Aim : Skill
{
protected override double SkillMultiplier => 26.25;
protected override double StrainDecayBase => 0.15;
protected override double StrainValueOf(OsuDifficultyHitObject current)
{
double angleBonus = 1.0;
if (current.Angle != null)
{
double angle = current.Angle.Value * 180 / Math.PI;
if (current.JumpDistance > SINGLE_SPACING_THRESHOLD)
{
if (angle > 75)
angleBonus = (angle / 45 - 75) / 2;
else if (angle > 120)
angleBonus = 0.5;
}
}
return angleBonus * (
Math.Pow(current.JumpDistance - SINGLE_SPACING_THRESHOLD, 0.99)
+ Math.Pow(current.TravelDistance, 0.99)
+ Math.Pow(current.JumpDistance, 0.99)
) / current.StrainTime;
}
}
}