This commit is contained in:
hujiabin 2024-06-18 14:38:56 +08:00
parent 1957cf1271
commit 303f25ebd7

View File

@ -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,
)
));