diff --git a/osu.Game.Rulesets.Catch/CatchRuleset.cs b/osu.Game.Rulesets.Catch/CatchRuleset.cs index 6495c5379b..5973eea602 100644 --- a/osu.Game.Rulesets.Catch/CatchRuleset.cs +++ b/osu.Game.Rulesets.Catch/CatchRuleset.cs @@ -101,7 +101,7 @@ namespace osu.Game.Rulesets.Catch case ModType.Conversion: return new Mod[] { - new CatchModDifficultyAdjust(), + new ModDifficultyAdjust(), }; case ModType.Automation: diff --git a/osu.Game.Rulesets.Catch/Mods/CatchModDifficultyAdjust.cs b/osu.Game.Rulesets.Catch/Mods/CatchModDifficultyAdjust.cs deleted file mode 100644 index 6643ebadf1..0000000000 --- a/osu.Game.Rulesets.Catch/Mods/CatchModDifficultyAdjust.cs +++ /dev/null @@ -1,51 +0,0 @@ -// 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.Catch.Mods -{ - public class CatchModDifficultyAdjust : ModDifficultyAdjust - { - [SettingSource("Drain Rate", "Override the beatmap's set HP")] - public override BindableNumber DrainRate { get; } = new BindableFloat - { - MinValue = 1, - MaxValue = 10, - Default = 5, - Value = 5, - Precision = 1F, - }; - - [SettingSource("Fruit Size", "Override the beatmap's set CS")] - public override BindableNumber CircleSize { get; } = new BindableFloat - { - MinValue = 1, - MaxValue = 10, - Default = 5, - Value = 5, - Precision = 0.1F, - }; - - [SettingSource("Approach Rate", "Override the beatmap's set AR")] - public override BindableNumber ApproachRate { get; } = new BindableFloat - { - MinValue = 1, - MaxValue = 10, - Default = 5, - Value = 5, - Precision = 0.1F, - }; - - public override void ApplyToDifficulty(BeatmapDifficulty difficulty) - { - difficulty.DrainRate = DrainRate.Value; - difficulty.CircleSize = CircleSize.Value; - difficulty.ApproachRate = ApproachRate.Value; - difficulty.OverallDifficulty = ApproachRate.Value; - } - } -} diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index c4908d1993..520bcfb586 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -143,7 +143,7 @@ namespace osu.Game.Rulesets.Mania new ManiaModRandom(), new ManiaModDualStages(), new ManiaModMirror(), - new ManiaModDifficultyAdjust(), + new ModDifficultyAdjust(), }; case ModType.Automation: diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModDifficultyAdjust.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModDifficultyAdjust.cs deleted file mode 100644 index 67554e6b92..0000000000 --- a/osu.Game.Rulesets.Mania/Mods/ManiaModDifficultyAdjust.cs +++ /dev/null @@ -1,22 +0,0 @@ -// 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.Configuration; -using osu.Game.Rulesets.Mods; - -namespace osu.Game.Rulesets.Mania.Mods -{ - public class ManiaModDifficultyAdjust : ModDifficultyAdjust - { - [SettingSource("Overall Difficulty", "Override the beatmap's set OD")] - public override BindableNumber OverallDifficulty { get; } = new BindableFloat - { - MinValue = 1, - MaxValue = 10, - Default = 5, - Value = 5, - Precision = 0.1F, - }; - } -} diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModDifficultyAdjust.cs b/osu.Game.Rulesets.Osu/Mods/OsuModDifficultyAdjust.cs deleted file mode 100644 index 86ab4579bb..0000000000 --- a/osu.Game.Rulesets.Osu/Mods/OsuModDifficultyAdjust.cs +++ /dev/null @@ -1,52 +0,0 @@ -// 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.Configuration; -using osu.Game.Rulesets.Mods; - -namespace osu.Game.Rulesets.Osu.Mods -{ - public class OsuModDifficultyAdjust : ModDifficultyAdjust - { - [SettingSource("Drain Rate", "Override the beatmap's set HP")] - public override BindableNumber DrainRate { get; } = new BindableFloat - { - MinValue = 1, - MaxValue = 10, - Default = 5, - Value = 5, - Precision = 0.1F, - }; - - [SettingSource("Circle Size", "Override the beatmap's set CS")] - public override BindableNumber CircleSize { get; } = new BindableFloat - { - MinValue = 1, - MaxValue = 10, - Default = 5, - Value = 5, - Precision = 0.1F, - }; - - [SettingSource("Approach Rate", "Override the beatmap's set AR")] - public override BindableNumber ApproachRate { get; } = new BindableFloat - { - MinValue = 1, - MaxValue = 10, - Default = 5, - Value = 5, - Precision = 0.1F, - }; - - [SettingSource("Overall Difficulty", "Override the beatmap's set OD")] - public override BindableNumber OverallDifficulty { get; } = new BindableFloat - { - MinValue = 1, - MaxValue = 10, - Default = 5, - Value = 5, - Precision = 0.1F, - }; - } -} diff --git a/osu.Game.Rulesets.Osu/OsuRuleset.cs b/osu.Game.Rulesets.Osu/OsuRuleset.cs index 746876b217..b9fa14baa1 100644 --- a/osu.Game.Rulesets.Osu/OsuRuleset.cs +++ b/osu.Game.Rulesets.Osu/OsuRuleset.cs @@ -121,7 +121,7 @@ namespace osu.Game.Rulesets.Osu return new Mod[] { new OsuModTarget(), - new OsuModDifficultyAdjust(), + new ModDifficultyAdjust(), }; case ModType.Automation: diff --git a/osu.Game.Rulesets.Taiko/Mods/TaikoModDifficultyAdjust.cs b/osu.Game.Rulesets.Taiko/Mods/TaikoModDifficultyAdjust.cs deleted file mode 100644 index ed76cf77ac..0000000000 --- a/osu.Game.Rulesets.Taiko/Mods/TaikoModDifficultyAdjust.cs +++ /dev/null @@ -1,32 +0,0 @@ -// 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.Configuration; -using osu.Game.Rulesets.Mods; - -namespace osu.Game.Rulesets.Taiko.Mods -{ - public class TaikoModDifficultyAdjust : ModDifficultyAdjust - { - [SettingSource("Drain Rate", "Override the beatmap's set HP")] - public override BindableNumber DrainRate { get; } = new BindableFloat - { - MinValue = 1, - MaxValue = 10, - Default = 5, - Value = 5, - Precision = 0.1F, - }; - - [SettingSource("Overall Difficulty", "Override the beatmap's set OD")] - public override BindableNumber OverallDifficulty { get; } = new BindableFloat - { - MinValue = 1, - MaxValue = 10, - Default = 5, - Value = 5, - Precision = 0.1F, - }; - } -} diff --git a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs index c4c85c183b..40ce58aeca 100644 --- a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs +++ b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs @@ -100,7 +100,7 @@ namespace osu.Game.Rulesets.Taiko case ModType.Conversion: return new Mod[] { - new TaikoModDifficultyAdjust(), + new ModDifficultyAdjust(), }; case ModType.Automation: diff --git a/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs b/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs index d1f6bf45b4..532da8a647 100644 --- a/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs +++ b/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs @@ -5,10 +5,11 @@ using osu.Game.Beatmaps; using osu.Framework.Bindables; using osu.Framework.Graphics.Sprites; using System; +using osu.Game.Configuration; namespace osu.Game.Rulesets.Mods { - public abstract class ModDifficultyAdjust : Mod, IApplicableToDifficulty + public class ModDifficultyAdjust : Mod, IApplicableToDifficulty { public override string Name => @"Difficulty Adjust"; @@ -24,20 +25,52 @@ namespace osu.Game.Rulesets.Mods public override Type[] IncompatibleMods => new[] { typeof(ModEasy), typeof(ModHardRock) }; - public virtual BindableNumber DrainRate { get; } + [SettingSource("Drain Rate", "Override the beatmap's set HP")] + public BindableNumber DrainRate { get; } = new BindableFloat + { + MinValue = 1, + MaxValue = 10, + Default = 5, + Value = 5, + Precision = 0.1F, + }; - public virtual BindableNumber CircleSize { get; } + [SettingSource("Circle Size", "Override the beatmap's set CS")] + public BindableNumber CircleSize { get; } = new BindableFloat + { + MinValue = 1, + MaxValue = 10, + Default = 5, + Value = 5, + Precision = 0.1F, + }; - public virtual BindableNumber ApproachRate { get; } + [SettingSource("Approach Rate", "Override the beatmap's set AR")] + public BindableNumber ApproachRate { get; } = new BindableFloat + { + MinValue = 1, + MaxValue = 10, + Default = 5, + Value = 5, + Precision = 0.1F, + }; - public virtual BindableNumber OverallDifficulty { get; } + [SettingSource("Overall Difficulty", "Override the beatmap's set OD")] + public BindableNumber OverallDifficulty { get; } = new BindableFloat + { + MinValue = 1, + MaxValue = 10, + Default = 5, + Value = 5, + Precision = 0.1F, + }; public virtual void ApplyToDifficulty(BeatmapDifficulty difficulty) { - difficulty.DrainRate = DrainRate != null ? DrainRate.Value : difficulty.DrainRate; - difficulty.CircleSize = CircleSize != null ? CircleSize.Value : difficulty.CircleSize; - difficulty.ApproachRate = ApproachRate != null ? ApproachRate.Value : difficulty.ApproachRate; - difficulty.OverallDifficulty = OverallDifficulty != null ? OverallDifficulty.Value : difficulty.OverallDifficulty; + difficulty.DrainRate = DrainRate.Value; + difficulty.CircleSize = CircleSize.Value; + difficulty.ApproachRate = ApproachRate.Value; + difficulty.OverallDifficulty = OverallDifficulty.Value; } } }