mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 11:35:35 +08:00
Allow restarts in ModPerfect
This commit is contained in:
parent
dea2acaea3
commit
fd774c6a09
@ -6,13 +6,15 @@ using osu.Game.Rulesets.Scoring;
|
||||
|
||||
namespace osu.Game.Rulesets.Mods
|
||||
{
|
||||
public abstract class ModPerfect : ModSuddenDeath
|
||||
public abstract class ModPerfect : ModSuddenDeath, IApplicableRestartOnFail
|
||||
{
|
||||
public override string Name => "Perfect";
|
||||
public override string ShortenedName => "PF";
|
||||
public override FontAwesome Icon => FontAwesome.fa_osu_mod_perfect;
|
||||
public override string Description => "SS or quit.";
|
||||
|
||||
public bool AllowRestart => true;
|
||||
|
||||
protected override bool FailCondition(ScoreProcessor scoreProcessor) => scoreProcessor.Accuracy.Value != 1;
|
||||
}
|
||||
}
|
||||
|
@ -289,6 +289,12 @@ namespace osu.Game.Screens.Play
|
||||
if (Beatmap.Value.Mods.Value.OfType<IApplicableFailOverride>().Any(m => !m.AllowFail))
|
||||
return false;
|
||||
|
||||
if (Beatmap.Value.Mods.Value.OfType<IApplicableRestartOnFail>().Any(m => m.AllowRestart))
|
||||
{
|
||||
Restart();
|
||||
return false;
|
||||
}
|
||||
|
||||
adjustableClock.Stop();
|
||||
|
||||
HasFailed = true;
|
||||
|
Loading…
Reference in New Issue
Block a user