Kade-Engine/source/Ratings.hx
2021-04-04 18:08:19 -07:00

30 lines
971 B
Haxe

class Ratings
{
public static function CalculateRating(noteDiff:Float, ?customSafeZone:Float):String
{
var customTimeScale = Conductor.timeScale;
if (customSafeZone != null)
customTimeScale = customSafeZone / 166;
// trace(customTimeScale + ' vs ' + Conductor.timeScale);
// I HATE THIS IF CONDITION
// IF LEMON SEES THIS I'M SORRY :(
if (noteDiff > 135 * customTimeScale) // way early
return "shit";
else if (noteDiff > 90 * customTimeScale) // early
return "bad";
else if (noteDiff > 45 * customTimeScale) // your kinda there
return "good";
else if (noteDiff < -45 * customTimeScale) // little late
return "good";
else if (noteDiff < -90 * customTimeScale) // late
return "bad";
else if (noteDiff < -135 * customTimeScale) // late as fuck
return "shit";
return "sick";
}
}