Pārlūkot izejas kodu

扫荡功能修改: (每日)前三次免费, 后面需要广告扫荡(间隔1分钟)

wanggangzero 5 mēneši atpakaļ
vecāks
revīzija
3d15dffb2f

+ 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

+ 7 - 5
Gameserver/App/process/FightProc.php

@@ -270,11 +270,11 @@ 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;
-
+        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 +329,7 @@ class FightProc {
                 }
             }
         }
+# 奖励逻辑
 
         TaskProc::OnFightSweepGate();
         UserProc::updateUserInfo();
@@ -341,6 +342,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,