mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 22:56:36 +09:00
Implemented the 3 lives system into the Easy Mod.
This commit is contained in:
@ -51,6 +51,8 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
public int RestartCount;
|
||||
|
||||
public int Lives = 2;
|
||||
|
||||
[Resolved]
|
||||
private ScoreManager scoreManager { get; set; }
|
||||
|
||||
@ -323,8 +325,32 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
protected FailOverlay FailOverlay { get; private set; }
|
||||
|
||||
|
||||
private bool onFail()
|
||||
{
|
||||
|
||||
//issue #3372
|
||||
if (Beatmap.Value.Mods.Value.Any(x => x is ModEasy))
|
||||
{
|
||||
|
||||
if (Lives != 0)
|
||||
{
|
||||
Lives--;
|
||||
ScoreProcessor.Health.Value = 100;
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
GameplayClockContainer.Stop();
|
||||
HasFailed = true;
|
||||
FailOverlay.Retries = RestartCount;
|
||||
FailOverlay.Show();
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (Beatmap.Value.Mods.Value.OfType<IApplicableFailOverride>().Any(m => !m.AllowFail))
|
||||
return false;
|
||||
|
||||
@ -332,6 +358,8 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
HasFailed = true;
|
||||
|
||||
|
||||
|
||||
// There is a chance that we could be in a paused state as the ruleset's internal clock (see FrameStabilityContainer)
|
||||
// could process an extra frame after the GameplayClock is stopped.
|
||||
// In such cases we want the fail state to precede a user triggered pause.
|
||||
|
Reference in New Issue
Block a user