diff --git a/webapp/services/FormulaService.php b/webapp/services/FormulaService.php index bab7fece..96d6b0ff 100644 --- a/webapp/services/FormulaService.php +++ b/webapp/services/FormulaService.php @@ -2,6 +2,7 @@ namespace services; +require_once('mt/Item.php'); require_once('mt/FormulaPvp.php'); use mt; @@ -245,7 +246,16 @@ class FormulaService extends BaseService { public static function calcHeroPvpTiliConsume($heroDb) { //ROUND((最大角色体力值-当前剩余体力值)*(PVP角色体力总价值+PVE角色体力总价值)/最大角色体力值,0) - return 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)