1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 21:02:54 +08:00

Merge pull request #12515 from frenzibyte/legacy-scores-classic-mod

Apply "classic" mod to all legacy scores
This commit is contained in:
Dan Balasescu 2021-04-22 19:52:09 +09:00 committed by GitHub
commit 739d83da2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 73 additions and 21 deletions

View File

@ -114,6 +114,7 @@ namespace osu.Game.Rulesets.Catch
return new Mod[] return new Mod[]
{ {
new CatchModDifficultyAdjust(), new CatchModDifficultyAdjust(),
new CatchModClassic(),
}; };
case ModType.Automation: case ModType.Automation:

View File

@ -0,0 +1,11 @@
// 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.
using osu.Game.Rulesets.Mods;
namespace osu.Game.Rulesets.Catch.Mods
{
public class CatchModClassic : ModClassic
{
}
}

View File

@ -239,6 +239,7 @@ namespace osu.Game.Rulesets.Mania
new ManiaModDualStages(), new ManiaModDualStages(),
new ManiaModMirror(), new ManiaModMirror(),
new ManiaModDifficultyAdjust(), new ManiaModDifficultyAdjust(),
new ManiaModClassic(),
new ManiaModInvert(), new ManiaModInvert(),
new ManiaModConstantSpeed() new ManiaModConstantSpeed()
}; };

View File

@ -0,0 +1,11 @@
// 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.
using osu.Game.Rulesets.Mods;
namespace osu.Game.Rulesets.Mania.Mods
{
public class ManiaModClassic : ModClassic
{
}
}

View File

@ -4,7 +4,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Graphics.Sprites;
using osu.Game.Configuration; using osu.Game.Configuration;
using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects;
@ -16,22 +15,8 @@ using osu.Game.Rulesets.UI;
namespace osu.Game.Rulesets.Osu.Mods namespace osu.Game.Rulesets.Osu.Mods
{ {
public class OsuModClassic : Mod, IApplicableToHitObject, IApplicableToDrawableHitObjects, IApplicableToDrawableRuleset<OsuHitObject> public class OsuModClassic : ModClassic, IApplicableToHitObject, IApplicableToDrawableHitObjects, IApplicableToDrawableRuleset<OsuHitObject>
{ {
public override string Name => "Classic";
public override string Acronym => "CL";
public override double ScoreMultiplier => 1;
public override IconUsage? Icon => FontAwesome.Solid.History;
public override string Description => "Feeling nostalgic?";
public override bool Ranked => false;
public override ModType Type => ModType.Conversion;
[SettingSource("No slider head accuracy requirement", "Scores sliders proportionally to the number of ticks hit.")] [SettingSource("No slider head accuracy requirement", "Scores sliders proportionally to the number of ticks hit.")]
public Bindable<bool> NoSliderHeadAccuracy { get; } = new BindableBool(true); public Bindable<bool> NoSliderHeadAccuracy { get; } = new BindableBool(true);

View File

@ -0,0 +1,11 @@
// 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.
using osu.Game.Rulesets.Mods;
namespace osu.Game.Rulesets.Taiko.Mods
{
public class TaikoModClassic : ModClassic
{
}
}

View File

@ -135,6 +135,7 @@ namespace osu.Game.Rulesets.Taiko
{ {
new TaikoModRandom(), new TaikoModRandom(),
new TaikoModDifficultyAdjust(), new TaikoModDifficultyAdjust(),
new TaikoModClassic(),
}; };
case ModType.Automation: case ModType.Automation:

View File

@ -0,0 +1,24 @@
// 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.
using osu.Framework.Graphics.Sprites;
namespace osu.Game.Rulesets.Mods
{
public abstract class ModClassic : Mod
{
public override string Name => "Classic";
public override string Acronym => "CL";
public override double ScoreMultiplier => 1;
public override IconUsage? Icon => FontAwesome.Solid.History;
public override string Description => "Feeling nostalgic?";
public override bool Ranked => false;
public override ModType Type => ModType.Conversion;
}
}

View File

@ -65,14 +65,21 @@ namespace osu.Game.Scoring
{ {
get get
{ {
var rulesetInstance = Ruleset?.CreateInstance();
if (rulesetInstance == null)
return mods ?? Array.Empty<Mod>();
Mod[] scoreMods = Array.Empty<Mod>();
if (mods != null) if (mods != null)
return mods; scoreMods = mods;
else if (localAPIMods != null)
scoreMods = apiMods.Select(m => m.ToMod(rulesetInstance)).ToArray();
if (localAPIMods == null) if (IsLegacyScore)
return Array.Empty<Mod>(); scoreMods = scoreMods.Append(rulesetInstance.GetAllMods().OfType<ModClassic>().Single()).ToArray();
var rulesetInstance = Ruleset.CreateInstance(); return scoreMods;
return apiMods.Select(m => m.ToMod(rulesetInstance)).ToArray();
} }
set set
{ {