From 303f25ebd7e7bd81b905e7aa7772ef796c6cddab Mon Sep 17 00:00:00 2001 From: hujiabin <519660157@qq.com> Date: Tue, 18 Jun 2024 14:38:56 +0800 Subject: [PATCH] 1 --- webapp/services/RoomBattleDataService.php | 25 +++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/webapp/services/RoomBattleDataService.php b/webapp/services/RoomBattleDataService.php index af218dd1..440d57a4 100644 --- a/webapp/services/RoomBattleDataService.php +++ b/webapp/services/RoomBattleDataService.php @@ -47,6 +47,7 @@ class RoomBattleDataService extends BaseService { public function settlementReward(){ + error_log('settlementReward1'); $realUserNum = 0; $myTeamScore = 0; foreach ($this->teamData['members'] as $member){ @@ -159,6 +160,7 @@ class RoomBattleDataService extends BaseService { } public function _getBattleRewards($userDb,$heroDb,$battleScore,$teamScoreAvg,$teamScore,&$reward){ + error_log('settlementReward : _getBattleRewards'); $mapModeMeta = mt\MapMode::findByMapMode($this->mapMode); $teamRank = getXVal($this->teamData,'pvp_team_rank', 0); if ($mapModeMeta){ @@ -175,7 +177,12 @@ class RoomBattleDataService extends BaseService { $heroMeta = \mt\Item::get($heroDb['hero_id']); $heroAtteMeta = mt\EconomyAttribute::findByGrade($heroMeta['relationship'],$heroDb['quality']); $heroTimesMax = $heroAtteMeta['roundPerDay']; - + error_log("Condition:".json_encode(array( + 'account' => $userDb['account_id'], + 'heroBattleTimes' => $heroTimes, + 'goldModeTimes' => $goldModeTimes, + 'validTimeBool' => Hero::verifyValid($heroDb) ? 1:0 + ))); //金币模式检验 if ($this->mapMode == mt\MapMode::GOLD_MODE && // ($goldModeTimes >= $mapModeMeta['rewards_max_time'] )){ @@ -208,14 +215,15 @@ class RoomBattleDataService extends BaseService { $gold = floor($gold * $this->realUserCount * $coefficient * ($battleScore / $teamScore)); } } - //基础金币获得 - $baseValue = $gold; //财富值加成 $wealthK = mt\Parameter::getVal('economy_hero_wealth_K',0); $wealthE = mt\Parameter::getVal('economy_hero_wealth_E',0); - $gold = floor( $gold * (1 + $wealthE * (Hero::getHeroWealth($heroDb) / (Hero::getHeroWealth($heroDb) + $wealthK)))); - $wealthValue = $gold - $baseValue; + $wealthRate = $wealthE * (Hero::getHeroWealth($heroDb) / (Hero::getHeroWealth($heroDb) + $wealthK)); + $gold = floor( $gold * (1 + $wealthRate)); +// $wealthValue = round($wealthRate,4); + //基础金币获得 + $baseValue = $gold; //算力加成 $currentPeriod= \mt\AchievementsCycle::getCurrentPeriod(); @@ -226,10 +234,11 @@ class RoomBattleDataService extends BaseService { $totalCompute = $currentCompute + $s * $lastCompute; $computeParam = mt\Parameter::getVal('economy_account_compute_K',0); $computeMaxEffect = mt\Parameter::getVal('economy_account_compute_E',0); - $gold = floor($gold * ($totalCompute / ($totalCompute + $computeParam) * $computeMaxEffect + 1)); + $powerRate = $totalCompute / ($totalCompute + $computeParam) * $computeMaxEffect; + $gold = floor($gold * ($powerRate + 1)); $compute = ($totalCompute / ($totalCompute + $computeParam) * $computeMaxEffect + 1); - $hashRateValue = $gold - $baseValue - $wealthValue; + $hashRateValue = round($powerRate,4); } if ($userDb['account_id'] == "6517_2006_s1_0_104162729566475397176"){ error_log("BattleGoldRecord:".json_encode(array( @@ -259,7 +268,7 @@ class RoomBattleDataService extends BaseService { "item_num" => floor($gold), "details" => array( 'baseValue' => $baseValue, - 'wealthValue' => $wealthValue, +// 'wealthValue' => $wealthValue, 'hashRateValue' => isset($hashRateValue) ? $hashRateValue : 0, ) ));