This commit is contained in:
aozhiwei 2022-05-27 14:45:33 +08:00
parent 7f8550dba5
commit 67e12dc2d6

View File

@ -2,6 +2,7 @@
namespace services;
require_once('mt/Item.php');
require_once('mt/FormulaPvp.php');
use mt;
@ -245,8 +246,17 @@ class FormulaService extends BaseService {
public static function calcHeroPvpTiliConsume($heroDb)
{
//ROUND((最大角色体力值-当前剩余体力值)*(PVP角色体力总价值+PVE角色体力总价值)/最大角色体力值,0)
$heroMeta = mt\Item::get($heroDb['hero_id']);
if (!$heroMeta) {
return 0;
}
$cost = round(
($heroMeta['init_tili'] - $heroDb['hero_tili']) *
(1) /
$heroMeta['init_tili']
);
return $cost;
}
public static function calcWeaponPvpDurabilityConsume($weaponDb)
{