From 7fd6f3f32cc67176429a94b472a859a8732d0a55 Mon Sep 17 00:00:00 2001
From: Peter-io <93472377+Peter-io@users.noreply.github.com>
Date: Thu, 11 Jul 2024 15:48:02 +0200
Subject: [PATCH] Revert "Include TriggeredFail in mods"
This reverts commit 8da673ec24310ee041288066627c0f0291d7c10e.
---
osu.Game.Rulesets.Osu/Mods/OsuModTargetPractice.cs | 4 +---
osu.Game/Rulesets/Mods/ModCinema.cs | 2 --
osu.Game/Rulesets/Mods/ModEasyWithExtraLives.cs | 8 +-------
osu.Game/Rulesets/Mods/ModFailCondition.cs | 8 +-------
osu.Game/Rulesets/Mods/ModNoFail.cs | 2 --
osu.Game/Rulesets/Mods/ModSuddenDeath.cs | 2 +-
6 files changed, 4 insertions(+), 22 deletions(-)
diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModTargetPractice.cs b/osu.Game.Rulesets.Osu/Mods/OsuModTargetPractice.cs
index cca1719458..a5846efdfe 100644
--- a/osu.Game.Rulesets.Osu/Mods/OsuModTargetPractice.cs
+++ b/osu.Game.Rulesets.Osu/Mods/OsuModTargetPractice.cs
@@ -103,13 +103,11 @@ namespace osu.Game.Rulesets.Osu.Mods
public bool RestartOnFail => false;
- public bool TriggeredFail { get; set; } = false;
-
public void ApplyToHealthProcessor(HealthProcessor healthProcessor)
{
// Sudden death
healthProcessor.FailConditions += (_, result)
- => TriggeredFail = result.Type.AffectsCombo()
+ => result.Type.AffectsCombo()
&& !result.IsHit;
}
diff --git a/osu.Game/Rulesets/Mods/ModCinema.cs b/osu.Game/Rulesets/Mods/ModCinema.cs
index 85a492ac49..0c00eb6ae0 100644
--- a/osu.Game/Rulesets/Mods/ModCinema.cs
+++ b/osu.Game/Rulesets/Mods/ModCinema.cs
@@ -51,7 +51,5 @@ namespace osu.Game.Rulesets.Mods
public bool PerformFail() => false;
public bool RestartOnFail => false;
-
- public bool TriggeredFail => false;
}
}
diff --git a/osu.Game/Rulesets/Mods/ModEasyWithExtraLives.cs b/osu.Game/Rulesets/Mods/ModEasyWithExtraLives.cs
index b9f5c00ef2..e101ac440e 100644
--- a/osu.Game/Rulesets/Mods/ModEasyWithExtraLives.cs
+++ b/osu.Game/Rulesets/Mods/ModEasyWithExtraLives.cs
@@ -35,11 +35,7 @@ namespace osu.Game.Rulesets.Mods
public bool PerformFail()
{
- if (retries == 0)
- {
- TriggeredFail = true;
- return true;
- }
+ if (retries == 0) return true;
health.Value = health.MaxValue;
retries--;
@@ -49,8 +45,6 @@ namespace osu.Game.Rulesets.Mods
public bool RestartOnFail => false;
- public bool TriggeredFail { get; set; } = false;
-
public void ApplyToHealthProcessor(HealthProcessor healthProcessor)
{
health.BindTo(healthProcessor.Health);
diff --git a/osu.Game/Rulesets/Mods/ModFailCondition.cs b/osu.Game/Rulesets/Mods/ModFailCondition.cs
index eef14ba7bc..0b229766c1 100644
--- a/osu.Game/Rulesets/Mods/ModFailCondition.cs
+++ b/osu.Game/Rulesets/Mods/ModFailCondition.cs
@@ -20,8 +20,6 @@ namespace osu.Game.Rulesets.Mods
public virtual bool RestartOnFail => Restart.Value;
- public virtual bool TriggeredFail { get; set; } = false;
-
private Action? triggerFailureDelegate;
public void ApplyToHealthProcessor(HealthProcessor healthProcessor)
@@ -33,11 +31,7 @@ namespace osu.Game.Rulesets.Mods
///
/// Immediately triggers a failure on the loaded .
///
- protected void TriggerFailure()
- {
- TriggeredFail = true;
- triggerFailureDelegate?.Invoke();
- }
+ protected void TriggerFailure() => triggerFailureDelegate?.Invoke();
///
/// Determines whether should trigger a failure. Called every time a
diff --git a/osu.Game/Rulesets/Mods/ModNoFail.cs b/osu.Game/Rulesets/Mods/ModNoFail.cs
index 4f39cd410e..1aaef8eac4 100644
--- a/osu.Game/Rulesets/Mods/ModNoFail.cs
+++ b/osu.Game/Rulesets/Mods/ModNoFail.cs
@@ -31,8 +31,6 @@ namespace osu.Game.Rulesets.Mods
public bool RestartOnFail => false;
- public bool TriggeredFail => false;
-
public void ReadFromConfig(OsuConfigManager config)
{
config.BindWith(OsuSetting.ShowHealthDisplayWhenCantFail, showHealthBar);
diff --git a/osu.Game/Rulesets/Mods/ModSuddenDeath.cs b/osu.Game/Rulesets/Mods/ModSuddenDeath.cs
index e9622fc22a..d07ff6ce87 100644
--- a/osu.Game/Rulesets/Mods/ModSuddenDeath.cs
+++ b/osu.Game/Rulesets/Mods/ModSuddenDeath.cs
@@ -24,7 +24,7 @@ namespace osu.Game.Rulesets.Mods
public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(ModPerfect)).ToArray();
protected override bool FailCondition(HealthProcessor healthProcessor, JudgementResult result)
- => TriggeredFail = result.Type.AffectsCombo()
+ => result.Type.AffectsCombo()
&& !result.IsHit;
}
}