명성 / 계급 계산식을 for loop 없앰

This commit is contained in:
2018-08-06 01:23:39 +09:00
parent acb3b6ac85
commit bb707b4a03
+2 -6
View File
@@ -445,18 +445,14 @@ function getExpLevel($experience) {
if($experience < 1000) { if($experience < 1000) {
$level = intdiv($experience, 100); $level = intdiv($experience, 100);
} else { } else {
for($level = 0; $experience > (($level+1)*($level+1)*10); $level++) { $level = Util::toInt(sqrt($experience/10));
}
} }
return $level; return $level;
} }
function getDedLevel($dedication) { function getDedLevel($dedication) {
for($level = 0; $dedication > (($level+1)*($level+1)*100); $level++) { return Util::toInt(sqrt($dedication/100));
}
return $level;
} }
function expStatus($exp) { function expStatus($exp) {