diff --git a/osu.Game.Rulesets.Diva/Beatmaps/DivaBeatmapConverter.cs b/osu.Game.Rulesets.Diva/Beatmaps/DivaBeatmapConverter.cs index 8dfdcd2..917a060 100644 --- a/osu.Game.Rulesets.Diva/Beatmaps/DivaBeatmapConverter.cs +++ b/osu.Game.Rulesets.Diva/Beatmaps/DivaBeatmapConverter.cs @@ -20,6 +20,12 @@ public class DivaBeatmapConverter : BeatmapConverter //every approach piece of a combo will come from one direction //create patterns of same button + public int TargetButtons; + + private DivaAction prevAction = DivaAction.Triangle; + private Vector2 prevObjectPos = Vector2.Zero; + //these variables were at the end of the class, such heresy had i done + private const float approach_piece_distance = 1200; public DivaBeatmapConverter(IBeatmap beatmap, Ruleset ruleset) @@ -99,9 +105,5 @@ private Vector2 GetApproachPieceOriginPos(Vector2 currentObjectPos) return dir.Normalized() * approach_piece_distance; } - public int TargetButtons; - - private DivaAction prevAction = DivaAction.Triangle; - private Vector2 prevObjectPos = Vector2.Zero; } } diff --git a/osu.Game.Rulesets.Diva/DivaRuleset.cs b/osu.Game.Rulesets.Diva/DivaRuleset.cs index 0d823e5..1e12794 100644 --- a/osu.Game.Rulesets.Diva/DivaRuleset.cs +++ b/osu.Game.Rulesets.Diva/DivaRuleset.cs @@ -117,6 +117,12 @@ public override IEnumerable GetModsFor(ModType type) return new Mod[] { new OsuModDifficultyAdjust(), + new MultiMod( + new DivaModKey1(), + new DivaModKey2(), + new DivaModKey3(), + new DivaModKey4() + ), }; default: diff --git a/osu.Game.Rulesets.Diva/Mods/DivaKeyMod.cs b/osu.Game.Rulesets.Diva/Mods/DivaKeyMod.cs new file mode 100644 index 0000000..b78834e --- /dev/null +++ b/osu.Game.Rulesets.Diva/Mods/DivaKeyMod.cs @@ -0,0 +1,35 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using System; +using System.Linq; +using osu.Game.Beatmaps; +using osu.Game.Rulesets.Diva.Beatmaps; +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Diva.Mods +{ + public abstract class DivaKeyMod : Mod, IApplicableToBeatmapConverter + { + public override string Acronym => Name; + public abstract int KeyCount { get; } + public override ModType Type => ModType.Conversion; + public override double ScoreMultiplier => 1; // TODO: Implement the Diva key mod score multiplier + public override bool Ranked => true; + + public void ApplyToBeatmapConverter(IBeatmapConverter beatmapConverter) + { + var bc = (DivaBeatmapConverter)beatmapConverter; + + bc.TargetButtons = KeyCount; + } + + public override Type[] IncompatibleMods => new[] + { + typeof(DivaModKey1), + typeof(DivaModKey2), + typeof(DivaModKey3), + typeof(DivaModKey4) + }.Except(new[] { GetType() }).ToArray(); + } +} \ No newline at end of file diff --git a/osu.Game.Rulesets.Diva/Mods/DivaModKey1.cs b/osu.Game.Rulesets.Diva/Mods/DivaModKey1.cs new file mode 100644 index 0000000..4d55c2d --- /dev/null +++ b/osu.Game.Rulesets.Diva/Mods/DivaModKey1.cs @@ -0,0 +1,13 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +namespace osu.Game.Rulesets.Diva.Mods +{ + public class DivaModKey1 : DivaKeyMod + { + public override int KeyCount => 1; + public override string Name => "One Button"; + public override string Acronym => "1B"; + public override string Description => @"Play with one button."; + } +} \ No newline at end of file diff --git a/osu.Game.Rulesets.Diva/Mods/DivaModKey2.cs b/osu.Game.Rulesets.Diva/Mods/DivaModKey2.cs new file mode 100644 index 0000000..c5286a2 --- /dev/null +++ b/osu.Game.Rulesets.Diva/Mods/DivaModKey2.cs @@ -0,0 +1,13 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +namespace osu.Game.Rulesets.Diva.Mods +{ + public class DivaModKey2 : DivaKeyMod + { + public override int KeyCount => 2; + public override string Name => "Two Buttons"; + public override string Acronym => "2B"; + public override string Description => @"Play with two buttons."; + } +} \ No newline at end of file diff --git a/osu.Game.Rulesets.Diva/Mods/DivaModKey3.cs b/osu.Game.Rulesets.Diva/Mods/DivaModKey3.cs new file mode 100644 index 0000000..fdd5d8c --- /dev/null +++ b/osu.Game.Rulesets.Diva/Mods/DivaModKey3.cs @@ -0,0 +1,13 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +namespace osu.Game.Rulesets.Diva.Mods +{ + public class DivaModKey3 : DivaKeyMod + { + public override int KeyCount => 3; + public override string Name => "Three Buttons"; + public override string Acronym => "3B"; + public override string Description => @"Play with three buttons."; + } +} \ No newline at end of file diff --git a/osu.Game.Rulesets.Diva/Mods/DivaModKey4.cs b/osu.Game.Rulesets.Diva/Mods/DivaModKey4.cs new file mode 100644 index 0000000..6fe4ffe --- /dev/null +++ b/osu.Game.Rulesets.Diva/Mods/DivaModKey4.cs @@ -0,0 +1,13 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +namespace osu.Game.Rulesets.Diva.Mods +{ + public class DivaModKey4 : DivaKeyMod + { + public override int KeyCount => 4; + public override string Name => "Four Buttons"; + public override string Acronym => "4B"; + public override string Description => @"Play with four buttons."; + } +} \ No newline at end of file