2019-01-24 16:43:03 +08:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2018-04-13 17:19:50 +08:00
|
|
|
|
2017-04-21 16:33:20 +08:00
|
|
|
using System;
|
2023-12-20 13:50:21 +08:00
|
|
|
using osu.Framework.Bindables;
|
2019-03-27 18:29:27 +08:00
|
|
|
using osu.Framework.Graphics.Sprites;
|
2022-08-11 03:54:48 +08:00
|
|
|
using osu.Framework.Localisation;
|
2023-12-20 13:50:21 +08:00
|
|
|
using osu.Game.Configuration;
|
2017-04-21 16:33:20 +08:00
|
|
|
using osu.Game.Graphics;
|
2023-12-20 13:50:21 +08:00
|
|
|
using osu.Game.Screens.Play;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
2017-04-21 16:33:20 +08:00
|
|
|
namespace osu.Game.Rulesets.Mods
|
|
|
|
{
|
2023-12-20 13:50:21 +08:00
|
|
|
public abstract class ModNoFail : Mod, IApplicableFailOverride, IApplicableToHUD, IReadFromConfig
|
2017-04-21 16:33:20 +08:00
|
|
|
{
|
2018-03-14 11:07:03 +08:00
|
|
|
public override string Name => "No Fail";
|
2018-11-30 16:16:00 +08:00
|
|
|
public override string Acronym => "NF";
|
2021-12-10 13:15:00 +08:00
|
|
|
public override IconUsage? Icon => OsuIcon.ModNoFail;
|
2017-05-03 02:36:55 +08:00
|
|
|
public override ModType Type => ModType.DifficultyReduction;
|
2022-08-11 03:54:48 +08:00
|
|
|
public override LocalisableString Description => "You can't fail, no matter what.";
|
2017-04-21 16:33:20 +08:00
|
|
|
public override double ScoreMultiplier => 0.5;
|
2023-12-23 22:10:31 +08:00
|
|
|
public override Type[] IncompatibleMods => new[] { typeof(ModFailCondition), typeof(ModCinema) };
|
2024-01-31 21:59:35 +08:00
|
|
|
public override bool Ranked => UsesDefaultConfiguration;
|
2023-12-20 13:50:21 +08:00
|
|
|
|
|
|
|
private readonly Bindable<bool> showHealthBar = new Bindable<bool>();
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// We never fail, 'yo.
|
|
|
|
/// </summary>
|
|
|
|
public bool PerformFail() => false;
|
|
|
|
|
|
|
|
public bool RestartOnFail => false;
|
|
|
|
|
|
|
|
public void ReadFromConfig(OsuConfigManager config)
|
|
|
|
{
|
|
|
|
config.BindWith(OsuSetting.ShowHealthDisplayWhenCantFail, showHealthBar);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void ApplyToHUD(HUDOverlay overlay)
|
|
|
|
{
|
|
|
|
overlay.ShowHealthBar.BindTo(showHealthBar);
|
|
|
|
}
|
2017-04-21 16:33:20 +08:00
|
|
|
}
|
2017-12-31 03:10:25 +08:00
|
|
|
}
|