宝箱开启公式修改
This commit is contained in:
parent
6a8d0d5806
commit
c3ce8b3602
@ -395,26 +395,18 @@ class BagController extends BaseAuthedController {
|
|||||||
// $lucky = Hero::getAccountLucky(myself()->_getAddress());
|
// $lucky = Hero::getAccountLucky(myself()->_getAddress());
|
||||||
$lucky = Hero::getAccountLuckyTemp();
|
$lucky = Hero::getAccountLuckyTemp();
|
||||||
$luckyParam = \mt\Parameter::getVal('economy_account_luck_K',0);
|
$luckyParam = \mt\Parameter::getVal('economy_account_luck_K',0);
|
||||||
$luckyMaxPro = \mt\Parameter::getVal('economy_account_luck_E',0);
|
|
||||||
$prob = $luckyMaxPro * ($lucky / ($lucky+$luckyParam));
|
$rangeArr = explode("|",\mt\Parameter::getVal('economy_account_luck_range',0));
|
||||||
|
$rate = ($rangeArr[1]-$rangeArr[0]) * $lucky/($lucky+$luckyParam) + $rangeArr[0];
|
||||||
|
$rnd = rand() / (mt_getrandmax() + 1);
|
||||||
$items = array();
|
$items = array();
|
||||||
for ($i=0;$i<$itemNum;$i++){
|
if ($rnd <= $rate){
|
||||||
$times = $this->proEffect($prob,1);
|
|
||||||
$itemsTemp = \services\LootService::dropOutItem($itemMeta['loot']);
|
$itemsTemp = \services\LootService::dropOutItem($itemMeta['loot']);
|
||||||
if ($times > 0){
|
|
||||||
foreach ($itemsTemp as $itemTemp){
|
|
||||||
$itemTemp['item_num'] += $itemTemp['item_num']*$times;
|
|
||||||
array_push($items,$itemTemp);
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
foreach ($itemsTemp as $itemTemp){
|
foreach ($itemsTemp as $itemTemp){
|
||||||
array_push($items,$itemTemp);
|
array_push($items,$itemTemp);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
$items = array();
|
$items = array();
|
||||||
for ($i=0;$i<$itemNum;$i++){
|
for ($i=0;$i<$itemNum;$i++){
|
||||||
|
@ -270,21 +270,17 @@ END
|
|||||||
$lootMeta = mt\LootConfig::find($itemMeta['loot']);
|
$lootMeta = mt\LootConfig::find($itemMeta['loot']);
|
||||||
if ($lootMeta['isAffected']){
|
if ($lootMeta['isAffected']){
|
||||||
$luckyParam = \mt\Parameter::getVal('economy_account_luck_K',0);
|
$luckyParam = \mt\Parameter::getVal('economy_account_luck_K',0);
|
||||||
$luckyMaxPro = \mt\Parameter::getVal('economy_account_luck_E',0);
|
$rangeArr = explode("|",\mt\Parameter::getVal('economy_account_luck_range',0));
|
||||||
$prob = $luckyMaxPro * ($lucky / ($lucky+$luckyParam));
|
$rate = ($rangeArr[1]-$rangeArr[0]) * $lucky/($lucky+$luckyParam) + $rangeArr[0];
|
||||||
|
$rnd = rand() / (mt_getrandmax() + 1);
|
||||||
for ($i=0; $i<$itemNum; $i++){
|
for ($i=0; $i<$itemNum; $i++){
|
||||||
$times = $this->proEffect($prob,1);
|
if ($rnd <= $rate){
|
||||||
$temp = array(
|
$items = \services\LootService::dropOutItem($itemMeta['loot']);
|
||||||
"prob" => $prob,
|
|
||||||
"times" => $times
|
|
||||||
);
|
|
||||||
$items = \services\LootService::dropOutItem($itemMeta['loot']);
|
|
||||||
if ($times > 0){
|
|
||||||
foreach ($items as &$item){
|
|
||||||
$item['item_num'] += $item['item_num']*$times;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
array_unshift($items,$temp);
|
array_unshift($items,array(
|
||||||
|
'rnd' => $rnd,
|
||||||
|
'rate' => $rate,
|
||||||
|
));
|
||||||
TGLog::writeToLog("game_2006_api","loot",array(
|
TGLog::writeToLog("game_2006_api","loot",array(
|
||||||
$itemId => $items
|
$itemId => $items
|
||||||
));
|
));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user