This commit is contained in:
hujiabin 2024-04-16 21:26:52 +08:00
parent e478d73cbd
commit 2978e5093f

View File

@ -183,13 +183,15 @@ class RoomBattleDataService extends BaseService {
//算力加成 //算力加成
$currentPeriod= \mt\AchievementsCycle::getCurrentPeriod(); $currentPeriod= \mt\AchievementsCycle::getCurrentPeriod();
$lastCompute = HashRate::getTotalByAccount($userDb['account_id'], $currentPeriod['id'] - 1); if ($currentPeriod){
$currentCompute = HashRate::getTotalByAccount($userDb['account_id'], $currentPeriod['id']); $lastCompute = HashRate::getTotalByAccount($userDb['account_id'], $currentPeriod['id'] - 1);
$s = mt\Parameter::getVal('economy_account_compute_s',0); $currentCompute = HashRate::getTotalByAccount($userDb['account_id'], $currentPeriod['id']);
$totalCompute = $currentCompute + $s * $lastCompute; $s = mt\Parameter::getVal('economy_account_compute_s',0);
$computeParam = mt\Parameter::getVal('economy_account_compute_K',0); $totalCompute = $currentCompute + $s * $lastCompute;
$computeMaxEffect = mt\Parameter::getVal('economy_account_compute_E',0); $computeParam = mt\Parameter::getVal('economy_account_compute_K',0);
$gold = intval( $gold * ($totalCompute / ($totalCompute + $computeParam) * $computeMaxEffect + 1)); $computeMaxEffect = mt\Parameter::getVal('economy_account_compute_E',0);
$gold = intval( $gold * ($totalCompute / ($totalCompute + $computeParam) * $computeMaxEffect + 1));
}
if ($gold > 0){ if ($gold > 0){
array_push($reward,array( array_push($reward,array(
"item_id" => V_ITEM_GOLD, "item_id" => V_ITEM_GOLD,