wanggangzero 9 meses atrás
pai
commit
7c5d1ca827

+ 14 - 6
Gameserver/App/base/CmdCode.php

@@ -157,13 +157,11 @@ class CmdCode {
      * 领取活跃点宝箱奖励
      */
     const cmd_task_receiveActivePointBoxReward = 6205;
-    
+
     /**
      * 一键领取
      */
     const cmd_task_prizesAllreceived = 6206;
-
-
 // </editor-fold>
 //
 // <editor-fold defaultstate="collapsed" desc="背包操作码 - 64xx">
@@ -261,7 +259,7 @@ class CmdCode {
      * 角色升星
      */
     const hero_strengthenStar = 6603;
-    
+
     /**
      * 解锁英雄记录重置
      */
@@ -306,7 +304,7 @@ class CmdCode {
 // <editor-fold defaultstate="collapsed" desc="战斗操作码 - 68xx">
 
     /**
-     * 主线剧情: 奖励结算
+     * 主线剧情关卡: 奖励结算
      */
     const fight_settle = 6801;
 
@@ -409,7 +407,17 @@ class CmdCode {
      * 每天重置挑战红点
      */
     const fight_ResetChallange_RedMask = 6821;
-    
+
+    /**
+     * 封印/解锁技能
+     */
+    const fight_lockSkill = 6822;
+
+    /**
+     * 解锁更多技能封印数量
+     */
+    const fight_buyLockSkillCount = 6823;
+
 // </editor-fold>
 // <editor-fold defaultstate="collapsed" desc="系统操作码 - 69xx">
 

+ 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-08-23 09:41:29
+ // 日期: 2024-08-27 14:21:45
 ////////////////////
 
 /**

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

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-08-23 09:09:55
+ // 日期: 2024-08-23 11:35:49
 ////////////////////
 
 

+ 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-08-06 10:05:48
+ // 日期: 2024-08-27 14:12:36
 ////////////////////
 
 
@@ -253,5 +253,20 @@ class sm_globalsettings
     */
     public $FirstMainTaskId;
 
+    /**
+    * @var int 技能封印按钮可用条件(已解锁技能总数达到X)  
+    */
+    public $Skill_LockBtn_EnableCount;
+
+    /**
+    * @var string 花费XX元宝将技能封印上限提升至X个  
+    */
+    public $Skill_LockBtn_BuyCount_Cost;
+
+    /**
+    * @var int 技能封印初始可用数量  
+    */
+    public $Skill_LockBtn_InitCount;
+
 }
 

+ 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-08-22 16:05:49
+ // 日期: 2024-08-27 09:35:49
 ////////////////////
 
 

+ 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-08-22 16:05:49
+ // 日期: 2024-08-27 09:35:49
 ////////////////////
 
 

+ 2 - 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-08-22 16:05:49
+ // 日期: 2024-08-23 16:56:58
 ////////////////////
 
 
@@ -45,6 +45,7 @@ class sm_item
     *  301.洗练石
     *  401.启灵石
     *  501.角色碎片
+    *  502.角色卡
     *  701. 随机礼盒 default(0) 
     */
     public $itemType;

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

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-08-14 10:10:24
+ // 日期: 2024-08-27 09:35:49
 ////////////////////
 
 

+ 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-08-22 14:38:17
+ // 日期: 2024-08-23 10:47:17
 ////////////////////
 
 

+ 9 - 7
Gameserver/App/model/Const/sm_skills.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-08-22 18:05:49
+ // 日期: 2024-08-26 16:07:02
 ////////////////////
 
 
@@ -177,11 +177,6 @@ class sm_skills
     */
     public $immediate_hp;
 
-    /**
-    * @var Int32 解锁(成就Id,0无需解锁) 2023.11.20  
-    */
-    public $unlock_acc_id;
-
     /**
     * @var Int32 稀有度(影响三选一出现几率) 2023.11.20  
     */
@@ -233,12 +228,19 @@ class sm_skills
     */
     public $emit_number;
 
+    /**
+    * @var Int32 解锁顺序(从小到大)2024.8.26  
+    */
+    public $unlock_order;
+
     /**
     * @var String 技能解锁条件
+    *  类型0: 默认解锁; 举例 0:0 默认解锁, 不在法术书界面展示, 0:1 默认解锁, 在法术书界面展示
     *  类型1:通关指定关卡解锁技能;例如通关第一关:1:1(类型+第X关)
     *  类型2:解锁指定人物解锁技能:例如解锁孙悟空:2:1001(类型+角色唯一ID)
     *  类型3:玩家失败次数解锁技能:例如玩家失败一次解锁技能3:1(类型+累计失败次数)
-    *  类型4:不解锁技能 4:9999  
+    *  类型4:不解锁技能 4:9999
+    *  类型5: 玩家等级解锁, 玩家等级达到指定值(比如5级),配置1:5(玩家等级)  
     */
     public $unlock_acc_id_new;
 

+ 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-08-22 19:35:49
+ // 日期: 2024-08-27 11:35:49
 ////////////////////
 
 

+ 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-08-22 19:35:49
+ // 日期: 2024-08-27 11:35:49
 ////////////////////
 
 

+ 43 - 21
Gameserver/App/model/User/Info_PrivateState.php

@@ -28,15 +28,14 @@ class Info_PrivateState extends Object_ext {
      */
     #[ArrayType]
     public $dailyShopReceived = array();
-    
+
     /**
      * 每日商店广告次数
      * @var type
      */
     public $dailyShop_GuangGaoNum = 0;
-
     public $dailyShop_GuangGaoTs = 0;
-    
+
     /**
      * 每日随机到的信息
      * @var type
@@ -95,7 +94,7 @@ class Info_PrivateState extends Object_ext {
      */
     public $junbeiShop_AllNumRecord = null;
     public $junbeiShop_XinYuan = null;
-    
+
     /**
      * 登录天数
      * @var array[]
@@ -108,13 +107,13 @@ class Info_PrivateState extends Object_ext {
      */
     #[ArrayType]
     public $day7_drawed = array();
-    
+
     /**
      * 7日 累计
      * @var type
      */
     public $day7_accumulate = 0;
-    
+
     /**
      * 7日 累计奖励领取记录
      * @var type
@@ -145,13 +144,12 @@ class Info_PrivateState extends Object_ext {
      * @var type
      */
     public $buyNum_ShopBoxBright = 0;
-    
+
     /**
      * 金币商城第一个冷却时间记录
      * @var type
      */
     public $goldShop_CoolDownTs_1 = 0;
-
     public $goldShop_GuangGaoNum = 0;
 
     /**
@@ -159,24 +157,25 @@ class Info_PrivateState extends Object_ext {
      * @var type
      */
     public $goldShop_CoolDownTs_2 = 0;
+
     /**
      * 金币商城第三个冷却时间记录
      * @var type
      */
     public $goldShop_CoolDownTs_3 = 0;
-    
+
     /**
      * 月卡
      * @var type
      */
     //public $monthCardShop_Received = array();
-    
+
     /**
-     * 资源月卡购买时间记录 
+     * 资源月卡购买时间记录
      * @var int
      */
     public $monthCardShop_ts = 0;
-    
+
     /**
      * 特权月卡购买时间记录
      * @var int
@@ -194,7 +193,7 @@ class Info_PrivateState extends Object_ext {
      * @var type
      */
     public $buyTiliNum = 0;
-    
+
     /**
      *  广告得体力倒计时
      * @var type
@@ -204,6 +203,7 @@ class Info_PrivateState extends Object_ext {
     /*
      * 通关荣誉榜奖励领取记录
      */
+
     #[ArrayType]
     public $rankReward_drawed_MainGate = array();
 
@@ -213,13 +213,13 @@ class Info_PrivateState extends Object_ext {
      */
     #[ArrayType]
     public $rankReward_drawed_fightPower = array();
-    
+
     /**
      * @var array[] 领取激活码记录
      */
     #[ArrayType]
     public $usedTokens = array();
-    
+
     /**
      * 读公告记录
      * @var array()
@@ -231,13 +231,13 @@ class Info_PrivateState extends Object_ext {
      * 0:没有红点 1:有红点
      */
     public $redTip_Mail = 0;
-    
+
     /**
      * 关卡榜里的荣誉榜红点
      * @var type
      */
     public $redTip_RewardMainGateRank = 0;
-    
+
     /**
      * 战力榜里的荣誉榜红点
      * @var type
@@ -250,16 +250,34 @@ class Info_PrivateState extends Object_ext {
      */
     #[ArrayType]
     public $funUnlockRecord = array();
-    
+
     /**
      * 解锁的技能记录
      * @var array()
      */
     #[ArrayType]
     public $skillUnlockRecord = array();
-    
+
+    /**
+     * @var int 技能锁定数量(解锁后)
+     */
+    public $skillLockerNumber = 0;
+
+    /**
+     * @var array (解锁后)封印技能记录
+     */
+    #[ArrayType]
+    public $skillReLocked = array();
+
+    /**
+     * @var int 玩家升级前等级
+     */
     public $oldLevel = 0;
-    
+
+    /**
+     *
+     * @var int 玩家升级后等级
+     */
     public $upLevel = 0;
 
     /**
@@ -267,7 +285,7 @@ class Info_PrivateState extends Object_ext {
      * @var type
      */
     public $challange_RedMask = 0;
-    
+
     public function initialize() {
         $this->junbeiShopNumRecord = new \stdClass();
         $this->junbeiShop_AllNumRecord = new \stdClass();
@@ -281,9 +299,13 @@ class Info_PrivateState extends Object_ext {
                 $this->junbeiShop_AllNumRecord = new \stdClass();
                 $this->junbeiShop_XinYuan = new \stdClass();
                 $this->supplyBichuDic = new \stdClass();
+                $this->skillLockerNumber = glc()->Skill_LockBtn_InitCount;       # 初始值
             }
         } else {
             parent::__construct($arg);
+            if ($this->skillLockerNumber < glc()->Skill_LockBtn_InitCount) {
+                $this->skillLockerNumber = glc()->Skill_LockBtn_InitCount;       # 初始值
+            }
         }
     }
 }

+ 13 - 13
Gameserver/App/model/User/Info_UserBase.php

@@ -113,7 +113,7 @@ class Info_UserBase extends Object_ext {
         $this->gold = glc()->Init_Player_gold;
         $this->cash = glc()->Init_Player_cash;
         $this->xp = 0;
-            
+
         $this->maxXp = GameConfig::player_level_getItem(2)->xp_need;
 
         $this->level = 1;
@@ -134,7 +134,7 @@ class Info_UserBase extends Object_ext {
      */
     function Add_tili($amt) {
         my_Assert($amt >= 0, "体力amt小于0");
-        //ActiveProc::ChangeTili($amt);       
+        //ActiveProc::ChangeTili($amt);
         for ($i = 0; $i < $amt; $i++) {
             if ((now() - $this->tili_ts) / glc()->tili_RecoverTS < $this->GetTili_RecoverrMax()) {
                 $this->tili_ts -= glc()->tili_RecoverTS;
@@ -143,17 +143,17 @@ class Info_UserBase extends Object_ext {
             }
         }
     }
-    
+
     /**
-     * 体力恢复的最大值(购买或者邮件领取的可以超出,超出后体力恢复失效)  
+     * 体力恢复的最大值(购买或者邮件领取的可以超出,超出后体力恢复失效)
      */
     function GetTili_RecoverrMax() {
         $maxTili = glc()->tili_RecoverrMax;
         $monthTs = 30 * 24 * 60 * 60;
-        if(ctx()->privateState->honourCardShop_ts > 0 && now() - ctx()->privateState->honourCardShop_ts < $monthTs){
+        if (ctx()->privateState->honourCardShop_ts > 0 && now() - ctx()->privateState->honourCardShop_ts < $monthTs) {
             $maxTili += glc()->tili_RecoverrMax_Add_HonourCard;
         }
-        
+
         return $maxTili;
     }
 
@@ -174,7 +174,7 @@ class Info_UserBase extends Object_ext {
      * @return bool 成功与否
      */
     function Consume_tili($amt) {
-        if ($amt >= 0) {          
+        if ($amt >= 0) {
             TaskProc::OnAccumulateTiliNum($amt);
             $cpt = glc()->tili_RecoverTS;
             if ($this->tili > 0) {
@@ -199,7 +199,7 @@ class Info_UserBase extends Object_ext {
      * @return int 计算当前可用体力值
      */
     function CurTili() {
-        $maxTili = $this->GetTili_RecoverrMax();       
+        $maxTili = $this->GetTili_RecoverrMax();
         $rec = (now() - $this->tili_ts) / glc()->tili_RecoverTS;
         $rec = $maxTili < $rec ? $maxTili : $rec;
         $t = $this->tili + $rec;
@@ -253,7 +253,7 @@ class Info_UserBase extends Object_ext {
                 return true;
             }
         }
-        
+
         return false;
     }
 
@@ -271,15 +271,15 @@ class Info_UserBase extends Object_ext {
         while ($this->xp >= $cfgLVs->$nextLevel->xp_need) {                     # 超过升级所需经验
             if ($this->level < glc()->Game_MaxPlayerLevel) {                    # 如果未到达最大等级
                 StoreProc::AddMultiItemInStore(GameConfig::player_level_getItem($this->level)->reward, Enum_StoreSourceType::AddExp);
-                $this->level++;               
+                $this->level++;
                 $this->xp -= $cfgLVs->$nextLevel->xp_need;
                 $curLevel = $this->level;
-                $nextLevel = $curLevel + 1;                              
+                $nextLevel = $curLevel + 1;
                 my_Assert(CommUtil::isPropertyExists($cfgLVs, $nextLevel), ErrCode::err_const_no); // "取英雄升级常量数据失败." . $nextLevel . "级");
                 $this->maxXp = $cfgLVs->$nextLevel->xp_need;
-                
+
                 TaskProc::OnUserLevel_X($this->level);
-                
+                FightProc::skillUnlock_userLevel($this->level);                 # 等级解锁技能
 //                StatProc::UserLevel($nowlv);                                  # 等级统计
             } else {                                                            # 如果已到达最大等级则仅补齐缺失的经验即可
                 $this->xp = $this->maxXp;                                       # 经验不能超过最大值

+ 49 - 1
Gameserver/App/process/FightProc.php

@@ -59,11 +59,32 @@ class FightProc {
                 return self::MainTZGetReward();
             case CmdCode::fight_ResetChallange_RedMask:                         # 6821 每天重置挑战红点
                 return self::ResetChallange_RedMask();
+            case CmdCode::fight_lockSkill:                                      # 6822 封印/解封技能
+                return self::LockSkill();
+            case CmdCode::fight_buyLockSkillCount:                              # 6823 购买更多封印数量
+                return self::BuySkillLockCount();
             default:
                 Err(ErrCode::cmd_err);
         }
     }
 
+    /**
+     * 6823 购买更多技能封印数量
+     */
+    static function BuySkillLockCount() {
+        list($n) = req()->paras;                                                # 解锁数量
+        my_Assert($n > ctx()->privateData()->skillLockerNumber, ErrCode::paras_err);
+
+        return Resp::ok();
+    }
+
+    /**
+     * 6822 封印/解封技能
+     */
+    static function LockSkill() {
+
+    }
+
     /**
      * 6821 每天重置挑战红点
      */
@@ -685,7 +706,7 @@ class FightProc {
             'newLevel' => $newLevel,
             'funUnlockRecord' => ctx()->privateState->funUnlockRecord,
             'skillUnlockRecord' => ctx()->privateState->skillUnlockRecord,
-            'heros'=> ctx()->heros,
+            'heros' => ctx()->heros,
         );
         return Resp::ok($ret);
     }
@@ -725,6 +746,8 @@ class FightProc {
         }
     }
 
+// <editor-fold defaultstate="collapsed" desc="技能解锁">
+
     /**
      * 检测技能解锁的 1 关卡解锁,游玩到一定关卡解锁技能
      * @param type $resultType
@@ -818,6 +841,31 @@ class FightProc {
         }
     }
 
+    /**
+     * 玩家等级解锁技能
+     * @param type $curLevel
+     */
+    static function skillUnlock_userLevel($curLevel) {
+        $dic = GameConfig::skills();
+        foreach ($dic as $id => $mo) {
+            if ($mo->unlock_acc_id_new == null) {
+                continue;
+            }
+
+            $strList = explode(':', $mo->unlock_acc_id_new);
+            $unlockType = $strList[0];
+            $unlockId = $strList[1];
+
+            if ($unlockType != 5) {                                             // 玩家等级
+                continue;
+            }
+            if ($unlockId <= $curLevel && !in_array($mo->typeId, ctx()->privateState->skillUnlockRecord)) {
+                ctx()->privateState->skillUnlockRecord[] = $mo->typeId;
+            }
+        }
+    }
+
+// </editor-fold>
 // <editor-fold defaultstate="collapsed" desc="排行榜">
 
     /**