Parcourir la source

章节解锁重写

cyzhao il y a 1 semaine
Parent
commit
f11ba16e0f

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

@@ -697,6 +697,11 @@ class CmdCode {
      */
     const fight_allGateBoxReceive = 6831;
     
+    /**
+     * 重置章节解锁动效
+     */
+    const fight_resetMapChapterUnlockEffect = 6832;
+    
 // </editor-fold>
 // <editor-fold defaultstate="collapsed" desc="系统操作码 - 69xx">
 

+ 5 - 1
Gameserver/App/model/User/Info_Gates.php

@@ -100,7 +100,11 @@ class Info_Gates extends Object_ext {
      * @var int 上次开始战斗的时间戳
      */
     public $lastStartFightTs = 0;
-
+    
+    public $oldChapterId = 0;
+    
+    public $newChapterId = 0;
+    
     public function initialize() {
         $startId = glc()->FirstGateId;                                          # 初始化第一关的关卡id
         $this->CurrentGateId = $startId;

+ 40 - 4
Gameserver/App/process/FightProc.php

@@ -79,11 +79,27 @@ class FightProc {
                 return self::GetWorldBoss_ClaimRewards();
             case CmdCode::fight_WorldBoss_settle:                               # 6830 世界boss结算
                 return self::WorldBoss_settle();
+
+            case CmdCode::fight_resetMapChapterUnlockEffect:                    # 6832 重置章节解锁动效
+                return self::ResetMapChapterUnlockEffect();
+
             default:
                 Err(ErrCode::cmd_err);
         }
     }
 
+    /**
+     * 6832 重置章节解锁动效
+     * @return type
+     */
+    public static function ResetMapChapterUnlockEffect() {
+        ctx()->gates()->oldChapterId = 0;
+        ctx()->gates()->newChapterId = 0;
+
+        UserProc::updateUserInfo();
+        return Resp::ok();
+    }
+
     /**
      * 6825 pvp 匹配一个对手
      * @return Resp
@@ -625,20 +641,20 @@ class FightProc {
                 GuideProc::HeroChange_Guide_Trigger($gateId, 1);
                 StoreProc::AddMultiItemInStore($gateMo->first_reward1);
             }
-            
+
             $ts2 = $gateMo->first_ts2 * 60;
             if ($ins_gateInfo->MaxSeconds >= $ts2 && !in_array(2, $ins_gateInfo->FirstReward)) {
                 $ins_gateInfo->FirstReward[] = 2;
                 GuideProc::HeroChange_Guide_Trigger($gateId, 2);
                 StoreProc::AddMultiItemInStore($gateMo->first_reward2);
             }
-                      
+
             if ($ins_gateInfo->pass > 0 && !in_array(3, $ins_gateInfo->FirstReward)) {
                 $ins_gateInfo->FirstReward[] = 3;
                 GuideProc::HeroChange_Guide_Trigger($gateId, 3);
                 StoreProc::AddMultiItemInStore($gateMo->first_reward3);
             }
-           ctx()->gates->GateList->$gateId = $ins_gateInfo;
+            ctx()->gates->GateList->$gateId = $ins_gateInfo;
         }
 
 
@@ -749,7 +765,7 @@ class FightProc {
         if ($curTs >= $ts) {
             $gateInfo->MaxSeconds = $curTs;
         }
-
+        $gatePassTag_old = ctx()->gates->GateList->gateId->pass;
         self::funUnlock_Gate($resultType, $gateId); //备注:这个接口的位置不能动 里面有关卡第一次胜利解锁的功能提示校验
         //self::subFunUnlock($resultType, $gateId);
         if ($resultType) {                                                      # 胜利
@@ -874,6 +890,26 @@ class FightProc {
             ctx()->baseInfo->animation = 1;
         }
 
+        if ($gateId != 11000) {
+            $newChapterId = 0;
+            $oldChapterId = 0;
+            $gatePassTag_new = ctx()->gates->GateList->gateId->pass;
+            if ($gatePassTag_old == 0 && $gatePassTag_new == 1) {              
+                $gate_chapter = GameConfig::gate_chapter();
+                foreach ($gate_chapter as $id => $gate_chapter_mo) {
+                    if($id == $gateId){
+                        $newChapterId = $id;
+                        break;
+                    }
+                    $oldChapterId = $id;
+                }
+                ctx()->gates()->oldChapterId = $oldChapterId;
+                ctx()->gates()->newChapterId = $newChapterId;                  
+            }
+        }
+
+
+
         UserProc::updateUserInfo();
         $ret = array(
             'gates' => ctx()->gates,