mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
Make Perfect auto restart toggleable
This commit is contained in:
@ -2,6 +2,8 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using osu.Framework.Bindables;
|
||||||
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Rulesets.Judgements;
|
using osu.Game.Rulesets.Judgements;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
|
|
||||||
@ -11,6 +13,9 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
{
|
{
|
||||||
public override Type[] IncompatibleMods => new[] { typeof(ModNoFail), typeof(ModRelax), typeof(ModAutoplay) };
|
public override Type[] IncompatibleMods => new[] { typeof(ModNoFail), typeof(ModRelax), typeof(ModAutoplay) };
|
||||||
|
|
||||||
|
[SettingSource("Restart on fail", "Automatically restarts when failed.")]
|
||||||
|
public BindableBool Restart { get; } = new BindableBool();
|
||||||
|
|
||||||
public virtual bool PerformFail() => true;
|
public virtual bool PerformFail() => true;
|
||||||
|
|
||||||
public virtual bool RestartOnFail => true;
|
public virtual bool RestartOnFail => true;
|
||||||
|
@ -21,6 +21,11 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
|
|
||||||
public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(ModSuddenDeath)).ToArray();
|
public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(ModSuddenDeath)).ToArray();
|
||||||
|
|
||||||
|
protected ModPerfect()
|
||||||
|
{
|
||||||
|
Restart.Value = Restart.Default = true;
|
||||||
|
}
|
||||||
|
|
||||||
protected override bool FailCondition(HealthProcessor healthProcessor, JudgementResult result)
|
protected override bool FailCondition(HealthProcessor healthProcessor, JudgementResult result)
|
||||||
=> result.Type.AffectsAccuracy()
|
=> result.Type.AffectsAccuracy()
|
||||||
&& result.Type != result.Judgement.MaxResult;
|
&& result.Type != result.Judgement.MaxResult;
|
||||||
|
@ -3,9 +3,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Bindables;
|
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Game.Configuration;
|
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Rulesets.Judgements;
|
using osu.Game.Rulesets.Judgements;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
@ -23,9 +21,6 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
|
|
||||||
public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(ModPerfect)).ToArray();
|
public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(ModPerfect)).ToArray();
|
||||||
|
|
||||||
[SettingSource("Restart on fail", "Automatically restarts when failed.")]
|
|
||||||
public BindableBool Restart { get; } = new BindableBool();
|
|
||||||
|
|
||||||
public override bool PerformFail() => true;
|
public override bool PerformFail() => true;
|
||||||
|
|
||||||
public override bool RestartOnFail => Restart.Value;
|
public override bool RestartOnFail => Restart.Value;
|
||||||
|
Reference in New Issue
Block a user