1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 05:53:10 +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 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 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.")] [SettingSource("Flashlight size", "Multiplier applied to the default flashlight size.")]
public override BindableFloat SizeMultiplier { get; } = new BindableFloat 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 class CatchModHardRock : ModHardRock, IApplicableToBeatmapProcessor
{ {
public override double ScoreMultiplier => 1.12; public override double ScoreMultiplier => UsesDefaultConfiguration ? 1.12 : 1;
public void ApplyToBeatmapProcessor(IBeatmapProcessor beatmapProcessor) public void ApplyToBeatmapProcessor(IBeatmapProcessor beatmapProcessor)
{ {

View File

@ -17,7 +17,7 @@ namespace osu.Game.Rulesets.Catch.Mods
public class CatchModHidden : ModHidden, IApplicableToDrawableRuleset<CatchHitObject> public class CatchModHidden : ModHidden, IApplicableToDrawableRuleset<CatchHitObject>
{ {
public override string Description => @"Play with fading fruits."; 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_offset_multiplier = 0.6;
private const double fade_out_duration_multiplier = 0.44; 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 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 IconUsage? Icon => FontAwesome.Solid.Adjust;
public override ModType Type => ModType.DifficultyIncrease; 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) }; public override Type[] IncompatibleMods => new[] { typeof(OsuModFlashlight) };
private DrawableOsuBlinds blinds; private DrawableOsuBlinds blinds;

View File

@ -9,6 +9,6 @@ namespace osu.Game.Rulesets.Osu.Mods
{ {
public class OsuModDoubleTime : ModDoubleTime 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 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(); public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(OsuModBlinds)).ToArray();
private const double default_follow_delay = 120; 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 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(); 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 Bindable<bool> OnlyFadeApproachCircles { get; } = new BindableBool();
public override string Description => @"Play with no approach circles and fading circles/sliders."; 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) }; 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 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 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 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.")] [SettingSource("Flashlight size", "Multiplier applied to the default flashlight size.")]
public override BindableFloat SizeMultiplier { get; } = new BindableFloat public override BindableFloat SizeMultiplier { get; } = new BindableFloat

View File

@ -10,7 +10,7 @@ namespace osu.Game.Rulesets.Taiko.Mods
{ {
public class TaikoModHardRock : ModHardRock public class TaikoModHardRock : ModHardRock
{ {
public override double ScoreMultiplier => 1.06; public override double ScoreMultiplier => UsesDefaultConfiguration ? 1.06 : 1;
/// <summary> /// <summary>
/// Multiplier factor added to the scrolling speed. /// 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 class TaikoModHidden : ModHidden, IApplicableToDrawableRuleset<TaikoHitObject>
{ {
public override string Description => @"Beats fade out before you hit them!"; 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> /// <summary>
/// How far away from the hit target should hitobjects start to fade out. /// 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 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); globalAvailableMods.BindTo(game.AvailableMods);
} }
private ModSettingChangeTracker? modSettingChangeTracker;
protected override void LoadComplete() 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. // 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 => SelectedMods.BindValueChanged(val =>
{ {
modSettingChangeTracker?.Dispose();
updateMultiplier(); updateMultiplier();
updateCustomisation(val); updateCustomisation(val);
updateFromExternalSelection(); updateFromExternalSelection();
if (AllowCustomisation)
{
modSettingChangeTracker = new ModSettingChangeTracker(val.NewValue);
modSettingChangeTracker.SettingChanged += _ => updateMultiplier();
}
}, true); }, true);
customisationVisible.BindValueChanged(_ => updateCustomisationVisualState(), true); customisationVisible.BindValueChanged(_ => updateCustomisationVisualState(), true);

View File

@ -126,6 +126,11 @@ namespace osu.Game.Rulesets.Mods
.Cast<IBindable>() .Cast<IBindable>()
.ToList(); .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> /// <summary>
/// Creates a copy of this <see cref="Mod"/> initialised to a default state. /// Creates a copy of this <see cref="Mod"/> initialised to a default state.
/// </summary> /// </summary>

View File

@ -9,9 +9,11 @@ using osu.Game.Screens.Play.HUD;
using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Mods;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using JetBrains.Annotations;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface;
using osu.Game.Configuration;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osuTK; using osuTK;
@ -61,11 +63,25 @@ namespace osu.Game.Screens.Select
Hotkey = GlobalAction.ToggleModSelection; Hotkey = GlobalAction.ToggleModSelection;
} }
[CanBeNull]
private ModSettingChangeTracker modSettingChangeTracker;
protected override void LoadComplete() protected override void LoadComplete()
{ {
base.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(() => private void updateMultiplierText() => Schedule(() =>