osu/osu.Game.Rulesets.Mania/Mods/ManiaKeyMod.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

46 lines
1.5 KiB
C#
Raw Normal View History

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
2018-04-13 09:19:50 +00:00
2018-06-06 07:20:17 +00:00
using System;
using System.Linq;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Mania.Beatmaps;
using osu.Game.Rulesets.Mods;
2018-04-13 09:19:50 +00:00
namespace osu.Game.Rulesets.Mania.Mods
{
public abstract class ManiaKeyMod : 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 mania key mod score multiplier
2024-01-31 13:59:35 +00:00
public override bool Ranked => UsesDefaultConfiguration;
2018-04-13 09:19:50 +00:00
public void ApplyToBeatmapConverter(IBeatmapConverter beatmapConverter)
{
var mbc = (ManiaBeatmapConverter)beatmapConverter;
2018-04-13 09:19:50 +00:00
// Although this can work, for now let's not allow keymods for mania-specific beatmaps
if (mbc.IsForCurrentRuleset)
return;
2018-04-13 09:19:50 +00:00
mbc.TargetColumns = KeyCount;
}
2018-06-06 07:20:17 +00:00
public override Type[] IncompatibleMods => new[]
{
typeof(ManiaModKey1),
typeof(ManiaModKey2),
typeof(ManiaModKey3),
typeof(ManiaModKey4),
typeof(ManiaModKey5),
typeof(ManiaModKey6),
typeof(ManiaModKey7),
typeof(ManiaModKey8),
typeof(ManiaModKey9),
2020-10-14 09:28:19 +00:00
typeof(ManiaModKey10),
2018-06-06 07:20:17 +00:00
}.Except(new[] { GetType() }).ToArray();
}
}