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