Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not force miss slider with strict tracking active if tracking is lost before head was judged #31304

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
163 changes: 163 additions & 0 deletions osu.Game.Rulesets.Osu.Tests/Mods/TestSceneOsuModStrictTracking.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
// See the LICENCE file in the repository root for full licence text.

using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Osu.Mods;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.Replays;
using osu.Game.Rulesets.Replays;
using osu.Game.Rulesets.Scoring;
using osuTK;

namespace osu.Game.Rulesets.Osu.Tests.Mods
Expand Down Expand Up @@ -49,5 +51,166 @@ public void TestSliderInput() => CreateModTest(new ModTestData
},
PassCondition = () => Player.ScoreProcessor.Combo.Value == 2
});

[Test]
public void TestReleaseOverSliderBeforeHeadHit() => CreateModTest(new ModTestData
{
Mod = new OsuModStrictTracking(),
Autoplay = false,
CreateBeatmap = () => new Beatmap
{
HitObjects = new List<HitObject>
{
new Slider
{
StartTime = 1000,
Path = new SliderPath
{
ControlPoints =
{
new PathControlPoint(),
new PathControlPoint(new Vector2(0, 100))
}
}
}
}
},
ReplayFrames = new List<ReplayFrame>
{
new OsuReplayFrame(501, new Vector2(200, 0), OsuAction.LeftButton),
new OsuReplayFrame(1000, new Vector2()),
new OsuReplayFrame(1020, new Vector2(), OsuAction.LeftButton),
new OsuReplayFrame(1750, new Vector2(0, 100), OsuAction.LeftButton),
new OsuReplayFrame(1751, new Vector2(0, 100)),
},
PassCondition = () => Player.ScoreProcessor.Combo.Value == 2
});

[Test]
public void TestDoNothing() => CreateModTest(new ModTestData
{
Mod = new OsuModStrictTracking(),
Autoplay = false,
CreateBeatmap = () => new Beatmap
{
HitObjects = new List<HitObject>
{
new Slider
{
StartTime = 1000,
Path = new SliderPath
{
ControlPoints =
{
new PathControlPoint(),
new PathControlPoint(new Vector2(0, 100))
}
}
}
}
},
ReplayFrames = new List<ReplayFrame>
{
new OsuReplayFrame(0, new Vector2()),
},
PassCondition = () => Player.ScoreProcessor.JudgedHits == 3 && Player.ScoreProcessor.Statistics.All(s => s.Key.IsMiss())
});

[Test]
public void TestMissHeadButTrackRestOfSlider() => CreateModTest(new ModTestData
{
Mod = new OsuModStrictTracking(),
Autoplay = false,
CreateBeatmap = () => new Beatmap
{
HitObjects = new List<HitObject>
{
new Slider
{
StartTime = 1000,
Path = new SliderPath
{
ControlPoints =
{
new PathControlPoint(),
new PathControlPoint(new Vector2(0, 100))
}
}
}
}
},
ReplayFrames = new List<ReplayFrame>
{
new OsuReplayFrame(0, new Vector2()),
new OsuReplayFrame(1375, new Vector2(0, 50), OsuAction.LeftButton),
new OsuReplayFrame(1751, new Vector2(0, 100)),
},
PassCondition = () => Player.ScoreProcessor.JudgedHits == 3 && Player.ScoreProcessor.Statistics[HitResult.Miss] == 1 && Player.ScoreProcessor.Statistics[HitResult.Great] == 1
});

[Test]
public void TestMissHeadThenDropTracking() => CreateModTest(new ModTestData
{
Mod = new OsuModStrictTracking(),
Autoplay = false,
CreateBeatmap = () => new Beatmap
{
HitObjects = new List<HitObject>
{
new Slider
{
StartTime = 1000,
Path = new SliderPath
{
ControlPoints =
{
new PathControlPoint(),
new PathControlPoint(new Vector2(0, 100))
}
}
}
}
},
ReplayFrames = new List<ReplayFrame>
{
new OsuReplayFrame(0, new Vector2()),
new OsuReplayFrame(1375, new Vector2(0, 50), OsuAction.LeftButton),
new OsuReplayFrame(1475, new Vector2(), OsuAction.LeftButton),
},
PassCondition = () => Player.ScoreProcessor.JudgedHits == 3 && Player.ScoreProcessor.Statistics.All(s => s.Key.IsMiss())
});

[Test]
public void TestLosingTrackingMissesTail() => CreateModTest(new ModTestData
{
Mod = new OsuModStrictTracking(),
Autoplay = false,
CreateBeatmap = () => new Beatmap
{
HitObjects = new List<HitObject>
{
new Slider
{
StartTime = 1000,
Path = new SliderPath
{
ControlPoints =
{
new PathControlPoint(),
new PathControlPoint(new Vector2(0, 100))
}
}
}
}
},
ReplayFrames = new List<ReplayFrame>
{
new OsuReplayFrame(0, new Vector2(), OsuAction.LeftButton),
new OsuReplayFrame(500, new Vector2(200, 0), OsuAction.LeftButton),
new OsuReplayFrame(501, new Vector2(200, 0)),
new OsuReplayFrame(1000, new Vector2(), OsuAction.LeftButton),
},
PassCondition = () => Player.ScoreProcessor.Statistics.GetValueOrDefault(HitResult.Miss) == 1
});
}
}
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Osu/Mods/OsuModStrictTracking.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void ApplyToDrawableHitObject(DrawableHitObject drawable)
{
if (e.NewValue || slider.Judged) return;

if (slider.Time.Current < slider.HitObject.StartTime)
if (slider.Time.Current < slider.HitObject.StartTime || !slider.HeadCircle.Judged)
return;

var tail = slider.NestedHitObjects.OfType<StrictTrackingDrawableSliderTail>().First();
Expand Down
Loading