mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 12:42:54 +08:00
Fix hold note hitwindow lenience
This commit is contained in:
parent
f67d263596
commit
43cdbec0a3
@ -191,6 +191,13 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private class DrawableTailNote : DrawableNote
|
private class DrawableTailNote : DrawableNote
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Lenience of release hit windows. This is to make cases where the hold note release
|
||||||
|
/// is timed alongside presses of other hit objects less awkward.
|
||||||
|
/// Todo: This shouldn't exist for non-LegacyBeatmapDecoder beatmaps
|
||||||
|
/// </summary>
|
||||||
|
private const double release_window_lenience = 1.5;
|
||||||
|
|
||||||
private readonly DrawableHoldNote holdNote;
|
private readonly DrawableHoldNote holdNote;
|
||||||
|
|
||||||
public DrawableTailNote(DrawableHoldNote holdNote, ManiaAction action)
|
public DrawableTailNote(DrawableHoldNote holdNote, ManiaAction action)
|
||||||
@ -203,6 +210,9 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
|||||||
|
|
||||||
protected override void CheckForJudgements(bool userTriggered, double timeOffset)
|
protected override void CheckForJudgements(bool userTriggered, double timeOffset)
|
||||||
{
|
{
|
||||||
|
// Factor in the release lenience
|
||||||
|
timeOffset /= release_window_lenience;
|
||||||
|
|
||||||
if (!userTriggered)
|
if (!userTriggered)
|
||||||
{
|
{
|
||||||
if (!HitObject.HitWindows.CanBeHit(timeOffset))
|
if (!HitObject.HitWindows.CanBeHit(timeOffset))
|
||||||
|
@ -55,7 +55,7 @@ namespace osu.Game.Rulesets.Mania.Objects
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The tail note of the hold.
|
/// The tail note of the hold.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly Note Tail = new TailNote();
|
public readonly Note Tail = new Note();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The time between ticks of this hold.
|
/// The time between ticks of this hold.
|
||||||
@ -94,25 +94,5 @@ namespace osu.Game.Rulesets.Mania.Objects
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The tail of the hold note.
|
|
||||||
/// </summary>
|
|
||||||
private class TailNote : Note
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Lenience of release hit windows. This is to make cases where the hold note release
|
|
||||||
/// is timed alongside presses of other hit objects less awkward.
|
|
||||||
/// Todo: This shouldn't exist for non-LegacyBeatmapDecoder beatmaps
|
|
||||||
/// </summary>
|
|
||||||
private const double release_window_lenience = 1.5;
|
|
||||||
|
|
||||||
protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, BeatmapDifficulty difficulty)
|
|
||||||
{
|
|
||||||
base.ApplyDefaultsToSelf(controlPointInfo, difficulty);
|
|
||||||
|
|
||||||
HitWindows *= release_window_lenience;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -135,39 +135,5 @@ namespace osu.Game.Rulesets.Objects
|
|||||||
/// <param name="timeOffset">The time offset.</param>
|
/// <param name="timeOffset">The time offset.</param>
|
||||||
/// <returns>Whether the <see cref="HitObject"/> can be hit at any point in the future from this time offset.</returns>
|
/// <returns>Whether the <see cref="HitObject"/> can be hit at any point in the future from this time offset.</returns>
|
||||||
public bool CanBeHit(double timeOffset) => timeOffset <= HalfWindowFor(HitResult.Meh);
|
public bool CanBeHit(double timeOffset) => timeOffset <= HalfWindowFor(HitResult.Meh);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Multiplies all hit windows by a value.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="windows">The hit windows to multiply.</param>
|
|
||||||
/// <param name="value">The value to multiply each hit window by.</param>
|
|
||||||
public static HitWindows operator *(HitWindows windows, double value)
|
|
||||||
{
|
|
||||||
windows.Perfect *= value;
|
|
||||||
windows.Great *= value;
|
|
||||||
windows.Good *= value;
|
|
||||||
windows.Ok *= value;
|
|
||||||
windows.Meh *= value;
|
|
||||||
windows.Miss *= value;
|
|
||||||
|
|
||||||
return windows;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Divides all hit windows by a value.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="windows">The hit windows to divide.</param>
|
|
||||||
/// <param name="value">The value to divide each hit window by.</param>
|
|
||||||
public static HitWindows operator /(HitWindows windows, double value)
|
|
||||||
{
|
|
||||||
windows.Perfect /= value;
|
|
||||||
windows.Great /= value;
|
|
||||||
windows.Good /= value;
|
|
||||||
windows.Ok /= value;
|
|
||||||
windows.Meh /= value;
|
|
||||||
windows.Miss /= value;
|
|
||||||
|
|
||||||
return windows;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user