add max nps

yeet lmao
This commit is contained in:
Barinade 2021-05-11 18:07:10 -05:00
parent dab9064aa2
commit cd023676a4
2 changed files with 7 additions and 5 deletions

View File

@ -1649,6 +1649,8 @@ class PlayState extends MusicBeatState
private var paused:Bool = false; private var paused:Bool = false;
var startedCountdown:Bool = false; var startedCountdown:Bool = false;
var canPause:Bool = true; var canPause:Bool = true;
var nps:Int = 0;
var maxNPS:Int = 0;
public static var songRate = 1.5; public static var songRate = 1.5;
@ -1732,6 +1734,8 @@ class PlayState extends MusicBeatState
balls--; balls--;
} }
nps = notesHitArray.length; nps = notesHitArray.length;
if (nps > maxNPS)
maxNPS = nps;
} }
if (FlxG.keys.justPressed.NINE) if (FlxG.keys.justPressed.NINE)
@ -1760,7 +1764,7 @@ class PlayState extends MusicBeatState
super.update(elapsed); super.update(elapsed);
scoreTxt.text = Ratings.CalculateRanking(songScore,songScoreDef,nps,accuracy); scoreTxt.text = Ratings.CalculateRanking(songScore,songScoreDef,nps,maxNPS,accuracy);
if (FlxG.keys.justPressed.ENTER && startedCountdown && canPause) if (FlxG.keys.justPressed.ENTER && startedCountdown && canPause)
{ {
persistentUpdate = false; persistentUpdate = false;
@ -3036,8 +3040,6 @@ class PlayState extends MusicBeatState
} }
} }
var nps:Int = 0;
function goodNoteHit(note:Note, resetMashViolation = true):Void function goodNoteHit(note:Note, resetMashViolation = true):Void
{ {

View File

@ -129,10 +129,10 @@ class Ratings
return "sick"; return "sick";
} }
public static function CalculateRanking(score:Int,scoreDef:Int,nps:Int,accuracy:Float):String public static function CalculateRanking(score:Int,scoreDef:Int,nps:Int,maxNPS:Int,accuracy:Float):String
{ {
return return
(FlxG.save.data.npsDisplay ? "NPS: " + nps + (!FlxG.save.data.botplay ? " | " : "") : "") + (!FlxG.save.data.botplay ? // NPS Toggle (FlxG.save.data.npsDisplay ? "NPS: " + nps + " (Max " + maxNPS + ")" + (!FlxG.save.data.botplay ? " | " : "") : "") + (!FlxG.save.data.botplay ? // NPS Toggle
"Score:" + (Conductor.safeFrames != 10 ? score + " (" + scoreDef + ")" : "" + score) + // Score "Score:" + (Conductor.safeFrames != 10 ? score + " (" + scoreDef + ")" : "" + score) + // Score
" | Combo Breaks:" + PlayState.misses + // Misses/Combo Breaks " | Combo Breaks:" + PlayState.misses + // Misses/Combo Breaks
" | Accuracy:" + (FlxG.save.data.botplay ? "N/A" : HelperFunctions.truncateFloat(accuracy, 2) + " %") + // Accuracy " | Accuracy:" + (FlxG.save.data.botplay ? "N/A" : HelperFunctions.truncateFloat(accuracy, 2) + " %") + // Accuracy