cyzhao 3 年之前
父節點
當前提交
5407d34314

+ 14 - 9
Gameserver/Amfphp/model/User/Info_College.php

@@ -195,7 +195,7 @@ class Info_College extends Object_ext{
      * 根据天 初始化
      * @return type
      */
-    public function initTaskCard() {
+    public function initTaskCard() {          
         if($this->funUnluckTs == 0){
            return;
         }
@@ -203,17 +203,20 @@ class Info_College extends Object_ext{
         $day = TimeUtil::tsDay($this->funUnluckTs);
         $curDay = TimeUtil::tsDay(time());
         $num = $curDay - $day;
-               
-        $college = GameConfig::college();
+
+        $collegeMo = GameConfig::college();       
+        $college = (array)$collegeMo;
+        ksort($college);
+        
         $index = 0;
         foreach ($college as $collegeId => $collegeMo) {
             $courseArr = explode(',',$collegeMo->cList);
-
+         
             if(!StlUtil::dictHasProperty($this->ingTaskCardDic, $collegeId)){
                 $this->ingTaskCardDic->$collegeId = new \stdClass();
             }
             $collegeDic = $this->ingTaskCardDic->$collegeId;
-            foreach ($courseArr as $courseId) {                
+            foreach ($courseArr as $courseId) {                            
                 if(!StlUtil::dictHasProperty($collegeDic, $courseId)){
                     $mo= GameConfig::course_getItem($courseId);
                     $arr = explode(',',$mo->misslist);
@@ -221,10 +224,10 @@ class Info_College extends Object_ext{
                     foreach ($arr as $cardId) {
                         $item = new ins_missCourseItem();        
                         $item->initialize($cardId);         
-                            
+                       
                         $cid = StoreProc::PutTaskCardInStore($cardId);                      // 存入背包
                         NormalEventProc::OnTaskCard_Actived($cid, null);                        # 带入事件
-                
+                          
                         $item->indexId = $cid;
                         $taskCard = new Ins_TaskCard(req()->userInfo->game->store->taskcards->$cid);# 任务卡对象
                         $taskCard->state = Enum_TaskCardStateType::ing;
@@ -250,13 +253,15 @@ class Info_College extends Object_ext{
                     $collegeDic->$courseId = $dic;
                 }
                 $this->ingTaskCardDic->$collegeId = $collegeDic;   
-                if($index >= $num){
+                if($index >= $num){                    
                     break 2;
                 }
                 $index += 1;  
             }
         } 
-        req()->userInfo->game->college->ingTaskCardDic = $this->ingTaskCardDic;  
+        req()->userInfo->game->college->ingTaskCardDic = $this->ingTaskCardDic; 
+        
+        //--------------------
         //$courseDic = GameConfig::course();
 //        $index = 0;
 //        foreach ($courseDic as $courseId => $mo) {

+ 9 - 0
Gameserver/Amfphp/model/User/Ins_TaskStep.php

@@ -88,6 +88,11 @@ class Ins_TaskStep extends Object_ext {
                     if (!empty($plot->presentItem)) {
                         if (strtolower($plot->presentItem) == strtolower("unlockBuild")) { # 特殊处理, 剧情中解锁建筑
                             req()->userInfo->game->privateState->unlockedBuild[] = $plot->presentEffect;
+                            if($plot->presentEffect == 1000){
+                                $college = new Info_College();
+                                $college->setFunUnluckTs();                              
+                            }
+                            
                         } else if (strtolower($plot->presentItem) == strtolower("rename")) {
                             // 跳过特殊字符串
                         } else {
@@ -103,6 +108,10 @@ class Ins_TaskStep extends Object_ext {
                 break;
             case Enum_EventActionType::UnlockBuild:                             # 解锁建筑
                 req()->userInfo->game->privateState->unlockedBuild[] = $act->parameters;
+                if($act->parameters == 1000){
+                    $college = new Info_College();
+                    $college->setFunUnluckTs();                              
+                }
                 break;
         }
     }

+ 5 - 0
Gameserver/Amfphp/process/EventProc.php

@@ -76,6 +76,11 @@ class EventProc {
             if (!in_array($id, $ubs)) {                                         # 尚未解锁的建筑,判断,已解锁的跳过
                 if ($b->playerLevelLimit <= $new) {                             # 符合解锁条件
                     req()->userInfo->game->privateState->unlockedBuild[] = $id; # 插入解锁记录
+                    
+                    if($id == 1000){
+                        $college = new Info_College();
+                        $college->setFunUnluckTs();                              
+                    }
                     StatisticsProc::unlockBuild($id);                           # 统计全服玩家解锁建筑
                     NormalEventProc::OnUnlockBuild($id, null);                   # 插入事件
                 }

+ 4 - 0
Gameserver/Amfphp/process/TaskProc.php

@@ -224,6 +224,10 @@ class TaskProc {
             if (!empty($plot->presentItem)) {
                 if (strtolower($plot->presentItem) == strtolower("unlockBuild")) { # 特殊处理, 剧情中解锁建筑
                     req()->userInfo->game->privateState->unlockedBuild[] = $plot->presentEffect; # 添加解锁记录
+                    if($plot->presentEffect == 1000){
+                        $college = new Info_College();
+                        $college->setFunUnluckTs();                              
+                    }
                     NormalEventProc::OnUnlockBuild($plot->presentEffect);       # 插入解锁事件
                 } else if (strtolower($plot->presentItem) == strtolower("rename")) {# 改名
                     // 跳过特殊字符串