2019-01-24 08:43:03 +00: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 09:19:50 +00:00
|
|
|
|
2021-02-24 05:32:50 +00:00
|
|
|
using System;
|
|
|
|
using System.Linq;
|
2019-03-27 10:29:27 +00:00
|
|
|
using osu.Framework.Graphics.Sprites;
|
2022-08-10 19:54:48 +00:00
|
|
|
using osu.Framework.Localisation;
|
2018-03-14 03:07:03 +00:00
|
|
|
using osu.Game.Graphics;
|
2019-06-21 05:29:16 +00:00
|
|
|
using osu.Game.Rulesets.Judgements;
|
2017-11-20 07:15:29 +00:00
|
|
|
using osu.Game.Rulesets.Scoring;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
2017-04-21 08:33:20 +00:00
|
|
|
namespace osu.Game.Rulesets.Mods
|
|
|
|
{
|
2021-02-24 05:32:50 +00:00
|
|
|
public abstract class ModPerfect : ModFailCondition
|
2017-04-21 08:33:20 +00:00
|
|
|
{
|
|
|
|
public override string Name => "Perfect";
|
2018-11-30 08:16:00 +00:00
|
|
|
public override string Acronym => "PF";
|
2020-01-14 13:22:00 +00:00
|
|
|
public override IconUsage? Icon => OsuIcon.ModPerfect;
|
2021-02-24 05:32:50 +00:00
|
|
|
public override ModType Type => ModType.DifficultyIncrease;
|
|
|
|
public override double ScoreMultiplier => 1;
|
2022-08-10 19:54:48 +00:00
|
|
|
public override LocalisableString Description => "SS or quit.";
|
2018-04-13 09:19:50 +00:00
|
|
|
|
2022-05-25 00:04:57 +00:00
|
|
|
public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(ModSuddenDeath), typeof(ModAccuracyChallenge) }).ToArray();
|
2021-02-24 05:32:50 +00:00
|
|
|
|
2021-08-12 02:12:35 +00:00
|
|
|
protected ModPerfect()
|
|
|
|
{
|
|
|
|
Restart.Value = Restart.Default = true;
|
|
|
|
}
|
|
|
|
|
2020-03-02 04:25:56 +00:00
|
|
|
protected override bool FailCondition(HealthProcessor healthProcessor, JudgementResult result)
|
2023-12-22 04:39:41 +00:00
|
|
|
=> (isRelevantResult(result.Judgement.MinResult) || isRelevantResult(result.Judgement.MaxResult) || isRelevantResult(result.Type))
|
2020-03-02 04:25:56 +00:00
|
|
|
&& result.Type != result.Judgement.MaxResult;
|
2023-12-22 04:39:41 +00:00
|
|
|
|
|
|
|
private bool isRelevantResult(HitResult result) => result.AffectsAccuracy() || result.AffectsCombo();
|
2017-04-21 08:33:20 +00:00
|
|
|
}
|
2017-11-20 07:15:29 +00:00
|
|
|
}
|