1414using Quaver . API . Maps . Processors . Scoring . Data ;
1515using Quaver . API . Maps . Processors . Scoring . Multiplayer ;
1616using Quaver . API . Replays ;
17+ using HitObjectType = Quaver . API . Enums . HitObjectType ;
1718
1819namespace Quaver . API . Maps . Processors . Scoring
1920{
@@ -173,7 +174,9 @@ public ScoreProcessorKeys(Replay replay, JudgementWindows windows = null) : base
173174 /// <param name="hitDifference"></param>
174175 /// <param name="keyPressType"></param>
175176 /// <param name="calculateAllStats"></param>
176- public Judgement CalculateScore ( int hitDifference , KeyPressType keyPressType , bool calculateAllStats = true )
177+ /// <param name="isMine"></param>
178+ public Judgement CalculateScore ( int hitDifference , KeyPressType keyPressType , bool calculateAllStats = true ,
179+ bool isMine = false )
177180 {
178181 var absoluteDifference = 0 ;
179182
@@ -222,18 +225,25 @@ public Judgement CalculateScore(int hitDifference, KeyPressType keyPressType, bo
222225 return judgement ;
223226
224227 if ( calculateAllStats )
225- CalculateScore ( judgement , keyPressType == KeyPressType . Release ) ;
228+ CalculateScore ( judgement , keyPressType == KeyPressType . Release , isMine ) ;
226229
227230 return judgement ;
228231 }
229232
233+ public void CalculateScore ( HitStat hitStat )
234+ {
235+ CalculateScore ( hitStat . Judgement , hitStat . KeyPressType == KeyPressType . Release ,
236+ hitStat . HitObject . Type is HitObjectType . Mine ) ;
237+ }
238+
230239 /// <inheritdoc />
231240 /// <summary>
232241 /// Calculate Score and Health increase/decrease with a given judgement.
233242 /// </summary>
234243 /// <param name="judgement"></param>
235244 /// <param name="isLongNoteRelease"></param>
236- public override void CalculateScore ( Judgement judgement , bool isLongNoteRelease = false )
245+ /// <param name="isMine"></param>
246+ public override void CalculateScore ( Judgement judgement , bool isLongNoteRelease = false , bool isMine = false )
237247 {
238248 // Update Judgement count
239249 CurrentJudgements [ judgement ] ++ ;
@@ -257,7 +267,9 @@ public override void CalculateScore(Judgement judgement, bool isLongNoteRelease
257267 MultiplierCount ++ ;
258268
259269 // Add to the combo since the user hit.
260- Combo ++ ;
270+ // Only do this when the note is not a mine (so it is a regular note)
271+ if ( ! isMine )
272+ Combo ++ ;
261273
262274 // Set the max combo if applicable.
263275 if ( Combo > MaxCombo )
@@ -372,17 +384,7 @@ protected override void InitializeHealthWeighting()
372384 /// <returns></returns>
373385 public int GetTotalJudgementCount ( )
374386 {
375- var judgements = 0 ;
376-
377- foreach ( var o in Map . HitObjects )
378- {
379- if ( o . IsLongNote )
380- judgements += 2 ;
381- else
382- judgements ++ ;
383- }
384-
385- return judgements ;
387+ return Map . HitObjects . Sum ( o => o . JudgementCount ) ;
386388 }
387389
388390 /// <summary>
0 commit comments