@@ -623,6 +623,18 @@ class PlayState extends MusicBeatState
623623 curRating = event .rating ;
624624 }
625625
626+ private function onRatingChange (rating : Rating ) {
627+ if (! hits .exists (rating .name ))
628+ hits .set (rating .name , 0 );
629+
630+ if (Options .ghostTapping ) {
631+ comboBreaks = false ;
632+ for (rating in ratingManager .ratingData )
633+ comboBreaks = comboBreaks || rating .breaksCombo ;
634+ } else
635+ comboBreaks = true ;
636+ }
637+
626638 private inline function set_health (v : Float )
627639 return health = FlxMath .bound (v , 0 , maxHealth );
628640 private inline function set_maxHealth (v : Float ) {
@@ -690,6 +702,14 @@ class PlayState extends MusicBeatState
690702 detailsText = isStoryMode ? (" Story Mode: " + storyWeek .name ) : " Freeplay" ;
691703
692704 for (rating in [for (i in ratingManager .ratingData ) i .name ]) hits .set (rating , 0 ); // Ensure all keys exist as to prevent null errors.
705+ if (Options .ghostTapping ) {
706+ comboBreaks = false ;
707+ for (rating in ratingManager .ratingData )
708+ comboBreaks = comboBreaks || rating .breaksCombo ;
709+ } else
710+ comboBreaks = true ;
711+ ratingManager .onRatingAdded .add (onRatingChange );
712+ ratingManager .onRatingRemoved .add (onRatingChange );
693713
694714 // Checks if cutscene files exists
695715 var cutscenePath = Paths .script (' songs/ ${SONG .meta .name }/cutscene' );
@@ -1946,9 +1966,9 @@ class PlayState extends MusicBeatState
19461966
19471967 var event : NoteHitEvent ;
19481968 if (strumLine != null && ! strumLine .cpu )
1949- event = EventManager .get (NoteHitEvent ).recycle (false , ! note .isSustainNote , ! note .isSustainNote , null , defaultDisplayRating , defaultDisplayCombo , note , strumLine .characters , true , note .noteType , note .animSuffix .getDefault (note .strumID < strumLine .members .length ? strumLine .members [note .strumID ].animSuffix : strumLine .animSuffix ), " game/score/" , " " , note .strumID , rating .score , note .isSustainNote ? null : rating .accuracy , 0.023 , rating .name , Options .splashesEnabled && ! note .isSustainNote && rating .splash , 0.5 , true , 0.7 , true , true , iconP1 );
1969+ event = EventManager .get (NoteHitEvent ).recycle (rating . breaksCombo , ! note .isSustainNote , ! note .isSustainNote , null , defaultDisplayRating , defaultDisplayCombo , note , strumLine .characters , true , note .noteType , note .animSuffix .getDefault (note .strumID < strumLine .members .length ? strumLine .members [note .strumID ].animSuffix : strumLine .animSuffix ), " game/score/" , " " , note .strumID , rating .score , note .isSustainNote ? null : rating .accuracy , rating . health , rating .name , Options .splashesEnabled && ! note .isSustainNote && rating .splash , 0.5 , true , 0.7 , true , true , iconP1 );
19501970 else
1951- event = EventManager .get (NoteHitEvent ).recycle (false , false , false , null , defaultDisplayRating , defaultDisplayCombo , note , strumLine .characters , false , note .noteType , note .animSuffix .getDefault (note .strumID < strumLine .members .length ? strumLine .members [note .strumID ].animSuffix : strumLine .animSuffix ), " game/score/" , " " , note .strumID , 0 , null , 0 , rating .name , false , 0.5 , true , 0.7 , true , true , iconP2 );
1971+ event = EventManager .get (NoteHitEvent ).recycle (rating . breaksCombo , false , false , null , defaultDisplayRating , defaultDisplayCombo , note , strumLine .characters , false , note .noteType , note .animSuffix .getDefault (note .strumID < strumLine .members .length ? strumLine .members [note .strumID ].animSuffix : strumLine .animSuffix ), " game/score/" , " " , note .strumID , 0 , null , 0 , rating .name , false , 0.5 , true , 0.7 , true , true , iconP2 );
19521972 event .deleteNote = ! note .isSustainNote ; // work around, to allow sustain notes to be deleted
19531973 event = scripts .event (strumLine != null && ! strumLine .cpu ? " onPlayerHit" : " onDadHit" , event );
19541974 strumLine .onHit .dispatch (event );
@@ -1964,7 +1984,11 @@ class PlayState extends MusicBeatState
19641984 totalAccuracyAmount + = event .accuracy ;
19651985 updateRating ();
19661986 }
1967- if (event .countAsCombo ) combo ++ ;
1987+ if (event .misses ) {
1988+ combo = 0 ;
1989+ misses ++ ;
1990+ } else if (event .countAsCombo )
1991+ combo ++ ;
19681992
19691993 if (event .showRating || (event .showRating == null && event .player ))
19701994 {
0 commit comments