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