1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-26 03:02:54 +08:00
osu-lazer/osu.Game/Rulesets/Mods/ModWindDown.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

65 lines
2.1 KiB
C#
Raw Normal View History

2019-01-26 13:43:27 +08:00
// 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 System;
using System.Linq;
2019-12-09 18:58:51 +08:00
using osu.Framework.Bindables;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Localisation;
2019-12-09 18:58:51 +08:00
using osu.Game.Configuration;
2019-01-26 12:15:45 +08:00
namespace osu.Game.Rulesets.Mods
{
public class ModWindDown : ModTimeRamp
2019-01-26 12:15:45 +08:00
{
public override string Name => "Wind Down";
public override string Acronym => "WD";
public override LocalisableString Description => "Sloooow doooown...";
2020-01-14 21:22:00 +08:00
public override IconUsage? Icon => FontAwesome.Solid.ChevronCircleDown;
[SettingSource("Initial rate", "The starting speed of the track")]
public override BindableNumber<double> InitialRate { get; } = new BindableDouble
{
MinValue = 0.51,
2020-01-29 14:34:36 +08:00
MaxValue = 2,
Default = 1,
Value = 1,
Precision = 0.01,
};
2019-12-09 18:58:51 +08:00
[SettingSource("Final rate", "The speed increase to ramp towards")]
public override BindableNumber<double> FinalRate { get; } = new BindableDouble
{
2019-12-12 16:45:11 +08:00
MinValue = 0.5,
MaxValue = 1.99,
2019-12-12 16:45:11 +08:00
Default = 0.75,
Value = 0.75,
2019-12-09 18:58:51 +08:00
Precision = 0.01,
};
2020-06-13 23:30:21 +08:00
[SettingSource("Adjust pitch", "Should pitch be adjusted with speed")]
public override BindableBool AdjustPitch { get; } = new BindableBool
{
Default = true,
Value = true
};
public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(ModWindUp)).ToArray();
public ModWindDown()
{
InitialRate.BindValueChanged(val =>
{
if (val.NewValue <= FinalRate.Value)
FinalRate.Value = val.NewValue - FinalRate.Precision;
});
FinalRate.BindValueChanged(val =>
{
if (val.NewValue >= InitialRate.Value)
InitialRate.Value = val.NewValue + InitialRate.Precision;
});
}
2019-01-26 12:15:45 +08:00
}
2019-03-06 13:14:41 +08:00
}