DualStages always doubles the column count in lazer

This commit is contained in:
smoogipoo 2018-01-22 15:18:39 +09:00
parent eede8333ba
commit 1350b68f15
2 changed files with 8 additions and 16 deletions

View File

@ -156,7 +156,7 @@ namespace osu.Game.Rulesets.Mania
NormalActionStart = ManiaAction.Key1, NormalActionStart = ManiaAction.Key1,
}.GenerateKeyBindingsFor(variant, out _); }.GenerateKeyBindingsFor(variant, out _);
case PlayfieldType.Dual: case PlayfieldType.Dual:
getDualStageKeyCounts(variant, out int s1K, out int s2K); int keys = getDualStageKeyCount(variant);
var stage1Bindings = new VariantMappingGenerator var stage1Bindings = new VariantMappingGenerator
{ {
@ -177,7 +177,7 @@ namespace osu.Game.Rulesets.Mania
SpecialKey = InputKey.Tilde, SpecialKey = InputKey.Tilde,
SpecialAction = ManiaAction.Special1, SpecialAction = ManiaAction.Special1,
NormalActionStart = ManiaAction.Key1 NormalActionStart = ManiaAction.Key1
}.GenerateKeyBindingsFor(s1K, out var nextNormal); }.GenerateKeyBindingsFor(keys, out var nextNormal);
var stage2Bindings = new VariantMappingGenerator var stage2Bindings = new VariantMappingGenerator
{ {
@ -198,7 +198,7 @@ namespace osu.Game.Rulesets.Mania
SpecialKey = InputKey.BackSlash, SpecialKey = InputKey.BackSlash,
SpecialAction = ManiaAction.Special2, SpecialAction = ManiaAction.Special2,
NormalActionStart = nextNormal NormalActionStart = nextNormal
}.GenerateKeyBindingsFor(s2K, out _); }.GenerateKeyBindingsFor(keys, out _);
return stage1Bindings.Concat(stage2Bindings); return stage1Bindings.Concat(stage2Bindings);
} }
@ -214,8 +214,8 @@ namespace osu.Game.Rulesets.Mania
return $"{variant}K"; return $"{variant}K";
case PlayfieldType.Dual: case PlayfieldType.Dual:
{ {
getDualStageKeyCounts(variant, out int s1K, out int s2K); var keys = getDualStageKeyCount(variant);
return $"{s1K}K + {s2K}K"; return $"{keys}K + {keys}K";
} }
} }
} }
@ -224,14 +224,7 @@ namespace osu.Game.Rulesets.Mania
/// Finds the number of keys for each stage in a <see cref="PlayfieldType.Dual"/> variant. /// Finds the number of keys for each stage in a <see cref="PlayfieldType.Dual"/> variant.
/// </summary> /// </summary>
/// <param name="variant">The variant.</param> /// <param name="variant">The variant.</param>
/// <param name="stage1">The number of keys for the first stage.</param> private int getDualStageKeyCount(int variant) => (variant - (int)PlayfieldType.Dual) / 2;
/// <param name="stage2">The number of keys for the second stage.</param>
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);
}
/// <summary> /// <summary>
/// Finds the <see cref="PlayfieldType"/> that corresponds to a variant value. /// Finds the <see cref="PlayfieldType"/> that corresponds to a variant value.

View File

@ -1,7 +1,6 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>. // Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using System.Collections.Generic; using System.Collections.Generic;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Rulesets.Mania.Beatmaps; using osu.Game.Rulesets.Mania.Beatmaps;
@ -38,8 +37,8 @@ namespace osu.Game.Rulesets.Mania.Mods
var newDefinitions = new List<StageDefinition>(); var newDefinitions = new List<StageDefinition>();
foreach (var existing in mrc.Beatmap.Stages) foreach (var existing in mrc.Beatmap.Stages)
{ {
newDefinitions.Add(new StageDefinition { Columns = (int)Math.Ceiling(existing.Columns / 2f) }); newDefinitions.Add(new StageDefinition { Columns = existing.Columns / 2 });
newDefinitions.Add(new StageDefinition { Columns = (int)Math.Floor(existing.Columns / 2f) }); newDefinitions.Add(new StageDefinition { Columns = existing.Columns / 2 });
} }
mrc.Beatmap.Stages = newDefinitions; mrc.Beatmap.Stages = newDefinitions;