From 904dfd205f3ab60ec1ca8db92659f40e61041b1f Mon Sep 17 00:00:00 2001 From: Sunaipaa-Kun Date: Thu, 8 Apr 2021 19:10:26 +0530 Subject: [PATCH 1/3] key mod --- .../Beatmaps/DivaBeatmapConverter.cs | 18 +++++----- osu.Game.Rulesets.Diva/DivaRuleset.cs | 6 ++++ osu.Game.Rulesets.Diva/Mods/DivaKeyMod.cs | 35 +++++++++++++++++++ osu.Game.Rulesets.Diva/Mods/DivaModKey1.cs | 13 +++++++ osu.Game.Rulesets.Diva/Mods/DivaModKey2.cs | 13 +++++++ osu.Game.Rulesets.Diva/Mods/DivaModKey3.cs | 13 +++++++ osu.Game.Rulesets.Diva/Mods/DivaModKey4.cs | 13 +++++++ 7 files changed, 103 insertions(+), 8 deletions(-) create mode 100644 osu.Game.Rulesets.Diva/Mods/DivaKeyMod.cs create mode 100644 osu.Game.Rulesets.Diva/Mods/DivaModKey1.cs create mode 100644 osu.Game.Rulesets.Diva/Mods/DivaModKey2.cs create mode 100644 osu.Game.Rulesets.Diva/Mods/DivaModKey3.cs create mode 100644 osu.Game.Rulesets.Diva/Mods/DivaModKey4.cs diff --git a/osu.Game.Rulesets.Diva/Beatmaps/DivaBeatmapConverter.cs b/osu.Game.Rulesets.Diva/Beatmaps/DivaBeatmapConverter.cs index 8dfdcd2..8bab1f3 100644 --- a/osu.Game.Rulesets.Diva/Beatmaps/DivaBeatmapConverter.cs +++ b/osu.Game.Rulesets.Diva/Beatmaps/DivaBeatmapConverter.cs @@ -15,10 +15,16 @@ namespace osu.Game.Rulesets.Diva.Beatmaps { public class DivaBeatmapConverter : BeatmapConverter { - //todo: - //make single position bursts to a line pattern - //every approach piece of a combo will come from one direction - //create patterns of same button + //todo: + //make single position bursts to a line pattern + //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; @@ -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..c791e48 --- /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 Button"; + 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..54bed46 --- /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 => "3 Button"; + 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..504e1ac --- /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 Button"; + public override string Acronym => "4B"; + public override string Description => @"Play with four buttons."; + } +} \ No newline at end of file From 8582f2f5232cbbcf2dc7dfa0f00ebdc7c4cadfb8 Mon Sep 17 00:00:00 2001 From: Sunaipaa-Kun Date: Thu, 8 Apr 2021 19:21:01 +0530 Subject: [PATCH 2/3] replaced tabs with spaces --- .../Beatmaps/DivaBeatmapConverter.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/osu.Game.Rulesets.Diva/Beatmaps/DivaBeatmapConverter.cs b/osu.Game.Rulesets.Diva/Beatmaps/DivaBeatmapConverter.cs index 8bab1f3..917a060 100644 --- a/osu.Game.Rulesets.Diva/Beatmaps/DivaBeatmapConverter.cs +++ b/osu.Game.Rulesets.Diva/Beatmaps/DivaBeatmapConverter.cs @@ -15,15 +15,15 @@ namespace osu.Game.Rulesets.Diva.Beatmaps { public class DivaBeatmapConverter : BeatmapConverter { - //todo: - //make single position bursts to a line pattern - //every approach piece of a combo will come from one direction - //create patterns of same button + //todo: + //make single position bursts to a line pattern + //every approach piece of a combo will come from one direction + //create patterns of same button - public int TargetButtons; + public int TargetButtons; - private DivaAction prevAction = DivaAction.Triangle; - private Vector2 prevObjectPos = Vector2.Zero; + 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; From 9ae22c5e0bbbcbb6e89febcb897c5ba9614fcb42 Mon Sep 17 00:00:00 2001 From: Sunaipaa-Kun Date: Thu, 8 Apr 2021 19:33:56 +0530 Subject: [PATCH 3/3] grammar! --- osu.Game.Rulesets.Diva/Mods/DivaModKey2.cs | 2 +- osu.Game.Rulesets.Diva/Mods/DivaModKey3.cs | 2 +- osu.Game.Rulesets.Diva/Mods/DivaModKey4.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Diva/Mods/DivaModKey2.cs b/osu.Game.Rulesets.Diva/Mods/DivaModKey2.cs index c791e48..c5286a2 100644 --- a/osu.Game.Rulesets.Diva/Mods/DivaModKey2.cs +++ b/osu.Game.Rulesets.Diva/Mods/DivaModKey2.cs @@ -6,7 +6,7 @@ namespace osu.Game.Rulesets.Diva.Mods public class DivaModKey2 : DivaKeyMod { public override int KeyCount => 2; - public override string Name => "Two Button"; + public override string Name => "Two Buttons"; public override string Acronym => "2B"; public override string Description => @"Play with two buttons."; } diff --git a/osu.Game.Rulesets.Diva/Mods/DivaModKey3.cs b/osu.Game.Rulesets.Diva/Mods/DivaModKey3.cs index 54bed46..fdd5d8c 100644 --- a/osu.Game.Rulesets.Diva/Mods/DivaModKey3.cs +++ b/osu.Game.Rulesets.Diva/Mods/DivaModKey3.cs @@ -6,7 +6,7 @@ namespace osu.Game.Rulesets.Diva.Mods public class DivaModKey3 : DivaKeyMod { public override int KeyCount => 3; - public override string Name => "3 Button"; + public override string Name => "Three Buttons"; public override string Acronym => "3B"; public override string Description => @"Play with three buttons."; } diff --git a/osu.Game.Rulesets.Diva/Mods/DivaModKey4.cs b/osu.Game.Rulesets.Diva/Mods/DivaModKey4.cs index 504e1ac..6fe4ffe 100644 --- a/osu.Game.Rulesets.Diva/Mods/DivaModKey4.cs +++ b/osu.Game.Rulesets.Diva/Mods/DivaModKey4.cs @@ -6,7 +6,7 @@ namespace osu.Game.Rulesets.Diva.Mods public class DivaModKey4 : DivaKeyMod { public override int KeyCount => 4; - public override string Name => "Four Button"; + public override string Name => "Four Buttons"; public override string Acronym => "4B"; public override string Description => @"Play with four buttons."; }