cyzhao 1 anno fa
parent
commit
50d2522687

+ 1 - 1
Gameserver/App/model/Const/GameConfig.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-05-10 17:03:56
+ // 日期: 2024-05-11 16:15:33
 ////////////////////
 
 /**

+ 11 - 4
Gameserver/App/model/Const/sm_gate.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-05-08 18:02:56
+ // 日期: 2024-05-11 14:56:02
 ////////////////////
 
 
@@ -112,17 +112,24 @@ class sm_gate
     public $unlockGateId;
 
     /**
-    * @var String 扫荡额外金币  
+    * @var String 扫荡额外金币
+    *  随机货币数量区间,货币类型(取itemId),获取概率
+    *  举例:1000-5000;1:100  
     */
     public $sweep_gold;
 
     /**
-    * @var String 扫荡得到的图纸  
+    * @var String 扫荡得到的图纸:获取道具数量区间;道具图纸ID(取ItemId):概率
+    *  概率总和值为100举例:
+    *  1-3;1002:30,1003,40,1004:30;
+    *    
     */
     public $sweep_tuzhi;
 
     /**
-    * @var String 扫荡得到的宝石  
+    * @var String 扫荡得到的宝石:获取道具数量区间;宝石品质:概率
+    *  概率总和值为100举例:
+    *  1-3;1:30,2,40,3:30;  
     */
     public $sweep_gem;
 

+ 12 - 2
Gameserver/App/model/Const/sm_globalsettings.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-05-10 16:52:52
+ // 日期: 2024-05-11 16:08:14
 ////////////////////
 
 
@@ -59,7 +59,7 @@ class sm_globalsettings
     public $tili_RecoverrMax;
 
     /**
-    * @var string 充值购买任一商品,即可获得如下奖励,仅此一次哦~  
+    * @var string 充值购买任一商品,即可获得如下奖励,仅此一次哦~暂时废弃  
     */
     public $FirstRechargePrice;
 
@@ -143,5 +143,15 @@ class sm_globalsettings
     */
     public $BuyTiliCost;
 
+    /**
+    * @var int 每日扫荡最大次数  
+    */
+    public $sweepMaxNum;
+
+    /**
+    * @var int 扫荡需要体力  
+    */
+    public $sweep_cost_tili;
+
 }
 

+ 1 - 1
Gameserver/App/model/Const/sm_hero.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-05-10 11:02:56
+ // 日期: 2024-05-11 10:32:56
 ////////////////////
 
 

+ 1 - 1
Gameserver/App/model/Const/sm_predicate.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-05-10 14:02:56
+ // 日期: 2024-05-11 10:07:06
 ////////////////////
 
 

+ 1 - 1
Gameserver/App/model/Const/sm_shop_cash.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-04-22 17:07:07
+ // 日期: 2024-05-11 14:32:56
 ////////////////////
 
 

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

@@ -39,9 +39,9 @@ class FightProc {
         //list($gateId) = req()->paras;        
         my_Assert(ctx()->gates->UnlockedGatesMaxId != 0, ErrCode::user_Gate_NoSweep);
         $mo = GameConfig::gate_getItem(ctx()->gates->UnlockedGatesMaxId);
-        $costTili = $mo->sweep_cost_tili;
+        $costTili = glc()->sweep_cost_tili;
         my_Assert(ctx()->baseInfo->tili >= $costTili, ErrCode::notenough_tili);
-        $max = $mo->sweepNum;
+        $max = glc()->sweepMaxNum;
         my_Assert(ctx()->gates->fightSweepNum < $max, ErrCode::user_Gate_SweepMaxNum_limit);
         ctx()->gates->fightSweepNum += 1;
         ctx()->baseInfo->Consume_tili($costTili);
@@ -93,29 +93,29 @@ class FightProc {
     
     static function sweepRandReward($rewardStr) {
         $ctxArr = explode(';', $rewardStr);
+        $numArr = explode('-', $ctxArr[0]);
+        $num = rand($numArr[0],$numArr[1]);
+                      
         $randNum = rand(1,100);
         $start = 0;
         $end = 0;
         
         $res = "";
-        foreach ($ctxArr as $str) {
-            $arr = explode(',', $str);
+        $itemArr = explode(',', $ctxArr[1]);             
+        foreach ($itemArr as $str) {
+            $arr = explode(':', $str);
             $itemId = $arr[1]; 
             $per = $arr[2];
             
             $end += $per;
-            if($randNum >= $start && $randNum < $end){
-                $numArr = explode('-', $arr[0]);
-                $n = rand($numArr[0],$numArr[1]);
-                $res = $itemId.','.$n;
+            if($randNum >= $start && $randNum < $end){             
+                $res = $itemId;
                 break;
             }
-            $start = $end;
-            
-            
+            $start = $end;                     
         }
         
-        return $res;
+        return $res.','.$num;
     }
 
     /**