cyzhao 10 mesiacov pred
rodič
commit
c11741d229

+ 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-07-15 10:31:44
+ // 日期: 2024-07-15 15:21:33
 ////////////////////
 
 /**

+ 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-07-15 09:51:44
+ // 日期: 2024-07-15 14:24:14
 ////////////////////
 
 

+ 0 - 5
Gameserver/App/model/Const/sm_shop_box.php

@@ -58,11 +58,6 @@ class sm_shop_box
     */
     public $cost_one_yaoshi;
 
-    /**
-    * @var String 买十次花费钥匙数量  
-    */
-    public $cost_ten_yaoshi;
-
     /**
     * @var String X次必出某品阶宝石 例子:次数,必出的宝石品阶  
     */

+ 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-07-15 10:27:20
+ // 日期: 2024-07-15 14:27:52
 ////////////////////
 
 

+ 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-07-15 10:27:20
+ // 日期: 2024-07-15 14:27:52
 ////////////////////
 
 

+ 23 - 17
Gameserver/App/process/ShopProc.php

@@ -37,12 +37,12 @@ class ShopProc {
         $addTili = 0;
         if ($type == 1) {//广告
             $maxNum = glc()->GuanggaoGetTili_DailyMaxNum;
-            my_Assert(ctx()->privateState->guanggaoGetTiliNum < $maxNum, ErrCode::user_shop_GuanggaoGetTiliNumLimit);                      
-            my_Assert(now() - ctx()->privateState->guanggaoGetTili_ts > 300, ErrCode::user_shop_DownTsLimit);           
+            my_Assert(ctx()->privateState->guanggaoGetTiliNum < $maxNum, ErrCode::user_shop_GuanggaoGetTiliNumLimit);
+            my_Assert(now() - ctx()->privateState->guanggaoGetTili_ts > 300, ErrCode::user_shop_DownTsLimit);
             $addTili = glc()->GuanggaoGetTili;
             ctx()->baseInfo->Add_tili(glc()->GuanggaoGetTili);
             ctx()->privateState->guanggaoGetTiliNum += 1;
-            
+
             ctx()->privateState->guanggaoGetTili_ts = now();
         } else {
             $maxNum = glc()->BuyTili_DailyMaxNum;
@@ -167,16 +167,7 @@ class ShopProc {
             case EnumShopGift::GemBox_Shop ://宝石宝箱
                 $mo = GameConfig::shop_box_getItem($typeId);
                 my_Assert($mo != null, ErrCode::err_const_no);
-
-                if ($buyNum > 0) {
-                    $cost = $mo->cost_ten;
-                    if ($buyNum == 1) {
-                        $cost = $mo->cost_one;
-                    }
-                    my_Assert($user->baseInfo->cash >= $cost, ErrCode::notenough_cash_msg);
-                    $user->baseInfo->Consume_Cash($cost);
-                }
-
+                
                 if ($mo->type == 1) {
                     if ($buyNum == 0) {
                         $buyNum = 1;
@@ -190,6 +181,22 @@ class ShopProc {
                         $user->privateState->lastFreeGetTs_ShopBoxBright = now();
                     }
                 }
+                
+                if ($buyNum == 1) {
+                    $cost = $mo->cost_one;
+                    $yaoshiArr = explode(',', $mo->cost_one_yaoshi);
+                    $itemId = $yaoshiArr[0];
+                    if (StlUtil::dictHasProperty(ctx()->store->items, $itemId) && ctx()->store->items[$itemId] >= $yaoshiArr[1]) {
+                        ctx()->store->removeItem($itemId, $yaoshiArr[1]);
+                    } else {
+                        my_Assert($user->baseInfo->cash >= $cost, ErrCode::notenough_cash_msg);
+                        $user->baseInfo->Consume_Cash($cost);
+                    }
+                } elseif ($buyNum == 10) {
+                    $cost = $mo->cost_ten;
+                    my_Assert($user->baseInfo->cash >= $cost, ErrCode::notenough_cash_msg);
+                    $user->baseInfo->Consume_Cash($cost);
+                }
 
                 $arr = array();
                 $arr[] = 1;
@@ -275,11 +282,11 @@ class ShopProc {
 
                         $n = rand(0, count($gemList) - 1);
                         $gem = StoreProc::initGem($gemList[$n]->typeId);
-                        
-                        if($mo->type == 2){
+
+                        if ($mo->type == 2) {
                             SystemProc::GetGem_GreaterOrangeQual_ShopBox(req()->zoneid, ctx()->baseInfo->name, $gemList[$n]->typeId);
                         }
-                        
+
                         $resultArr[] = $gem->uid;
                         StoreProc::PutGemInStore($gem);
                     }
@@ -456,7 +463,6 @@ class ShopProc {
                     $user->privateState->monthCardShop_ts = now();
                     StoreProc::AddMultiItemInStore($mo->buy_reward);
                     EmailProc::SendMonthCardRewardMail(req()->zoneid, req()->uid, $mo->daily_reward);
-                    
                 } else {
                     my_Assert($user->privateState->honourCardShop_ts == 0, ErrCode::err_const_no);
                     $user->privateState->honourCardShop_ts = now();