cyzhao 4 年之前
父节点
当前提交
4465ac2299
共有 2 个文件被更改,包括 16 次插入11 次删除
  1. 3 4
      Gameserver/Amfphp/model/User/Ins_YanLin.php
  2. 13 7
      Gameserver/Amfphp/process/HeroProc.php

+ 3 - 4
Gameserver/Amfphp/model/User/Ins_YanLin.php

@@ -30,13 +30,13 @@ class Ins_YanLin {
      * 当前的经验
      * @var type
      */
-    public $curExp = 0;
+    public $curStarExp = 0;
     
     /**
      * 当前的星级
      * @var type
      */
-    public $star = 0;
+    public $starLv = 0;
     
     /**
      * 言灵的等级
@@ -48,7 +48,6 @@ class Ins_YanLin {
         parent::__construct($args);       
     }
     
-    public function initialize($missId) {
-        $this->missCardId = $missId;
+    public function initialize($missId) {       
     }
 }

+ 13 - 7
Gameserver/Amfphp/process/HeroProc.php

@@ -968,11 +968,17 @@ class HeroProc {
    
         $store = $req->userInfo->game->store;
         if(!StlUtil::dictHasProperty($store->yanling,$yanlingUid)){
-            return Resp::err(ErrCode::hero_yanling_notfound);;
+            return Resp::err(ErrCode::hero_yanling_notfound);
         }
         $tag = true;
         foreach ($uidList as $costUid) {
-            if(!StlUtil::dictHasProperty($store->yanling,$costUid)){//校验是否是同类型
+            if(StlUtil::dictHasProperty($store->yanling,$costUid)){//校验是否是同类型
+                $confDic = GameConfig::item_yanling_getItem($costUid);
+                if($confDic->type != GameConfig::item_yanling_getItem($yanlingUid)->type){
+                    $tag = false;
+                    break;
+                }                
+            } else {
                 $tag = false;
                 break;
             }
@@ -990,14 +996,14 @@ class HeroProc {
             StlUtil::dictRemove($store->yanling, $costuid);
         }
         
-        $store->yanling->$yanlingUid->curExp += $exp;
+        $store->yanling->$yanlingUid->curStarExp += $exp;
         $dic = GameConfig::item_yanling_getItem($store->yanling->$yanlingUid->typeId);
         
-        if($store->yanling->$yanlingUid->curExp >= $dic->maxStarExp){
-            $store->yanling->$yanlingUid->curExp = 0;
-            $store->yanling->$yanlingUid->star += 1;
+        if($store->yanling->$yanlingUid->curStarExp >= $dic->maxStarExp){
+            $store->yanling->$yanlingUid->curStarExp = 0;
+            $store->yanling->$yanlingUid->starLv += 1;
             if($dic->nextId = 0){
-                $store->yanling->$yanlingUid->star = 5;
+                $store->yanling->$yanlingUid->starLv = 5;
             }
         }