1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 23:07:26 +08:00

Allow restarts in ModPerfect

This commit is contained in:
Paul Teng 2018-10-14 11:18:52 -04:00
parent dea2acaea3
commit fd774c6a09
2 changed files with 9 additions and 1 deletions

View File

@ -6,13 +6,15 @@ using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Mods namespace osu.Game.Rulesets.Mods
{ {
public abstract class ModPerfect : ModSuddenDeath public abstract class ModPerfect : ModSuddenDeath, IApplicableRestartOnFail
{ {
public override string Name => "Perfect"; public override string Name => "Perfect";
public override string ShortenedName => "PF"; public override string ShortenedName => "PF";
public override FontAwesome Icon => FontAwesome.fa_osu_mod_perfect; public override FontAwesome Icon => FontAwesome.fa_osu_mod_perfect;
public override string Description => "SS or quit."; public override string Description => "SS or quit.";
public bool AllowRestart => true;
protected override bool FailCondition(ScoreProcessor scoreProcessor) => scoreProcessor.Accuracy.Value != 1; protected override bool FailCondition(ScoreProcessor scoreProcessor) => scoreProcessor.Accuracy.Value != 1;
} }
} }

View File

@ -289,6 +289,12 @@ namespace osu.Game.Screens.Play
if (Beatmap.Value.Mods.Value.OfType<IApplicableFailOverride>().Any(m => !m.AllowFail)) if (Beatmap.Value.Mods.Value.OfType<IApplicableFailOverride>().Any(m => !m.AllowFail))
return false; return false;
if (Beatmap.Value.Mods.Value.OfType<IApplicableRestartOnFail>().Any(m => m.AllowRestart))
{
Restart();
return false;
}
adjustableClock.Stop(); adjustableClock.Stop();
HasFailed = true; HasFailed = true;