1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-07 13:42:56 +08:00
osu-lazer/osu.Game.Rulesets.Taiko/Difficulty/Skills/Rhythm.cs
Jay Lawton 824497d82c
Rewrite of the Rhythm Skill within osu!taiko (#31284)
* implement bell curve into diffcalcutils

* remove unneeded attributes

* implement new rhythm skill

* change dho variables

* update dho rhythm

* interval interface

* implement rhythmevaluator

* evenhitobjects

* evenpatterns

* evenrhythm

* change attribute ordering

* initial balancing

* change naming to Same instead of Even

* remove attribute bump for display

* Fix diffcalc tests

---------

Co-authored-by: StanR <hi@stanr.info>
2024-12-27 16:30:30 +03:00

39 lines
1.3 KiB
C#

// 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;
namespace osu.Game.Rulesets.Taiko.Difficulty.Skills
{
/// <summary>
/// Calculates the rhythm coefficient of taiko difficulty.
/// </summary>
public class Rhythm : StrainDecaySkill
{
protected override double SkillMultiplier => 1.0;
protected override double StrainDecayBase => 0.4;
private readonly double greatHitWindow;
public Rhythm(Mod[] mods, double greatHitWindow)
: base(mods)
{
this.greatHitWindow = greatHitWindow;
}
protected override double StrainValueOf(DifficultyHitObject current)
{
double difficulty = RhythmEvaluator.EvaluateDifficultyOf(current, greatHitWindow);
// To prevent abuse of exceedingly long intervals between awkward rhythms, we penalise its difficulty.
difficulty *= DifficultyCalculationUtils.Logistic(current.DeltaTime, 350, -1 / 25.0, 0.5) + 0.5;
return difficulty;
}
}
}