유틸리티 함수 추가

This commit is contained in:
2018-08-18 16:59:34 +09:00
parent 35a860bb38
commit baa9fdb660
2 changed files with 28 additions and 0 deletions
+20
View File
@@ -2706,6 +2706,19 @@ function CharExperience($exp, $personal) {
return $exp;
}
function getCharExpMultiplier($personal):float{
static $table = [
0 => 1.1,
1 => 1.1,
4 => 0.9,
5 => 0.9,
6 => 1.1,
7 => 0.9,
10 => 0.9
];
return $table[$personal] ?? 1;
}
function CharDedication($ded, $personal) {
switch($personal) {
case 10:
@@ -2716,6 +2729,13 @@ function CharDedication($ded, $personal) {
return $ded;
}
function getCharDedMultiplier($personal):float{
static $table = [
10 => 0.9
];
return $table[$personal] ?? 1;
}
function CharAtmos($atmos, $personal) {
switch($personal) {
case 2: case 4:
+8
View File
@@ -12,6 +12,14 @@ class Util extends \utilphp\util
return intval(round($value));
}
/**
* int 값으로 강제로 설정하는 부동소수점 반올림
* @param int|float $value
*/
public static function setRound(&$value) : void{
$value = static::round($value);
}
private static function _parseReq($value, string $type)
{
if (is_array($value)) {