From c2429b1fc3440bab230ffefb132d5d3b78709b61 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sat, 17 Sep 2022 16:04:23 +0800 Subject: [PATCH] 1 --- webapp/services/BattleDataService.php | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/webapp/services/BattleDataService.php b/webapp/services/BattleDataService.php index 7ff5c022..57384ced 100644 --- a/webapp/services/BattleDataService.php +++ b/webapp/services/BattleDataService.php @@ -471,8 +471,30 @@ class BattleDataService extends BaseService { $onlineNum = $this->getOnlineNumber(); - $heroProbability = min($heroFragment[$now].total / $onlineNum * 5 * ($instanceRankRate + $bossReward*0.2) * pow(2, $todayPveBattleTimes - $todayPveGetFragmentNum -1), 1); - $gunProbability = min($gunFragment[$now].total / $onlineNum * $dropRate * ($instanceRankRate + $bossReward*0.2) * pow(2, $todayPveBattleTimes - $todayPveGetFragmentNum -1), 1); + $rankedTopX= getXVal($params, 'ranked_topx'); + $meta = mt\FormulaPvp::getByRanked($rankedTopX); + if (!$meta) { + return; + } + + $heroProbability = min($heroFragment[$now].total / $onlineNum * + 5 * + ( + 0.5*$meta['ranked_topx'] + + 0.25*$meta['kills_topx'] + + 0.15*$meta['hero_topx'] + + 0.05*$meta['weapon_topx'] + ) * + pow(2, ($todayPvpBattleTimes % 10) - 1), 1); + $gunProbability = min($gunFragment[$now].total / $onlineNum * + 5 * + ( + 0.5*$meta['ranked_topx'] + + 0.25*$meta['kills_topx'] + + 0.15*$meta['hero_topx'] + + 0.05*$meta['weapon_topx'] + ) * + pow(2, ($todayPvpBattleTimes % 10) - 1), 1); $heroProbability = max($heroProbability, 0); $gunProbability = max($gunProbability, 0);