cyzhao 1 год назад
Родитель
Сommit
9b9f67308a
2 измененных файлов с 39 добавлено и 11 удалено
  1. 17 1
      Gameserver/App/configs/GameConfig.php
  2. 22 10
      Gameserver/App/process/FightProc.php

+ 17 - 1
Gameserver/App/configs/GameConfig.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2023-08-23 11:52:29
+ // 日期: 2023-08-24 16:38:15
 ////////////////////
 
 namespace loyalsoft;
@@ -479,6 +479,22 @@ class GameConfig {
         return self::get_hash_item('evolve', $itemid);
     }
     /**
+    * 进化功能里的特定磁条信息
+    * @return \evolveSpecific
+    */
+    public static function evolveSpecific()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'evolveSpecific');
+    }
+    /**
+    * @return \sm_evolveSpecific evolveSpecific item数据 
+    */
+    public static function evolveSpecific_getItem($itemid)
+    { 
+        return self::get_hash_item('evolveSpecific', $itemid);
+    }
+    /**
     * 当前版本(时间戳)
     * @return \ver
     */

+ 22 - 10
Gameserver/App/process/FightProc.php

@@ -29,7 +29,7 @@ class FightProc {
                 return FightProc::SelectGate();
             case CmdCode::cmd_fight_gateChallengePriceReviced:                  # 6804 
                 return FightProc::GateChallengePriceReviced();
-            case CmdCode::cmd_fight_evolveUnlock:                               # 6805
+            case CmdCode::cmd_fight_evolveUnlock:                               # 6805进化解锁
                 return FightProc::EvolveUnlock();
             default:
                 Err(ErrCode::cmd_err);
@@ -41,16 +41,28 @@ class FightProc {
      * @return type
      */
     public static function EvolveUnlock() {
-        list($zhangjieId, $gateId) = req()->paras;
-        
-        $mo = GameConfig::gate_challenge_getItem($zhangjieId);
-        my_Assert($mo!=null, ErrCode::err_const_no);
-        
-//        $list = explode(',', $mo->gates);
-//        my_Assert(in_array($gateId,$list), ErrCode::err_const_no);
-        
-        
+        list($type,$id) = req()->paras;
+                      
+        if($type == 1){
+            $mo = GameConfig::evolve_getItem($id);
+            my_Assert($mo!=null, ErrCode::err_const_no);
+            
+            my_Assert(ctx()->baseInfo->gold>=$mo->needGold_unlock, ErrCode::notenough_gold_msg);
+            ctx()->baseInfo->Consume_Gold($mo->needGold_unlock);                              
+        } else {
+            $mo =GameConfig::evolveSpecific_getItem($id);          
+            my_Assert($mo!=null, ErrCode::err_const_no);
+            if($mo->specificEvolveCost != null){
+                $cost = explode(',', $mo->specificEvolveCost);
+                $costId = $cost[0];
+                $costNum = $cost[1];
+                my_Assert(StlUtil::dictHasProperty(ctx()->store->items, $costId) && ctx()->store->items->$costId >= $costNum , ErrCode::notenough_item);               
+            }
+//             my_Assert(ctx()->baseInfo->gold>=$mo->needGold_unlock, ErrCode::notenough_gold_msg);
+        }
         
+        ctx()->gates->evolveUnlockRecord[] = $id;
+                   
         UserProc::updateUserInfo();
         $ret = array(          
             'store' => ctx()->store,