Skip to content

Commit

Permalink
Merge pull request #514 from LumpBloom7/Higher-weighted-slides
Browse files Browse the repository at this point in the history
Give slides a higher acc/combo weighting
  • Loading branch information
LumpBloom7 authored Nov 30, 2023
2 parents 4aeceb0 + 4b2cf89 commit 5eb4de1
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private void testSingle(double duration, bool auto = false)

foreach (DrawableSentakkiHitObject nested in dSlide.NestedHitObjects)
{
foreach (DrawableSentakkiHitObject nested2 in nested.NestedHitObjects)
foreach (DrawableSentakkiHitObject nested2 in nested.NestedHitObjects.OfType<DrawableSentakkiHitObject>())
nested2.Auto = auto;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ private void testSingle(double duration, bool auto = false)

foreach (DrawableSentakkiHitObject nested in dSlide.NestedHitObjects)
{
foreach (DrawableSentakkiHitObject nested2 in nested.NestedHitObjects)
foreach (DrawableSentakkiHitObject nested2 in nested.NestedHitObjects.OfType<DrawableSentakkiHitObject>())
nested2.Auto = auto;
}
}
Expand Down Expand Up @@ -140,7 +140,7 @@ private void testChain(double duration, bool auto = false)

foreach (DrawableSentakkiHitObject nested in dSlide.NestedHitObjects)
{
foreach (DrawableSentakkiHitObject nested2 in nested.NestedHitObjects)
foreach (DrawableSentakkiHitObject nested2 in nested.NestedHitObjects.OfType<DrawableSentakkiHitObject>())
nested2.Auto = auto;
}
}
Expand Down Expand Up @@ -182,7 +182,7 @@ private void testChainWithFan(double duration, bool auto = false)

foreach (DrawableSentakkiHitObject nested in dSlide.NestedHitObjects)
{
foreach (DrawableSentakkiHitObject nested2 in nested.NestedHitObjects)
foreach (DrawableSentakkiHitObject nested2 in nested.NestedHitObjects.OfType<DrawableSentakkiHitObject>())
nested2.Auto = auto;
}
}
Expand Down
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
11 changes: 5 additions & 6 deletions osu.Game.Rulesets.Sentakki/Objects/SentakkiLanedHitObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ public abstract class SentakkiLanedHitObject : SentakkiHitObject
{
protected virtual bool NeedBreakSample => true;

public virtual int ScoreWeighting => Break ? 5 : 1;

public readonly BindableBool BreakBindable = new BindableBool();

public bool Break
Expand All @@ -31,18 +33,15 @@ protected override void CreateNestedHitObjects(CancellationToken cancellationTok
{
base.CreateNestedHitObjects(cancellationToken);

if (Break)
{
for (int i = 0; i < 4; ++i)
AddNested(new ScorePaddingObject { StartTime = this.GetEndTime() });
for (int i = 1; i < ScoreWeighting; ++i)
AddNested(new ScorePaddingObject { StartTime = this.GetEndTime() });

// Add bonus for players hitting within the critical window
if (Break)
AddNested(new ScoreBonusObject
{
StartTime = this.GetEndTime(),
HitWindows = HitWindows
});
}
}

public override IList<HitSampleInfo> AuxiliarySamples => CreateBreakSample();
Expand Down
3 changes: 3 additions & 0 deletions osu.Game.Rulesets.Sentakki/Objects/SlideBody.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public class SlideBody : SentakkiLanedHitObject, IHasDuration
{
public override Color4 DefaultNoteColour => Color4.Aqua;

public override int ScoreWeighting => Break ? 5 : 3;

public double EndTime
{
get => StartTime + Duration;
Expand All @@ -42,6 +44,7 @@ public SlideBody(SlideBodyInfo slideBodyInfo)
protected override void CreateNestedHitObjects(CancellationToken cancellationToken)
{
CreateSlideCheckpoints();

if (NestedHitObjects.Any())
NestedHitObjects.First().Samples.Add(new SentakkiHitSampleInfo("slide", CreateHitSampleInfo().Volume));

Expand Down

0 comments on commit 5eb4de1

Please sign in to comment.