1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 02:32:55 +08:00

Merge pull request #19208 from frenzibyte/remove-score-multiplier-on-custom-mod-settings

Remove score multiplier on difficulty-increasing mods with customised settings
This commit is contained in:
Dan Balasescu 2022-07-20 20:12:59 +09:00 committed by GitHub
commit 7dfc18a0e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 48 additions and 17 deletions

View File

@ -9,6 +9,6 @@ namespace osu.Game.Rulesets.Catch.Mods
{
public class CatchModDoubleTime : ModDoubleTime
{
public override double ScoreMultiplier => 1.06;
public override double ScoreMultiplier => UsesDefaultConfiguration ? 1.06 : 1;
}
}

View File

@ -16,7 +16,7 @@ namespace osu.Game.Rulesets.Catch.Mods
{
public class CatchModFlashlight : ModFlashlight<CatchHitObject>
{
public override double ScoreMultiplier => 1.12;
public override double ScoreMultiplier => UsesDefaultConfiguration ? 1.12 : 1;
[SettingSource("Flashlight size", "Multiplier applied to the default flashlight size.")]
public override BindableFloat SizeMultiplier { get; } = new BindableFloat

View File

@ -11,7 +11,7 @@ namespace osu.Game.Rulesets.Catch.Mods
{
public class CatchModHardRock : ModHardRock, IApplicableToBeatmapProcessor
{
public override double ScoreMultiplier => 1.12;
public override double ScoreMultiplier => UsesDefaultConfiguration ? 1.12 : 1;
public void ApplyToBeatmapProcessor(IBeatmapProcessor beatmapProcessor)
{

View File

@ -17,7 +17,7 @@ namespace osu.Game.Rulesets.Catch.Mods
public class CatchModHidden : ModHidden, IApplicableToDrawableRuleset<CatchHitObject>
{
public override string Description => @"Play with fading fruits.";
public override double ScoreMultiplier => 1.06;
public override double ScoreMultiplier => UsesDefaultConfiguration ? 1.06 : 1;
private const double fade_out_offset_multiplier = 0.6;
private const double fade_out_duration_multiplier = 0.44;

View File

@ -10,6 +10,6 @@ namespace osu.Game.Rulesets.Catch.Mods
{
public class CatchModNightcore : ModNightcore<CatchHitObject>
{
public override double ScoreMultiplier => 1.06;
public override double ScoreMultiplier => UsesDefaultConfiguration ? 1.06 : 1;
}
}

View File

@ -30,7 +30,7 @@ namespace osu.Game.Rulesets.Osu.Mods
public override IconUsage? Icon => FontAwesome.Solid.Adjust;
public override ModType Type => ModType.DifficultyIncrease;
public override double ScoreMultiplier => 1.12;
public override double ScoreMultiplier => UsesDefaultConfiguration ? 1.12 : 1;
public override Type[] IncompatibleMods => new[] { typeof(OsuModFlashlight) };
private DrawableOsuBlinds blinds;

View File

@ -9,6 +9,6 @@ namespace osu.Game.Rulesets.Osu.Mods
{
public class OsuModDoubleTime : ModDoubleTime
{
public override double ScoreMultiplier => 1.12;
public override double ScoreMultiplier => UsesDefaultConfiguration ? 1.12 : 1;
}
}

View File

@ -21,7 +21,7 @@ namespace osu.Game.Rulesets.Osu.Mods
{
public class OsuModFlashlight : ModFlashlight<OsuHitObject>, IApplicableToDrawableHitObject
{
public override double ScoreMultiplier => 1.12;
public override double ScoreMultiplier => UsesDefaultConfiguration ? 1.12 : 1;
public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(OsuModBlinds)).ToArray();
private const double default_follow_delay = 120;

View File

@ -14,7 +14,7 @@ namespace osu.Game.Rulesets.Osu.Mods
{
public class OsuModHardRock : ModHardRock, IApplicableToHitObject
{
public override double ScoreMultiplier => 1.06;
public override double ScoreMultiplier => UsesDefaultConfiguration ? 1.06 : 1;
public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(ModMirror)).ToArray();

View File

@ -25,7 +25,7 @@ namespace osu.Game.Rulesets.Osu.Mods
public Bindable<bool> OnlyFadeApproachCircles { get; } = new BindableBool();
public override string Description => @"Play with no approach circles and fading circles/sliders.";
public override double ScoreMultiplier => 1.06;
public override double ScoreMultiplier => UsesDefaultConfiguration ? 1.06 : 1;
public override Type[] IncompatibleMods => new[] { typeof(IRequiresApproachCircles), typeof(OsuModSpinIn) };

View File

@ -10,6 +10,6 @@ namespace osu.Game.Rulesets.Osu.Mods
{
public class OsuModNightcore : ModNightcore<OsuHitObject>
{
public override double ScoreMultiplier => 1.12;
public override double ScoreMultiplier => UsesDefaultConfiguration ? 1.12 : 1;
}
}

View File

@ -9,6 +9,6 @@ namespace osu.Game.Rulesets.Taiko.Mods
{
public class TaikoModDoubleTime : ModDoubleTime
{
public override double ScoreMultiplier => 1.12;
public override double ScoreMultiplier => UsesDefaultConfiguration ? 1.12 : 1;
}
}

View File

@ -17,7 +17,7 @@ namespace osu.Game.Rulesets.Taiko.Mods
{
public class TaikoModFlashlight : ModFlashlight<TaikoHitObject>
{
public override double ScoreMultiplier => 1.12;
public override double ScoreMultiplier => UsesDefaultConfiguration ? 1.12 : 1;
[SettingSource("Flashlight size", "Multiplier applied to the default flashlight size.")]
public override BindableFloat SizeMultiplier { get; } = new BindableFloat

View File

@ -10,7 +10,7 @@ namespace osu.Game.Rulesets.Taiko.Mods
{
public class TaikoModHardRock : ModHardRock
{
public override double ScoreMultiplier => 1.06;
public override double ScoreMultiplier => UsesDefaultConfiguration ? 1.06 : 1;
/// <summary>
/// Multiplier factor added to the scrolling speed.

View File

@ -18,7 +18,7 @@ namespace osu.Game.Rulesets.Taiko.Mods
public class TaikoModHidden : ModHidden, IApplicableToDrawableRuleset<TaikoHitObject>
{
public override string Description => @"Beats fade out before you hit them!";
public override double ScoreMultiplier => 1.06;
public override double ScoreMultiplier => UsesDefaultConfiguration ? 1.06 : 1;
/// <summary>
/// How far away from the hit target should hitobjects start to fade out.

View File

@ -10,6 +10,6 @@ namespace osu.Game.Rulesets.Taiko.Mods
{
public class TaikoModNightcore : ModNightcore<TaikoHitObject>
{
public override double ScoreMultiplier => 1.12;
public override double ScoreMultiplier => UsesDefaultConfiguration ? 1.12 : 1;
}
}

View File

@ -222,6 +222,8 @@ namespace osu.Game.Overlays.Mods
globalAvailableMods.BindTo(game.AvailableMods);
}
private ModSettingChangeTracker? modSettingChangeTracker;
protected override void LoadComplete()
{
// this is called before base call so that the mod state is populated early, and the transition in `PopIn()` can play out properly.
@ -238,9 +240,17 @@ namespace osu.Game.Overlays.Mods
SelectedMods.BindValueChanged(val =>
{
modSettingChangeTracker?.Dispose();
updateMultiplier();
updateCustomisation(val);
updateFromExternalSelection();
if (AllowCustomisation)
{
modSettingChangeTracker = new ModSettingChangeTracker(val.NewValue);
modSettingChangeTracker.SettingChanged += _ => updateMultiplier();
}
}, true);
customisationVisible.BindValueChanged(_ => updateCustomisationVisualState(), true);

View File

@ -126,6 +126,11 @@ namespace osu.Game.Rulesets.Mods
.Cast<IBindable>()
.ToList();
/// <summary>
/// Whether all settings in this mod are set to their default state.
/// </summary>
protected virtual bool UsesDefaultConfiguration => Settings.All(s => s.IsDefault);
/// <summary>
/// Creates a copy of this <see cref="Mod"/> initialised to a default state.
/// </summary>

View File

@ -9,9 +9,11 @@ using osu.Game.Screens.Play.HUD;
using osu.Game.Rulesets.Mods;
using System.Collections.Generic;
using System.Linq;
using JetBrains.Annotations;
using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Configuration;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osuTK;
@ -61,11 +63,25 @@ namespace osu.Game.Screens.Select
Hotkey = GlobalAction.ToggleModSelection;
}
[CanBeNull]
private ModSettingChangeTracker modSettingChangeTracker;
protected override void LoadComplete()
{
base.LoadComplete();
Current.BindValueChanged(_ => updateMultiplierText(), true);
Current.BindValueChanged(mods =>
{
modSettingChangeTracker?.Dispose();
updateMultiplierText();
if (mods.NewValue != null)
{
modSettingChangeTracker = new ModSettingChangeTracker(mods.NewValue);
modSettingChangeTracker.SettingChanged += _ => updateMultiplierText();
}
}, true);
}
private void updateMultiplierText() => Schedule(() =>