修了很多bug和增加功能,优化不少问题
This commit is contained in:
@@ -126,6 +126,44 @@ public class HoldNote : BaseNote
|
||||
return Mathf.FloorToInt(baseScore * mult);
|
||||
}
|
||||
|
||||
private static bool TryRewriteNonMissJudgeToPerfect(int trackIndex, ref string judgeResult)
|
||||
{
|
||||
if (judgeResult != "Great" && judgeResult != "Good") return false;
|
||||
var ally = GetAllyForTrackCached(trackIndex);
|
||||
if (ally == null || ally.IsDead) return false;
|
||||
if (!ally.IsNonMissToPerfectRewriteActive()) return false;
|
||||
|
||||
judgeResult = "Perfect";
|
||||
return true;
|
||||
}
|
||||
|
||||
private static void AdjustCountsAfterRewriteToPerfect(int trackIndex, string originalJudge)
|
||||
{
|
||||
var sm = ScoreManager.Instance;
|
||||
if (sm == null) return;
|
||||
|
||||
if (originalJudge == "Great")
|
||||
{
|
||||
sm.countGreat = Mathf.Max(0, sm.countGreat - 1);
|
||||
if (trackIndex >= 0 && trackIndex < sm.trackGreatCounts.Length)
|
||||
sm.trackGreatCounts[trackIndex] = Mathf.Max(0, sm.trackGreatCounts[trackIndex] - 1);
|
||||
}
|
||||
else if (originalJudge == "Good")
|
||||
{
|
||||
sm.countGood = Mathf.Max(0, sm.countGood - 1);
|
||||
if (trackIndex >= 0 && trackIndex < sm.trackGoodCounts.Length)
|
||||
sm.trackGoodCounts[trackIndex] = Mathf.Max(0, sm.trackGoodCounts[trackIndex] - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
sm.countPerfect += 1;
|
||||
if (trackIndex >= 0 && trackIndex < sm.trackPerfectCounts.Length)
|
||||
sm.trackPerfectCounts[trackIndex] += 1;
|
||||
}
|
||||
|
||||
private JudgeManager cachedJudgeManager;
|
||||
private TrackKeyManager cachedTrackKeyManager;
|
||||
|
||||
@@ -897,6 +935,12 @@ public class HoldNote : BaseNote
|
||||
ReleaseTrackJudgeLockSafe();
|
||||
}
|
||||
|
||||
// Lucky Chance: rewrite non-Miss judge to Perfect during active duration.
|
||||
if (result != "Miss")
|
||||
{
|
||||
TryRewriteNonMissJudgeToPerfect(trackIndex, ref result);
|
||||
}
|
||||
|
||||
// show judge result and update combo/UI like short notes
|
||||
InputManager.Instance?.ShowJudgeResult(trackIndex, result);
|
||||
|
||||
@@ -1057,6 +1101,12 @@ public class HoldNote : BaseNote
|
||||
}
|
||||
}
|
||||
|
||||
string originalEndJudge = result;
|
||||
if (TryRewriteNonMissJudgeToPerfect(trackIndex, ref result))
|
||||
{
|
||||
AdjustCountsAfterRewriteToPerfect(trackIndex, originalEndJudge);
|
||||
}
|
||||
|
||||
if (JudgeManager.IsDebugEnabled) Debug.Log($"[HoldNote] END result for {noteID}: {result} (color={noteColor})");
|
||||
|
||||
// show UI/audio
|
||||
|
||||
Reference in New Issue
Block a user