Преглед на файлове

特权月卡加体力上限

cyzhao преди 11 месеца
родител
ревизия
a9966e9dfe

+ 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-06-20 17:10:35
+ // 日期: 2024-06-24 11:28:06
 ////////////////////
 
 /**

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

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-06-11 11:20:50
+ // 日期: 2024-06-21 18:13:18
 ////////////////////
 
 

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

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-06-14 14:24:46
+ // 日期: 2024-06-24 11:15:02
 ////////////////////
 
 

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

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-06-14 14:24:46
+ // 日期: 2024-06-24 11:15:02
 ////////////////////
 
 

+ 6 - 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-06-20 14:54:52
+ // 日期: 2024-06-24 11:08:12
 ////////////////////
 
 
@@ -228,5 +228,10 @@ class sm_globalsettings
     */
     public $Relive_cost;
 
+    /**
+    * @var int 购买特权月卡后体力上限增加  
+    */
+    public $tili_RecoverrMax_Add_HonourCard;
+
 }
 

+ 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-06-20 11:05:46
+ // 日期: 2024-06-21 17:05:46
 ////////////////////
 
 

+ 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-06-20 11:05:46
+ // 日期: 2024-06-21 17:05:46
 ////////////////////
 
 

+ 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-06-20 15:05:46
+ // 日期: 2024-06-21 15:05:46
 ////////////////////
 
 

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

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-06-07 18:24:37
+ // 日期: 2024-06-20 17:35:46
 ////////////////////
 
 

+ 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-06-20 17:11:02
+ // 日期: 2024-06-24 11:05:46
 ////////////////////
 
 

+ 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-06-20 17:11:02
+ // 日期: 2024-06-24 11:05:46
 ////////////////////
 
 

+ 20 - 5
Gameserver/App/model/User/Info_UserBase.php

@@ -143,19 +143,33 @@ class Info_UserBase extends Object_ext {
         //ActiveProc::ChangeTili($amt);
         TaskProc::OnAccumulateTiliNum($amt);
         for ($i = 0; $i < $amt; $i++) {
-            if ((now() - $this->tili_ts) / glc()->tili_RecoverTS < glc()->tili_RecoverrMax) {
+            if ((now() - $this->tili_ts) / glc()->tili_RecoverTS < $this->GetTili_RecoverrMax()) {
                 $this->tili_ts -= glc()->tili_RecoverTS;
             } else {
                 $this->tili++;
             }
         }
     }
+    
+    /**
+     * 体力恢复的最大值(购买或者邮件领取的可以超出,超出后体力恢复失效)  
+     */
+    function GetTili_RecoverrMax() {
+        $maxTili = glc()->tili_RecoverrMax;
+        $monthTs = 30 * 24 * 60 * 60;
+        if(ctx()->privateState->honourCardShop_ts > 0 && now() - ctx()->privateState->honourCardShop_ts < $monthTs){
+            $maxTili += glc()->tili_RecoverrMax_Add_HonourCard;
+        }
+        
+        return $maxTili;
+    }
 
     /**
      * 检查并修改体力ts的最小值.
      */
     function Reset_tilits() {
-        $min = now() - glc()->tili_RecoverTS * glc()->tili_RecoverrMax;
+        $maxTili = $this->GetTili_RecoverrMax();
+        $min = now() - glc()->tili_RecoverTS * $maxTili;
         if ($this->tili_ts < $min) {
             $this->tili_ts = $min;
         }
@@ -191,8 +205,9 @@ class Info_UserBase extends Object_ext {
      * @return int 计算当前可用体力值
      */
     function CurTili() {
+        $maxTili = $this->GetTili_RecoverrMax();       
         $rec = (now() - $this->tili_ts) / glc()->tili_RecoverTS;
-        $rec = glc()->tili_RecoverrMax < $rec ? glc()->tili_RecoverrMax : $rec;
+        $rec = $maxTili < $rec ? $maxTili : $rec;
         $t = $this->tili + $rec;
         return $t;
     }
@@ -240,11 +255,11 @@ class Info_UserBase extends Object_ext {
         if ($amt >= 0) {
             if ($this->cash - $amt >= 0) {
                 $this->cash -= $amt;
+                TaskProc::OnConsumeCashNum($amt);
                 return true;
             }
         }
-
-        TaskProc::OnConsumeCashNum($amt);
+        
         return false;
     }