Skip to content

Commit

Permalink
fixed rhythm for slideracc
Browse files Browse the repository at this point in the history
  • Loading branch information
Givikap120 committed Sep 22, 2024
1 parent 700d34e commit 2c2c93e
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions osu.Game.Rulesets.Osu/Difficulty/Skills/RhythmComplexity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,33 @@
using osu.Game.Rulesets.Difficulty.Skills;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Osu.Difficulty.Preprocessing;
using osu.Game.Rulesets.Osu.Mods;
using osu.Game.Rulesets.Osu.Objects;

namespace osu.Game.Rulesets.Osu.Difficulty.Skills
{
public class RhythmComplexity : Skill
{
private int circleCount;
private bool isSliderAcc;
private int accuracyObjectCount;
private int noteIndex;
private bool isPreviousOffbeat;
private readonly List<int> previousDoubles = new List<int>();
private double difficultyTotal;

public RhythmComplexity(Mod[] mods) : base(mods)
{
isSliderAcc = mods.OfType<OsuModClassic>().All(m => !m.NoSliderHeadAccuracy.Value);
}

public override void Process(DifficultyHitObject current)
{
var osuCurrent = (OsuDifficultyHitObject)current;

if (current.BaseObject is HitCircle)
if (current.BaseObject is HitCircle || (isSliderAcc && current.BaseObject is Slider))
{
difficultyTotal += calculateRhythmBonus(osuCurrent);
circleCount++;
accuracyObjectCount++;
}
else
isPreviousOffbeat = false;
Expand All @@ -41,8 +44,11 @@ public override void Process(DifficultyHitObject current)

public override double DifficultyValue()
{
double lengthRequirement = Math.Tanh(circleCount / 50.0);
return 1 + difficultyTotal / circleCount * lengthRequirement;
if (accuracyObjectCount == 0)
return 1;

double lengthRequirement = Math.Tanh(accuracyObjectCount / 50.0);
return 1 + difficultyTotal / accuracyObjectCount * lengthRequirement;
}

private double calculateRhythmBonus(OsuDifficultyHitObject current)
Expand Down

0 comments on commit 2c2c93e

Please sign in to comment.