Prechádzať zdrojové kódy

功能解锁代码调整

cyzhao 1 týždeň pred
rodič
commit
9298257e1d

+ 1 - 1
Gameserver/App/model/User/Enum_ActiveTaskCmdType.php

@@ -11,7 +11,7 @@ class Enum_ActiveTaskCmdType extends Enum {
     const OnLogin_X = 102;       //登录第X天(这个累计的意思是 这天不登录但是明天登录了 也会算上这天 )
     const OnReceiveTaskPrize = 103;       //领取任务奖励
     const ReName = 104;       //改名字
-    const OnLogin_Accumulate = 105; // 累计登录天数  登录一天加一天的
+    const OnLogin_Accumulate = 105; // 累计登录天数  登录一天加一天的[暂时并没有用着]
     const OnLogin_Accumulate_FlipCard = 106; // 累计登录天数  登录一天加一天的 只针对金蛇功能
 
     const PassGate_X = 201;       //通关第X关

+ 6 - 0
Gameserver/App/model/User/Info_PrivateState.php

@@ -513,6 +513,12 @@ class Info_PrivateState extends Object_ext {
      */
     public $flipCardNum_daily = 0;
     
+    /**
+     * 开始时间
+     * @var type
+     */
+    public $flipCardLottery_startTs = 0;
+    
     /**
      * 结束时间
      * @var type

+ 4 - 2
Gameserver/App/model/User/Ins_TaskStep_Active.php

@@ -272,7 +272,9 @@ class Ins_TaskStep_Active extends Object_ext {
                 $day = 0;               
                 $mo = GameConfig::subfun_unlock_getItem(Enum_SubFunType::FlipCardLottery);                
                 if (now()>= $mo->startTs && now()< $mo->endTs) {
-                    $startDay = TimeUtil::totalDays($mo->startTs);
+                    //$startDay = TimeUtil::totalDays($mo->startTs);
+                    
+                    $startDay = TimeUtil::totalDays(ctx()->privateState->flipCardLottery_startTs);
                     $endDay = TimeUtil::totalDays($mo->endTs);                  
                     if (TimeUtil::totalDays(now()) <= $endDay) {
                         $day = 0;
@@ -284,7 +286,7 @@ class Ins_TaskStep_Active extends Object_ext {
                         }
                     }
                 }
-                return $day;             
+                return $day;                                 
             case Enum_ActiveTaskCmdType::PassLayer_ChallengeGate:
                 if(ctx()->gates->TowerGate->CurLayer-1 < 0){
                     return 0;

+ 1 - 0
Gameserver/App/process/ActiveProc.php

@@ -82,6 +82,7 @@ class ActiveProc {
         //活动结束
         $mo = GameConfig::subfun_unlock_getItem(Enum_SubFunType::FlipCardLottery);
         if (now() >= $mo->startTs && now() < $mo->endTs && $mo->endTs != ctx()->privateState->flipCardLottery_endTs) {//当活动重启再次开启的时候再重置数据
+            ctx()->privateState->flipCardLottery_startTs = $mo->startTs;
             ctx()->privateState->flipCardLottery_endTs = $mo->endTs;
             ctx()->privateState->flipCardNum_all = 0;
             ctx()->privateState->flipCardNum_turnNum = 0;

+ 92 - 101
Gameserver/App/process/FightProc.php

@@ -894,17 +894,17 @@ class FightProc {
             $newChapterId = 0;
             $oldChapterId = 0;
             $gatePassTag_new = ctx()->gates->GateList->$gateId->pass;
-            if ($gatePassTag_old == 0 && $gatePassTag_new == 1) {              
+            if ($gatePassTag_old == 0 && $gatePassTag_new == 1) {
                 $gate_chapter = GameConfig::gate_chapter();
                 foreach ($gate_chapter as $id => $gate_chapter_mo) {
-                    if($gate_chapter_mo->unlockGateId == $gateId){
+                    if ($gate_chapter_mo->unlockGateId == $gateId) {
                         $newChapterId = $id;
                         break;
                     }
                     $oldChapterId = $id;
                 }
                 ctx()->gates()->oldChapterId = $oldChapterId;
-                ctx()->gates()->newChapterId = $newChapterId;                  
+                ctx()->gates()->newChapterId = $newChapterId;
             }
         }
 
@@ -953,78 +953,62 @@ class FightProc {
     static function funUnlock_Gate($resultType, $gateId) {
         $dic = GameConfig::fun_unlock();
         foreach ($dic as $id => $mo) {
-            if ($mo->unlockTip == 1) {//$mo->unlockGateId == $gateId
-                $tag = false;
-                if ($mo->unlockType1 != null) {
-                    //1:参与战斗结束即可  2战斗胜利  3某场战斗参加N次数才行
-                    switch ($mo->unlockType1) {
-                        case Enum_FunUnlockType::battle_Gate:
-                            if ($mo->unlockParas1 == $gateId && ctx()->gates->GateList->$gateId->fightNum == 0) {
-                                $tag = true;
-                            }
-                            break;
-                        case Enum_FunUnlockType::passBattle_Gate:
-                            if ($resultType == true && $mo->unlockParas1 == $gateId && ctx()->gates->GateList->$gateId->pass == 0) {
-                                $tag = true;
-                            }
-
-                            break;
-                        default:
-                            break;
-                    }
+            $tag = false;
+            if ($mo->unlockType1 != null) {
+                //1:参与战斗结束即可  2战斗胜利  3某场战斗参加N次数才行
+                switch ($mo->unlockType1) {
+                    case Enum_FunUnlockType::battle_Gate:
+                        if ($mo->unlockParas1 == $gateId && ctx()->gates->GateList->$gateId->fightNum == 0) {
+                            $tag = true;
+                        }
+                        break;
+                    case Enum_FunUnlockType::passBattle_Gate:
+                        if ($resultType == true && $mo->unlockParas1 == $gateId && ctx()->gates->GateList->$gateId->pass == 0) {
+                            $tag = true;
+                        }
+
+                        break;
+                    default:
+                        break;
                 }
+            }
 
-                if ($mo->unlockType2 != null) {
-                    //1:参与战斗结束即可  2战斗胜利  3某场战斗参加N次数才行
-                    switch ($mo->unlockType2) {
-                        case Enum_FunUnlockType::battle_Gate:
-                            if ($mo->unlockParas2 == $gateId && ctx()->gates->GateList->$gateId->fightNum == 0) {
-                                $tag = true;
-                            }
-                            break;
-                        case Enum_FunUnlockType::passBattle_Gate:
-                            if ($resultType == true && $mo->unlockParas2 == $gateId && ctx()->gates->GateList->$gateId->pass == 0) {
-                                $tag = true;
-                            }
-
-                            break;
-                        default:
-                            break;
-                    }
+            if ($mo->unlockType2 != null) {
+                //1:参与战斗结束即可  2战斗胜利  3某场战斗参加N次数才行
+                switch ($mo->unlockType2) {
+                    case Enum_FunUnlockType::battle_Gate:
+                        if ($mo->unlockParas2 == $gateId && ctx()->gates->GateList->$gateId->fightNum == 0) {
+                            $tag = true;
+                        }
+                        break;
+                    case Enum_FunUnlockType::passBattle_Gate:
+                        if ($resultType == true && $mo->unlockParas2 == $gateId && ctx()->gates->GateList->$gateId->pass == 0) {
+                            $tag = true;
+                        }
+
+                        break;
+                    default:
+                        break;
                 }
+            }
 
-                if ($tag && !in_array($id, ctx()->privateState->funUnlockRecord_2)) {
+            if ($tag && !in_array($id, ctx()->privateState->funUnlockRecord_2)) {
+                if ($mo->unlockTip == 1) {
                     ctx()->privateData(true)->funUnlockRecord[] = $id;
-                    ctx()->privateData(true)->funUnlockRecord_2[] = $id;
-                    if ($id == 13 || $id == 16 || $id == 14) {
-                        self::unlockGuideType($id);
-                        //ctx()->privateData(true)->funUnlockRecord_3[] = 
-                    }
-                    self::SubFunDateInit_FunUnlock($id);
                 }
+                ctx()->privateData(true)->funUnlockRecord_2[] = $id;
+                if ($id == 13 || $id == 16 || $id == 14) {
+                    //self::unlockGuideType($id);    
+                    GuideProc::Qingling_EquipWear_Guide_Trigger($id);
+                }
+                self::SubFunDateInit_FunUnlock($id);
             }
         }
     }
 
-    public static function unlockGuideType($id) {
-        GuideProc::Qingling_EquipWear_Guide_Trigger($id);
-//        $type = 0;
-//        switch ($id) {           
-//            case 16://启灵
-//                $type = E_GuideTypeState::Qingling_Guide;
-//                break;
-//            case 14://装备 首次获得装备 装备功能解锁 同时开启装备穿戴引导 
-//                $type = E_GuideTypeState::EquipWear_Guide;
-//                break;                     
-//            default:
-//                break;
-//        }
+//    public static function unlockGuideType($id) {
 //        
-//        if($type >0 && !in_array($type,ctx()->privateData(true)->funUnlockRecord_3)){
-//            ctx()->privateData(true)->funUnlockRecord_3[] = $type;
-//        }
-        //return $type;
-    }
+//    }
 
     /**
      *  初次得到装备 功能解锁
@@ -1033,22 +1017,22 @@ class FightProc {
         $dic = GameConfig::fun_unlock();
         foreach ($dic as $id => $mo) {
             $tag = false;
-            if ($mo->unlockTip == 1) {//$mo->unlockGateId == $gateId
-                if ($mo->unlockType1 != null && $mo->unlockType1 == Enum_FunUnlockType::equip_firstTime && count(StlUtil::dictToArray(ctx()->store->equip)) == 0) {
-                    $tag = true;
-                }
+            if ($mo->unlockType1 != null && $mo->unlockType1 == Enum_FunUnlockType::equip_firstTime && count(StlUtil::dictToArray(ctx()->store->equip)) == 0) {
+                $tag = true;
+            }
 
-                if ($mo->unlockType2 != null && $mo->unlockType2 == Enum_FunUnlockType::equip_firstTime && count(StlUtil::dictToArray(ctx()->store->equip)) == 0) {
-                    $tag = true;
-                }
+            if ($mo->unlockType2 != null && $mo->unlockType2 == Enum_FunUnlockType::equip_firstTime && count(StlUtil::dictToArray(ctx()->store->equip)) == 0) {
+                $tag = true;
             }
 
             if ($tag && !in_array($id, ctx()->privateState->funUnlockRecord_2)) {
-                ctx()->privateData(true)->funUnlockRecord[] = $id;
+                if ($mo->unlockTip == 1) {
+                    ctx()->privateData(true)->funUnlockRecord[] = $id;
+                }
                 ctx()->privateData(true)->funUnlockRecord_2[] = $id;
 
                 if ($id == 13 || $id == 16 || $id == 14) {
-                    self::unlockGuideType($id);
+                    GuideProc::Qingling_EquipWear_Guide_Trigger($id);
                     //ctx()->privateData(true)->funUnlockRecord_3[] = 
                 }
                 self::SubFunDateInit_FunUnlock($id);
@@ -1063,20 +1047,22 @@ class FightProc {
         $dic = GameConfig::fun_unlock();
         foreach ($dic as $id => $mo) {
             $tag = false;
-            if ($mo->unlockTip == 1) {//$mo->unlockGateId == $gateId
-                if ($mo->unlockType1 != null && $mo->unlockType1 == Enum_FunUnlockType::userLv && $mo->unlockParas1 == $level) {
-                    $tag = true;
-                }
+            if ($mo->unlockType1 != null && $mo->unlockType1 == Enum_FunUnlockType::userLv && $mo->unlockParas1 == $level) {
+                $tag = true;
+            }
 
-                if ($mo->unlockType2 != null && $mo->unlockType2 == Enum_FunUnlockType::userLv && $mo->unlockParas2 == $level) {
-                    $tag = true;
-                }
+            if ($mo->unlockType2 != null && $mo->unlockType2 == Enum_FunUnlockType::userLv && $mo->unlockParas2 == $level) {
+                $tag = true;
             }
+
             if ($tag && !in_array($id, ctx()->privateState->funUnlockRecord_2)) {
-                ctx()->privateData(true)->funUnlockRecord[] = $id;
+                if ($mo->unlockTip == 1) {//$mo->unlockGateId == $gateId
+                    ctx()->privateData(true)->funUnlockRecord[] = $id;
+                }
+
                 ctx()->privateData(true)->funUnlockRecord_2[] = $id;
                 if ($id == 13 || $id == 16 || $id == 14) {
-                    self::unlockGuideType($id);
+                    GuideProc::Qingling_EquipWear_Guide_Trigger($id);
                     //ctx()->privateData(true)->funUnlockRecord_3[] = self::unlockGuideType($id);
                 }
                 self::SubFunDateInit_FunUnlock($id);
@@ -1091,32 +1077,33 @@ class FightProc {
         $dic = GameConfig::fun_unlock();
         foreach ($dic as $id => $mo) {
             $tag = false;
-            if ($mo->unlockTip == 1) {//$mo->unlockGateId == $gateId
-                if ($mo->unlockType1 != null && $result = true && $mo->unlockType1 == Enum_FunUnlockType::mainChallengeGate_State) {
-                    $str = explode(',', $mo->unlockParas1);
-                    $uGateId = $str[0];
-                    $gateState = $str[1];
-
-                    if ($uGateId == $gateId && StlUtil::dictHasProperty(ctx()->gates->GateList, $gateId) && ctx()->gates->GateList->$gateId->tz_state == $gateState - 1) {
-                        $tag = true;
-                    }
-                }
+            if ($mo->unlockType1 != null && $result = true && $mo->unlockType1 == Enum_FunUnlockType::mainChallengeGate_State) {
+                $str = explode(',', $mo->unlockParas1);
+                $uGateId = $str[0];
+                $gateState = $str[1];
 
-                if ($mo->unlockType2 != null && $result = true && $mo->unlockType2 == Enum_FunUnlockType::mainChallengeGate_State) {
-                    $str = explode(',', $mo->unlockParas2);
-                    $uGateId = $str[0];
-                    $gateState = $str[1];
-                    if ($uGateId == $gateId && StlUtil::dictHasProperty(ctx()->gates->GateList, $gateId) && ctx()->gates->GateList->$gateId->tz_state == $gateState - 1) {
-                        $tag = true;
-                    }
+                if ($uGateId == $gateId && StlUtil::dictHasProperty(ctx()->gates->GateList, $gateId) && ctx()->gates->GateList->$gateId->tz_state == $gateState - 1) {
+                    $tag = true;
                 }
             }
 
+            if ($mo->unlockType2 != null && $result = true && $mo->unlockType2 == Enum_FunUnlockType::mainChallengeGate_State) {
+                $str = explode(',', $mo->unlockParas2);
+                $uGateId = $str[0];
+                $gateState = $str[1];
+                if ($uGateId == $gateId && StlUtil::dictHasProperty(ctx()->gates->GateList, $gateId) && ctx()->gates->GateList->$gateId->tz_state == $gateState - 1) {
+                    $tag = true;
+                }
+            }
+         
             if ($tag && !in_array($id, ctx()->privateState->funUnlockRecord_2)) {
-                ctx()->privateData(true)->funUnlockRecord[] = $id;
+                if ($mo->unlockTip == 1) {//$mo->unlockGateId == $gateId
+                    ctx()->privateData(true)->funUnlockRecord[] = $id;
+                }
+                
                 ctx()->privateData(true)->funUnlockRecord_2[] = $id;
                 if ($id == 13 || $id == 16 || $id == 14) {
-                    self::unlockGuideType($id);
+                    GuideProc::Qingling_EquipWear_Guide_Trigger($id);
                     //ctx()->privateData(true)->funUnlockRecord_3[] = self::unlockGuideType($id);
                 }
                 self::SubFunDateInit_FunUnlock($id);
@@ -1217,6 +1204,10 @@ class FightProc {
                 ActiveProc::InitDay7_Sign_NewPlayer(true);
                 ctx()->privateState->day7_drawed_newPlayer_startTs = now();
             }
+
+            if ($mo->funTypeId == Enum_FunType::FlipCardLottery && $mo->id == Enum_SubFunType::FlipCardLottery) {
+                ActiveProc::ClearFlipCardInfo();
+            }
         }
     }
 

+ 2 - 2
Gameserver/App/process/UserProc.php

@@ -511,6 +511,7 @@ class UserProc {
         ActiveProc::ResetActiveInfos();
         TaskProc::OnLogin_Accumulate();
         TaskProc::OnLogin_Accumulate_FlipCard();
+        ActiveProc::ClearFlipCardInfo();
         FightProc::ResetWorldBossRank_StartTs();
     }
 
@@ -574,8 +575,7 @@ class UserProc {
 
         TaskProc::checkMainTask();
         FightProc::SubFunDateInit_Config();
-
-        ActiveProc::ClearFlipCardInfo();
+      
         FightProc::ResetTurnNum();       
     }