mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Make SD and PF incompatible with each other
This commit is contained in:
@ -2,6 +2,7 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Rulesets.Judgements;
|
||||
@ -9,7 +10,7 @@ using osu.Game.Rulesets.Scoring;
|
||||
|
||||
namespace osu.Game.Rulesets.Mods
|
||||
{
|
||||
public abstract class ModSuddenDeath : Mod, IApplicableToHealthProcessor, IApplicableFailOverride
|
||||
public abstract class ModSuddenDeath : ModFailCondition
|
||||
{
|
||||
public override string Name => "Sudden Death";
|
||||
public override string Acronym => "SD";
|
||||
@ -18,18 +19,10 @@ namespace osu.Game.Rulesets.Mods
|
||||
public override string Description => "Miss and fail.";
|
||||
public override double ScoreMultiplier => 1;
|
||||
public override bool Ranked => true;
|
||||
public override Type[] IncompatibleMods => new[] { typeof(ModNoFail), typeof(ModRelax), typeof(ModAutoplay) };
|
||||
|
||||
public bool PerformFail() => true;
|
||||
public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(ModPerfect)).ToArray();
|
||||
|
||||
public bool RestartOnFail => true;
|
||||
|
||||
public void ApplyToHealthProcessor(HealthProcessor healthProcessor)
|
||||
{
|
||||
healthProcessor.FailConditions += FailCondition;
|
||||
}
|
||||
|
||||
protected virtual bool FailCondition(HealthProcessor healthProcessor, JudgementResult result)
|
||||
protected override bool FailCondition(HealthProcessor healthProcessor, JudgementResult result)
|
||||
=> result.Type.AffectsCombo()
|
||||
&& !result.IsHit;
|
||||
}
|
||||
|
Reference in New Issue
Block a user