diff --git a/osu.Game.Rulesets.Mania/Objects/ManiaHitObject.cs b/osu.Game.Rulesets.Mania/Objects/ManiaHitObject.cs index 22616fa0f9..be93471bcd 100644 --- a/osu.Game.Rulesets.Mania/Objects/ManiaHitObject.cs +++ b/osu.Game.Rulesets.Mania/Objects/ManiaHitObject.cs @@ -1,6 +1,8 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Game.Beatmaps; +using osu.Game.Beatmaps.ControlPoints; using osu.Game.Rulesets.Mania.Objects.Types; using osu.Game.Rulesets.Objects; @@ -9,5 +11,13 @@ namespace osu.Game.Rulesets.Mania.Objects public abstract class ManiaHitObject : HitObject, IHasColumn { public virtual int Column { get; set; } + + protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, BeatmapDifficulty difficulty) + { + base.ApplyDefaultsToSelf(controlPointInfo, difficulty); + + HitWindows.AllowsPerfect = true; + HitWindows.AllowsOk = true; + } } } diff --git a/osu.Game/Rulesets/Objects/HitWindows.cs b/osu.Game/Rulesets/Objects/HitWindows.cs index 6d9461e3b9..1b332ee80a 100644 --- a/osu.Game/Rulesets/Objects/HitWindows.cs +++ b/osu.Game/Rulesets/Objects/HitWindows.cs @@ -21,35 +21,47 @@ namespace osu.Game.Rulesets.Objects }; /// - /// Hit window for a hit. + /// Hit window for a result. + /// The user can only achieve receive this result if is true. /// public double Perfect { get; protected set; } /// - /// Hit window for a hit. + /// Hit window for a result. /// public double Great { get; protected set; } /// - /// Hit window for a hit. + /// Hit window for a result. /// public double Good { get; protected set; } /// - /// Hit window for an hit. + /// Hit window for an result. + /// The user can only achieve this result if is true. /// public double Ok { get; protected set; } /// - /// Hit window for a hit. + /// Hit window for a result. /// public double Meh { get; protected set; } /// - /// Hit window for a hit. + /// Hit window for a result. /// public double Miss { get; protected set; } + /// + /// Whether it's possible to achieve a result. + /// + public bool AllowsPerfect; + + /// + /// Whether it's possible to achieve a result. + /// + public bool AllowsOk; + /// /// Constructs hit windows by fitting a parameter to a 2-part piecewise linear function for each hit window. /// @@ -73,13 +85,13 @@ namespace osu.Game.Rulesets.Objects { timeOffset = Math.Abs(timeOffset); - if (timeOffset <= HalfWindowFor(HitResult.Perfect)) + if (AllowsPerfect && timeOffset <= HalfWindowFor(HitResult.Perfect)) return HitResult.Perfect; if (timeOffset <= HalfWindowFor(HitResult.Great)) return HitResult.Great; if (timeOffset <= HalfWindowFor(HitResult.Good)) return HitResult.Good; - if (timeOffset <= HalfWindowFor(HitResult.Ok)) + if (AllowsOk && timeOffset <= HalfWindowFor(HitResult.Ok)) return HitResult.Ok; if (timeOffset <= HalfWindowFor(HitResult.Meh)) return HitResult.Meh;