mirror of https://github.com/ppy/osu
Merge pull request #27341 from Hiviexd/taiko-constant-speed-mod
Add osu!taiko `Constant Speed` mod
This commit is contained in:
commit
6304a5ed41
|
@ -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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -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:
|
||||||
|
|
|
@ -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()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue