Bladeren bron

次级功能

cyzhao 9 maanden geleden
bovenliggende
commit
dbecc02979

+ 0 - 2
Gameserver/App/configs/GameConfig.php

@@ -6,8 +6,6 @@
  // 日期: 2024-09-06 10:15:03
 ////////////////////
 
-namespace loyalsoft;
-
 /**
  * 常量配置数据 
  */

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

@@ -310,6 +310,12 @@ class Info_PrivateState extends Object_ext {
      */
     #[ArrayType]
     public $accumulateRechargeRewardRecord = array();
+    
+    /**
+     * 次级功能开启时间记录
+     * @var type
+     */
+    public $subFunStartTs = null;
 
     public function initialize() {
         $this->junbeiShopNumRecord = new \stdClass();
@@ -325,6 +331,8 @@ class Info_PrivateState extends Object_ext {
                 $this->junbeiShop_XinYuan = new \stdClass();
                 $this->supplyBichuDic = new \stdClass();
                 $this->skillLockerNumber = glc()->Skill_LockBtn_InitCount;       # 初始值
+                $this->subFunStartTs = new \stdClass();
+                
             }
         } else {
             parent::__construct($arg);

+ 54 - 11
Gameserver/App/process/FightProc.php

@@ -615,6 +615,7 @@ class FightProc {
         }
 
         self::funUnlock($resultType, $gateId); //备注:这个接口的位置不能动 里面有关卡第一次胜利解锁的功能提示校验
+        self::subFunUnlock($resultType, $gateId);
         if ($resultType) {                                                      # 胜利
             self::skillUnlock_gate($resultType, $gateId); //备注 这个接口位置不能动
 
@@ -713,7 +714,7 @@ class FightProc {
         TaskProc::OnKillCommonNumMonster($killMonsterNum);
         TaskProc::OnKillleaderNumMonster($killBossNum);
         TaskProc::OnFightGate_X($gateId);
-                     
+
         UserProc::updateUserInfo();
         $ret = array(
             'gates' => ctx()->gates,
@@ -730,6 +731,7 @@ class FightProc {
             'funUnlockRecord' => ctx()->privateState->funUnlockRecord,
             'skillUnlockRecord' => ctx()->privateState->skillUnlockRecord,
             'heros' => ctx()->heros,
+            'subFunStartTs'=> ctx()->privateState->subFunStartTs,
         );
         return Resp::ok($ret);
     }
@@ -763,7 +765,48 @@ class FightProc {
                 }
 
                 if ($tag) {
-                    ctx()->privateState->funUnlockRecord[] = $id;
+                    ctx()->privateState->funUnlockRecord[] = $id;               
+                }
+            }
+        }
+    }
+
+    /**
+     * 检测次级功能解锁的
+     * @param type $resultType
+     * @param type $gateId
+     * @return type
+     */
+    static function subFunUnlock($resultType, $gateId) {
+        $dic = GameConfig::subfun_unlock();
+        foreach ($dic as $id => $mo) {
+            if ($mo->type != 1) {
+                continue;
+            }
+
+            if ($mo->unlockGateId == $gateId) {
+                $tag = false;
+                //1:参与战斗结束即可  2战斗胜利  3某场战斗参加N次数才行
+                switch ($mo->unlockType) {
+                    case 1:
+                        if (ctx()->gates->GateList->$gateId->fightNum == 0) {
+                            $tag = true;
+                        }
+                        break;
+                    case 2:
+                        if ($resultType == true && ctx()->gates->GateList->$gateId->pass == 0) {
+                            $tag = true;
+                        }
+
+                        break;
+                    default:
+                        break;
+                }
+
+                if ($tag) {
+                    if (!StlUtil::dictHasProperty(ctx()->privateState->subFunStartTs, $id)) {
+                        ctx()->privateState->subFunStartTs->$id = now();
+                    }
                 }
             }
         }
@@ -1216,7 +1259,7 @@ class FightProc {
 
         $tag = self::isExistNoDrawed_MainGate();
         UserProc::updateUserInfo();
-        $ret = array('redTip' => $tag, 'task' => ctx()->task,'store'=> ctx()->store,'cash'=> ctx()->baseInfo->cash,'reward'=> StoreProc::$reward);
+        $ret = array('redTip' => $tag, 'task' => ctx()->task, 'store' => ctx()->store, 'cash' => ctx()->baseInfo->cash, 'reward' => StoreProc::$reward);
         return Resp::ok($ret);
     }
 
@@ -1242,7 +1285,7 @@ class FightProc {
         $tag = self::isExistNoDrawed_FightPower();
 
         UserProc::updateUserInfo();
-        $ret = array('redTip' => $tag, 'task' => ctx()->task,'store'=> ctx()->store,'cash'=> ctx()->baseInfo->cash,'reward'=> StoreProc::$reward);
+        $ret = array('redTip' => $tag, 'task' => ctx()->task, 'store' => ctx()->store, 'cash' => ctx()->baseInfo->cash, 'reward' => StoreProc::$reward);
         return Resp::ok($ret);
     }
 
@@ -1277,13 +1320,13 @@ class FightProc {
 
         UserProc::updateUserInfo();
         $ret = array('redTip' => 0,
-                    'task' => ctx()->task,
-                    'store'=> ctx()->store,
-                    'cash'=> ctx()->baseInfo->cash,
-                    'reward'=> StoreProc::$reward,
-                    'rankReward_drawed_fightPower'=>ctx()->privateState->rankReward_drawed_fightPower,
-                    'rankReward_drawed_MainGate'=>ctx()->privateState->rankReward_drawed_MainGate,
-            );
+            'task' => ctx()->task,
+            'store' => ctx()->store,
+            'cash' => ctx()->baseInfo->cash,
+            'reward' => StoreProc::$reward,
+            'rankReward_drawed_fightPower' => ctx()->privateState->rankReward_drawed_fightPower,
+            'rankReward_drawed_MainGate' => ctx()->privateState->rankReward_drawed_MainGate,
+        );
         return Resp::ok($ret);
     }
 

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

@@ -455,7 +455,7 @@ class UserProc {
         TaskProc::OnLogin_day7();
         TaskProc::checkMainTask();
     }
-
+   
 //    static function clear() {
 //        $dic = GameConfig::announcement();
 //        foreach ($dic as $mo) {