From 0674113a83ba123a8593572c3a1dc9acf5a1f64b Mon Sep 17 00:00:00 2001 From: hwabis Date: Sun, 27 Oct 2024 09:59:40 -0400 Subject: [PATCH] refactor diagonal twists to be part of the horizontal twist mod and to not be frequency-adjustable --- .../Beatmaps/PumpTrainerHitObjectGenerator.cs | 2 +- .../PumpTrainerHitObjectGeneratorSettings.cs | 5 +- .../Mods/PumpTrainerModBanSinglesTwists.cs | 1 - .../Mods/PumpTrainerModDiagonalTwists.cs | 46 ------------------- .../Mods/PumpTrainerModHorizontalTwists.cs | 11 +++++ .../PumpTrainerRuleset.cs | 1 - 6 files changed, 15 insertions(+), 51 deletions(-) delete mode 100644 osu.Game.Rulesets.PumpTrainer/Mods/PumpTrainerModDiagonalTwists.cs diff --git a/osu.Game.Rulesets.PumpTrainer/Beatmaps/PumpTrainerHitObjectGenerator.cs b/osu.Game.Rulesets.PumpTrainer/Beatmaps/PumpTrainerHitObjectGenerator.cs index 4043010..8f7ffbd 100644 --- a/osu.Game.Rulesets.PumpTrainer/Beatmaps/PumpTrainerHitObjectGenerator.cs +++ b/osu.Game.Rulesets.PumpTrainer/Beatmaps/PumpTrainerHitObjectGenerator.cs @@ -495,7 +495,7 @@ private void banColumnsCausingBannedPatterns(List candidateColumns, Foot } // Ban diagonal twists (single pad) - if (random.NextDouble() > Settings.DiagonalTwistFrequency) + if (!Settings.AllowDiagonalTwists) { if (previousColumn == Column.P1C) { diff --git a/osu.Game.Rulesets.PumpTrainer/Beatmaps/PumpTrainerHitObjectGeneratorSettings.cs b/osu.Game.Rulesets.PumpTrainer/Beatmaps/PumpTrainerHitObjectGeneratorSettings.cs index f7ff64f..52efe1c 100644 --- a/osu.Game.Rulesets.PumpTrainer/Beatmaps/PumpTrainerHitObjectGeneratorSettings.cs +++ b/osu.Game.Rulesets.PumpTrainer/Beatmaps/PumpTrainerHitObjectGeneratorSettings.cs @@ -34,10 +34,11 @@ public class PumpTrainerHitObjectGeneratorSettings public double HorizontalTwistFrequency = 0; /// - /// 0 to 1 determining how frequently to generate a diagonal twist. Higher means more likely. + /// Determines whether to allow generating diagonal twists. + /// This requires horizontal twists to be on (greater than 0) to have any effect. /// Example starting left foot: DL --> C --> UR /// - public double DiagonalTwistFrequency = 0; + public bool AllowDiagonalTwists = false; /// /// 0 to 1 determining how frequently to generate a diagonal skip. Higher means more likely. diff --git a/osu.Game.Rulesets.PumpTrainer/Mods/PumpTrainerModBanSinglesTwists.cs b/osu.Game.Rulesets.PumpTrainer/Mods/PumpTrainerModBanSinglesTwists.cs index 924410c..1cbc50e 100644 --- a/osu.Game.Rulesets.PumpTrainer/Mods/PumpTrainerModBanSinglesTwists.cs +++ b/osu.Game.Rulesets.PumpTrainer/Mods/PumpTrainerModBanSinglesTwists.cs @@ -30,7 +30,6 @@ public class PumpTrainerModBanSinglesTwists : Mod, IApplicableToBeatmapConverter { typeof(PumpTrainerModBanFarColumns), typeof(PumpTrainerModHorizontalTwists), - typeof(PumpTrainerModDiagonalTwists), typeof(PumpTrainerModCornersOnSixteenths), typeof(PumpTrainerModDiagonalSkips), typeof(PumpTrainerModHorizontalTriples), diff --git a/osu.Game.Rulesets.PumpTrainer/Mods/PumpTrainerModDiagonalTwists.cs b/osu.Game.Rulesets.PumpTrainer/Mods/PumpTrainerModDiagonalTwists.cs deleted file mode 100644 index 7fb5656..0000000 --- a/osu.Game.Rulesets.PumpTrainer/Mods/PumpTrainerModDiagonalTwists.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using osu.Framework.Bindables; -using osu.Framework.Localisation; -using osu.Game.Beatmaps; -using osu.Game.Configuration; -using osu.Game.Rulesets.Mods; -using osu.Game.Rulesets.PumpTrainer.Beatmaps; -using osu.Game.Rulesets.PumpTrainer.Mods.ExcludeColumns; - -namespace osu.Game.Rulesets.PumpTrainer.Mods -{ - public class PumpTrainerModDiagonalTwists : Mod, IApplicableToBeatmapConverter - { - [SettingSource("Frequency")] - public Bindable DiagonalTwistFrequency { get; } = new BindableDouble(0.5) - { - MinValue = 0.1, - MaxValue = 1.0, - Default = 0.5, - Precision = 0.1, - }; - - public override string Name => "[P1Single+] Diagonal Twists"; - public override string Acronym => "DDD"; - public override LocalisableString Description => - "Crossovers across a single panel, including the center panel.\n" + - "Requires the \"horizontal twists\" mod to be enabled."; - public override double ScoreMultiplier => 1; - public override ModType Type => ModType.DifficultyIncrease; - public override Type[] IncompatibleMods => new Type[] -{ - typeof(PumpTrainerModExcludeP1DL), - typeof(PumpTrainerModExcludeP1UL), - typeof(PumpTrainerModExcludeP1C), - typeof(PumpTrainerModExcludeP1UR), - typeof(PumpTrainerModExcludeP1DR), -}; - - public void ApplyToBeatmapConverter(IBeatmapConverter beatmapConverter) - { - var pumpBeatmapConverter = (PumpTrainerBeatmapConverter)beatmapConverter; - - pumpBeatmapConverter.Settings.DiagonalTwistFrequency = DiagonalTwistFrequency.Value; - } - } -} diff --git a/osu.Game.Rulesets.PumpTrainer/Mods/PumpTrainerModHorizontalTwists.cs b/osu.Game.Rulesets.PumpTrainer/Mods/PumpTrainerModHorizontalTwists.cs index 650f3a5..14c3d33 100644 --- a/osu.Game.Rulesets.PumpTrainer/Mods/PumpTrainerModHorizontalTwists.cs +++ b/osu.Game.Rulesets.PumpTrainer/Mods/PumpTrainerModHorizontalTwists.cs @@ -24,6 +24,12 @@ public class PumpTrainerModHorizontalTwists : Mod, IApplicableToBeatmapConverter Default = false, }; + [SettingSource("[P1Single+] Diagonal Twists")] + public Bindable AllowDiagonalTwists { get; } = new BindableBool(false) + { + Default = false, + }; + public override string Name => "Horizontal Twists"; public override string Acronym => "H"; public override LocalisableString Description => @@ -41,6 +47,11 @@ public void ApplyToBeatmapConverter(IBeatmapConverter beatmapConverter) { pumpBeatmapConverter.Settings.LargeTwistFrequency = HorizontalTwistFrequency.Value; } + + if (AllowDiagonalTwists.Value) + { + pumpBeatmapConverter.Settings.AllowDiagonalTwists = true; + } } } } diff --git a/osu.Game.Rulesets.PumpTrainer/PumpTrainerRuleset.cs b/osu.Game.Rulesets.PumpTrainer/PumpTrainerRuleset.cs index 853afd1..fd936a4 100644 --- a/osu.Game.Rulesets.PumpTrainer/PumpTrainerRuleset.cs +++ b/osu.Game.Rulesets.PumpTrainer/PumpTrainerRuleset.cs @@ -45,7 +45,6 @@ public override IEnumerable GetModsFor(ModType type) return new Mod[] { new PumpTrainerModHorizontalTwists(), - new PumpTrainerModDiagonalTwists(), new PumpTrainerModCornersOnSixteenths(), new PumpTrainerModDiagonalSkips(), new PumpTrainerModHorizontalTriples(),