osu/osu.Game.Rulesets.Osu/Difficulty/Skills/Aim.cs

50 lines
2.0 KiB
C#
Raw Normal View History

// 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 09:19:50 +00:00
using System;
2018-05-15 08:36:29 +00:00
using osu.Game.Rulesets.Osu.Difficulty.Preprocessing;
2018-04-13 09:19:50 +00:00
2018-05-15 08:36:29 +00:00
namespace osu.Game.Rulesets.Osu.Difficulty.Skills
2018-04-13 09:19:50 +00: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-24 03:41:04 +00:00
private const double angle_bonus_begin = Math.PI / 3;
2018-12-22 00:31:30 +00:00
private const double timing_threshold = 107;
2018-12-22 00:56:33 +00:00
2018-04-13 09:19:50 +00:00
protected override double SkillMultiplier => 26.25;
protected override double StrainDecayBase => 0.15;
protected override double StrainValueOf(OsuDifficultyHitObject current)
2018-12-08 06:01:26 +00:00
{
2018-12-21 05:52:43 +00:00
double result = 0;
2018-12-08 06:01:26 +00:00
2018-12-24 03:41:04 +00:00
const double scale = 90;
2019-01-29 07:35:20 +00:00
double applyDiminishingExp(double val) => Math.Pow(val, 0.99);
2018-12-21 05:52:43 +00:00
if (Previous.Count > 0)
{
2018-12-22 00:31:30 +00:00
if (current.Angle != null && current.Angle.Value > angle_bonus_begin)
2018-12-21 13:52:27 +00:00
{
2018-12-24 03:41:04 +00:00
var angleBonus = Math.Sqrt(
Math.Max(Previous[0].JumpDistance - scale, 0)
* Math.Pow(Math.Sin(current.Angle.Value - angle_bonus_begin), 2)
* Math.Max(current.JumpDistance - scale, 0));
2019-01-29 07:35:20 +00:00
result = 1.5 * applyDiminishingExp(Math.Max(0, angleBonus)) / Math.Max(timing_threshold, Previous[0].StrainTime);
2018-12-21 13:52:27 +00:00
}
2018-12-21 05:52:43 +00:00
}
2019-01-29 07:35:20 +00:00
double jumpDistanceExp = applyDiminishingExp(current.JumpDistance);
double travelDistanceExp = applyDiminishingExp(current.TravelDistance);
2018-12-24 03:41:04 +00:00
return Math.Max(
2019-01-29 07:35:20 +00:00
result + (jumpDistanceExp + travelDistanceExp + Math.Sqrt(travelDistanceExp * jumpDistanceExp)) / Math.Max(current.StrainTime, timing_threshold),
(Math.Sqrt(travelDistanceExp * jumpDistanceExp) + jumpDistanceExp + travelDistanceExp) / current.StrainTime
);
2018-12-08 06:01:26 +00:00
}
2018-04-13 09:19:50 +00:00
}
}