Merge pull request #27341 from Hiviexd/taiko-constant-speed-mod

Add osu!taiko `Constant Speed` mod
This commit is contained in:
Dan Balasescu 2024-05-23 21:01:53 +09:00 committed by GitHub
commit 6304a5ed41
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 36 additions and 8 deletions

View File

@ -26,12 +26,5 @@ protected override void LoadComplete()
ShowSpeedChanges.BindValueChanged(showChanges => VisualisationMethod = showChanges.NewValue ? ScrollVisualisationMethod.Overlapping : ScrollVisualisationMethod.Constant, true); ShowSpeedChanges.BindValueChanged(showChanges => VisualisationMethod = showChanges.NewValue ? ScrollVisualisationMethod.Overlapping : ScrollVisualisationMethod.Constant, true);
} }
protected override double ComputeTimeRange()
{
// Adjust when we're using constant algorithm to not be sluggish.
double multiplier = ShowSpeedChanges.Value ? 1 : 4;
return base.ComputeTimeRange() / multiplier;
}
} }
} }

View File

@ -0,0 +1,29 @@
// 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.Framework.Graphics.Sprites;
using osu.Framework.Localisation;
using osu.Game.Configuration;
using osu.Game.Rulesets.Taiko.Objects;
using osu.Game.Rulesets.Taiko.UI;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.UI;
namespace osu.Game.Rulesets.Taiko.Mods
{
public class TaikoModConstantSpeed : Mod, IApplicableToDrawableRuleset<TaikoHitObject>
{
public override string Name => "Constant Speed";
public override string Acronym => "CS";
public override double ScoreMultiplier => 0.9;
public override LocalisableString Description => "No more tricky speed changes!";
public override IconUsage? Icon => FontAwesome.Solid.Equals;
public override ModType Type => ModType.Conversion;
public void ApplyToDrawableRuleset(DrawableRuleset<TaikoHitObject> drawableRuleset)
{
var taikoRuleset = (DrawableTaikoRuleset)drawableRuleset;
taikoRuleset.VisualisationMethod = ScrollVisualisationMethod.Constant;
}
}
}

View File

@ -150,6 +150,7 @@ public override IEnumerable<Mod> GetModsFor(ModType type)
new TaikoModClassic(), new TaikoModClassic(),
new TaikoModSwap(), new TaikoModSwap(),
new TaikoModSingleTap(), new TaikoModSingleTap(),
new TaikoModConstantSpeed(),
}; };
case ModType.Automation: case ModType.Automation:

View File

@ -82,7 +82,12 @@ protected override void Update()
TimeRange.Value = ComputeTimeRange(); TimeRange.Value = ComputeTimeRange();
} }
protected virtual double ComputeTimeRange() => PlayfieldAdjustmentContainer.ComputeTimeRange(); protected virtual double ComputeTimeRange()
{
// Adjust when we're using constant algorithm to not be sluggish.
double multiplier = VisualisationMethod == ScrollVisualisationMethod.Constant ? 4 * Beatmap.Difficulty.SliderMultiplier : 1;
return PlayfieldAdjustmentContainer.ComputeTimeRange() / multiplier;
}
protected override void UpdateAfterChildren() protected override void UpdateAfterChildren()
{ {