diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModPerfectRelaxed.cs b/osu.Game.Rulesets.Osu/Mods/OsuModPerfectRelaxed.cs new file mode 100644 index 0000000000..4ad83c4df6 --- /dev/null +++ b/osu.Game.Rulesets.Osu/Mods/OsuModPerfectRelaxed.cs @@ -0,0 +1,11 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Osu.Mods +{ + public class OsuModPerfectRelaxed : ModPerfectRelaxed + { + } +} diff --git a/osu.Game.Rulesets.Osu/OsuRuleset.cs b/osu.Game.Rulesets.Osu/OsuRuleset.cs index 7042ad0cd4..55f74b199c 100644 --- a/osu.Game.Rulesets.Osu/OsuRuleset.cs +++ b/osu.Game.Rulesets.Osu/OsuRuleset.cs @@ -166,7 +166,7 @@ namespace osu.Game.Rulesets.Osu return new Mod[] { new OsuModHardRock(), - new MultiMod(new OsuModSuddenDeath(), new OsuModPerfect()), + new MultiMod(new OsuModSuddenDeath(), new OsuModPerfect(), new OsuModPerfectRelaxed()), new MultiMod(new OsuModDoubleTime(), new OsuModNightcore()), new OsuModHidden(), new MultiMod(new OsuModFlashlight(), new OsuModBlinds()), diff --git a/osu.Game/Rulesets/Mods/ModCinema.cs b/osu.Game/Rulesets/Mods/ModCinema.cs index 0c00eb6ae0..f0213d4f88 100644 --- a/osu.Game/Rulesets/Mods/ModCinema.cs +++ b/osu.Game/Rulesets/Mods/ModCinema.cs @@ -30,7 +30,7 @@ namespace osu.Game.Rulesets.Mods public override IconUsage? Icon => OsuIcon.ModCinema; public override LocalisableString Description => "Watch the video without visual distractions."; - public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(ModAutoplay), typeof(ModNoFail), typeof(ModFailCondition) }).ToArray(); + public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(ModAutoplay), typeof(ModNoFail), typeof(ModFailCondition), typeof(ModPerfectRelaxed) }).ToArray(); public void ApplyToHUD(HUDOverlay overlay) { diff --git a/osu.Game/Rulesets/Mods/ModPerfectRelaxed.cs b/osu.Game/Rulesets/Mods/ModPerfectRelaxed.cs new file mode 100644 index 0000000000..67cccc42aa --- /dev/null +++ b/osu.Game/Rulesets/Mods/ModPerfectRelaxed.cs @@ -0,0 +1,58 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using System; +using System.Linq; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Localisation; +using osu.Game.Graphics; +using osu.Game.Rulesets.Judgements; +using osu.Game.Rulesets.Scoring; +using osu.Game.Beatmaps; +using osu.Game.Rulesets.Objects; +using osu.Game.Scoring; + +namespace osu.Game.Rulesets.Mods +{ + public abstract class ModPerfectRelaxed : Mod, IApplicableToHitObject, IApplicableToBeatmap + { + public override string Name => "Perfect Relaxed"; + public override string Acronym => "PFR"; + public override IconUsage? Icon => OsuIcon.ModPerfect; + public override ModType Type => ModType.DifficultyIncrease; + public override double ScoreMultiplier => 1; + public override LocalisableString Description => "300 or miss."; + public override bool Ranked => false; + + public void ApplyToHitObject(HitObject ho) { +/* + ho.HitWindows = new HitWindowsPerfect(); + ho.HitWindows.SetDifficulty(6); +*/ + } + + public void ApplyToBeatmap(IBeatmap beatmap) + { + BeatmapDifficulty bd = beatmap.Difficulty; + + foreach(var ho in beatmap.HitObjects){ + ho.HitWindows = new HitWindowsPerfect(bd); + + foreach(var nested_ho in ho.NestedHitObjects) { + nested_ho.HitWindows = new HitWindowsPerfect(bd); + } + } + } + } + + class HitWindowsPerfect : HitWindows { + public HitWindowsPerfect(BeatmapDifficulty bd) { + this.SetDifficulty(bd.OverallDifficulty); + } + + public override bool IsHitResultAllowed(HitResult result) { + return result == HitResult.Great || result == HitResult.Miss; + } + } +} +