@@ -557,10 +557,11 @@ class PlayState extends MusicBeatState
557557 public var noteTypesArray : Array <String > = [null ];
558558
559559 /**
560- * Hit window, in milliseconds. Defaults to 250ms unless changed in options.
561- * Base game hit window is 175ms .
560+ * Hit window, in milliseconds. A Legacy CNE Hit window configuration,
561+ * Don't use this, it's for mods that still uses the old judgement timing, instead use ratingManager .
562562 */
563- public var hitWindow : Float = Options .hitWindow ; // is calculated in create(), is safeFrames in milliseconds.
563+ public var hitWindow : Float = Options .hitWindow ;
564+ @:noCompletion @:dox (hide ) private var _legacyRating : Rating = {name : " " , window : 0 , accuracy : 0 , score : 0 };
564565
565566 @:noCompletion @:dox (hide ) private var _startCountdownCalled : Bool = false ;
566567 @:noCompletion @:dox (hide ) private var _endSongCalled : Bool = false ;
@@ -1884,48 +1885,48 @@ class PlayState extends MusicBeatState
18841885
18851886 note .wasGoodHit = true ;
18861887
1887- /**
1888- * CALCULATES RATING
1889- */
1890- var noteDiff = Math .abs (Conductor .songPosition - note .strumTime );
1891- var daRating : Rating = ratingManager .judgeNote (noteDiff );
1888+ var noteDiff = Math .abs (Conductor .songPosition - note .strumTime ), rating : Rating ;
1889+ if (! Flags .USE_LEGACY_TIMING ) rating = ratingManager .judgeNote (noteDiff );
1890+ else {
1891+ (rating = _legacyRating ).splash = false ;
1892+ if (noteDiff > hitWindow * 0.9 ) {
1893+ rating .window = hitWindow ;
1894+ rating .name = " shit" ;
1895+ rating .score = 50 ;
1896+ rating .accuracy = 0.25 ;
1897+ }
1898+ else if (noteDiff > hitWindow * 0.75 ) {
1899+ rating .window = hitWindow * 0.9 ;
1900+ rating .name = " bad" ;
1901+ rating .score = 100 ;
1902+ rating .accuracy = 0.45 ;
1903+ }
1904+ else if (noteDiff > hitWindow * 0.2 ) {
1905+ rating .window = hitWindow * 0.75 ;
1906+ rating .name = " good" ;
1907+ rating .score = 200 ;
1908+ rating .accuracy = 0.75 ;
1909+ }
1910+ else {
1911+ rating .window = hitWindow * 0.2 ;
1912+ rating .name = " sick" ;
1913+ rating .score = 300 ;
1914+ rating .accuracy = 1 ;
1915+ rating .splash = true ;
1916+ }
1917+ }
18921918
18931919 var event : NoteHitEvent ;
18941920 if (strumLine != null && ! strumLine .cpu )
1895- 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 , daRating .score , note .isSustainNote ? null : daRating .accuracy , 0.023 , daRating .name , Options .splashesEnabled && ! note .isSustainNote && daRating .splash , 0.5 , true , 0.7 , true , true , iconP1 );
1921+ 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 );
18961922 else
1897- 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 , daRating .name , false , 0.5 , true , 0.7 , true , true , iconP2 );
1923+ 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 );
18981924 event .deleteNote = ! note .isSustainNote ; // work around, to allow sustain notes to be deleted
18991925 event = scripts .event (strumLine != null && ! strumLine .cpu ? " onPlayerHit" : " onDadHit" , event );
19001926 strumLine .onHit .dispatch (event );
19011927 gameAndCharsEvent (" onNoteHit" , event );
19021928
19031929 if (! event .cancelled ) {
1904- if (event .legacyJudge ) {
1905- event .rating = ' sick' ;
1906- event .score = 300 ;
1907- event .accuracy = 1 ;
1908-
1909- if (noteDiff > hitWindow * 0.9 )
1910- {
1911- event .rating = ' shit' ;
1912- event .score = 50 ;
1913- event .accuracy = 0.25 ;
1914- }
1915- else if (noteDiff > hitWindow * 0.75 )
1916- {
1917- event .rating = ' bad' ;
1918- event .score = 100 ;
1919- event .accuracy = 0.45 ;
1920- }
1921- else if (noteDiff > hitWindow * 0.2 )
1922- {
1923- event .rating = ' good' ;
1924- event .score = 200 ;
1925- event .accuracy = 0.75 ;
1926- }
1927- }
1928-
19291930 if (! note .isSustainNote ) {
19301931 if (event .countScore ) songScore + = event .score ;
19311932 if (event .accuracy != null ) {
0 commit comments