-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathBeatmapObjectExecutionRatingsRecorder.cs
31 lines (30 loc) · 1.48 KB
/
BeatmapObjectExecutionRatingsRecorder.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using DataPuller.Data;
using HarmonyLib;
#nullable enable
namespace DataPuller.Harmony
{
[HarmonyPatch(typeof(global::BeatmapObjectExecutionRatingsRecorder), nameof(global::BeatmapObjectExecutionRatingsRecorder.HandleScoringForNoteDidFinish))]
internal class BeatmapObjectExecutionRatingsRecorder
{
[HarmonyPostfix]
public static void HandleScoringForNoteDidFinish_PostFix(ScoringElement scoringElement)
{
if (scoringElement != null)
{
if (scoringElement is GoodCutScoringElement goodCutScoringElement)
{
LiveData.Instance.Combo++;
LiveData.Instance.BlockHitScore = new()
{
PreSwing = goodCutScoringElement.cutScoreBuffer.beforeCutScore,
PostSwing = goodCutScoringElement.cutScoreBuffer.afterCutScore,
CenterSwing = goodCutScoringElement.cutScoreBuffer.centerDistanceCutScore
};
LiveData.Instance.Score += goodCutScoringElement.cutScore * goodCutScoringElement.multiplier;
LiveData.Instance.MaxScore += goodCutScoringElement.maxPossibleCutScore * goodCutScoringElement.multiplier;
LiveData.Instance.MaxScoreWithMultipliers = ScoreModel.GetModifiedScoreForGameplayModifiersScoreMultiplier(LiveData.Instance.MaxScore, MapData.Instance.ModifiersMultiplier);
}
}
}
}
}