Skip to content

Commit

Permalink
Count slide taps properly in beatmap stats
Browse files Browse the repository at this point in the history
  • Loading branch information
LumpBloom7 committed Nov 26, 2023
1 parent ccb79da commit 7caff84
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 27 deletions.
5 changes: 2 additions & 3 deletions osu.Game.Rulesets.Sentakki/Beatmaps/SentakkiBeatmap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using osu.Game.Graphics;
using osu.Game.Rulesets.Sentakki.Localisation;
using osu.Game.Rulesets.Sentakki.Objects;
using osu.Game.Rulesets.UI;
using osuTK;

namespace osu.Game.Rulesets.Sentakki.Beatmaps
Expand All @@ -14,11 +13,11 @@ public class SentakkiBeatmap : Beatmap<SentakkiHitObject>
{
public override IEnumerable<BeatmapStatistic> GetStatistics()
{
int taps = HitObjects.Count(b => b is Tap);
int taps = HitObjects.Count(b => b is Tap or Slide);
int holds = HitObjects.Count(h => h is Hold);
int touchHolds = HitObjects.Count(h => h is TouchHold);
int touchs = HitObjects.Count(h => h is Touch);
int slides = HitObjects.Count(h => h is Slide);
int slides = HitObjects.OfType<Slide>().Sum(h => h.SlideInfoList.Count);

return new[]
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using osu.Game.Rulesets.Difficulty.Preprocessing;
using osu.Game.Rulesets.Difficulty.Skills;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Sentakki.Objects;

namespace osu.Game.Rulesets.Sentakki.Difficulty
{
Expand All @@ -18,29 +17,7 @@ public SentakkiDifficultyCalculator(IRulesetInfo ruleset, IWorkingBeatmap beatma

protected override DifficultyAttributes CreateDifficultyAttributes(IBeatmap beatmap, Mod[] mods, Skill[] skills, double clockRate)
{
int maxCombo = 0;

foreach (SentakkiHitObject h in beatmap.HitObjects)
{
switch (h)
{
case Slide slide:
maxCombo += 1 + slide.SlideInfoList.Count + (slide.Break ? 4 : 0);
break;

case Hold hold:
maxCombo += 2 + (hold.Break ? 8 : 0);
break;

case Tap tap:
maxCombo += 1 + (tap.Break ? 4 : 0);
break;

default:
++maxCombo;
break;
}
}
int maxCombo = beatmap.GetMaxCombo();

return new DifficultyAttributes
{
Expand Down

0 comments on commit 7caff84

Please sign in to comment.