1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-21 06:52:55 +08:00
osu-lazer/osu.Game.Rulesets.Taiko/Difficulty/Skills/Rhythm.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

40 lines
1.4 KiB
C#
Raw Normal View History

2020-06-08 15:30:26 +08: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.
using osu.Game.Rulesets.Difficulty.Preprocessing;
using osu.Game.Rulesets.Difficulty.Skills;
using osu.Game.Rulesets.Difficulty.Utils;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Taiko.Difficulty.Evaluators;
2020-06-08 15:30:26 +08:00
namespace osu.Game.Rulesets.Taiko.Difficulty.Skills
{
/// <summary>
/// Calculates the rhythm coefficient of taiko difficulty.
/// </summary>
public class Rhythm : StrainDecaySkill
2020-06-08 15:30:26 +08:00
{
protected override double SkillMultiplier => 1.0;
protected override double StrainDecayBase => 0.4;
2020-08-22 23:51:35 +08:00
private readonly double greatHitWindow;
public Rhythm(Mod[] mods, double greatHitWindow)
: base(mods)
{
this.greatHitWindow = greatHitWindow;
}
2020-08-22 23:51:35 +08:00
protected override double StrainValueOf(DifficultyHitObject current)
2020-06-08 15:30:26 +08:00
{
double difficulty = RhythmEvaluator.EvaluateDifficultyOf(current, greatHitWindow);
2020-06-08 15:30:26 +08:00
// To prevent abuse of exceedingly long intervals between awkward rhythms, we penalise its difficulty.
double staminaDifficulty = StaminaEvaluator.EvaluateDifficultyOf(current) - 0.5; // Remove base strain
difficulty *= DifficultyCalculationUtils.Logistic(staminaDifficulty, 1 / 15.0, 50.0);
2020-06-08 15:30:26 +08:00
return difficulty;
}
2020-06-08 15:30:26 +08:00
}
}