Selaa lähdekoodia

Merge branch 'dev' of http://ylsjtt.game7000.com:3000/YLSJ/jzhj2024server into dev

cyzhao 5 kuukautta sitten
vanhempi
commit
472f097aa7
2 muutettua tiedostoa jossa 29 lisäystä ja 13 poistoa
  1. 16 7
      Gameserver/App/model/User/Info_Gates.php
  2. 13 6
      Gameserver/App/process/FightProc.php

+ 16 - 7
Gameserver/App/model/User/Info_Gates.php

@@ -17,18 +17,19 @@ class Info_Gates extends Object_ext {
 
     /**
      * 当前剧情选择的关卡
+     * @var int 
      */
     public $CurrentGateId = 0;
 
     /**
      * 已解锁剧情关卡的最大id
-     * @var type
+     * @var int
      */
     public $UnlockedGatesMaxId = 0;
 
     /**
      * 最大通关id
-     * @var type
+     * @var int
      */
     public $maxPassGateId = 0;
 
@@ -40,13 +41,13 @@ class Info_Gates extends Object_ext {
 
     /**
      * 挑战功能领取记录
-     * @var type
+     * @var []
      */
     public $GatesChallengeRecord = null;
 
     /**
      * 进化解锁记录
-     * @var type
+     * @var []
      */
     #[ArrayType]
     public $evolveUnlockRecord = array();
@@ -54,33 +55,41 @@ class Info_Gates extends Object_ext {
     /**
      * 巡逻领取奖励的时间
      * @var int
+     * @deprecated since version 巡逻没有用着
      */
     public $xunluo_StartTs = 0;
 
     /**
      * 快速巡逻的购买记录
      * @var int
+     * @deprecated since version 巡逻没有用着
      */
     public $xunluo_quick_buyRecord = 0;
 
     /**
      * 进化左边解锁最大值得记录
-     * @var type
+     * @var int
      */
     public $evolveMaxId_left = 0;
 
     /**
      * 进化右边解锁最大值得记录
-     * @var type
+     * @var int
      */
     public $evolveMaxId_right = 0;
 
     /**
      * 扫荡
-     * @var type
+     * @var int
      */
     public $fightSweepNum = 0;
 
+    /**
+     * 扫荡 下次扫荡时间戳
+     * @var int
+     */
+    public $fightSweepTs = 0;
+
     /**
      * 挑战关卡信息
      * @var Ins_TowerGateInfo

+ 13 - 6
Gameserver/App/process/FightProc.php

@@ -255,7 +255,7 @@ class FightProc {
      */
     public static function FightSweep() {
         //list($gateId) = req()->paras;
-// 2024.12.17 扫荡修改: 前3次免费, 后面可以一直看广告免费.
+// 2024.12.17 扫荡修改: 前3次免费, 后面可以一直看广告免费.(特权月卡可以免广告, 结合到一起, 特权月卡就可以一直刷了.)
 
         $passGateId = ctx()->gates->maxPassGateId();                            # 最高通关关卡id
         my_Assert($passGateId != 0, ErrCode::gate_NoSweep);                     # 还没有通关关卡
@@ -270,11 +270,15 @@ class FightProc {
 //            $max = glc()->sweepMaxNum;
 //            my_Assert(ctx()->gates->fightSweepNum < $max, ErrCode::gate_SweepMaxNum_limit);
 //        }
-
-        ctx()->gates->fightSweepNum += 1;
-        ctx()->baseInfo->Consume_tili($costTili);
-        ctx()->privateData(true)->battlePass_tili += $costTili;
-
+        if (ctx()->gates->fightSweepNum <= glc()->sweepMaxNum) {
+            ctx()->gates->fightSweepTs = now();                                 # 前三次无冷却
+        } else {
+            ctx()->gates->fightSweepTs = now(60);                               # 下次扫荡时间戳(广告时需要间隔)
+        }
+        ctx()->gates->fightSweepNum += 1;                                       # 增加扫荡次数记录
+        ctx()->baseInfo->Consume_tili($costTili);                               # 扣除体力
+        ctx()->privateData(true)->battlePass_tili += $costTili;                 # 增加体力消耗记录
+# 发放扫荡奖励↓
         $wavesArr = GameConfig::waves_getItemArray($passGateId);
         $count = count($wavesArr);
         $wavesMo = $wavesArr[$count - 1];
@@ -329,6 +333,7 @@ class FightProc {
                 }
             }
         }
+# 奖励逻辑结束.
 
         TaskProc::OnFightSweepGate();
         UserProc::updateUserInfo();
@@ -341,6 +346,7 @@ class FightProc {
             'maxXp' => ctx()->baseInfo->maxXp,
             'level' => ctx()->baseInfo->level,
             'fightSweepNum' => ctx()->gates->fightSweepNum,
+            'fightSweepTs' => ctx()->gates->fightSweepTs,
             //'prizeArr' => $prizeArr,
             'store' => ctx()->store,
             'task' => ctx()->task,
@@ -434,6 +440,7 @@ class FightProc {
     public static function FightDailyClear() {
         //ctx()->gates->xunluo_quick_buyRecord = 0;
         ctx()->gates->fightSweepNum = 0;
+        ctx()->gates->fightSweepTs = now();
         ctx()->gates()->TowerGateInfo()->RefreshSkillTimes = 0;
         ctx()->gates()->TowerGateInfo()->TodayChanNum = glc()->tower_daily_chanceNum;