From 1350b68f15aab8af1e5f3856af3511fbab3ae7da Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 22 Jan 2018 15:18:39 +0900 Subject: [PATCH] DualStages always doubles the column count in lazer --- osu.Game.Rulesets.Mania/ManiaRuleset.cs | 19 ++++++------------- .../Mods/ManiaModDualStages.cs | 5 ++--- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index dad9633a37..39f22b7672 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -156,7 +156,7 @@ namespace osu.Game.Rulesets.Mania NormalActionStart = ManiaAction.Key1, }.GenerateKeyBindingsFor(variant, out _); case PlayfieldType.Dual: - getDualStageKeyCounts(variant, out int s1K, out int s2K); + int keys = getDualStageKeyCount(variant); var stage1Bindings = new VariantMappingGenerator { @@ -177,7 +177,7 @@ namespace osu.Game.Rulesets.Mania SpecialKey = InputKey.Tilde, SpecialAction = ManiaAction.Special1, NormalActionStart = ManiaAction.Key1 - }.GenerateKeyBindingsFor(s1K, out var nextNormal); + }.GenerateKeyBindingsFor(keys, out var nextNormal); var stage2Bindings = new VariantMappingGenerator { @@ -198,7 +198,7 @@ namespace osu.Game.Rulesets.Mania SpecialKey = InputKey.BackSlash, SpecialAction = ManiaAction.Special2, NormalActionStart = nextNormal - }.GenerateKeyBindingsFor(s2K, out _); + }.GenerateKeyBindingsFor(keys, out _); return stage1Bindings.Concat(stage2Bindings); } @@ -214,8 +214,8 @@ namespace osu.Game.Rulesets.Mania return $"{variant}K"; case PlayfieldType.Dual: { - getDualStageKeyCounts(variant, out int s1K, out int s2K); - return $"{s1K}K + {s2K}K"; + var keys = getDualStageKeyCount(variant); + return $"{keys}K + {keys}K"; } } } @@ -224,14 +224,7 @@ namespace osu.Game.Rulesets.Mania /// Finds the number of keys for each stage in a variant. /// /// The variant. - /// The number of keys for the first stage. - /// The number of keys for the second stage. - private void getDualStageKeyCounts(int variant, out int stage1, out int stage2) - { - int totalKeys = variant - (int)PlayfieldType.Dual; - stage1 = (int)Math.Ceiling(totalKeys / 2f); - stage2 = (int)Math.Floor(totalKeys / 2f); - } + private int getDualStageKeyCount(int variant) => (variant - (int)PlayfieldType.Dual) / 2; /// /// Finds the that corresponds to a variant value. diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModDualStages.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModDualStages.cs index 2611d1c6a2..1ba4ef9af1 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaModDualStages.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModDualStages.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System; using System.Collections.Generic; using osu.Game.Beatmaps; using osu.Game.Rulesets.Mania.Beatmaps; @@ -38,8 +37,8 @@ namespace osu.Game.Rulesets.Mania.Mods var newDefinitions = new List(); foreach (var existing in mrc.Beatmap.Stages) { - newDefinitions.Add(new StageDefinition { Columns = (int)Math.Ceiling(existing.Columns / 2f) }); - newDefinitions.Add(new StageDefinition { Columns = (int)Math.Floor(existing.Columns / 2f) }); + newDefinitions.Add(new StageDefinition { Columns = existing.Columns / 2 }); + newDefinitions.Add(new StageDefinition { Columns = existing.Columns / 2 }); } mrc.Beatmap.Stages = newDefinitions;