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.
|
|
|
|
|
2022-06-17 15:37:17 +08:00
|
|
|
#nullable disable
|
|
|
|
|
2019-03-12 17:15:18 +08:00
|
|
|
using System;
|
|
|
|
using System.Linq;
|
2019-12-09 18:58:51 +08:00
|
|
|
using osu.Framework.Bindables;
|
2019-03-27 18:29:27 +08:00
|
|
|
using osu.Framework.Graphics.Sprites;
|
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
|
|
|
|
{
|
2019-08-01 11:35:17 +08:00
|
|
|
public class ModWindUp : ModTimeRamp
|
2019-01-26 12:15:45 +08:00
|
|
|
{
|
|
|
|
public override string Name => "Wind Up";
|
|
|
|
public override string Acronym => "WU";
|
2019-03-04 17:39:13 +08:00
|
|
|
public override string Description => "Can you keep up?";
|
2020-01-14 21:22:00 +08:00
|
|
|
public override IconUsage? Icon => FontAwesome.Solid.ChevronCircleUp;
|
2019-01-26 20:15:19 +08:00
|
|
|
public override double ScoreMultiplier => 1.0;
|
2019-03-12 17:15:18 +08:00
|
|
|
|
2020-01-27 07:56:18 +08:00
|
|
|
[SettingSource("Initial rate", "The starting speed of the track")]
|
|
|
|
public override BindableNumber<double> InitialRate { get; } = new BindableDouble
|
|
|
|
{
|
|
|
|
MinValue = 0.5,
|
2021-02-23 23:52:53 +08:00
|
|
|
MaxValue = 1.99,
|
2020-01-27 07:56:18 +08:00
|
|
|
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
|
|
|
|
{
|
2021-02-23 23:52:53 +08:00
|
|
|
MinValue = 0.51,
|
2019-12-09 18:58:51 +08:00
|
|
|
MaxValue = 2,
|
|
|
|
Default = 1.5,
|
|
|
|
Value = 1.5,
|
|
|
|
Precision = 0.01,
|
|
|
|
};
|
2019-03-12 17:15:18 +08:00
|
|
|
|
2020-06-13 23:30:21 +08:00
|
|
|
[SettingSource("Adjust pitch", "Should pitch be adjusted with speed")]
|
2020-06-13 22:16:27 +08:00
|
|
|
public override BindableBool AdjustPitch { get; } = new BindableBool
|
|
|
|
{
|
|
|
|
Default = true,
|
|
|
|
Value = true
|
|
|
|
};
|
|
|
|
|
2019-08-01 11:35:17 +08:00
|
|
|
public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(ModWindDown)).ToArray();
|
2021-02-23 23:38:09 +08:00
|
|
|
|
|
|
|
public ModWindUp()
|
|
|
|
{
|
|
|
|
InitialRate.BindValueChanged(val =>
|
2021-02-24 22:40:56 +08:00
|
|
|
{
|
|
|
|
if (val.NewValue >= FinalRate.Value)
|
|
|
|
FinalRate.Value = val.NewValue + FinalRate.Precision;
|
|
|
|
});
|
2021-02-23 23:38:09 +08:00
|
|
|
|
|
|
|
FinalRate.BindValueChanged(val =>
|
2021-02-24 22:40:56 +08:00
|
|
|
{
|
|
|
|
if (val.NewValue <= InitialRate.Value)
|
2021-02-25 02:16:10 +08:00
|
|
|
InitialRate.Value = val.NewValue - InitialRate.Precision;
|
2021-02-24 22:40:56 +08:00
|
|
|
});
|
2021-02-23 23:38:09 +08:00
|
|
|
}
|
2019-01-26 12:15:45 +08:00
|
|
|
}
|
2019-03-12 17:15:18 +08:00
|
|
|
}
|