cyzhao пре 5 месеци
родитељ
комит
cfcc8d3cb7

+ 1 - 1
Gameserver/App/model/Const/GameConfig.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-12-13 11:18:46
+ // 日期: 2024-12-16 16:22:58
 ////////////////////
 
 /**

+ 1 - 1
Gameserver/App/model/Const/sm_activeTask.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-12-12 21:04:29
+ // 日期: 2024-12-16 10:05:55
 ////////////////////
 
 

+ 1 - 1
Gameserver/App/model/Const/sm_activeTask_type.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-12-12 21:04:29
+ // 日期: 2024-12-16 10:05:55
 ////////////////////
 
 

+ 1 - 1
Gameserver/App/model/Const/sm_equip.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-12-05 17:30:57
+ // 日期: 2024-12-16 09:37:06
 ////////////////////
 
 

+ 1 - 1
Gameserver/App/model/Const/sm_fun_unlock.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-12-13 10:20:46
+ // 日期: 2024-12-13 13:57:12
 ////////////////////
 
 

+ 16 - 1
Gameserver/App/model/Const/sm_globalsettings.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-12-11 18:05:55
+ // 日期: 2024-12-16 16:05:32
 ////////////////////
 
 
@@ -108,6 +108,11 @@ class sm_globalsettings
     */
     public $DailyShopRefreshCostGold;
 
+    /**
+    * @var Int32 免费抽奖次数  
+    */
+    public $activity_lottery_FreeNum;
+
     /**
     * @var String 宝石品阶  
     */
@@ -323,10 +328,20 @@ class sm_globalsettings
     */
     public $equipQual_NotDownGrading;
 
+    /**
+    * @var Int32 仙树抽奖广告  
+    */
+    public $activity_lottery_GuanggaoNum;
+
     /**
     * @var Int32 战力公式: 攻击力系数  
     */
     public $fightPower_MulAtk;
 
+    /**
+    * @var Int32 仙树抽奖倒计时时间  
+    */
+    public $activity_lottery_GuanggaoDownTs;
+
 }
 

+ 1 - 1
Gameserver/App/model/Const/sm_hero.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-12-12 19:05:55
+ // 日期: 2024-12-16 16:05:55
 ////////////////////
 
 

+ 1 - 1
Gameserver/App/model/Const/sm_heroType_typeId.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-12-12 19:05:55
+ // 日期: 2024-12-16 16:05:55
 ////////////////////
 
 

+ 1 - 1
Gameserver/App/model/Const/sm_item.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-12-12 14:37:01
+ // 日期: 2024-12-16 10:05:55
 ////////////////////
 
 

+ 1 - 1
Gameserver/App/model/Const/sm_player_level.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-12-03 10:48:11
+ // 日期: 2024-12-16 10:23:40
 ////////////////////
 
 

+ 1 - 1
Gameserver/App/model/Const/sm_predicate.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-12-06 18:05:55
+ // 日期: 2024-12-13 16:15:17
 ////////////////////
 
 

+ 1 - 1
Gameserver/App/model/Const/sm_waveItem.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-12-12 21:02:21
+ // 日期: 2024-12-16 12:00:22
 ////////////////////
 
 

+ 1 - 1
Gameserver/App/model/Const/sm_waves.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-12-12 21:02:21
+ // 日期: 2024-12-16 12:00:22
 ////////////////////
 
 

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

@@ -330,6 +330,18 @@ class Info_PrivateState extends Object_ext {
      * @var type
      */
     public $lotteryNum = 0;
+    
+    /**
+     * 转盘抽奖免费次数
+     * @var type
+     */
+    public $lotteryNum_free = 0;
+   
+    /*
+     * 
+     */
+    public $activity_lottery_guanggaoTs = 0;
+
 
     /**
      * 抽奖得到过紫色品阶的宝石

+ 63 - 47
Gameserver/App/process/ActiveProc.php

@@ -120,24 +120,40 @@ class ActiveProc {
         my_Assert(in_array($num, $arr), ErrCode::active_lotteryNumErr);
         my_Assert(ctx()->privateState->lotteryNum + $num <= glc()->activity_lottery_allNum, ErrCode::active_lotteryNumLimit);
 
-        $cost = "";
-        if ($num == 1) {
-            $cost = glc()->activity_lottery_tree_one_cost;
-        } else {
-            $cost = glc()->activity_lottery_tree_ten_cost;
+        $costTag = true;
+        if ($num == 1 && ctx()->privateState->lotteryNum_free < glc()->activity_lottery_FreeNum + glc()->activity_lottery_GuanggaoNum) {
+            $costTag = false;            
+        }
+
+        if($num == 1){
+            ctx()->privateState->lotteryNum_free += 1;
+        }
+        
+        if ($costTag) {
+            $cost = "";
+            if ($num == 1) {
+                $cost = glc()->activity_lottery_tree_one_cost;
+            } else {
+                $cost = glc()->activity_lottery_tree_ten_cost;
+            }
+            my_Assert($cost != "", ErrCode::active_lotteryCostErr);
+            $costArr = explode(',', $cost);
+            $item = ctx()->store->items;
+            $costId = $costArr[0];
+            $costNum = $costArr[1];
+            my_Assert(StlUtil::dictHasProperty($item, $costId) && $item->$costId >= $costNum, ErrCode::notenough_item);
+            ctx()->store->removeItem($costId, $costNum);
+        }
+
+        if (ctx()->privateState->lotteryNum_free > glc()->activity_lottery_FreeNum && ctx()->privateState->lotteryNum_free <= glc()->activity_lottery_FreeNum + glc()->activity_lottery_FreeNum) {
+            my_Assert(now() - ctx()->privateData(true)->activity_lottery_guanggaoTs >= glc()->activity_lottery_GuanggaoDownTs, ErrCode::user_shop_DownTsLimit);
+            ctx()->privateData(true)->activity_lottery_guanggaoTs = now();                
         }
-        my_Assert($cost != "", ErrCode::active_lotteryCostErr);
-        $costArr = explode(',', $cost);
-        $item = ctx()->store->items;
-        $costId = $costArr[0];
-        $costNum = $costArr[1];
-        my_Assert(StlUtil::dictHasProperty($item, $costId) && $item->$costId >= $costNum, ErrCode::notenough_item);
-        ctx()->store->removeItem($costId, $costNum);
 
         if (ctx()->privateState->lotteryNum < glc()->activity_lottery_allNum) {
             ctx()->privateState->lotteryNum += $num;
         }
-
+      
         $rewardList = array();
         $dic = GameConfig::activity_lottery_tree();
         for ($i = 0; $i < $num; $i++) {
@@ -416,21 +432,21 @@ class ActiveProc {
     /**
      * 限时贩卖 2天一刷
      */
-    public static function ResetLimitTsBuy() {       
+    public static function ResetLimitTsBuy() {
         ctx()->privateState->limitTsBuy_RewardRecord = array();
-        
+
         $mo = GameConfig::subfun_unlock_getItem(Enum_SubFunType::LimitTsSale);
         $day = $mo->ts;
         $startDay = TimeUtil::totalDays($mo->startTs);
         $nextDay = TimeUtil::totalDays();
-     
+
         $num = $nextDay - $startDay;
         $refershType = $num % $day; //day 2天一刷新 余数只会是0 或 1; 0:两天后在刷新,1就是已经过了一天了,在过一天就刷新,当前时间减一天
-        ctx()->privateState->nextDayLogin = now() - 86400*$refershType;
+        ctx()->privateState->nextDayLogin = now() - 86400 * $refershType;
 //        if ($refershType == 1) {
 //            ctx()->privateState->nextDayLogin = now() - 86400;
 //        }
-      
+
         $val = intval($num / $day);
         $yushu = $val % glc()->activity_limitTsBuy_giftTypeNum;
         $type = $yushu + 1;
@@ -470,9 +486,9 @@ class ActiveProc {
 
         my_Assert(ctx()->baseInfo->cash >= explode(',', $mo->cost)[1], ErrCode::notenough_cash_msg);
         ctx()->baseInfo->Consume_Cash(explode(',', $mo->cost)[1]);
-        
+
         $rewardArr = ctx()->privateState->limitTsBuy_RewardRecord;
-        $count = array_count_values($rewardArr)[$typeId];	        
+        $count = array_count_values($rewardArr)[$typeId];
         my_Assert($count < $mo->limitNum, ErrCode::user_shop_LimitNum);
 
         StoreProc::AddMultiItemInStore($mo->reward);                            # 发放奖励
@@ -489,42 +505,42 @@ class ActiveProc {
                     'reward_equip' => StoreProc::$reward_equip,
         ));
     }
-    
+
     /**
      * 6109 战令奖励领取
      */
     public static function BattlePassDrawReward() {
-        list($id) = req()->paras;                                               
+        list($id) = req()->paras;
 
         $mo = GameConfig::activity_battlepass_getItem($id);                     # 查询奖励数据
         my_Assert(null != $mo, ErrCode::err_const_no);                          # 防御找不到配置
         $subFunType = $mo->type;
         $typeId = $mo->typeId;
-        
-        $str_1 = $subFunType.'-1-'.$typeId;       
-        $str_2 = $subFunType.'-2-'.$typeId;        
+
+        $str_1 = $subFunType . '-1-' . $typeId;
+        $str_2 = $subFunType . '-2-' . $typeId;
         $isHasBuy_high = false;
         switch ($subFunType) {
             case Enum_SubFunType::ActivePoint_BattlePass:
-                $point =ctx()->privateState->battlePass_taskPoint;                         
+                $point = ctx()->privateState->battlePass_taskPoint;
                 my_Assert($point >= $typeId, ErrCode::active_pointNotEnough);
-                
-                if(ctx()->privateState->battlePass_activePoint_cost_ts > 0 && now() < ctx()->privateState->battlePass_activePoint_cost_ts + 30*24*60*60){
+
+                if (ctx()->privateState->battlePass_activePoint_cost_ts > 0 && now() < ctx()->privateState->battlePass_activePoint_cost_ts + 30 * 24 * 60 * 60) {
                     $isHasBuy_high = true;
                 }
-                
+
                 break;
             case Enum_SubFunType::Tili_BattleBass:
                 my_Assert(ctx()->privateData()->battlePass_tili >= $typeId, ErrCode::active_costTiliNotEnough);
-                if(ctx()->privateState->battlePass_tili_cost_ts > 0 && now() < ctx()->privateState->battlePass_tili_cost_ts + 30*24*60*60){
+                if (ctx()->privateState->battlePass_tili_cost_ts > 0 && now() < ctx()->privateState->battlePass_tili_cost_ts + 30 * 24 * 60 * 60) {
                     $isHasBuy_high = true;
                 }
                 break;
             case Enum_SubFunType::Gate_BattleBass:
-                my_Assert(StlUtil::dictHasProperty(ctx()->gates->GateList,$typeId), ErrCode::gate_GateNoUnlock);
+                my_Assert(StlUtil::dictHasProperty(ctx()->gates->GateList, $typeId), ErrCode::gate_GateNoUnlock);
                 my_Assert(ctx()->gates->GateList->$typeId->pass > 0, ErrCode::evolve_GateNoPass);
-                                      
-                if(ctx()->privateState->battlePass_gate_cost_ts > 0 && now() < ctx()->privateState->battlePass_gate_cost_ts + 30*24*60*60){
+
+                if (ctx()->privateState->battlePass_gate_cost_ts > 0 && now() < ctx()->privateState->battlePass_gate_cost_ts + 30 * 24 * 60 * 60) {
                     $isHasBuy_high = true;
                 }
                 break;
@@ -532,18 +548,18 @@ class ActiveProc {
             default:
                 break;
         }
-        
-        if(!in_array($str_1, ctx()->privateState->battlePassRewardReceived)){         
+
+        if (!in_array($str_1, ctx()->privateState->battlePassRewardReceived)) {
             StoreProc::AddMultiItemInStore($mo->rewards_1);                     # 发放奖励
             ctx()->privateData(true)->battlePassRewardReceived[] = $str_1;
         }
-        
+
         //my_Assert(!in_array($str_1, ctx()->privateState->battlePassRewardReceived), ErrCode::active_hasgetted);
-        if($isHasBuy_high && !in_array($str_2, ctx()->privateState->battlePassRewardReceived)){
+        if ($isHasBuy_high && !in_array($str_2, ctx()->privateState->battlePassRewardReceived)) {
             StoreProc::AddMultiItemInStore($mo->rewards_2);                     # 发放奖励
             ctx()->privateData(true)->battlePassRewardReceived[] = $str_2;
         }
-                                                 
+
         UserProc::updateUserInfo();                                             # 回存
         return Resp::ok(array('gold' => ctx()->baseInfo->gold,
                     'cash' => ctx()->baseInfo->cash,
@@ -553,7 +569,7 @@ class ActiveProc {
                     'reward' => StoreProc::$reward,
                     'reward_Gem' => StoreProc::$reward_Gem,
                     'reward_equip' => StoreProc::$reward_equip,
-                    "tili" => ctx()->baseInfo->tili, 
+                    "tili" => ctx()->baseInfo->tili,
                     "tili_ts" => ctx()->baseInfo->tili_ts,
         ));
     }
@@ -567,29 +583,29 @@ class ActiveProc {
         $rmArr = array();
         foreach ($list as $str) {
             $arr = explode('-', $str);
-            if($arr[0] == $type){
+            if ($arr[0] == $type) {
                 $rmArr[] = $str;
             }
         }
-        
+
         foreach ($rmArr as $k) {
-            StlUtil::arrayRemove(ctx()->privateData(true)->battlePassRewardReceived, $k); 
+            StlUtil::arrayRemove(ctx()->privateData(true)->battlePassRewardReceived, $k);
         }
     }
-    
+
     /**
      * 7日签到 数据更新
      */
-    public static function InitDay7_Sign_NewPlayer($unlock = false) {     
+    public static function InitDay7_Sign_NewPlayer($unlock = false) {
         if (!$unlock && !FightProc::isFunUnlock(21)) {//之所以这有两个判断是因为这个 活动解锁的代码监测位置问题,fightProc 里解锁监测代码在 $gateInfo->tz_state = $index;之前了 这个位置没有办法解锁
             return;
         }
         $index = count(ctx()->privateState->day7_drawed_newPlayer_LoginDays) + 1;
         if (count(ctx()->privateState->day7_drawed_newPlayer_LoginDays) < 7) {
             ctx()->privateState->day7_drawed_newPlayer_LoginDays[] = $index;
-        }                      
+        }
     }
-    
+
     /**
      * 6110 新手7日签到
      * @return type
@@ -614,5 +630,5 @@ class ActiveProc {
                     'reward_equip' => StoreProc::$reward_equip,
         ));
     }
-    
+
 }