From 1d3bb498c465bd499f33cf5707780eae376c5eae Mon Sep 17 00:00:00 2001 From: Alten Date: Fri, 27 Dec 2019 21:41:07 -0500 Subject: [PATCH] Add new mod --- .../Mods/TauModDifficultyAdjust.cs | 49 +++++++++++++++++++ tau/osu.Game.Rulesets.tau/tauRuleset.cs | 6 +++ 2 files changed, 55 insertions(+) create mode 100644 tau/osu.Game.Rulesets.tau/Mods/TauModDifficultyAdjust.cs diff --git a/tau/osu.Game.Rulesets.tau/Mods/TauModDifficultyAdjust.cs b/tau/osu.Game.Rulesets.tau/Mods/TauModDifficultyAdjust.cs new file mode 100644 index 00000000..73fad22e --- /dev/null +++ b/tau/osu.Game.Rulesets.tau/Mods/TauModDifficultyAdjust.cs @@ -0,0 +1,49 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Framework.Bindables; +using osu.Game.Beatmaps; +using osu.Game.Configuration; +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Tau.Mods +{ + public class TauModDifficultyAdjust : ModDifficultyAdjust + { + [SettingSource("Paddle Size", "Override a beatmap's set PS.")] + public BindableNumber PaddleSize { get; } = new BindableFloat + { + Precision = 0.1f, + MinValue = 1, + MaxValue = 10, + Default = 5, + Value = 5, + }; + + [SettingSource("Approach Rate", "Override a beatmap's set AR.")] + public BindableNumber ApproachRate { get; } = new BindableFloat + { + Precision = 0.1f, + MinValue = 1, + MaxValue = 10, + Default = 5, + Value = 5, + }; + + protected override void TransferSettings(BeatmapDifficulty difficulty) + { + base.TransferSettings(difficulty); + + TransferSetting(PaddleSize, difficulty.CircleSize); + TransferSetting(ApproachRate, difficulty.ApproachRate); + } + + protected override void ApplySettings(BeatmapDifficulty difficulty) + { + base.ApplySettings(difficulty); + + difficulty.CircleSize = PaddleSize.Value; + difficulty.ApproachRate = ApproachRate.Value; + } + } +} diff --git a/tau/osu.Game.Rulesets.tau/tauRuleset.cs b/tau/osu.Game.Rulesets.tau/tauRuleset.cs index 856326ff..61c0171c 100644 --- a/tau/osu.Game.Rulesets.tau/tauRuleset.cs +++ b/tau/osu.Game.Rulesets.tau/tauRuleset.cs @@ -65,6 +65,12 @@ public override IEnumerable GetModsFor(ModType type) new TauModRelax(), }; + case ModType.Conversion: + return new Mod[] + { + new TauModDifficultyAdjust(), + }; + case ModType.Fun: return new Mod[] {