From 1f48cfb79af0a821832b5c92750e13470a71d4ec Mon Sep 17 00:00:00 2001 From: tgi74000 Date: Thu, 8 Mar 2018 17:35:20 +0100 Subject: [PATCH 1/4] Added Mirror Mod for Mania --- osu.Game.Rulesets.Mania/ManiaRuleset.cs | 1 + .../Mods/ManiaMirrorMod.cs | 28 +++++++++++++++++++ .../osu.Game.Rulesets.Mania.csproj | 1 + 3 files changed, 30 insertions(+) create mode 100644 osu.Game.Rulesets.Mania/Mods/ManiaMirrorMod.cs diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index 16b6888f2b..7c257bf719 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -91,6 +91,7 @@ namespace osu.Game.Rulesets.Mania }, new ManiaModRandom(), new ManiaModDualStages(), + new ManiaMirrorMod(), new MultiMod { Mods = new Mod[] diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaMirrorMod.cs b/osu.Game.Rulesets.Mania/Mods/ManiaMirrorMod.cs new file mode 100644 index 0000000000..cbcbd9f329 --- /dev/null +++ b/osu.Game.Rulesets.Mania/Mods/ManiaMirrorMod.cs @@ -0,0 +1,28 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Extensions.IEnumerableExtensions; +using osu.Game.Rulesets.Mania.Objects; +using osu.Game.Rulesets.Mania.UI; +using osu.Game.Rulesets.Mods; +using osu.Game.Rulesets.UI; +using System.Linq; + +namespace osu.Game.Rulesets.Mania.Mods +{ + public class ManiaMirrorMod : Mod, IApplicableToRulesetContainer + { + public override string Name => "Mirror"; + public override string ShortenedName => "MR"; + public override ModType Type => ModType.Special; + public override double ScoreMultiplier => 1; + public override bool Ranked => true; + + public void ApplyToRulesetContainer(RulesetContainer rulesetContainer) + { + var availableColumns = ((ManiaRulesetContainer)rulesetContainer).Beatmap.TotalColumns; + + rulesetContainer.Objects.OfType().ForEach(h => h.Column = -(h.Column) + (availableColumns)-1); + } + } +} diff --git a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj index a09b3e93a7..3c80e21ff2 100644 --- a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj +++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj @@ -81,6 +81,7 @@ + From ed20e31bbe1e95ee642d6357fb08e278ede68bad Mon Sep 17 00:00:00 2001 From: tgi74000 Date: Sat, 10 Mar 2018 08:39:11 +0100 Subject: [PATCH 2/4] Removed redundant parentheses --- osu.Game.Rulesets.Mania/Mods/ManiaMirrorMod.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaMirrorMod.cs b/osu.Game.Rulesets.Mania/Mods/ManiaMirrorMod.cs index cbcbd9f329..e7f0e27733 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaMirrorMod.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaMirrorMod.cs @@ -22,7 +22,7 @@ namespace osu.Game.Rulesets.Mania.Mods { var availableColumns = ((ManiaRulesetContainer)rulesetContainer).Beatmap.TotalColumns; - rulesetContainer.Objects.OfType().ForEach(h => h.Column = -(h.Column) + (availableColumns)-1); + rulesetContainer.Objects.OfType().ForEach(h => h.Column = -h.Column + availableColumns - 1); } } } From a4dfeff2d775e018407c45eded431b33a9ec1a62 Mon Sep 17 00:00:00 2001 From: tgi74000 Date: Sat, 10 Mar 2018 08:44:46 +0100 Subject: [PATCH 3/4] Renamed ManiaMirrorMod to ManiaModMirror --- osu.Game.Rulesets.Mania/ManiaRuleset.cs | 2 +- .../Mods/{ManiaMirrorMod.cs => ManiaModMirror.cs} | 2 +- osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename osu.Game.Rulesets.Mania/Mods/{ManiaMirrorMod.cs => ManiaModMirror.cs} (91%) diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index 7c257bf719..268bc23640 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -91,7 +91,7 @@ namespace osu.Game.Rulesets.Mania }, new ManiaModRandom(), new ManiaModDualStages(), - new ManiaMirrorMod(), + new ManiaModMirror(), new MultiMod { Mods = new Mod[] diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaMirrorMod.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModMirror.cs similarity index 91% rename from osu.Game.Rulesets.Mania/Mods/ManiaMirrorMod.cs rename to osu.Game.Rulesets.Mania/Mods/ManiaModMirror.cs index e7f0e27733..be3a0e02db 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaMirrorMod.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModMirror.cs @@ -10,7 +10,7 @@ using System.Linq; namespace osu.Game.Rulesets.Mania.Mods { - public class ManiaMirrorMod : Mod, IApplicableToRulesetContainer + public class ManiaModMirror : Mod, IApplicableToRulesetContainer { public override string Name => "Mirror"; public override string ShortenedName => "MR"; diff --git a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj index 3c80e21ff2..52d8f66717 100644 --- a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj +++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj @@ -81,7 +81,7 @@ - + From 46caab6310d74a0b3d7ba36a3edea53aca6b17b0 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 12 Mar 2018 11:56:49 +0900 Subject: [PATCH 4/4] Reorder arithmetic operation --- osu.Game.Rulesets.Mania/Mods/ManiaModMirror.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModMirror.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModMirror.cs index be3a0e02db..cfa5ef88b8 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaModMirror.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModMirror.cs @@ -22,7 +22,7 @@ namespace osu.Game.Rulesets.Mania.Mods { var availableColumns = ((ManiaRulesetContainer)rulesetContainer).Beatmap.TotalColumns; - rulesetContainer.Objects.OfType().ForEach(h => h.Column = -h.Column + availableColumns - 1); + rulesetContainer.Objects.OfType().ForEach(h => h.Column = availableColumns - 1 - h.Column); } } }