Skip to content

Commit

Permalink
Revert "Gameplay: Fix rekka bug (?)"
Browse files Browse the repository at this point in the history
This reverts commit 8a0e65f.
  • Loading branch information
0thElement committed Aug 21, 2024
1 parent c4365ec commit b9a3e26
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 57 deletions.
29 changes: 1 addition & 28 deletions Assets/Scripts/Gameplay/Data/Events/Arc.Judgement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ namespace ArcCreate.Gameplay.Data
/// <summary>
/// Partial class for judgement.
/// </summary>
public partial class Arc : LongNote, ILongNote, IArcJudgementReceiver, IArcTapJudgementReceiver
public partial class Arc : LongNote, ILongNote, IArcJudgementReceiver
{
private int numJudgementRequestsSent = 0;
private bool sentTapBlockingJudgement = false;
private bool highlightRequestSent = false;
private bool spawnedParticleThisFrame = false;

Expand All @@ -25,7 +24,6 @@ public void ResetJudgeTo(int timing)
highlightRequestSent = false;
arcGroupAlpha = 1;
hasBeenHitOnce = hasBeenHitOnce && timing >= Timing && timing <= EndTiming;
sentTapBlockingJudgement = timing >= Timing;
for (int i = 0; i < segments.Count; i++)
{
ArcSegmentData segment = segments[i];
Expand Down Expand Up @@ -83,12 +81,6 @@ public void UpdateJudgement(int currentTiming, GroupProperties groupProperties)
highlightRequestSent = true;
}

if (!IsTrace && currentTiming >= Timing - Values.MissJudgeWindow && !sentTapBlockingJudgement)
{
RequestTapBlockingJudgement(groupProperties);
sentTapBlockingJudgement = true;
}

spawnedParticleThisFrame = false;
}

Expand Down Expand Up @@ -140,10 +132,6 @@ public void ProcessArcJudgement(bool isExpired, bool isJudgement, GroupPropertie
}
}

public void ProcessArcTapJudgement(int offset, GroupProperties properties)
{
}

private void RequestJudgement(GroupProperties props)
{
for (int t = numJudgementRequestsSent; t < TotalCombo; t++)
Expand All @@ -164,21 +152,6 @@ private void RequestJudgement(GroupProperties props)
numJudgementRequestsSent = TotalCombo;
}

private void RequestTapBlockingJudgement(GroupProperties props)
{
Services.Judgement.Request(new ArcTapJudgementRequest()
{
ExpireAtTiming = Timing,
AutoAtTiming = Timing,
IsBlocker = true,
Width = 1,
X = WorldXAt(0),
Y = WorldYAt(0),
Receiver = this,
Properties = props,
});
}

private void RequestHighlight(int timing, GroupProperties props)
{
Services.Judgement.Request(new ArcJudgementRequest()
Expand Down
1 change: 0 additions & 1 deletion Assets/Scripts/Gameplay/Data/Events/ArcTap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ private void RequestJudgement(GroupProperties props)
X = WorldX,
Y = WorldY,
Width = Width,
IsBlocker = false,
Receiver = this,
Properties = props,
});
Expand Down
39 changes: 12 additions & 27 deletions Assets/Scripts/Gameplay/Judgement/Input/TouchInputHandler.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System;
using System.Collections.Generic;
using ArcCreate.Gameplay.Data;
using ArcCreate.Utility;
Expand Down Expand Up @@ -83,40 +82,26 @@ public void HandleTapRequests(
{
ArcTapJudgementRequest req = arcTapRequests[i];
int timingDifference = req.AutoAtTiming - currentTiming;
if (timingDifference > minTimingDifference)
{
continue;
}

Vector2 judgementSize = req.Properties.CurrentJudgementSize;
Vector3 judgementOffset = req.Properties.CurrentJudgementOffset;
Vector3 worldPosition = new Vector3(req.X, req.Y, 0) + judgementOffset;
Vector3 screenPosition = Services.Camera.GameplayCamera.WorldToScreenPoint(worldPosition);
Vector3 deltaToNote = screenPosition - input.ScreenPos;
float distanceToNote = deltaToNote.sqrMagnitude;

if (ArcTapCollide(input, screenPosition, worldPosition, req.Width, judgementSize))
if (ArcTapCollide(input, screenPosition, worldPosition, req.Width, judgementSize)
&& (timingDifference < minTimingDifference || distanceToNote <= minPositionDifference))
{
if (timingDifference < minTimingDifference || distanceToNote <= minPositionDifference)
{
if (req.IsBlocker &&
(minTimingDifference - timingDifference <= Values.MaxJudgeWindow
|| currentTiming >= req.AutoAtTiming))
{
continue;
}

minTimingDifference = timingDifference;
minPositionDifference = distanceToNote;
applicableArcTapRequestExists = true;
applicableArcTapRequest = req;
applicableArcTapRequestIndex = i;
}
else if (timingDifference <= minTimingDifference + Values.MaxJudgeWindow
&& applicableArcTapRequestExists && applicableArcTapRequest.IsBlocker
&& !req.IsBlocker)
{
minTimingDifference = timingDifference;
minPositionDifference = distanceToNote;
applicableArcTapRequestExists = true;
applicableArcTapRequest = req;
applicableArcTapRequestIndex = i;
}
minTimingDifference = timingDifference;
minPositionDifference = distanceToNote;
applicableArcTapRequestExists = true;
applicableArcTapRequest = req;
applicableArcTapRequestIndex = i;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ public struct ArcTapJudgementRequest
public float X;
public float Y;
public float Width;
public bool IsBlocker;
public IArcTapJudgementReceiver Receiver;
public GroupProperties Properties;
}
Expand Down

0 comments on commit b9a3e26

Please sign in to comment.