From 3bcddf3cc8cb76f9ad154e4baeb39d30fc306e64 Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Sun, 27 Aug 2023 01:27:48 +0300 Subject: [PATCH] Add gap of two whole spins before achieving bonus score --- .../Objects/Drawables/DrawableSpinner.cs | 2 +- osu.Game.Rulesets.Osu/Objects/Spinner.cs | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs index 2d2a4a05ac..20bbb9a1d1 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs @@ -312,7 +312,7 @@ private void updateBonusScore() tick.TriggerResult(true); if (tick is DrawableSpinnerBonusTick) - gainedBonus.Value = score_per_tick * (spins - HitObject.SpinsRequired); + gainedBonus.Value = score_per_tick * (spins - HitObject.FirstBonusSpin); } currentSpins++; diff --git a/osu.Game.Rulesets.Osu/Objects/Spinner.cs b/osu.Game.Rulesets.Osu/Objects/Spinner.cs index f32c6ae979..a26cb7b090 100644 --- a/osu.Game.Rulesets.Osu/Objects/Spinner.cs +++ b/osu.Game.Rulesets.Osu/Objects/Spinner.cs @@ -31,11 +31,21 @@ public double EndTime /// public int SpinsRequired { get; protected set; } = 1; + /// + /// The gap between spinner completion and the first bonus-awarding spin. + /// + private const int bonus_spins_gap = 2; + /// /// Number of spins available to give bonus, beyond . /// public int MaximumBonusSpins { get; protected set; } = 1; + /// + /// The first spin awarding bonus score. + /// + public int FirstBonusSpin => SpinsRequired + bonus_spins_gap; + public override Vector2 StackOffset => Vector2.Zero; protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, IBeatmapDifficultyInfo difficulty) @@ -48,14 +58,14 @@ protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, I double minimumRotationsPerSecond = IBeatmapDifficultyInfo.DifficultyRange(difficulty.OverallDifficulty, 1.5, 2.5, 3.75); SpinsRequired = (int)(secondsDuration * minimumRotationsPerSecond); - MaximumBonusSpins = (int)((maximum_rotations_per_second - minimumRotationsPerSecond) * secondsDuration); + MaximumBonusSpins = (int)((maximum_rotations_per_second - minimumRotationsPerSecond) * secondsDuration) - bonus_spins_gap; } protected override void CreateNestedHitObjects(CancellationToken cancellationToken) { base.CreateNestedHitObjects(cancellationToken); - int totalSpins = MaximumBonusSpins + SpinsRequired; + int totalSpins = MaximumBonusSpins + SpinsRequired + bonus_spins_gap; for (int i = 0; i < totalSpins; i++) { @@ -63,7 +73,7 @@ protected override void CreateNestedHitObjects(CancellationToken cancellationTok double startTime = StartTime + (float)(i + 1) / totalSpins * Duration; - AddNested(i < SpinsRequired + AddNested(i < FirstBonusSpin ? new SpinnerTick { StartTime = startTime, SpinnerDuration = Duration } : new SpinnerBonusTick { StartTime = startTime, SpinnerDuration = Duration, Samples = new[] { CreateHitSampleInfo("spinnerbonus") } }); }