Forráskód Böngészése

Merge branch 'dev' of http://ylsjtt.game7000.com:3000/YLSJ/jzhj2024server into dev

wanggangzero 9 hónapja
szülő
commit
01e2bd36df

+ 5 - 0
Gameserver/App/base/CmdCode.php

@@ -261,6 +261,11 @@ class CmdCode {
      * 角色升星
      */
     const hero_strengthenStar = 6603;
+    
+    /**
+     * 解锁英雄记录重置
+     */
+    const hero_resetUnlockHero = 6604;
 //
 // </editor-fold>
 // <editor-fold defaultstate="collapsed" desc="邮件操作码 - 67xx">

+ 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-13 15:07:22
+ // 日期: 2024-08-23 09:41:29
 ////////////////////
 
 /**

+ 2 - 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-08-13 11:32:57
+ // 日期: 2024-08-13 17:40:15
 ////////////////////
 
 
@@ -46,6 +46,7 @@ class sm_activeTask
     *  207: 通关主线挑战第X关的X模式X次;参数1:关卡ID和难度(1普通,2困难,3噩梦),逗号分隔。;参数2:次数
     *  208: 领取排行榜元宝奖励X次;参数1:无;参数2:次数(数值)
     *  209: 玩家等级到达X级;参数1:无;参数2:等级(数值)
+    *  210:通关第X关;参数1:关卡ID;参数2:通关次数(记录已通关状态)
     *  301: 完成X次启灵;参数1:无;参数2:次数(数值)
     *  302: 完成X次关键启灵;参数1:无;参数2:次数(数值)
     *  401: 镶嵌X个X品质以上宝石;参数1:宝石品质(数值);参数2:宝石数量

+ 2 - 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-08-13 11:32:57
+ // 日期: 2024-08-13 17:40:15
 ////////////////////
 
 
@@ -46,6 +46,7 @@ class sm_activeTask_type
     *  207: 通关主线挑战第X关的X模式X次;参数1:关卡ID和难度(1普通,2困难,3噩梦),逗号分隔。;参数2:次数
     *  208: 领取排行榜元宝奖励X次;参数1:无;参数2:次数(数值)
     *  209: 玩家等级到达X级;参数1:无;参数2:等级(数值)
+    *  210:通关第X关;参数1:关卡ID;参数2:通关次数(记录已通关状态)
     *  301: 完成X次启灵;参数1:无;参数2:次数(数值)
     *  302: 完成X次关键启灵;参数1:无;参数2:次数(数值)
     *  401: 镶嵌X个X品质以上宝石;参数1:宝石品质(数值);参数2:宝石数量

+ 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-08 17:28:50
+ // 日期: 2024-08-23 09:09:55
 ////////////////////
 
 

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

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-08-12 15:50:45
+ // 日期: 2024-08-20 14:05:49
 ////////////////////
 
 

+ 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-08-13 12:05:49
+ // 日期: 2024-08-20 17:35:49
 ////////////////////
 
 

+ 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-08-06 09:42:14
+ // 日期: 2024-08-19 15:26:27
 ////////////////////
 
 

+ 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-08-06 09:42:14
+ // 日期: 2024-08-19 15:26:27
 ////////////////////
 
 

+ 16 - 6
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-13 11:35:49
+ // 日期: 2024-08-22 16:05:49
 ////////////////////
 
 
@@ -53,6 +53,11 @@ class sm_hero
     */
     public $desc;
 
+    /**
+    * @var Int32 是否为默认解锁 (0:不解锁 1:解锁) default(0) 
+    */
+    public $isDefaultUnlock;
+
     /**
     * @var String 需要的人物碎片:itemId,num  
     */
@@ -99,22 +104,22 @@ class sm_hero
     public $dec_demage;
 
     /**
-    * @var Int32 重击率(百分比)  
+    * @var Single 重击率(百分比)  
     */
     public $bigHit_rate;
 
     /**
-    * @var Int32 重击倍率: 初始2倍 default(200) 
+    * @var Single 重击倍率: 初始2倍 default(200) 
     */
     public $bigHit_Val;
 
     /**
-    * @var Int32 神圣一击率(百分比)  
+    * @var Single 神圣一击率(百分比)  
     */
     public $sentHit_rate;
 
     /**
-    * @var Int32 普通怪物秒杀几率(百分比) default(0) 
+    * @var Single 普通怪物秒杀几率(百分比) default(0) 
     */
     public $instantKillMonsterRate;
 
@@ -195,7 +200,7 @@ class sm_hero
     public $mul_gainGold;
 
     /**
-    * @var Int32 角色特殊词条 default(0) 
+    * @var String 角色特殊词条 default(0) 
     */
     public $special_predicate;
 
@@ -204,5 +209,10 @@ class sm_hero
     */
     public $headImg;
 
+    /**
+    * @var Int32 角色卡(道具ID) default(0) 
+    */
+    public $roleCard;
+
 }
 

+ 16 - 6
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-13 11:35:49
+ // 日期: 2024-08-22 16:05:49
 ////////////////////
 
 
@@ -53,6 +53,11 @@ class sm_heroType_typeId
     */
     public $desc;
 
+    /**
+    * @var Int32 是否为默认解锁 (0:不解锁 1:解锁) default(0) 
+    */
+    public $isDefaultUnlock;
+
     /**
     * @var String 需要的人物碎片:itemId,num  
     */
@@ -99,22 +104,22 @@ class sm_heroType_typeId
     public $dec_demage;
 
     /**
-    * @var Int32 重击率(百分比)  
+    * @var Single 重击率(百分比)  
     */
     public $bigHit_rate;
 
     /**
-    * @var Int32 重击倍率: 初始2倍 default(200) 
+    * @var Single 重击倍率: 初始2倍 default(200) 
     */
     public $bigHit_Val;
 
     /**
-    * @var Int32 神圣一击率(百分比)  
+    * @var Single 神圣一击率(百分比)  
     */
     public $sentHit_rate;
 
     /**
-    * @var Int32 普通怪物秒杀几率(百分比) default(0) 
+    * @var Single 普通怪物秒杀几率(百分比) default(0) 
     */
     public $instantKillMonsterRate;
 
@@ -195,7 +200,7 @@ class sm_heroType_typeId
     public $mul_gainGold;
 
     /**
-    * @var Int32 角色特殊词条 default(0) 
+    * @var String 角色特殊词条 default(0) 
     */
     public $special_predicate;
 
@@ -204,5 +209,10 @@ class sm_heroType_typeId
     */
     public $headImg;
 
+    /**
+    * @var Int32 角色卡(道具ID) default(0) 
+    */
+    public $roleCard;
+
 }
 

+ 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-07-30 17:21:26
+ // 日期: 2024-08-22 16:05:49
 ////////////////////
 
 

+ 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-24 14:54:00
+ // 日期: 2024-08-15 16:43:50
 ////////////////////
 
 

+ 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-01 17:04:24
+ // 日期: 2024-08-14 10:10:24
 ////////////////////
 
 

+ 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-13 14:03:43
+ // 日期: 2024-08-22 14:38:17
 ////////////////////
 
 

+ 1 - 1
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-13 11:03:31
+ // 日期: 2024-08-22 18:05:49
 ////////////////////
 
 

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

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-08-08 13:48:10
+ // 日期: 2024-08-22 19:31:45
 ////////////////////
 
 

+ 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-13 12:05:49
+ // 日期: 2024-08-22 19: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-13 12:05:49
+ // 日期: 2024-08-22 19:35:49
 ////////////////////
 
 

+ 8 - 1
Gameserver/App/model/User/Info_Heros.php

@@ -25,6 +25,13 @@ class Info_Heros extends Object_ext {
      * @var type
      */
     public $Dic = null;
+    
+    /**
+     * 角色卡解锁英雄记录
+     * @var type
+     */
+    #[ArrayType]
+    public $roleCardUnlockHeroList = array();
 
     public function initialize() {
         $heroConf = GameConfig::hero();
@@ -33,7 +40,7 @@ class Info_Heros extends Object_ext {
                 $insHero = new Ins_Hero();
                 $insHero->Id = $heroId;
                 $insHero->isUnlock = 0;               
-                if ($mo->heroDebris_need == null) {
+                if ($mo->isDefaultUnlock == 1) {
                     $insHero->isUnlock = 1;
                 }                              
                 $this->Dic->$heroId = $insHero;

+ 2 - 2
Gameserver/App/process/EmailProc.php

@@ -198,7 +198,7 @@ class EmailProc {
                     //'reward' => $mail->appendix
                     'reward' => $reward,
                     'reward_Gem' => $reward_Gem,
-                    'redTip'=>$tag,
+                    'redTip'=>$tag,                  
         ));
     }
 
@@ -255,7 +255,7 @@ class EmailProc {
                     'num' => $n,
                     'reward' => $reward,
                     'reward_Gem' => $reward_Gem,
-                    'redTip'=>$tag,
+                    'redTip'=>$tag,                   
         ));
     }
 

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

@@ -685,6 +685,7 @@ class FightProc {
             'newLevel' => $newLevel,
             'funUnlockRecord' => ctx()->privateState->funUnlockRecord,
             'skillUnlockRecord' => ctx()->privateState->skillUnlockRecord,
+            'heros'=> ctx()->heros,
         );
         return Resp::ok($ret);
     }

+ 101 - 38
Gameserver/App/process/HeroProc.php

@@ -28,69 +28,82 @@ class HeroProc {
                 return self::UnlockHero();
             case CmdCode::hero_strengthenStar:                                  # 6603 角色升星
                 return self::HeroStrengthenStar();
+            case CmdCode::hero_resetUnlockHero:                                 # 6604 角色卡解锁英雄
+                return self::ResetUnlockHero();    
             default:
                 Err(ErrCode::cmd_err);
         }
     }
     
+    private static function ResetUnlockHero() {
+        list($heroId) = req()->paras;
+        
+        if(in_array($heroId, ctx()->heros->roleCardUnlockHeroList)){
+            StlUtil::arrayRemove(ctx()->heros->roleCardUnlockHeroList, $heroId);
+        }
+              
+        UserProc::updateUserInfo();
+        return Resp::ok(array());
+        
+    }
+
     /**
      * 6603 角色升星
      * @return type
      */
-    private static function HeroStrengthenStar(){
-        list($heroId) = req()->paras;             
-        
+    private static function HeroStrengthenStar() {
+        list($heroId) = req()->paras;
+
         $mo = GameConfig::hero_getItem($heroId);
         my_Assert($mo != null, ErrCode::err_const_no);
-        
+
         my_Assert(StlUtil::dictHasProperty(ctx()->heros->Dic, $heroId), "找不到英雄配置数据!");
         my_Assert(ctx()->heros->Dic->$heroId->isUnlock == 1, "英雄未解锁!");
-        
-        $nextMo = null;       
+
+        $nextMo = null;
         $typeList = GameConfig::heroType_typeId_getItemArray($mo->typeID);
         foreach ($typeList as $item) {
-            if($item->starLv == $mo->starLv +1){
+            if ($item->starLv == $mo->starLv + 1) {
                 $nextMo = $item;
                 break;
             }
-                
         }
-        
+
         my_Assert($nextMo != null, "没有下一星级配置信息");
-        
+
         $heroDebrisList = explode(',', $nextMo->heroDebris_need);
         $itemId = $heroDebrisList[0];
         $itemNum = $heroDebrisList[1];
-        
-        my_Assert(StlUtil::dictHasProperty(ctx()->store->items, $itemId) && ctx()->store->items->$itemId >= $itemNum, ErrCode::notenough_item);      
+
+        my_Assert(StlUtil::dictHasProperty(ctx()->store->items, $itemId) && ctx()->store->items->$itemId >= $itemNum, ErrCode::notenough_item);
         ctx()->store->removeItem($itemId, $itemNum);
-        
+
         $nextHeroId = $nextMo->id;
-        
+
         $ins_hero = new Ins_Hero(ctx()->heros->Dic->$heroId);
-        $ins_hero->Id = $nextHeroId;                     
+        $ins_hero->Id = $nextHeroId;
         ctx()->heros->Dic->$nextHeroId = $ins_hero;
-        if(ctx()->heros->CurrentHeroId == $heroId){
+        if (ctx()->heros->CurrentHeroId == $heroId) {
             ctx()->heros->CurrentHeroId = $nextHeroId;
         }
         StlUtil::dictRemove(ctx()->heros->Dic, $heroId);
-                             
+
         UserProc::updateUserInfo();
-        return Resp::ok(array(                   
+        return Resp::ok(array(
                     'store' => ctx()->store,
-                    'heros'=>ctx()->heros,
-                    'newHeroId'=>$nextHeroId,
+                    'heros' => ctx()->heros,
+                    'newHeroId' => $nextHeroId,
         ));
     }
-    
+
     /**
      * 购买角色
      * @return type
      */
-    private static function BuyHero(){
+    private static function BuyHero() {
         list($heroId) = req()->paras;                                        # 切换英雄id
         my_Assert(GameConfig::hero_getItem($heroId) != null, "找不到英雄配置数据!");
-       
+
         ctx()->heros->Dic->$heroId->isUnlock = 1;
 
         return Resp::ok();
@@ -101,35 +114,84 @@ class HeroProc {
      * @return type
      */
     private static function UnlockHero() {
-        list($heroId) = req()->paras;             
-        
+        list($heroId) = req()->paras;
+
         $mo = GameConfig::hero_getItem($heroId);
         my_Assert($mo != null, ErrCode::err_const_no);
-        
+
         my_Assert(StlUtil::dictHasProperty(ctx()->heros->Dic, $heroId), "找不到英雄配置数据!");
         my_Assert(ctx()->heros->Dic->$heroId->isUnlock == 0, "英雄已经解锁!");
-        
+
         //$heroDebris_need = $mo->heroDebris_need;
         $heroDebrisList = explode(',', $mo->heroDebris_need);
         $itemId = $heroDebrisList[0];
         $itemNum = $heroDebrisList[1];
-        
+
         my_Assert(StlUtil::dictHasProperty(ctx()->store->items, $itemId) && ctx()->store->items->$itemId >= $itemNum, ErrCode::notenough_item);
-        
+
         ctx()->store->removeItem($itemId, $itemNum);
-        
-        FightProc::skillUnlock_heroUnlock($heroId);//这个接口位置不能动
-        
-        ctx()->heros->Dic->$heroId->isUnlock = 1;//解锁
-        ctx()->heros->Dic->$heroId->isNewHeadImgTip = 1;                   
-        
+
+        self::UnlockNewHero($heroId);
+
         UserProc::updateUserInfo();
-        return Resp::ok(array(                   
+        return Resp::ok(array(
                     'store' => ctx()->store,
-                    'heros'=>ctx()->heros,
+                    'heros' => ctx()->heros,
                     'skillUnlockRecord' => ctx()->privateState->skillUnlockRecord,
         ));
-       
+    }
+
+    public static function UnlockNewHero($heroId) {
+        FightProc::skillUnlock_heroUnlock($heroId); //这个接口位置不能动
+
+        ctx()->heros->Dic->$heroId->isUnlock = 1; //解锁
+        ctx()->heros->Dic->$heroId->isNewHeadImgTip = 1;
+    }
+
+    public static function RoleCardUnlockHero($itemId, $num) {
+        $heroDic = GameConfig::hero();
+        $heroTypeId = 0;
+
+        $tMo = null;
+        foreach ($heroDic as $mo) {
+            if ($itemId == $mo->roleCard) {
+                $heroTypeId = $mo->typeID;
+                $tMo = $mo;
+                break;
+            }
+        }
+        $tag = false;
+        if ($heroTypeId != 0) {
+            $dic = ctx()->heros->Dic;
+            foreach ($dic as $heroItem) {
+                $hero = GameConfig::hero_getItem($heroItem->id);
+                if ($hero->typeID == $heroTypeId) {
+                    $tag = true;
+                    break;
+                }
+            }
+
+            if ($tag) {//英雄已经解锁,则转为碎片
+                for ($i = 0; $i < $num; $i++) {
+                    if ($tMo->heroDebris_need != null) {
+                        StoreProc::AddMultiItemInStore($tMo->heroDebris_need);
+                    }
+                }
+            } else {//解锁英雄
+                for ($i = 0; $i < $num; $i++) {
+                    if ($i == 0) {
+                        HeroProc::UnlockNewHero($tMo->id);
+                        ctx()->heros->roleCardUnlockHeroList[] = $tMo->id;
+                        
+                        //StoreProc::$reward_hero[] = $tMo->id;
+                    } else {
+                        StoreProc::AddMultiItemInStore($tMo->heroDebris_need);
+                    }
+                }
+            }
+        }
+        
+        UserProc::updateUserInfo();
     }
 
     /**
@@ -141,4 +203,5 @@ class HeroProc {
         ctx()->heros->CurrentHeroId = $newHeroId;
         return Resp::ok();
     }
+
 }

+ 1 - 0
Gameserver/App/process/ShopProc.php

@@ -462,6 +462,7 @@ class ShopProc {
                     'privateState' => $user->privateState,
                     'store' => $user->store,
                     'task' => ctx()->task,
+                    'heros'=> ctx()->heros,
                     'reward' => StoreProc::$reward,
                     'reward_Gem' => StoreProc::$reward_Gem,
         ));

+ 6 - 0
Gameserver/App/process/StoreProc.php

@@ -749,6 +749,8 @@ class StoreProc {
     
     static $reward = array();
     static $reward_Gem = array();
+    static $reward_hero = array();
+    
     /**
      * 具体奖励存入背包
      * @param type $goodsStr
@@ -792,6 +794,10 @@ class StoreProc {
                     if ($itemMo->itemType == 100) {//图纸
                         self::checkEquipUpgradeTip();
                     }
+                    break;
+                case 502://角色卡
+                    HeroProc::RoleCardUnlockHero($itemId, $num);
+                    
                     break;
                 case 201://宝石           
                     for ($i = 0; $i < $num; $i++) {                       

+ 5 - 2
Gameserver/App/process/TaskProc.php

@@ -63,7 +63,7 @@ class TaskProc {
         } else {
             foreach ($dic as $uid => $task) {
                 $t = new Ins_TaskStep_Active($task);
-                if ($t->mo()->type == $type && $t->isFinish()) {
+                if ($t->mo()->type == $type && $t->state == Enum_TaskCardStateType::finish) {
                     $arr[] = $uid;
                 }
             }
@@ -110,6 +110,7 @@ class TaskProc {
                     'reward_Gem' => StoreProc::$reward_Gem,
                     'gold' => ctx()->baseInfo->gold,
                     'cash' => ctx()->baseInfo->cash,
+                    'hero'=> ctx()->heros,
         ));
     }
 
@@ -152,6 +153,7 @@ class TaskProc {
                     'reward_Gem' => StoreProc::$reward_Gem,
                     'gold' => ctx()->baseInfo->gold,
                     'cash' => ctx()->baseInfo->cash,
+                    'reward_hero'=> StoreProc::$reward_hero,
         ));
     }
 
@@ -214,7 +216,8 @@ class TaskProc {
                     'reward' => StoreProc::$reward,
                     'reward_Gem' => StoreProc::$reward_Gem,
                     'gold' => ctx()->baseInfo->gold,
-                    'cash' => ctx()->baseInfo->cash,
+                    'cash' => ctx()->baseInfo->cash,   
+                    'heros'=> ctx()->heros,
         ));
     }