mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 08:49:59 +09:00
Male NoFail use an applicable interface
This commit is contained in:
16
osu.Game/Rulesets/Mods/IApplicableFailOverride.cs
Normal file
16
osu.Game/Rulesets/Mods/IApplicableFailOverride.cs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
namespace osu.Game.Rulesets.Mods
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Represents a mod which can override (and block) a fail.
|
||||||
|
/// </summary>
|
||||||
|
public interface IApplicableFailOverride : IApplicableMod
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Whether we should allow failing at the current point in time.
|
||||||
|
/// </summary>
|
||||||
|
bool AllowFail { get; }
|
||||||
|
}
|
||||||
|
}
|
@ -55,10 +55,5 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
/// The mods this mod cannot be enabled with.
|
/// The mods this mod cannot be enabled with.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual Type[] IncompatibleMods => new Type[] { };
|
public virtual Type[] IncompatibleMods => new Type[] { };
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Whether we should allow failing at the current point in time.
|
|
||||||
/// </summary>
|
|
||||||
public virtual bool AllowFail => true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ using osu.Game.Graphics;
|
|||||||
|
|
||||||
namespace osu.Game.Rulesets.Mods
|
namespace osu.Game.Rulesets.Mods
|
||||||
{
|
{
|
||||||
public abstract class ModNoFail : Mod
|
public abstract class ModNoFail : Mod, IApplicableFailOverride
|
||||||
{
|
{
|
||||||
public override string Name => "NoFail";
|
public override string Name => "NoFail";
|
||||||
public override string ShortenedName => "NF";
|
public override string ShortenedName => "NF";
|
||||||
@ -20,6 +20,6 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// We never fail, 'yo.
|
/// We never fail, 'yo.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override bool AllowFail => false;
|
public bool AllowFail => false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -298,7 +298,7 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
private bool onFail()
|
private bool onFail()
|
||||||
{
|
{
|
||||||
if (Beatmap.Value.Mods.Value.Any(m => !m.AllowFail))
|
if (Beatmap.Value.Mods.Value.OfType<IApplicableFailOverride>().Any(m => !m.AllowFail))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
decoupledClock.Stop();
|
decoupledClock.Stop();
|
||||||
|
@ -310,6 +310,7 @@
|
|||||||
<Compile Include="Overlays\Profile\Sections\Ranks\DrawableTotalScore.cs" />
|
<Compile Include="Overlays\Profile\Sections\Ranks\DrawableTotalScore.cs" />
|
||||||
<Compile Include="Overlays\Profile\Sections\Ranks\ScoreModsContainer.cs" />
|
<Compile Include="Overlays\Profile\Sections\Ranks\ScoreModsContainer.cs" />
|
||||||
<Compile Include="Overlays\Settings\Sections\Maintenance\DeleteAllBeatmapsDialog.cs" />
|
<Compile Include="Overlays\Settings\Sections\Maintenance\DeleteAllBeatmapsDialog.cs" />
|
||||||
|
<Compile Include="Rulesets\Mods\IApplicableFailOverride.cs" />
|
||||||
<Compile Include="Rulesets\Mods\IApplicableMod.cs" />
|
<Compile Include="Rulesets\Mods\IApplicableMod.cs" />
|
||||||
<Compile Include="Rulesets\Mods\IApplicableToDrawableHitObject.cs" />
|
<Compile Include="Rulesets\Mods\IApplicableToDrawableHitObject.cs" />
|
||||||
<Compile Include="Screens\Select\ImportFromStablePopup.cs" />
|
<Compile Include="Screens\Select\ImportFromStablePopup.cs" />
|
||||||
|
Reference in New Issue
Block a user