2019-01-24 08:43:03 +00: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 09:19:50 +00:00
|
|
|
|
|
2017-06-05 21:45:22 +00:00
|
|
|
|
using System;
|
2019-02-12 07:03:28 +00:00
|
|
|
|
using osu.Game.Rulesets.Difficulty.Preprocessing;
|
2021-02-06 04:06:16 +00:00
|
|
|
|
using osu.Game.Rulesets.Mods;
|
2022-05-28 12:29:09 +00:00
|
|
|
|
using osu.Game.Rulesets.Osu.Difficulty.Evaluators;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2018-05-15 08:36:29 +00:00
|
|
|
|
namespace osu.Game.Rulesets.Osu.Difficulty.Skills
|
2017-06-05 21:45:22 +00:00
|
|
|
|
{
|
2017-06-07 18:29:03 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Represents the skill required to correctly aim at every object in the map with a uniform CircleSize and normalized distances.
|
|
|
|
|
/// </summary>
|
2021-06-14 17:18:49 +00:00
|
|
|
|
public class Aim : OsuStrainSkill
|
2017-06-05 21:45:22 +00:00
|
|
|
|
{
|
2021-11-10 00:59:28 +00:00
|
|
|
|
public Aim(Mod[] mods, bool withSliders)
|
2021-02-06 04:06:16 +00:00
|
|
|
|
: base(mods)
|
|
|
|
|
{
|
2021-11-10 00:59:28 +00:00
|
|
|
|
this.withSliders = withSliders;
|
2021-02-06 04:06:16 +00:00
|
|
|
|
}
|
|
|
|
|
|
2021-11-11 12:46:22 +00:00
|
|
|
|
private readonly bool withSliders;
|
|
|
|
|
|
2021-11-08 00:53:51 +00:00
|
|
|
|
private double currentStrain;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2022-07-20 13:10:34 +00:00
|
|
|
|
private double skillMultiplier => 23.55;
|
2021-08-17 13:39:18 +00:00
|
|
|
|
private double strainDecayBase => 0.15;
|
|
|
|
|
|
|
|
|
|
private double strainDecay(double ms) => Math.Pow(strainDecayBase, ms / 1000);
|
|
|
|
|
|
2022-05-22 15:26:22 +00:00
|
|
|
|
protected override double CalculateInitialStrain(double time, DifficultyHitObject current) => currentStrain * strainDecay(time - current.Previous(0).StartTime);
|
2021-08-17 13:39:18 +00:00
|
|
|
|
|
|
|
|
|
protected override double StrainValueAt(DifficultyHitObject current)
|
|
|
|
|
{
|
|
|
|
|
currentStrain *= strainDecay(current.DeltaTime);
|
2022-05-28 12:29:09 +00:00
|
|
|
|
currentStrain += AimEvaluator.EvaluateDifficultyOf(current, withSliders) * skillMultiplier;
|
2021-08-17 13:39:18 +00:00
|
|
|
|
|
|
|
|
|
return currentStrain;
|
|
|
|
|
}
|
2017-06-05 21:45:22 +00:00
|
|
|
|
}
|
2017-06-05 22:07:00 +00:00
|
|
|
|
}
|