-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathRatings.hx
151 lines (131 loc) · 5.31 KB
/
Ratings.hx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
import flixel.FlxG;
class Ratings
{
public static function GenerateLetterRank(accuracy:Float) // generate a letter ranking
{
var ranking:String = "N/A";
if(FlxG.save.data.botplay && !PlayState.loadRep)
ranking = "BotPlay";
if (PlayState.misses == 0 && PlayState.bads == 0 && PlayState.shits == 0 && PlayState.goods == 0) // Marvelous (SICK) Full Combo
ranking = "(MFC)";
else if (PlayState.misses == 0 && PlayState.bads == 0 && PlayState.shits == 0 && PlayState.goods >= 1) // Good Full Combo (Nothing but Goods & Sicks)
ranking = "(GFC)";
else if (PlayState.misses == 0) // Regular FC
ranking = "(FC)";
else if (PlayState.misses < 10) // Single Digit Combo Breaks
ranking = "(SDCB)";
else
ranking = "(Clear)";
// WIFE TIME :)))) (based on Wife3)
var wifeConditions:Array<Bool> = [
accuracy >= 99.9935, // AAAAA
accuracy >= 99.980, // AAAA:
accuracy >= 99.970, // AAAA.
accuracy >= 99.955, // AAAA
accuracy >= 99.90, // AAA:
accuracy >= 99.80, // AAA.
accuracy >= 99.70, // AAA
accuracy >= 99, // AA:
accuracy >= 96.50, // AA.
accuracy >= 93, // AA
accuracy >= 90, // A:
accuracy >= 85, // A.
accuracy >= 80, // A
accuracy >= 70, // B
accuracy >= 60, // C
accuracy < 60 // D
];
for(i in 0...wifeConditions.length)
{
var b = wifeConditions[i];
if (b)
{
switch(i)
{
case 0:
ranking += " AAAAA";
case 1:
ranking += " AAAA:";
case 2:
ranking += " AAAA.";
case 3:
ranking += " AAAA";
case 4:
ranking += " AAA:";
case 5:
ranking += " AAA.";
case 6:
ranking += " AAA";
case 7:
ranking += " AA:";
case 8:
ranking += " AA.";
case 9:
ranking += " AA";
case 10:
ranking += " A:";
case 11:
ranking += " A.";
case 12:
ranking += " A";
case 13:
ranking += " B";
case 14:
ranking += " C";
case 15:
ranking += " D";
}
break;
}
}
if (accuracy == 0)
ranking = "N/A";
else if(FlxG.save.data.botplay && !PlayState.loadRep)
ranking = "BotPlay";
return ranking;
}
public static function CalculateRating(noteDiff:Float, ?customSafeZone:Float):String // Generate a judgement through some timing shit
{
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 :(
// trace('Hit Info\nDifference: ' + noteDiff + '\nZone: ' + Conductor.safeZoneOffset * 1.5 + "\nTS: " + customTimeScale + "\nLate: " + 155 * customTimeScale);
if (FlxG.save.data.botplay && !PlayState.loadRep)
return "sick"; // FUNNY
var rating = checkRating(noteDiff,customTimeScale);
return rating;
}
public static function checkRating(ms:Float, ts:Float)
{
var rating = "sick";
if (ms <= 166 * ts && ms >= 135 * ts)
rating = "shit";
if (ms < 135 * ts && ms >= 90 * ts)
rating = "bad";
if (ms < 90 * ts && ms >= 45 * ts)
rating = "good";
if (ms < 45 * ts && ms >= -45 * ts)
rating = "sick";
if (ms > -90 * ts && ms <= -45 * ts)
rating = "good";
if (ms > -135 * ts && ms <= -90 * ts)
rating = "bad";
if (ms > -166 * ts && ms <= -135 * ts)
rating = "shit";
return rating;
}
public static function CalculateRanking(score:Int,scoreDef:Int,nps:Int,maxNPS:Int,accuracy:Float):String
{
return
(FlxG.save.data.npsDisplay ? // NPS Toggle
"NPS: " + nps + " (Max " + maxNPS + ")" + (!PlayStateChangeables.botPlay || PlayState.loadRep ? " | " : "") : "") + // NPS
(!PlayStateChangeables.botPlay || PlayState.loadRep ? "Score:" + (Conductor.safeFrames != 10 ? score + " (" + scoreDef + ")" : "" + score) + // Score
(FlxG.save.data.accuracyDisplay ? // Accuracy Toggle
" | Combo Breaks:" + PlayState.misses + // Misses/Combo Breaks
" | Accuracy:" + (PlayStateChangeables.botPlay && !PlayState.loadRep ? "N/A" : HelperFunctions.truncateFloat(accuracy, 2) + " %") + // Accuracy
" | " + GenerateLetterRank(accuracy) : "") : ""); // Letter Rank
}
}