2019-01-24 16:43:03 +08:00
|
|
|
|
// 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 17:19:50 +08:00
|
|
|
|
|
2022-06-17 15:37:17 +08:00
|
|
|
|
#nullable disable
|
|
|
|
|
|
2018-06-06 15:20:17 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Linq;
|
2018-01-09 12:41:57 +08:00
|
|
|
|
using osu.Game.Beatmaps;
|
|
|
|
|
using osu.Game.Rulesets.Mania.Beatmaps;
|
|
|
|
|
using osu.Game.Rulesets.Mods;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2018-01-09 12:41:57 +08:00
|
|
|
|
namespace osu.Game.Rulesets.Mania.Mods
|
|
|
|
|
{
|
2018-04-19 21:04:12 +08:00
|
|
|
|
public abstract class ManiaKeyMod : Mod, IApplicableToBeatmapConverter
|
2018-01-09 12:41:57 +08:00
|
|
|
|
{
|
2018-11-30 16:16:00 +08:00
|
|
|
|
public override string Acronym => Name;
|
2018-01-09 12:41:57 +08:00
|
|
|
|
public abstract int KeyCount { get; }
|
2018-07-31 17:00:42 +08:00
|
|
|
|
public override ModType Type => ModType.Conversion;
|
2018-01-09 12:41:57 +08:00
|
|
|
|
public override double ScoreMultiplier => 1; // TODO: Implement the mania key mod score multiplier
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2018-04-19 21:04:12 +08:00
|
|
|
|
public void ApplyToBeatmapConverter(IBeatmapConverter beatmapConverter)
|
2018-01-09 12:41:57 +08:00
|
|
|
|
{
|
|
|
|
|
var mbc = (ManiaBeatmapConverter)beatmapConverter;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2018-01-09 12:41:57 +08:00
|
|
|
|
// Although this can work, for now let's not allow keymods for mania-specific beatmaps
|
|
|
|
|
if (mbc.IsForCurrentRuleset)
|
|
|
|
|
return;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2018-01-09 12:41:57 +08:00
|
|
|
|
mbc.TargetColumns = KeyCount;
|
|
|
|
|
}
|
2018-06-06 15:20:17 +08: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 17:28:19 +08:00
|
|
|
|
typeof(ManiaModKey10),
|
2018-06-06 15:20:17 +08:00
|
|
|
|
}.Except(new[] { GetType() }).ToArray();
|
2018-01-09 12:41:57 +08:00
|
|
|
|
}
|
|
|
|
|
}
|