diff --git a/webapp/services/BattleDataService.php b/webapp/services/BattleDataService.php index 526b5714..76174ddc 100644 --- a/webapp/services/BattleDataService.php +++ b/webapp/services/BattleDataService.php @@ -517,9 +517,6 @@ class BattleDataService extends BaseService { $onlineNum, $gunFragmentNum, $todayPvpBattleTimes); - - $heroProbability = max($heroProbability, 0); - $gunProbability = max($gunProbability, 0); $emptyProbability = max(1 - $heroProbability - $gunProbability, 0); $dropIdx = $this->randWeight(array($heroProbability, $gunProbability, $emptyProbability)); diff --git a/webapp/services/FormulaService.php b/webapp/services/FormulaService.php index 8fc161f5..7d01a6cd 100644 --- a/webapp/services/FormulaService.php +++ b/webapp/services/FormulaService.php @@ -118,7 +118,7 @@ class FormulaService extends BaseService { 0.05 * $weaponTopX * $meta['weapon_topx'] ) * pow(2, ($todayPvpBattleTimes % 10) - 1), 1); - return $heroProbability; + return max(0, $heroProbability); } public static function calcWeaponFragmentProbabilityPvp($params, @@ -135,15 +135,15 @@ class FormulaService extends BaseService { return 0; } $weaponProbability = min($FragmentNum / $onlineNum * - 5 * - ( - 0.5 * $rankedTopX * $meta['ranked_topx'] + - 0.25 * $killsTopX * $meta['kills_topx'] + - 0.15 * $heroTopX * $meta['hero_topx'] + - 0.05 * $weaponTopX * $meta['weapon_topx'] - ) * - pow(2, ($todayPvpBattleTimes % 10) - 1), 1); - return $weaponProbability; + 5 * + ( + 0.5 * $rankedTopX * $meta['ranked_topx'] + + 0.25 * $killsTopX * $meta['kills_topx'] + + 0.15 * $heroTopX * $meta['hero_topx'] + + 0.05 * $weaponTopX * $meta['weapon_topx'] + ) * + pow(2, ($todayPvpBattleTimes % 10) - 1), 1); + return max(0, $weaponProbability); } public static function getHeroPvpTiliTotalValue($heroDb)