// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Game.Rulesets.Difficulty.Preprocessing; using osu.Game.Rulesets.Difficulty.Skills; namespace osu.Game.Rulesets.Taiko.Difficulty.Skills { /// /// Stamina of a single key, calculated based on repetition speed. /// public class SingleKeyStamina { private double? previousHitTime; /// /// Similar to /// public double StrainValueOf(DifficultyHitObject current) { if (previousHitTime == null) { previousHitTime = current.StartTime; return 0; } double objectStrain = 0.5; objectStrain += speedBonus(current.StartTime - previousHitTime.Value); previousHitTime = current.StartTime; return objectStrain; } /// /// Applies a speed bonus dependent on the time since the last hit performed using this key. /// /// The duration between the current and previous note hit using the same key. private double speedBonus(double notePairDuration) { return 175 / (notePairDuration + 100); } } }