62 lines
1.7 KiB
PHP
62 lines
1.7 KiB
PHP
|
<?php
|
|||
|
|
|||
|
namespace FightRequest;
|
|||
|
|
|||
|
class FRHelper
|
|||
|
{
|
|||
|
/** <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
|||
|
* @param int $type <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
|||
|
* @param int $userLevel <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
|||
|
* @return object
|
|||
|
*/
|
|||
|
public static function getTeammatesLevel(int $type, int $userLevel): object
|
|||
|
{
|
|||
|
$min = 0;
|
|||
|
$max = 21;
|
|||
|
switch ($type) {
|
|||
|
default:
|
|||
|
break;
|
|||
|
case 1: // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>
|
|||
|
$max = $userLevel;
|
|||
|
break;
|
|||
|
case 2: // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
$max = $userLevel - 1;
|
|||
|
break;
|
|||
|
case 3: // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
$min = $userLevel;
|
|||
|
$max = $userLevel;
|
|||
|
break;
|
|||
|
case 4: // <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> 1 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
$min = $userLevel;
|
|||
|
$max = $userLevel + 1;
|
|||
|
break;
|
|||
|
case 5: // <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> 1 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
$min = $userLevel - 1;
|
|||
|
$max = $userLevel;
|
|||
|
break;
|
|||
|
case 6: // <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> +- 1
|
|||
|
$min = $userLevel - 1;
|
|||
|
$max = $userLevel + 1;
|
|||
|
break;
|
|||
|
}
|
|||
|
return (object)[
|
|||
|
'min'=> $min,
|
|||
|
'max'=> $max,
|
|||
|
];
|
|||
|
}
|
|||
|
|
|||
|
/** <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
|||
|
* @param int $type <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
|||
|
* @param int $userLevel <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
|||
|
* @return object
|
|||
|
*/
|
|||
|
public static function getChaoticTeammatesLevel(int $type, int $userLevel): object
|
|||
|
{
|
|||
|
if (!in_array($type, [3, 6])) {
|
|||
|
$type = 0;
|
|||
|
}
|
|||
|
return self::getTeammatesLevel($type, $userLevel);
|
|||
|
}
|
|||
|
}
|
|||
|
|