Skip to content

Commit

Permalink
Merge pull request #354 from LumpBloom7/Smoother-slide-fan
Browse files Browse the repository at this point in the history
Add more checkpoints to SlideFans
  • Loading branch information
LumpBloom7 authored Jul 23, 2022
2 parents 1d1b7b4 + 1849be3 commit ec7a151
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,7 @@ public class DrawableSlideCheckpoint : DrawableSentakkiHitObject
// All hits can only be done after the parent StartTime
public bool IsHittable => Time.Current > ParentHitObject.HitObject.StartTime && isPreviousNodeHit();

private bool isPreviousNodeHit()
{
if (HitObject.StrictCompletionOrder)
return ThisIndex < 1 || parentSlide.SlideCheckpoints[ThisIndex - 1].IsHit;

return ThisIndex < 2 || parentSlide.SlideCheckpoints[ThisIndex - 2].IsHit;
}
private bool isPreviousNodeHit() => ThisIndex < 2 || parentSlide.SlideCheckpoints[ThisIndex - 2].IsHit;

private Container<DrawableSlideCheckpointNode> nodes;

Expand Down
6 changes: 3 additions & 3 deletions osu.Game.Rulesets.Sentakki/Objects/SlideBody.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ protected override void CreateNestedHitObjects(CancellationToken cancellationTok

protected virtual void CreateSlideCheckpoints()
{
var distance = SlideInfo.SlidePath.TotalDistance;
var nodeCount = (int)Math.Floor(distance / 100);
double distance = SlideInfo.SlidePath.TotalDistance;
int nodeCount = (int)Math.Floor(distance / 100);
for (int i = 0; i < nodeCount; i++)
{
var progress = (double)(i + 1) / nodeCount;
double progress = (double)(i + 1) / nodeCount;
SlideCheckpoint checkpoint = new SlideCheckpoint()
{
Progress = (float)progress,
Expand Down
9 changes: 0 additions & 9 deletions osu.Game.Rulesets.Sentakki/Objects/SlideCheckpoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ namespace osu.Game.Rulesets.Sentakki.Objects
{
public class SlideCheckpoint : SentakkiHitObject
{
public SlideCheckpoint(bool strictMode = false)
{
StrictCompletionOrder = strictMode;
}

// Used to update slides visuals
public float Progress { get; set; }

Expand All @@ -21,10 +16,6 @@ public SlideCheckpoint(bool strictMode = false)

public int NodesToPass { get; set; } = 1;

// If this is true, then all previous checkpoints must be completed to hit this one
// This is in contrast to non-strict, where you can hit it if the n-2 checkpoint is hit
public bool StrictCompletionOrder { get; }

protected override void CreateNestedHitObjects(CancellationToken cancellationToken)
{
foreach (var nodePosition in NodePositions)
Expand Down
6 changes: 3 additions & 3 deletions osu.Game.Rulesets.Sentakki/Objects/SlideFan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ protected override void CreateSlideCheckpoints()
{
// Add body nodes (should be two major sets)
Vector2 originpoint = new Vector2(0, -SentakkiPlayfield.INTERSECTDISTANCE);
for (int i = 1; i < 3; ++i)
for (int i = 1; i < 5; ++i)
{
float progress = 0.5f * i;
SlideCheckpoint checkpoint = new SlideCheckpoint(true)
float progress = 0.25f * i;
SlideCheckpoint checkpoint = new SlideCheckpoint()
{
Progress = progress,
StartTime = StartTime + ShootDelay + ((Duration - ShootDelay) * progress),
Expand Down

0 comments on commit ec7a151

Please sign in to comment.