2018-04-13 17:19:50 +08:00
|
|
|
|
// 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;
|
2018-05-15 16:36:29 +08:00
|
|
|
|
using osu.Game.Rulesets.Osu.Difficulty.Preprocessing;
|
2018-12-08 14:52:12 +08:00
|
|
|
|
using osuTK;
|
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 correctly aim at every object in the map with a uniform CircleSize and normalized distances.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class Aim : Skill
|
|
|
|
|
{
|
2018-12-08 14:52:12 +08:00
|
|
|
|
private const double min_angle_bonus = 0;
|
|
|
|
|
private const double max_angle_bonus = 0.5;
|
|
|
|
|
private const double angle_bonus_begin = 5 * Math.PI / 12;
|
|
|
|
|
private const double pi_over_2 = Math.PI / 2;
|
|
|
|
|
|
2018-04-13 17:19:50 +08:00
|
|
|
|
protected override double SkillMultiplier => 26.25;
|
|
|
|
|
protected override double StrainDecayBase => 0.15;
|
|
|
|
|
|
2018-10-10 17:53:54 +08:00
|
|
|
|
protected override double StrainValueOf(OsuDifficultyHitObject current)
|
2018-12-08 14:01:26 +08:00
|
|
|
|
{
|
2018-12-08 14:52:12 +08:00
|
|
|
|
double angleBonus = 0;
|
2018-12-08 14:01:26 +08:00
|
|
|
|
|
|
|
|
|
if (current.Angle != null)
|
2018-12-08 14:52:12 +08:00
|
|
|
|
angleBonus = MathHelper.Clamp((current.Angle.Value - angle_bonus_begin) / pi_over_2, min_angle_bonus, max_angle_bonus);
|
2018-12-08 14:01:26 +08:00
|
|
|
|
|
2018-12-08 14:52:12 +08:00
|
|
|
|
return (angleBonus * Math.Pow(Math.Max(0, current.JumpDistance - SINGLE_SPACING_THRESHOLD), 0.99)
|
2018-12-08 14:01:26 +08:00
|
|
|
|
+ Math.Pow(current.TravelDistance, 0.99)
|
|
|
|
|
+ Math.Pow(current.JumpDistance, 0.99)
|
|
|
|
|
) / current.StrainTime;
|
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
}
|