diff --git a/webapp/services/FormulaService.php b/webapp/services/FormulaService.php index 166892f6..6ed0a55a 100644 --- a/webapp/services/FormulaService.php +++ b/webapp/services/FormulaService.php @@ -10,12 +10,46 @@ class FormulaService extends BaseService { public static function getHeroPvpDailyCegUpLimit($heroDb) { - return 0; + //ROUND((0.0402*角色NFT阶数^3-0.9459*角色NFT阶数^2+11.9664*角色NFT阶数+4.01892)+(0.0268*角色幸运值^3-2.15712*角色幸运值^2+60.944*角色幸运值-560.24),0)+系统参数 + $sysParam = 0; + $lucky = 0; + $upLimit = round( + ( + 0.0402*pow($heroDb['quality'],3) - + 0.9459*pow($heroDb['quality'],2) + + 11.9664*$heroDb['quality'] + + 4.01892 + ) + + ( + 0.0268*pow($lucky, 3) - + 2.15712*pow($lucky, 2) + + 60.944*$lucky - + 560.24 + ) + ) + $sysParam; + return $upLimit; } public static function getHeroPveDailyCegUpLimit($heroDb) { - return 0; + //ROUND((0.0938*角色NFT阶数^3-2.2071*角色NFT阶数^2+27.9216*角色NFT阶数+9.3776)+(0.0625*角色幸运值^3-5.0334*角色幸运值^2+142.2028*角色幸运值-1307.2268),0)+系统参数 + $sysParam = 0; + $lucky = 0; + $upLimit = round( + ( + 0.0938*pow($heroDb['quality'],3) - + 2.2071*pow($heroDb['quality'],2) + + 27.9216*$heroDb['quality'] + + 9.3776 + ) + + ( + 0.0625*pow($lucky, 3) - + 5.0334*pow($lucky, 2) + + 142.2028*$lucky - + 1307.2268 + ) + ) + $sysParam; + return $upLimit; } public static function calcHeroPvpCeg($heroDb, $params) @@ -49,12 +83,46 @@ class FormulaService extends BaseService { public static function getWeaponPvpDailyCegUpLimit($weaponDb) { - return 0; + //ROUND((0.0111*武器NFT阶数^3-0.25974*武器NFT阶数^2+3.29292*武器NFT阶数+1.3389)+(0.0074*武器幸运值^3-0.59396*武器幸运值^2+16.7708*武器幸运值-153.964),0)+系统参数 + $sysParam = 0; + $lucky = 0; + $upLimit = round( + ( + 0.0111*pow($heroDb['quality'],3) - + 0.25974*pow($heroDb['quality'],2) + + 3.29292*$heroDb['quality'] + + 1.3389 + ) + + ( + 0.0074*pow($lucky, 3) - + 0.59396*pow($lucky, 2) + + 16.7708*$lucky - + 153.964 + ) + ) + $sysParam; + return $upLimit; } public static function getWeaponPveDailyCegUpLimit($weaponDb) { - return 0; + //ROUND((0.0259*武器NFT阶数^3-0.6061*武器NFT阶数^2+7.6836*武器NFT阶数+3.1241)+(0.0174*武器幸运值^3-1.3859*武器幸运值^2+39.132*武器幸运值-359.2493),0)+系统参数 + $sysParam = 0; + $lucky = 0; + $upLimit = round( + ( + 0.0259*pow($heroDb['quality'],3) - + 0.6061*pow($heroDb['quality'],2) + + 7.6836*$heroDb['quality'] + + 3.1241 + ) + + ( + 0.0174*pow($lucky, 3) - + 1.3859*pow($lucky, 2) + + 39.132*$lucky - + 359.2493 + ) + ) + $sysParam; + return $upLimit; } public static function calcWeaponPvpCeg($weaponDb)