1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 16:47:52 +08:00
osu-lazer/osu.Game.Rulesets.Osu/Difficulty/Skills/Aim.cs

44 lines
1.4 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 17:19:50 +08:00
2022-06-17 15:37:17 +08:00
#nullable disable
2018-04-13 17:19:50 +08:00
using System;
using osu.Game.Rulesets.Difficulty.Preprocessing;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Osu.Difficulty.Evaluators;
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>
2021-06-15 01:18:49 +08:00
public class Aim : OsuStrainSkill
2018-04-13 17:19:50 +08:00
{
public Aim(Mod[] mods, bool withSliders)
: base(mods)
{
this.withSliders = withSliders;
}
2021-11-11 20:46:22 +08:00
private readonly bool withSliders;
private double currentStrain;
2018-04-13 17:19:50 +08:00
private double skillMultiplier => 23.55;
2021-08-17 21:39:18 +08:00
private double strainDecayBase => 0.15;
private double strainDecay(double ms) => Math.Pow(strainDecayBase, ms / 1000);
protected override double CalculateInitialStrain(double time, DifficultyHitObject current) => currentStrain * strainDecay(time - current.Previous(0).StartTime);
2021-08-17 21:39:18 +08:00
protected override double StrainValueAt(DifficultyHitObject current)
{
currentStrain *= strainDecay(current.DeltaTime);
currentStrain += AimEvaluator.EvaluateDifficultyOf(current, withSliders) * skillMultiplier;
2021-08-17 21:39:18 +08:00
return currentStrain;
}
2018-04-13 17:19:50 +08:00
}
}