notebook实装功能,galgame继续,一些bug修复
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using System.Globalization;
|
||||
using UnityEngine;
|
||||
|
||||
public class Note : BaseNote
|
||||
@@ -55,12 +56,10 @@ public class Note : BaseNote
|
||||
|
||||
private static int ComputePmDeltaFromJudge(string judgeResult, AllyCombatant ally)
|
||||
{
|
||||
// If current character slot has no ally or is dead, then this corresponding track will also not get idol score
|
||||
if (ally == null || ally.IsDead) return 0;
|
||||
|
||||
int baseScore = 0;
|
||||
|
||||
var bmm = ally != null ? ally.bmm : null;
|
||||
if (bmm == null) bmm = BeatmapManager.Instance;
|
||||
if (bmm == null) bmm = GetBeatmapManagerCached();
|
||||
if (bmm != null) baseScore = Mathf.Max(0, bmm.perNoteScore);
|
||||
|
||||
@@ -109,6 +108,42 @@ public class Note : BaseNote
|
||||
sm.trackPerfectCounts[trackIndex] += 1;
|
||||
}
|
||||
|
||||
private string BuildNoteLogId()
|
||||
{
|
||||
if (noteData != null)
|
||||
{
|
||||
return "tap:"
|
||||
+ TrackIndex
|
||||
+ ":"
|
||||
+ noteData.time.ToString("0.###", CultureInfo.InvariantCulture)
|
||||
+ ":"
|
||||
+ gameObject.GetInstanceID();
|
||||
}
|
||||
|
||||
return "tap:"
|
||||
+ TrackIndex
|
||||
+ ":"
|
||||
+ hitTime.ToString("0.###", CultureInfo.InvariantCulture)
|
||||
+ ":"
|
||||
+ gameObject.GetInstanceID();
|
||||
}
|
||||
|
||||
private void LogTapJudge(string judgeResult, float rawOffsetMs, bool rewrittenToPerfect, bool autoplay, float actionTime)
|
||||
{
|
||||
GameplaySkillLogger.RecordJudgeResult(
|
||||
"Tap",
|
||||
"Single",
|
||||
TrackIndex,
|
||||
BuildNoteLogId(),
|
||||
judgeResult,
|
||||
rawOffsetMs,
|
||||
rewrittenToPerfect,
|
||||
autoplay,
|
||||
actionTime,
|
||||
hitTime,
|
||||
float.NaN);
|
||||
}
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
anim = GetComponent<AnimationController>();
|
||||
@@ -218,6 +253,7 @@ public class Note : BaseNote
|
||||
ScoreManager.Instance.RecordOffset(0f);
|
||||
|
||||
const string judgeResult = "Perfect";
|
||||
if (noteData != null) noteData.judgeResult = judgeResult;
|
||||
|
||||
InputManager.Instance?.ShowJudgeResult(TrackIndex, judgeResult);
|
||||
JudgeSoundManager.Instance?.PlayJudgeSound(judgeResult);
|
||||
@@ -241,6 +277,7 @@ public class Note : BaseNote
|
||||
}
|
||||
|
||||
try { SkillBuilder.Instance?.NotifyNoteHit(TrackIndex, judgeResult, SkillDefinition.NoteTypeTrigger.Tap); } catch { }
|
||||
LogTapJudge(judgeResult, 0f, false, true, pressTime);
|
||||
|
||||
Judge();
|
||||
}
|
||||
@@ -368,10 +405,13 @@ public class Note : BaseNote
|
||||
if (!string.IsNullOrEmpty(judgeResult))
|
||||
{
|
||||
string originalJudge = judgeResult;
|
||||
bool rewrittenToPerfect = false;
|
||||
if (TryRewriteNonMissJudgeToPerfect(TrackIndex, ref judgeResult))
|
||||
{
|
||||
rewrittenToPerfect = true;
|
||||
AdjustCountsAfterRewriteToPerfect(TrackIndex, originalJudge);
|
||||
}
|
||||
if (noteData != null) noteData.judgeResult = judgeResult;
|
||||
|
||||
InputManager.Instance?.ShowJudgeResult(TrackIndex, judgeResult);
|
||||
JudgeSoundManager.Instance?.PlayJudgeSound(judgeResult);
|
||||
@@ -396,6 +436,7 @@ public class Note : BaseNote
|
||||
}
|
||||
|
||||
try { SkillBuilder.Instance?.NotifyNoteHit(TrackIndex, judgeResult, SkillDefinition.NoteTypeTrigger.Tap); } catch { }
|
||||
LogTapJudge(judgeResult, rawOffsetMs, rewrittenToPerfect, false, pressTime);
|
||||
}
|
||||
|
||||
Judge();
|
||||
@@ -452,6 +493,7 @@ public class Note : BaseNote
|
||||
ScoreManager.Instance?.RecordOffset(0);
|
||||
|
||||
if (JudgeManager.IsDebugEnabled) Debug.Log($"{keyToPress} Miss");
|
||||
if (noteData != null) noteData.judgeResult = "Miss";
|
||||
|
||||
InputManager.Instance?.ShowJudgeResult(TrackIndex, "Miss");
|
||||
JudgeSoundManager.Instance?.PlayJudgeSound("Miss");
|
||||
@@ -476,6 +518,7 @@ public class Note : BaseNote
|
||||
}
|
||||
|
||||
try { SkillBuilder.Instance?.NotifyNoteHit(TrackIndex, "Miss", SkillDefinition.NoteTypeTrigger.Tap); } catch { }
|
||||
LogTapJudge("Miss", 0f, false, false, Time.time);
|
||||
|
||||
// notify global judge manager that this note has been finally judged (miss)
|
||||
JudgeManager.Instance?.NotifyNoteJudged();
|
||||
|
||||
Reference in New Issue
Block a user