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
|
|
|
|
|
2018-01-15 16:43:45 +08:00
|
|
|
|
using System;
|
2017-03-10 14:08:53 +08:00
|
|
|
|
using System.Collections.Generic;
|
2018-01-15 16:43:45 +08:00
|
|
|
|
using System.Linq;
|
2021-02-25 14:38:56 +08:00
|
|
|
|
using osu.Framework.Extensions.EnumExtensions;
|
2017-08-03 13:36:21 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
2019-03-27 18:29:27 +08:00
|
|
|
|
using osu.Framework.Graphics.Sprites;
|
2017-08-23 11:49:50 +08:00
|
|
|
|
using osu.Framework.Input.Bindings;
|
2022-08-15 02:54:02 +08:00
|
|
|
|
using osu.Framework.Localisation;
|
2022-08-29 13:01:04 +08:00
|
|
|
|
using osu.Game.Beatmaps;
|
2018-04-13 21:41:35 +08:00
|
|
|
|
using osu.Game.Beatmaps.Legacy;
|
2018-06-11 12:17:08 +08:00
|
|
|
|
using osu.Game.Configuration;
|
2022-08-29 13:01:04 +08:00
|
|
|
|
using osu.Game.Graphics;
|
2018-06-11 13:36:19 +08:00
|
|
|
|
using osu.Game.Overlays.Settings;
|
2018-06-11 12:17:08 +08:00
|
|
|
|
using osu.Game.Rulesets.Configuration;
|
2018-05-15 16:38:04 +08:00
|
|
|
|
using osu.Game.Rulesets.Difficulty;
|
2018-06-07 15:08:37 +08:00
|
|
|
|
using osu.Game.Rulesets.Edit;
|
2021-03-30 15:07:04 +08:00
|
|
|
|
using osu.Game.Rulesets.Filter;
|
2018-04-19 21:04:12 +08:00
|
|
|
|
using osu.Game.Rulesets.Mania.Beatmaps;
|
2018-06-11 12:17:08 +08:00
|
|
|
|
using osu.Game.Rulesets.Mania.Configuration;
|
2018-05-15 16:40:19 +08:00
|
|
|
|
using osu.Game.Rulesets.Mania.Difficulty;
|
2018-06-07 15:08:37 +08:00
|
|
|
|
using osu.Game.Rulesets.Mania.Edit;
|
2021-08-22 23:40:11 +08:00
|
|
|
|
using osu.Game.Rulesets.Mania.Edit.Setup;
|
2022-08-29 13:01:04 +08:00
|
|
|
|
using osu.Game.Rulesets.Mania.Mods;
|
|
|
|
|
using osu.Game.Rulesets.Mania.Replays;
|
2019-12-17 19:08:13 +08:00
|
|
|
|
using osu.Game.Rulesets.Mania.Scoring;
|
2022-09-27 17:52:21 +08:00
|
|
|
|
using osu.Game.Rulesets.Mania.Skinning.Argon;
|
2022-10-04 18:50:55 +08:00
|
|
|
|
using osu.Game.Rulesets.Mania.Skinning.Default;
|
2020-12-07 11:32:52 +08:00
|
|
|
|
using osu.Game.Rulesets.Mania.Skinning.Legacy;
|
2022-08-29 13:01:04 +08:00
|
|
|
|
using osu.Game.Rulesets.Mania.UI;
|
|
|
|
|
using osu.Game.Rulesets.Mods;
|
|
|
|
|
using osu.Game.Rulesets.Replays.Types;
|
2019-12-17 19:08:13 +08:00
|
|
|
|
using osu.Game.Rulesets.Scoring;
|
2023-09-04 16:43:23 +08:00
|
|
|
|
using osu.Game.Rulesets.Scoring.Legacy;
|
2022-08-29 13:01:04 +08:00
|
|
|
|
using osu.Game.Rulesets.UI;
|
2018-11-28 15:12:57 +08:00
|
|
|
|
using osu.Game.Scoring;
|
2021-08-22 23:40:11 +08:00
|
|
|
|
using osu.Game.Screens.Edit.Setup;
|
2020-06-19 20:18:58 +08:00
|
|
|
|
using osu.Game.Screens.Ranking.Statistics;
|
2022-08-29 13:01:04 +08:00
|
|
|
|
using osu.Game.Skinning;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2017-04-18 15:05:58 +08:00
|
|
|
|
namespace osu.Game.Rulesets.Mania
|
2016-11-09 18:49:05 +08:00
|
|
|
|
{
|
2019-12-24 12:48:27 +08:00
|
|
|
|
public class ManiaRuleset : Ruleset, ILegacyRuleset
|
2016-11-09 18:49:05 +08:00
|
|
|
|
{
|
2020-04-21 09:56:04 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The maximum number of supported keys in a single stage.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public const int MAX_STAGE_KEYS = 10;
|
|
|
|
|
|
2022-07-10 10:15:02 +08:00
|
|
|
|
public override DrawableRuleset CreateDrawableRulesetWith(IBeatmap beatmap, IReadOnlyList<Mod>? mods = null) => new DrawableManiaRuleset(this, beatmap, mods);
|
2019-12-17 19:08:13 +08:00
|
|
|
|
|
2019-12-24 16:01:17 +08:00
|
|
|
|
public override ScoreProcessor CreateScoreProcessor() => new ManiaScoreProcessor();
|
2019-12-17 19:08:13 +08:00
|
|
|
|
|
2023-01-11 12:01:18 +08:00
|
|
|
|
public override HealthProcessor CreateHealthProcessor(double drainStartTime) => new ManiaHealthProcessor(drainStartTime);
|
2019-12-17 19:08:13 +08:00
|
|
|
|
|
2019-12-24 15:02:16 +08:00
|
|
|
|
public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => new ManiaBeatmapConverter(beatmap, this);
|
2019-12-17 19:08:13 +08:00
|
|
|
|
|
2022-03-15 11:37:39 +08:00
|
|
|
|
public override PerformanceCalculator CreatePerformanceCalculator() => new ManiaPerformanceCalculator();
|
2018-06-07 15:08:37 +08:00
|
|
|
|
|
2019-08-30 13:39:02 +08:00
|
|
|
|
public const string SHORT_NAME = "mania";
|
|
|
|
|
|
2022-08-29 13:01:04 +08:00
|
|
|
|
public override string RulesetAPIVersionSupported => CURRENT_RULESET_API_VERSION;
|
2022-08-22 15:10:55 +08:00
|
|
|
|
|
2018-06-07 15:08:37 +08:00
|
|
|
|
public override HitObjectComposer CreateHitObjectComposer() => new ManiaHitObjectComposer(this);
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2024-03-21 02:52:16 +08:00
|
|
|
|
public override IBeatmapVerifier CreateBeatmapVerifier() => new ManiaBeatmapVerifier();
|
|
|
|
|
|
2022-09-15 16:36:14 +08:00
|
|
|
|
public override ISkin? CreateSkinTransformer(ISkin skin, IBeatmap beatmap)
|
|
|
|
|
{
|
|
|
|
|
switch (skin)
|
|
|
|
|
{
|
2022-10-04 18:50:55 +08:00
|
|
|
|
case TrianglesSkin:
|
2022-10-06 13:51:17 +08:00
|
|
|
|
return new ManiaTrianglesSkinTransformer(skin, beatmap);
|
2022-10-04 18:50:55 +08:00
|
|
|
|
|
2022-09-27 17:52:21 +08:00
|
|
|
|
case ArgonSkin:
|
2022-10-06 13:51:17 +08:00
|
|
|
|
return new ManiaArgonSkinTransformer(skin, beatmap);
|
2022-10-05 18:21:38 +08:00
|
|
|
|
|
2022-10-05 21:41:20 +08:00
|
|
|
|
case DefaultLegacySkin:
|
|
|
|
|
return new ManiaClassicSkinTransformer(skin, beatmap);
|
|
|
|
|
|
2022-10-05 18:21:38 +08:00
|
|
|
|
case LegacySkin:
|
|
|
|
|
return new ManiaLegacySkinTransformer(skin, beatmap);
|
2022-09-15 16:36:14 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
}
|
2019-12-26 21:03:21 +08:00
|
|
|
|
|
2020-03-24 11:06:24 +08:00
|
|
|
|
public override IEnumerable<Mod> ConvertFromLegacyMods(LegacyMods mods)
|
2018-04-13 21:41:35 +08:00
|
|
|
|
{
|
2021-02-25 14:38:56 +08:00
|
|
|
|
if (mods.HasFlagFast(LegacyMods.Nightcore))
|
2018-04-13 21:41:35 +08:00
|
|
|
|
yield return new ManiaModNightcore();
|
2021-02-25 14:38:56 +08:00
|
|
|
|
else if (mods.HasFlagFast(LegacyMods.DoubleTime))
|
2018-04-13 21:41:35 +08:00
|
|
|
|
yield return new ManiaModDoubleTime();
|
|
|
|
|
|
2021-02-25 14:38:56 +08:00
|
|
|
|
if (mods.HasFlagFast(LegacyMods.Perfect))
|
2019-09-16 04:55:25 +08:00
|
|
|
|
yield return new ManiaModPerfect();
|
2021-02-25 14:38:56 +08:00
|
|
|
|
else if (mods.HasFlagFast(LegacyMods.SuddenDeath))
|
2019-09-16 04:55:25 +08:00
|
|
|
|
yield return new ManiaModSuddenDeath();
|
|
|
|
|
|
2021-02-25 14:38:56 +08:00
|
|
|
|
if (mods.HasFlagFast(LegacyMods.Cinema))
|
2019-11-24 01:32:16 +08:00
|
|
|
|
yield return new ManiaModCinema();
|
2021-02-25 14:38:56 +08:00
|
|
|
|
else if (mods.HasFlagFast(LegacyMods.Autoplay))
|
2018-04-13 21:41:35 +08:00
|
|
|
|
yield return new ManiaModAutoplay();
|
|
|
|
|
|
2021-02-25 14:38:56 +08:00
|
|
|
|
if (mods.HasFlagFast(LegacyMods.Easy))
|
2018-04-13 21:41:35 +08:00
|
|
|
|
yield return new ManiaModEasy();
|
|
|
|
|
|
2021-02-25 14:38:56 +08:00
|
|
|
|
if (mods.HasFlagFast(LegacyMods.FadeIn))
|
2018-04-13 21:41:35 +08:00
|
|
|
|
yield return new ManiaModFadeIn();
|
|
|
|
|
|
2021-02-25 14:38:56 +08:00
|
|
|
|
if (mods.HasFlagFast(LegacyMods.Flashlight))
|
2018-04-13 21:41:35 +08:00
|
|
|
|
yield return new ManiaModFlashlight();
|
|
|
|
|
|
2021-02-25 14:38:56 +08:00
|
|
|
|
if (mods.HasFlagFast(LegacyMods.HalfTime))
|
2018-04-13 21:41:35 +08:00
|
|
|
|
yield return new ManiaModHalfTime();
|
|
|
|
|
|
2021-02-25 14:38:56 +08:00
|
|
|
|
if (mods.HasFlagFast(LegacyMods.HardRock))
|
2018-04-13 21:41:35 +08:00
|
|
|
|
yield return new ManiaModHardRock();
|
|
|
|
|
|
2021-02-25 14:38:56 +08:00
|
|
|
|
if (mods.HasFlagFast(LegacyMods.Hidden))
|
2018-04-13 21:41:35 +08:00
|
|
|
|
yield return new ManiaModHidden();
|
|
|
|
|
|
2021-02-25 14:38:56 +08:00
|
|
|
|
if (mods.HasFlagFast(LegacyMods.Key1))
|
2018-04-13 21:41:35 +08:00
|
|
|
|
yield return new ManiaModKey1();
|
|
|
|
|
|
2021-02-25 14:38:56 +08:00
|
|
|
|
if (mods.HasFlagFast(LegacyMods.Key2))
|
2018-04-13 21:41:35 +08:00
|
|
|
|
yield return new ManiaModKey2();
|
|
|
|
|
|
2021-02-25 14:38:56 +08:00
|
|
|
|
if (mods.HasFlagFast(LegacyMods.Key3))
|
2018-04-13 21:41:35 +08:00
|
|
|
|
yield return new ManiaModKey3();
|
|
|
|
|
|
2021-02-25 14:38:56 +08:00
|
|
|
|
if (mods.HasFlagFast(LegacyMods.Key4))
|
2018-04-13 21:41:35 +08:00
|
|
|
|
yield return new ManiaModKey4();
|
|
|
|
|
|
2021-02-25 14:38:56 +08:00
|
|
|
|
if (mods.HasFlagFast(LegacyMods.Key5))
|
2018-04-13 21:41:35 +08:00
|
|
|
|
yield return new ManiaModKey5();
|
|
|
|
|
|
2021-02-25 14:38:56 +08:00
|
|
|
|
if (mods.HasFlagFast(LegacyMods.Key6))
|
2018-04-13 21:41:35 +08:00
|
|
|
|
yield return new ManiaModKey6();
|
|
|
|
|
|
2021-02-25 14:38:56 +08:00
|
|
|
|
if (mods.HasFlagFast(LegacyMods.Key7))
|
2018-04-13 21:41:35 +08:00
|
|
|
|
yield return new ManiaModKey7();
|
|
|
|
|
|
2021-02-25 14:38:56 +08:00
|
|
|
|
if (mods.HasFlagFast(LegacyMods.Key8))
|
2018-04-13 21:41:35 +08:00
|
|
|
|
yield return new ManiaModKey8();
|
|
|
|
|
|
2021-02-25 14:38:56 +08:00
|
|
|
|
if (mods.HasFlagFast(LegacyMods.Key9))
|
2018-04-13 21:41:35 +08:00
|
|
|
|
yield return new ManiaModKey9();
|
|
|
|
|
|
2021-02-25 14:38:56 +08:00
|
|
|
|
if (mods.HasFlagFast(LegacyMods.KeyCoop))
|
2020-11-15 22:38:12 +08:00
|
|
|
|
yield return new ManiaModDualStages();
|
|
|
|
|
|
2021-02-25 14:38:56 +08:00
|
|
|
|
if (mods.HasFlagFast(LegacyMods.NoFail))
|
2018-04-13 21:41:35 +08:00
|
|
|
|
yield return new ManiaModNoFail();
|
|
|
|
|
|
2021-02-25 14:38:56 +08:00
|
|
|
|
if (mods.HasFlagFast(LegacyMods.Random))
|
2018-04-13 21:41:35 +08:00
|
|
|
|
yield return new ManiaModRandom();
|
2020-08-29 17:49:17 +08:00
|
|
|
|
|
2021-02-25 14:38:56 +08:00
|
|
|
|
if (mods.HasFlagFast(LegacyMods.Mirror))
|
2020-08-29 17:49:17 +08:00
|
|
|
|
yield return new ManiaModMirror();
|
2023-07-09 22:15:17 +08:00
|
|
|
|
|
|
|
|
|
if (mods.HasFlagFast(LegacyMods.ScoreV2))
|
|
|
|
|
yield return new ModScoreV2();
|
2018-04-13 21:41:35 +08:00
|
|
|
|
}
|
|
|
|
|
|
2020-03-24 11:06:24 +08:00
|
|
|
|
public override LegacyMods ConvertToLegacyMods(Mod[] mods)
|
|
|
|
|
{
|
|
|
|
|
var value = base.ConvertToLegacyMods(mods);
|
|
|
|
|
|
|
|
|
|
foreach (var mod in mods)
|
|
|
|
|
{
|
|
|
|
|
switch (mod)
|
|
|
|
|
{
|
2022-06-24 20:25:23 +08:00
|
|
|
|
case ManiaModKey1:
|
2020-03-24 11:06:24 +08:00
|
|
|
|
value |= LegacyMods.Key1;
|
|
|
|
|
break;
|
|
|
|
|
|
2022-06-24 20:25:23 +08:00
|
|
|
|
case ManiaModKey2:
|
2020-03-24 11:06:24 +08:00
|
|
|
|
value |= LegacyMods.Key2;
|
|
|
|
|
break;
|
|
|
|
|
|
2022-06-24 20:25:23 +08:00
|
|
|
|
case ManiaModKey3:
|
2020-03-24 11:06:24 +08:00
|
|
|
|
value |= LegacyMods.Key3;
|
|
|
|
|
break;
|
|
|
|
|
|
2022-06-24 20:25:23 +08:00
|
|
|
|
case ManiaModKey4:
|
2020-03-24 11:06:24 +08:00
|
|
|
|
value |= LegacyMods.Key4;
|
|
|
|
|
break;
|
|
|
|
|
|
2022-06-24 20:25:23 +08:00
|
|
|
|
case ManiaModKey5:
|
2020-03-24 11:06:24 +08:00
|
|
|
|
value |= LegacyMods.Key5;
|
|
|
|
|
break;
|
|
|
|
|
|
2022-06-24 20:25:23 +08:00
|
|
|
|
case ManiaModKey6:
|
2020-03-24 11:06:24 +08:00
|
|
|
|
value |= LegacyMods.Key6;
|
|
|
|
|
break;
|
|
|
|
|
|
2022-06-24 20:25:23 +08:00
|
|
|
|
case ManiaModKey7:
|
2020-03-24 11:06:24 +08:00
|
|
|
|
value |= LegacyMods.Key7;
|
|
|
|
|
break;
|
|
|
|
|
|
2022-06-24 20:25:23 +08:00
|
|
|
|
case ManiaModKey8:
|
2020-03-24 11:06:24 +08:00
|
|
|
|
value |= LegacyMods.Key8;
|
|
|
|
|
break;
|
|
|
|
|
|
2022-06-24 20:25:23 +08:00
|
|
|
|
case ManiaModKey9:
|
2020-03-24 11:06:24 +08:00
|
|
|
|
value |= LegacyMods.Key9;
|
|
|
|
|
break;
|
|
|
|
|
|
2022-06-24 20:25:23 +08:00
|
|
|
|
case ManiaModDualStages:
|
2020-11-15 22:38:12 +08:00
|
|
|
|
value |= LegacyMods.KeyCoop;
|
|
|
|
|
break;
|
|
|
|
|
|
2022-06-24 20:25:23 +08:00
|
|
|
|
case ManiaModFadeIn:
|
2020-03-24 11:06:24 +08:00
|
|
|
|
value |= LegacyMods.FadeIn;
|
2020-11-16 13:52:18 +08:00
|
|
|
|
value &= ~LegacyMods.Hidden; // this is toggled on in the base call due to inheritance, but we don't want that.
|
2020-03-24 11:06:24 +08:00
|
|
|
|
break;
|
2020-08-29 17:49:17 +08:00
|
|
|
|
|
2022-06-24 20:25:23 +08:00
|
|
|
|
case ManiaModMirror:
|
2020-08-29 17:49:17 +08:00
|
|
|
|
value |= LegacyMods.Mirror;
|
|
|
|
|
break;
|
2020-11-15 22:38:12 +08:00
|
|
|
|
|
2022-06-24 20:25:23 +08:00
|
|
|
|
case ManiaModRandom:
|
2020-11-15 22:38:12 +08:00
|
|
|
|
value |= LegacyMods.Random;
|
|
|
|
|
break;
|
2020-03-24 11:06:24 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return value;
|
|
|
|
|
}
|
|
|
|
|
|
2017-03-02 13:07:28 +08:00
|
|
|
|
public override IEnumerable<Mod> GetModsFor(ModType type)
|
2017-03-02 10:05:52 +08:00
|
|
|
|
{
|
2017-03-02 13:07:28 +08:00
|
|
|
|
switch (type)
|
2017-03-02 10:05:52 +08:00
|
|
|
|
{
|
2017-03-02 13:07:28 +08:00
|
|
|
|
case ModType.DifficultyReduction:
|
|
|
|
|
return new Mod[]
|
2017-03-02 10:05:52 +08:00
|
|
|
|
{
|
2017-03-02 13:07:28 +08:00
|
|
|
|
new ManiaModEasy(),
|
|
|
|
|
new ManiaModNoFail(),
|
2018-06-06 13:07:50 +08:00
|
|
|
|
new MultiMod(new ManiaModHalfTime(), new ManiaModDaycore()),
|
2017-03-02 13:07:28 +08:00
|
|
|
|
};
|
2019-04-01 11:16:05 +08:00
|
|
|
|
|
2017-03-02 13:07:28 +08:00
|
|
|
|
case ModType.DifficultyIncrease:
|
|
|
|
|
return new Mod[]
|
2017-03-02 10:05:52 +08:00
|
|
|
|
{
|
2017-03-02 13:07:28 +08:00
|
|
|
|
new ManiaModHardRock(),
|
2018-06-06 13:07:50 +08:00
|
|
|
|
new MultiMod(new ManiaModSuddenDeath(), new ManiaModPerfect()),
|
|
|
|
|
new MultiMod(new ManiaModDoubleTime(), new ManiaModNightcore()),
|
2024-02-06 23:15:06 +08:00
|
|
|
|
new MultiMod(new ManiaModFadeIn(), new ManiaModHidden(), new ManiaModCover()),
|
2017-03-02 13:07:28 +08:00
|
|
|
|
new ManiaModFlashlight(),
|
2022-05-24 22:56:31 +08:00
|
|
|
|
new ModAccuracyChallenge(),
|
2017-03-02 13:07:28 +08:00
|
|
|
|
};
|
2019-04-01 11:16:05 +08:00
|
|
|
|
|
2018-07-31 17:00:42 +08:00
|
|
|
|
case ModType.Conversion:
|
2017-03-02 13:07:28 +08:00
|
|
|
|
return new Mod[]
|
2017-03-02 10:05:52 +08:00
|
|
|
|
{
|
2017-03-02 13:07:28 +08:00
|
|
|
|
new ManiaModRandom(),
|
2018-01-22 14:11:15 +08:00
|
|
|
|
new ManiaModDualStages(),
|
2018-03-10 15:44:46 +08:00
|
|
|
|
new ManiaModMirror(),
|
2019-12-20 18:30:23 +08:00
|
|
|
|
new ManiaModDifficultyAdjust(),
|
2021-04-21 14:14:31 +08:00
|
|
|
|
new ManiaModClassic(),
|
2020-08-18 00:40:55 +08:00
|
|
|
|
new ManiaModInvert(),
|
2022-01-27 19:35:31 +08:00
|
|
|
|
new ManiaModConstantSpeed(),
|
2023-11-02 14:49:10 +08:00
|
|
|
|
new ManiaModHoldOff(),
|
|
|
|
|
new MultiMod(
|
|
|
|
|
new ManiaModKey1(),
|
|
|
|
|
new ManiaModKey2(),
|
|
|
|
|
new ManiaModKey3(),
|
|
|
|
|
new ManiaModKey4(),
|
|
|
|
|
new ManiaModKey5(),
|
|
|
|
|
new ManiaModKey6(),
|
|
|
|
|
new ManiaModKey7(),
|
|
|
|
|
new ManiaModKey8(),
|
|
|
|
|
new ManiaModKey9(),
|
|
|
|
|
new ManiaModKey10()
|
|
|
|
|
),
|
2018-07-31 17:00:42 +08:00
|
|
|
|
};
|
2019-04-01 11:16:05 +08:00
|
|
|
|
|
2018-07-31 17:00:42 +08:00
|
|
|
|
case ModType.Automation:
|
|
|
|
|
return new Mod[]
|
|
|
|
|
{
|
2019-11-24 01:32:16 +08:00
|
|
|
|
new MultiMod(new ManiaModAutoplay(), new ManiaModCinema()),
|
2017-03-02 13:07:28 +08:00
|
|
|
|
};
|
2019-04-01 11:16:05 +08:00
|
|
|
|
|
2019-01-26 12:15:45 +08:00
|
|
|
|
case ModType.Fun:
|
|
|
|
|
return new Mod[]
|
|
|
|
|
{
|
2021-07-28 18:21:08 +08:00
|
|
|
|
new MultiMod(new ModWindUp(), new ModWindDown()),
|
|
|
|
|
new ManiaModMuted(),
|
2022-03-01 21:12:06 +08:00
|
|
|
|
new ModAdaptiveSpeed()
|
2019-01-26 12:15:45 +08:00
|
|
|
|
};
|
2019-04-01 11:16:05 +08:00
|
|
|
|
|
2023-07-09 22:15:17 +08:00
|
|
|
|
case ModType.System:
|
|
|
|
|
return new Mod[]
|
|
|
|
|
{
|
|
|
|
|
new ModScoreV2(),
|
|
|
|
|
};
|
|
|
|
|
|
2017-03-02 13:07:28 +08:00
|
|
|
|
default:
|
2019-11-28 21:41:29 +08:00
|
|
|
|
return Array.Empty<Mod>();
|
2017-03-02 13:07:28 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2017-03-10 04:37:03 +08:00
|
|
|
|
public override string Description => "osu!mania";
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2019-08-30 13:39:02 +08:00
|
|
|
|
public override string ShortName => SHORT_NAME;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2020-01-03 19:39:15 +08:00
|
|
|
|
public override string PlayingVerb => "Smashing keys";
|
|
|
|
|
|
2019-03-27 18:29:27 +08:00
|
|
|
|
public override Drawable CreateIcon() => new SpriteIcon { Icon = OsuIcon.RulesetMania };
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2021-11-15 17:23:03 +08:00
|
|
|
|
public override DifficultyCalculator CreateDifficultyCalculator(IWorkingBeatmap beatmap) => new ManiaDifficultyCalculator(RulesetInfo, beatmap);
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2019-12-24 12:48:27 +08:00
|
|
|
|
public int LegacyID => 3;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2023-07-04 16:32:54 +08:00
|
|
|
|
public ILegacyScoreSimulator CreateLegacyScoreSimulator() => new ManiaLegacyScoreSimulator();
|
2023-06-29 16:24:37 +08:00
|
|
|
|
|
2018-03-01 00:32:32 +08:00
|
|
|
|
public override IConvertibleReplayFrame CreateConvertibleReplayFrame() => new ManiaReplayFrame();
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2022-07-10 10:15:02 +08:00
|
|
|
|
public override IRulesetConfigManager CreateConfig(SettingsStore? settings) => new ManiaRulesetConfigManager(settings, RulesetInfo);
|
2018-06-11 12:17:08 +08:00
|
|
|
|
|
2018-06-11 13:36:19 +08:00
|
|
|
|
public override RulesetSettingsSubsection CreateSettings() => new ManiaSettingsSubsection(this);
|
|
|
|
|
|
2018-01-15 16:43:45 +08:00
|
|
|
|
public override IEnumerable<int> AvailableVariants
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2020-04-21 09:56:04 +08:00
|
|
|
|
for (int i = 1; i <= MAX_STAGE_KEYS; i++)
|
2018-01-22 13:59:17 +08:00
|
|
|
|
yield return (int)PlayfieldType.Single + i;
|
2020-04-21 09:56:04 +08:00
|
|
|
|
for (int i = 2; i <= MAX_STAGE_KEYS * 2; i += 2)
|
2018-01-22 13:59:17 +08:00
|
|
|
|
yield return (int)PlayfieldType.Dual + i;
|
2018-01-15 16:43:45 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2017-08-23 11:49:50 +08:00
|
|
|
|
public override IEnumerable<KeyBinding> GetDefaultKeyBindings(int variant = 0)
|
|
|
|
|
{
|
2018-01-22 14:18:11 +08:00
|
|
|
|
switch (getPlayfieldType(variant))
|
2018-01-15 16:43:45 +08:00
|
|
|
|
{
|
2018-01-22 13:59:17 +08:00
|
|
|
|
case PlayfieldType.Single:
|
2020-04-20 20:28:36 +08:00
|
|
|
|
return new SingleStageVariantGenerator(variant).GenerateMappings();
|
2019-04-01 11:16:05 +08:00
|
|
|
|
|
2018-01-22 13:59:17 +08:00
|
|
|
|
case PlayfieldType.Dual:
|
2020-04-20 20:28:36 +08:00
|
|
|
|
return new DualStageVariantGenerator(getDualStageKeyCount(variant)).GenerateMappings();
|
2018-01-15 16:43:45 +08:00
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2019-11-28 21:41:29 +08:00
|
|
|
|
return Array.Empty<KeyBinding>();
|
2018-01-15 16:43:45 +08:00
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2022-08-22 13:51:00 +08:00
|
|
|
|
public override LocalisableString GetVariantName(int variant)
|
2018-01-15 16:43:45 +08:00
|
|
|
|
{
|
2018-01-22 14:18:11 +08:00
|
|
|
|
switch (getPlayfieldType(variant))
|
2017-08-23 11:49:50 +08:00
|
|
|
|
{
|
2018-01-15 16:43:45 +08:00
|
|
|
|
default:
|
|
|
|
|
return $"{variant}K";
|
2019-04-01 11:16:05 +08:00
|
|
|
|
|
2018-01-22 13:59:17 +08:00
|
|
|
|
case PlayfieldType.Dual:
|
2018-01-15 16:43:45 +08:00
|
|
|
|
{
|
2021-10-27 12:04:41 +08:00
|
|
|
|
int keys = getDualStageKeyCount(variant);
|
2018-01-22 14:18:39 +08:00
|
|
|
|
return $"{keys}K + {keys}K";
|
2018-01-15 16:43:45 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2018-01-15 16:43:45 +08:00
|
|
|
|
/// <summary>
|
2018-01-22 13:59:17 +08:00
|
|
|
|
/// Finds the number of keys for each stage in a <see cref="PlayfieldType.Dual"/> variant.
|
2018-01-15 16:43:45 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="variant">The variant.</param>
|
2018-01-22 14:18:39 +08:00
|
|
|
|
private int getDualStageKeyCount(int variant) => (variant - (int)PlayfieldType.Dual) / 2;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2018-01-15 16:43:45 +08:00
|
|
|
|
/// <summary>
|
2018-01-22 13:59:17 +08:00
|
|
|
|
/// Finds the <see cref="PlayfieldType"/> that corresponds to a variant value.
|
2018-01-15 16:43:45 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="variant">The variant value.</param>
|
2018-01-22 13:59:17 +08:00
|
|
|
|
/// <returns>The <see cref="PlayfieldType"/> that corresponds to <paramref name="variant"/>.</returns>
|
2018-01-22 14:18:11 +08:00
|
|
|
|
private PlayfieldType getPlayfieldType(int variant)
|
2018-01-15 16:43:45 +08:00
|
|
|
|
{
|
2024-02-09 01:01:00 +08:00
|
|
|
|
return (PlayfieldType)Enum.GetValues(typeof(PlayfieldType)).Cast<int>().OrderDescending().First(v => variant >= v);
|
2018-01-15 16:43:45 +08:00
|
|
|
|
}
|
2020-06-19 20:18:58 +08:00
|
|
|
|
|
2020-10-07 14:34:36 +08:00
|
|
|
|
protected override IEnumerable<HitResult> GetValidHitResults()
|
|
|
|
|
{
|
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
HitResult.Perfect,
|
|
|
|
|
HitResult.Great,
|
|
|
|
|
HitResult.Good,
|
|
|
|
|
HitResult.Ok,
|
|
|
|
|
HitResult.Meh,
|
2023-10-13 16:36:30 +08:00
|
|
|
|
|
|
|
|
|
// HitResult.SmallBonus is used for awarding perfect bonus score but is not included here as
|
|
|
|
|
// it would be a bit redundant to show this to the user.
|
2020-10-07 14:34:36 +08:00
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
2023-06-01 13:35:14 +08:00
|
|
|
|
public override StatisticItem[] CreateStatisticsForScore(ScoreInfo score, IBeatmap playableBeatmap) => new[]
|
2020-06-19 20:18:58 +08:00
|
|
|
|
{
|
2023-06-01 13:35:14 +08:00
|
|
|
|
new StatisticItem("Performance Breakdown", () => new PerformanceBreakdownChart(score, playableBeatmap)
|
2020-06-19 20:18:58 +08:00
|
|
|
|
{
|
2023-06-01 13:35:14 +08:00
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
|
AutoSizeAxes = Axes.Y
|
|
|
|
|
}),
|
|
|
|
|
new StatisticItem("Timing Distribution", () => new HitEventTimingDistributionGraph(score.HitEvents)
|
2020-08-28 02:46:49 +08:00
|
|
|
|
{
|
2023-06-01 13:35:14 +08:00
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
|
Height = 250
|
|
|
|
|
}, true),
|
2023-07-14 01:53:52 +08:00
|
|
|
|
new StatisticItem("Statistics", () => new SimpleStatisticTable(2, new SimpleStatisticItem[]
|
2022-02-05 21:30:35 +08:00
|
|
|
|
{
|
2023-06-01 13:35:14 +08:00
|
|
|
|
new AverageHitError(score.HitEvents),
|
|
|
|
|
new UnstableRate(score.HitEvents)
|
|
|
|
|
}), true)
|
2020-06-19 20:18:58 +08:00
|
|
|
|
};
|
2021-03-30 15:07:04 +08:00
|
|
|
|
|
|
|
|
|
public override IRulesetFilterCriteria CreateRulesetFilterCriteria()
|
|
|
|
|
{
|
|
|
|
|
return new ManiaFilterCriteria();
|
|
|
|
|
}
|
2021-08-22 23:40:11 +08:00
|
|
|
|
|
2021-09-05 12:34:23 +08:00
|
|
|
|
public override RulesetSetupSection CreateEditorSetupSection() => new ManiaSetupSection();
|
2023-07-21 17:52:19 +08:00
|
|
|
|
|
|
|
|
|
public override DifficultySection CreateEditorDifficultySection() => new ManiaDifficultySection();
|
2023-12-09 21:09:49 +08:00
|
|
|
|
|
2024-03-28 21:39:15 +08:00
|
|
|
|
public int GetKeyCount(IBeatmapInfo beatmapInfo, IReadOnlyList<Mod>? mods = null)
|
2024-04-01 16:02:32 +08:00
|
|
|
|
=> ManiaBeatmapConverter.GetColumnCount(LegacyBeatmapConversionDifficultyInfo.FromBeatmapInfo(beatmapInfo), mods);
|
2018-01-15 16:43:45 +08:00
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2018-01-22 13:59:17 +08:00
|
|
|
|
public enum PlayfieldType
|
2018-01-15 16:43:45 +08:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
2018-01-22 15:11:26 +08:00
|
|
|
|
/// Columns are grouped into a single stage.
|
2018-01-22 13:57:25 +08:00
|
|
|
|
/// Number of columns in this stage lies at (item - Single).
|
2018-01-15 16:43:45 +08:00
|
|
|
|
/// </summary>
|
2018-01-22 13:57:25 +08:00
|
|
|
|
Single = 0,
|
2019-02-27 20:07:17 +08:00
|
|
|
|
|
2018-01-15 16:43:45 +08:00
|
|
|
|
/// <summary>
|
2018-01-22 15:11:26 +08:00
|
|
|
|
/// Columns are grouped into two stages.
|
2018-01-22 13:57:25 +08:00
|
|
|
|
/// Overall number of columns lies at (item - Dual), further computation is required for
|
|
|
|
|
/// number of columns in each individual stage.
|
2018-01-15 16:43:45 +08:00
|
|
|
|
/// </summary>
|
2018-01-22 13:57:25 +08:00
|
|
|
|
Dual = 1000,
|
2016-11-09 18:49:05 +08:00
|
|
|
|
}
|
|
|
|
|
}
|