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

Adjust Swell hit speed. #676

Merged
merged 2 commits into from
Apr 26, 2017
Merged
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
7 changes: 5 additions & 2 deletions osu.Game.Rulesets.Taiko/Replays/TaikoAutoReplay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ namespace osu.Game.Rulesets.Taiko.Replays
{
public class TaikoAutoReplay : Replay
{
private const double swell_hit_speed = 50;

private readonly Beatmap<TaikoHitObject> beatmap;

public TaikoAutoReplay(Beatmap<TaikoHitObject> beatmap)
Expand Down Expand Up @@ -45,12 +47,13 @@ private void createAutoReplay()
int d = 0;
int count = 0;
int req = swell.RequiredHits;
double hitRate = swell.Duration / req;
double hitRate = Math.Min(swell_hit_speed, swell.Duration / req);
for (double j = h.StartTime; j < endTime; j += hitRate)
{
switch (d)
{
default:
case 0:
button = ReplayButtonState.Left1;
break;
case 1:
Expand All @@ -66,7 +69,7 @@ private void createAutoReplay()

Frames.Add(new ReplayFrame(j, null, null, button));
d = (d + 1) % 4;
if (++count > req)
if (++count == req)
break;
}
}
Expand Down