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

Merge pull request #25917 from rushiiMachine/remove-relax-mod-exclusions

Allow failing with "relax" and "autopilot" mods
This commit is contained in:
Dean Herbert 2023-12-20 15:48:21 +09:00 committed by GitHub
commit 98efff0bd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 28 additions and 41 deletions

View File

@ -16,7 +16,7 @@ using osu.Game.Rulesets.UI;
namespace osu.Game.Rulesets.Osu.Mods
{
public class OsuModAutopilot : Mod, IApplicableFailOverride, IUpdatableByPlayfield, IApplicableToDrawableRuleset<OsuHitObject>
public class OsuModAutopilot : Mod, IUpdatableByPlayfield, IApplicableToDrawableRuleset<OsuHitObject>
{
public override string Name => "Autopilot";
public override string Acronym => "AP";
@ -37,10 +37,6 @@ namespace osu.Game.Rulesets.Osu.Mods
typeof(ModTouchDevice)
};
public bool PerformFail() => false;
public bool RestartOnFail => false;
private OsuInputManager inputManager = null!;
private List<OsuReplayFrame> replayFrames = null!;

View File

@ -1,31 +0,0 @@
// 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.Bindables;
using osu.Game.Configuration;
using osu.Game.Screens.Play;
namespace osu.Game.Rulesets.Mods
{
public abstract class ModBlockFail : Mod, IApplicableFailOverride, IApplicableToHUD, IReadFromConfig
{
private readonly Bindable<bool> showHealthBar = new Bindable<bool>();
/// <summary>
/// We never fail, 'yo.
/// </summary>
public bool PerformFail() => false;
public bool RestartOnFail => false;
public void ReadFromConfig(OsuConfigManager config)
{
config.BindWith(OsuSetting.ShowHealthDisplayWhenCantFail, showHealthBar);
}
public void ApplyToHUD(HUDOverlay overlay)
{
overlay.ShowHealthBar.BindTo(showHealthBar);
}
}
}

View File

@ -11,7 +11,7 @@ namespace osu.Game.Rulesets.Mods
{
public abstract class ModFailCondition : Mod, IApplicableToHealthProcessor, IApplicableFailOverride
{
public override Type[] IncompatibleMods => new[] { typeof(ModNoFail), typeof(ModRelax) };
public override Type[] IncompatibleMods => new[] { typeof(ModNoFail) };
[SettingSource("Restart on fail", "Automatically restarts when failed.")]
public BindableBool Restart { get; } = new BindableBool();

View File

@ -2,13 +2,16 @@
// See the LICENCE file in the repository root for full licence text.
using System;
using osu.Framework.Bindables;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Localisation;
using osu.Game.Configuration;
using osu.Game.Graphics;
using osu.Game.Screens.Play;
namespace osu.Game.Rulesets.Mods
{
public abstract class ModNoFail : ModBlockFail
public abstract class ModNoFail : Mod, IApplicableFailOverride, IApplicableToHUD, IReadFromConfig
{
public override string Name => "No Fail";
public override string Acronym => "NF";
@ -16,6 +19,25 @@ namespace osu.Game.Rulesets.Mods
public override ModType Type => ModType.DifficultyReduction;
public override LocalisableString Description => "You can't fail, no matter what.";
public override double ScoreMultiplier => 0.5;
public override Type[] IncompatibleMods => new[] { typeof(ModRelax), typeof(ModFailCondition) };
public override Type[] IncompatibleMods => new[] { typeof(ModFailCondition) };
private readonly Bindable<bool> showHealthBar = new Bindable<bool>();
/// <summary>
/// We never fail, 'yo.
/// </summary>
public bool PerformFail() => false;
public bool RestartOnFail => false;
public void ReadFromConfig(OsuConfigManager config)
{
config.BindWith(OsuSetting.ShowHealthDisplayWhenCantFail, showHealthBar);
}
public void ApplyToHUD(HUDOverlay overlay)
{
overlay.ShowHealthBar.BindTo(showHealthBar);
}
}
}

View File

@ -7,13 +7,13 @@ using osu.Game.Graphics;
namespace osu.Game.Rulesets.Mods
{
public abstract class ModRelax : ModBlockFail
public abstract class ModRelax : Mod
{
public override string Name => "Relax";
public override string Acronym => "RX";
public override IconUsage? Icon => OsuIcon.ModRelax;
public override ModType Type => ModType.Automation;
public override double ScoreMultiplier => 0.1;
public override Type[] IncompatibleMods => new[] { typeof(ModAutoplay), typeof(ModNoFail), typeof(ModFailCondition) };
public override Type[] IncompatibleMods => new[] { typeof(ModAutoplay) };
}
}