浏览代码

扫荡图纸奖励计算bug修改

cyzhao 11 月之前
父节点
当前提交
c8ab76a6dd
共有 1 个文件被更改,包括 12 次插入12 次删除
  1. 12 12
      Gameserver/App/process/FightProc.php

+ 12 - 12
Gameserver/App/process/FightProc.php

@@ -68,14 +68,14 @@ class FightProc {
         $mo = GameConfig::gate_getItem($passGateId);
         $mo = GameConfig::gate_getItem($passGateId);
         $gateName = $mo->gateName;
         $gateName = $mo->gateName;
         $costTili = glc()->sweep_cost_tili;
         $costTili = glc()->sweep_cost_tili;
-        $curTili =  ctx()->baseInfo->CurTili();       
+        $curTili = ctx()->baseInfo->CurTili();
         my_Assert($curTili >= $costTili, ErrCode::notenough_tili);
         my_Assert($curTili >= $costTili, ErrCode::notenough_tili);
         $max = glc()->sweepMaxNum;
         $max = glc()->sweepMaxNum;
         my_Assert(ctx()->gates->fightSweepNum < $max, ErrCode::gate_SweepMaxNum_limit);
         my_Assert(ctx()->gates->fightSweepNum < $max, ErrCode::gate_SweepMaxNum_limit);
         ctx()->gates->fightSweepNum += 1;
         ctx()->gates->fightSweepNum += 1;
         ctx()->baseInfo->Consume_tili($costTili);
         ctx()->baseInfo->Consume_tili($costTili);
         $prizeArr = array();
         $prizeArr = array();
-      
+
         $wavesArr = GameConfig::waves_getItemArray($passGateId);
         $wavesArr = GameConfig::waves_getItemArray($passGateId);
         $count = count($wavesArr);
         $count = count($wavesArr);
         $wavesMo = $wavesArr[$count - 1];
         $wavesMo = $wavesArr[$count - 1];
@@ -91,7 +91,6 @@ class FightProc {
         if ($wavesMo->rewardTuZhi != null) {
         if ($wavesMo->rewardTuZhi != null) {
             $tuzhi = explode('-', $wavesMo->rewardTuZhi);
             $tuzhi = explode('-', $wavesMo->rewardTuZhi);
             $n = rand($tuzhi[0], $tuzhi[1]);
             $n = rand($tuzhi[0], $tuzhi[1]);
-
             $tuzhiArr = array();
             $tuzhiArr = array();
             $item = GameConfig::item();
             $item = GameConfig::item();
             foreach ($item as $id => $mo) {
             foreach ($item as $id => $mo) {
@@ -99,12 +98,13 @@ class FightProc {
                     $tuzhiArr[] = $id;
                     $tuzhiArr[] = $id;
                 }
                 }
             }
             }
-
-            $index = rand(0, count($tuzhiArr) - 1);
-            $goodsStr = $tuzhiArr[$index] . ',' . $n;
-
-            $prizeArr[] = $goodsStr;
-            StoreProc::AddMultiItemInStore($goodsStr);
+            for ($i = 0; $i < $n; $i++) {
+                $index = rand(0, count($tuzhiArr) - 1);
+                $goodsStr = $tuzhiArr[$index] . ',' . 1;
+                $prizeArr[] = $goodsStr;
+                StoreProc::AddMultiItemInStore($goodsStr);
+            }                    
+            
         }
         }
 
 
         if ($wavesMo->rewardGem != null) {
         if ($wavesMo->rewardGem != null) {
@@ -118,7 +118,7 @@ class FightProc {
                 foreach ($dic as $key => $gemMo) {
                 foreach ($dic as $key => $gemMo) {
                     if ($gemMo->qual == $qual && $gemMo->position == $posId) {
                     if ($gemMo->qual == $qual && $gemMo->position == $posId) {
                         $prizeArr[] = $gemMo->typeId . ',' . $list[1];
                         $prizeArr[] = $gemMo->typeId . ',' . $list[1];
-                        
+
                         SystemProc::GetGem_GreaterOrangeQual_SweepMainGateIndex(req()->zoneid, ctx()->baseInfo->name, Ins_GateInfo::gateNum($passGateId), $gateName, $gemMo->typeId);
                         SystemProc::GetGem_GreaterOrangeQual_SweepMainGateIndex(req()->zoneid, ctx()->baseInfo->name, Ins_GateInfo::gateNum($passGateId), $gateName, $gemMo->typeId);
                         StoreProc::PutGemInStore($gemMo->typeId, $list[1]);
                         StoreProc::PutGemInStore($gemMo->typeId, $list[1]);
                         break;
                         break;
@@ -438,7 +438,7 @@ class FightProc {
                 ctx()->gates->GateList->$gateId->pass = 1;
                 ctx()->gates->GateList->$gateId->pass = 1;
                 TaskProc::Day7TaskReset($gateId);                               # 刷新七日任务
                 TaskProc::Day7TaskReset($gateId);                               # 刷新七日任务
                 $maxGateId = ctx()->gates->maxPassGateNumId();
                 $maxGateId = ctx()->gates->maxPassGateNumId();
-                
+
                 if ($maxGateId > 0) {
                 if ($maxGateId > 0) {
                     self::Ranking_MainGateIndex($maxGateId);
                     self::Ranking_MainGateIndex($maxGateId);
                     self::IsAchievedMainGate_PassReward($maxGateId);
                     self::IsAchievedMainGate_PassReward($maxGateId);
@@ -496,7 +496,7 @@ class FightProc {
                 foreach ($pool as $item) {
                 foreach ($pool as $item) {
                     if ($r <= ($l + $item['p'])) {
                     if ($r <= ($l + $item['p'])) {
                         $gemId = $item['q'] * 100000 + rand(1, 6) * 1000;
                         $gemId = $item['q'] * 100000 + rand(1, 6) * 1000;
-                        SystemProc::GetGem_GreaterOrangeQual_MainGate(req()->zoneid, ctx()->baseInfo->name,Ins_GateInfo::gateNum($gateId), $gateMo->gateName, $gemId);//广播
+                        SystemProc::GetGem_GreaterOrangeQual_MainGate(req()->zoneid, ctx()->baseInfo->name, Ins_GateInfo::gateNum($gateId), $gateMo->gateName, $gemId); //广播
                         StoreProc::PutGemInStore($gemId);                       # 发放宝石并退出本次投色子
                         StoreProc::PutGemInStore($gemId);                       # 发放宝石并退出本次投色子
                         $pickups .= ";$gemId,1";
                         $pickups .= ";$gemId,1";
                         break;
                         break;