cyzhao пре 1 година
родитељ
комит
0c3b7999cf

+ 4 - 0
Gameserver/App/base/CmdCode.php

@@ -196,6 +196,10 @@ class CmdCode {
      */
     const store_allEquipUpgrade = 6412;
 
+    /**
+     * 洗练
+     */
+    const store_gemXiLian = 6413;
     // </editor-fold>
     // <editor-fold defaultstate="collapsed" desc="商城操作码 - 65xx">
 

+ 4 - 0
Gameserver/App/base/ErrCode.php

@@ -393,6 +393,10 @@ class ErrCode {
      * 前端给的宝石存在不能合成的宝石
      */
     const user_store_GemCanotCompose = 3306;
+    
+    const user_store_NotExistGem = 3307;
+    
+    const user_store_GemNotXilian = 3308;
 // </editor-fold>
 //
     

+ 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-08 17:28:30
+ // 日期: 2024-05-09 16:57:17
 ////////////////////
 
 /**

+ 1 - 1
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 17:28:11
+ // 日期: 2024-05-08 18:02:56
 ////////////////////
 
 

+ 6 - 1
Gameserver/App/model/Const/sm_globalsettings.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-04-22 17:07:06
+ // 日期: 2024-05-09 16:56:50
 ////////////////////
 
 
@@ -118,5 +118,10 @@ class sm_globalsettings
     */
     public $GemQualName;
 
+    /**
+    * @var string   
+    */
+    public $GemQualNeedXILianStone;
+
 }
 

+ 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-08 16:32:56
+ // 日期: 2024-05-09 16:31:46
 ////////////////////
 
 

+ 6 - 0
Gameserver/App/model/User/Info_UserBase.php

@@ -107,6 +107,12 @@ class Info_UserBase extends Object_ext {
      * @var type
      */
     public $fRechargePriceReceived = 0;
+    
+    /**
+     * 洗练石
+     * @var type
+     */
+    public $xilianStone = 0;
 
     public function initialize() {
 //        my_Assert(GameConfig::primordial_data(), "找不到账号初始化数据");         # 防御

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

@@ -44,7 +44,7 @@ class FightProc {
         $max = $mo->sweepNum;
         my_Assert(ctx()->gates->fightSweepNum < $max, ErrCode::user_Gate_SweepMaxNum_limit);
         ctx()->gates->fightSweepNum += 1;
-        
+        ctx()->baseInfo->Consume_tili($costTili);
         $prizeArr = array();
         $prizeArr[] = $mo->reward_win;
         if($mo->sweep_gold != null){

+ 53 - 1
Gameserver/App/process/StoreProc.php

@@ -44,11 +44,63 @@ class StoreProc {
                 return StoreProc::removeNewGemTip();
             case CmdCode::store_allEquipUpgrade:                                # 6412 所有装备的一键升级
                 return StoreProc::allEquipUpgrade();
+            case CmdCode::store_gemXiLian:                                      # 6413 洗练
+                return StoreProc::gemXiLian();
             default:
                 Err(ErrCode::cmd_err);
         }
     }
-
+    
+    /**
+     * 洗练
+     * @return Resp
+     */
+    public static function gemXiLian() {
+        list($uid) = req()->paras;
+          
+        //把 qual pos u一样的宝石开锁关锁
+        $gemStore = ctx()->store->gemStore;
+        my_Assert(StlUtil::dictHasProperty($gemStore, $uid), ErrCode::user_store_NotExistGem);
+        
+        $gem = new Ins_Gem($gemStore->$uid);
+        my_Assert($gem->mo()->qual >= 5, ErrCode::user_store_GemNotXilian);
+        
+        $arr = explode(';', glc()->GemQualNeedXILianStone); 
+        $needStone = 0;
+        foreach ($arr as $val) {
+            $str = explode(':', $val);
+            if($str[0] == $gem->mo()->qual){
+                $needStone = $str[1];
+                break;
+            }
+        }
+        
+        my_Assert(ctx()->baseInfo->xilianStone >= $needStone, ErrCode::user_store_GemNotXilian);
+ 
+        $dic = GameConfig::predicate();
+        $pList = array();
+        foreach ($dic as $id => $pMo) {
+            if($pMo->positions != null){
+                $list = explode(',',$pMo->positions);
+                if($pMo->id != $gem->predicateId && $pMo->qual == $gem->mo()->qual && in_array($gem->mo()->position, $list)){
+                    $pList[] = $pMo->id;
+                }
+            }                    
+        }
+        
+        $rand = random_int(0, count($list)-1);
+        $pId = $list[$rand]; 
+        ctx()->store->gemStore->$uid->predicateId = $pId;     
+        
+        ctx()->baseInfo->xilianStone -= $needStone;
+        
+        UserProc::updateUserInfo();
+        return Resp::ok(array(
+                    'xilianStone' => ctx()->baseInfo->xilianStone,
+                    'predicateId' => $pId,
+        ));
+    }
+    
     /**
      * 宝石开锁解锁
      * @return Resp