Преглед на файлове

言灵卡模板字段发生变化

cyzhao преди 3 години
родител
ревизия
bdffe9dc10

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

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2022-05-23 16:11:44
+ // 日期: 2022-05-25 15:46:25
 ////////////////////
 
 /**

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

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2022-05-19 10:59:58
+ // 日期: 2022-05-24 15:58:58
 ////////////////////
 
 

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_item_base.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2022-05-18 14:41:06
+ // 日期: 2022-05-25 15:44:20
 ////////////////////
 
 

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_item_taskcard.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2022-04-25 10:58:06
+ // 日期: 2022-05-24 11:15:29
 ////////////////////
 
 

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_item_taskcard_type.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2022-04-25 10:58:06
+ // 日期: 2022-05-24 11:15:29
 ////////////////////
 
 

+ 28 - 3
Gameserver/Amfphp/model/Const/sm_item_yanlingbook.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-12-21 14:42:34
+ // 日期: 2022-05-25 15:44:53
 ////////////////////
 
 
@@ -19,12 +19,27 @@ class sm_item_yanlingbook
     public $typeId;
 
     /**
-    * @var Int32 可以召唤的言灵ID default(0) 
+    * @var Int32 1:指定卡;2:品质固定随机卡;3:品质元素固定随机卡 default(0) 
+    */
+    public $type;
+
+    /**
+    * @var String 用途未知!!请到数据库中添加字段注释。  
+    */
+    public $yanlingPool;
+
+    /**
+    * @var String 用途未知!!请到数据库中添加字段注释。  
+    */
+    public $hunqi;
+
+    /**
+    * @var Int32 可以召唤的言灵ID--废弃  
     */
     public $yanling_id;
 
     /**
-    * @var String 合成召唤书需要的碎片数量: itemid,num default(0) 
+    * @var String 合成召唤书需要的碎片数量: itemid,num--废弃 default(0) 
     */
     public $seg_num;
 
@@ -33,5 +48,15 @@ class sm_item_yanlingbook
     */
     public $cost_materials;
 
+    /**
+    * @var Int32 用途未知!!请到数据库中添加字段注释。 default(0) 
+    */
+    public $costGold;
+
+    /**
+    * @var Int32 弱点类型(元素类型)//0 空的//1 金 //2 冰 //3 火 //4 风 //5 雷 //6 毒 //7 黑暗 //8 亡灵 // 9 物理 default(0) 
+    */
+    public $weekType;
+
 }
 

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_plot.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2022-04-25 10:56:52
+ // 日期: 2022-05-24 11:16:36
 ////////////////////
 
 

+ 50 - 29
Gameserver/Amfphp/process/HeroProc.php

@@ -86,11 +86,12 @@ class HeroProc {
         
         my_Assert(StlUtil::dictHasProperty(ctx()->store, $cardId) , ErrCode::err_const_no);
         
-        $mo = GameConfig::zhaohuanCard_getItem($cardId);
+        $mo = GameConfig::item_yanlingbook_getItem($cardId);
         my_Assert($mo != null, ErrCode::err_const_no);
-        my_Assert(ctx()->baseInfo->gold >= $mo->cost, ErrCode::notenough_gold_msg);     
-        my_Assert(StlUtil::dictHasProperty(ctx()->store->items, $mo->hunqi), ErrCode::err_const_no);
-        $list = explode(';', $mo->material); 
+        my_Assert(ctx()->baseInfo->gold >= $mo->costGold, ErrCode::notenough_gold_msg);     
+        $hunqiList = explode(',', $mo->hunqi);
+        my_Assert(StlUtil::dictHasProperty(ctx()->store->items, $hunqiList[0]), ErrCode::err_const_no);
+        $list = explode(';', $mo->cost_materials); 
        
         foreach ($list as $value) {
             $slist = explode(',',$value);
@@ -99,8 +100,9 @@ class HeroProc {
             my_Assert(StlUtil::dictHasProperty(ctx()->store->items, $id) && ctx()->store->items->$id >= $num , ErrCode::err_const_no);            
         }
         ctx()->store(true)->RemoveItemFromStore($cardId, 1);
-        ctx()->base(true)->Consume_Gold($mo->cost);
-        ctx()->store(true)->RemoveItemFromStore($mo->hunqi, 1);
+        ctx()->base(true)->Consume_Gold($mo->cost);       
+        ctx()->store(true)->RemoveItemFromStore($hunqiList[0],$hunqiList[1]);
+        
         foreach ($list as $value) {
             $slist = explode(',',$value);
             $id = $slist[0];
@@ -109,34 +111,53 @@ class HeroProc {
         }
         
         //1:指定卡;2:品质固定随机卡;3:品质元素固定随机卡
-        switch ($mo->type) {
-            case 1:
-               $yanlingId = $mo->yanlingPool;               
-                break;
-            case 2:
-            case 3:
-                $rList = explode(';', $mo->yanlingPool); 
-                $rand = rand(0,100);
+        $rList = explode(';', $mo->yanlingPool); 
+        $rand = rand(0,100);
                 
-                $start = 0;
-                $end = 0;
-                foreach ($rList as $value) {
-                    $valueList = explode(',', $value);
-                    $end += $valueList[1];
+        $start = 0;
+        $end = 0;
+        $yanlingId =0;
+        foreach ($rList as $value) {
+            $valueList = explode(',', $value);
+            $end += $valueList[1];
                     
-                    if($rand >= $start && $rand < $end){
-                        $yanlingId = $valueList[0];      
-                        break;
-                    }
-                    $start = $end;
-                }
-                
-                
-                break;           
-            default:
+            if($rand >= $start && $rand < $end){
+                $yanlingId = $valueList[0];      
                 break;
+            }
+            $start = $end;
         }
         
+        
+        
+//        switch ($mo->type) {
+//            case 1:
+//               $yanlingId = $mo->yanlingPool;               
+//                break;
+//            case 2:
+//            case 3:
+//                $rList = explode(';', $mo->yanlingPool); 
+//                $rand = rand(0,100);
+//                
+//                $start = 0;
+//                $end = 0;
+//                foreach ($rList as $value) {
+//                    $valueList = explode(',', $value);
+//                    $end += $valueList[1];
+//                    
+//                    if($rand >= $start && $rand < $end){
+//                        $yanlingId = $valueList[0];      
+//                        break;
+//                    }
+//                    $start = $end;
+//                }
+//                
+//                
+//                break;           
+//            default:
+//                break;
+//        }
+        
         $yanling = new Ins_YanLin();
         $yanling->typeId = $yanlingId;
         $cid = ctx()->privateState->currentId++;