王刚 преди 1 година
родител
ревизия
580ffba13e

+ 33 - 1
Gameserver/App/configs/GameConfig.php

@@ -4,7 +4,7 @@
 // 由CodeGenerator创建。
 // 由CodeGenerator创建。
 // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
 // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
 // author: gwang
 // author: gwang
-// 日期: 2024-05-30 09:45:20
+// 日期: 2024-05-30 15:39:54
 ////////////////////
 ////////////////////
 
 
 namespace loyalsoft;
 namespace loyalsoft;
@@ -659,6 +659,38 @@ class GameConfig {
         return self::get_hash_item('player_level', $itemid);
         return self::get_hash_item('player_level', $itemid);
     }
     }
 
 
+    /**
+     *  辅助:主线剧情解锁
+     * @return \gate_unlock
+     */
+    public static function gate_unlock() {
+        static $a = null;
+        return self::initValue($a, 'gate_unlock');
+    }
+
+    /**
+     * @return \sm_gate_unlock gate_unlock itemArray
+     */
+    public static function gate_unlock_getItemArray($key) {
+        return self::get_hash_item('gate_unlock', $key);
+    }
+
+    /**
+     * 辅助: 波次直查
+     * @return \waveItem
+     */
+    public static function waveItem() {
+        static $a = null;
+        return self::initValue($a, 'waveItem');
+    }
+
+    /**
+     * @return \sm_waveItem waveItem item数据
+     */
+    public static function waveItem_getItem($gateId, $waveId) {
+        return self::get_hash_item('waveItem', "$gateId-$waveId");
+    }
+
     /**
     /**
      * 当前版本(时间戳)
      * 当前版本(时间戳)
      * @return \ver
      * @return \ver

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

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
  // author: gwang 
- // 日期: 2024-05-30 09:45:20
+ // 日期: 2024-05-30 15:39:54
 ////////////////////
 ////////////////////
 
 
 /**
 /**
@@ -653,6 +653,38 @@ class GameConfig {
         return self::get_hash_item('player_level', $itemid);
         return self::get_hash_item('player_level', $itemid);
     }
     }
     /**
     /**
+    *  辅助:主线剧情解锁
+    * @return \gate_unlock
+    */
+    public static function gate_unlock()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'gate_unlock');
+    }
+    /**
+    * @return \sm_gate_unlock gate_unlock itemArray 
+    */
+    public static function gate_unlock_getItemArray($key)
+    { 
+        return self::get_hash_item('gate_unlock', $key);
+    }
+    /**
+    * 辅助: 波次直查
+    * @return \waveItem
+    */
+    public static function waveItem()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'waveItem');
+    }
+    /**
+    * @return \sm_waveItem waveItem item数据 
+    */
+    public static function waveItem_getItem($gateId, $waveId)
+    { 
+        return self::get_hash_item('waveItem', "$gateId-$waveId");
+    }
+    /**
     * 当前版本(时间戳)
     * 当前版本(时间戳)
     * @return \ver
     * @return \ver
     */
     */

+ 25 - 0
Gameserver/App/model/Const/sm_gate_unlock.php

@@ -0,0 +1,25 @@
+<?php
+////////////////////
+ // 由CodeGenerator创建。
+ // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
+ // author: gwang 
+ // 日期: 2024-05-30 09:12:59
+////////////////////
+
+
+/**
+ * Static Model gate_unlock  辅助:主线剧情解锁
+ */
+class sm_gate_unlock
+{
+
+    /**
+    * @var Int32 关卡id: 
+    *  命名规律:关卡类型(1主线2主线挑战)+ 地图资源类型(最大9999)+关卡难度(1普通2困难3噩梦)+ 关卡序号(最大999)
+    *  例如:10010101,20010111
+    *  备注: 地图资源类型(第一位: 1四方连续 2上下连续 3固定 4左右连续)  
+    */
+    public $gateId;
+
+}
+

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

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
  // author: gwang 
- // 日期: 2024-05-29 16:27:24
+ // 日期: 2024-05-30 10:31:14
 ////////////////////
 ////////////////////
 
 
 
 

+ 92 - 0
Gameserver/App/model/Const/sm_waveItem.php

@@ -0,0 +1,92 @@
+<?php
+////////////////////
+ // 由CodeGenerator创建。
+ // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
+ // author: gwang 
+ // 日期: 2024-05-30 10:57:10
+////////////////////
+
+
+/**
+ * Static Model waveItem 辅助: 波次直查
+ */
+class sm_waveItem
+{
+
+    /**
+    * @var Int32 关卡id  
+    */
+    public $gateId;
+
+    /**
+    * @var Int32 自战场开始以来的分钟数  
+    */
+    public $waveId;
+
+    /**
+    * @var String 怪物id(池)列表(id:权重,id:权重...)最多16个怪物id  
+    */
+    public $monsterIds;
+
+    /**
+    * @var Int32 最小数量: n(数量) default(0) 
+    */
+    public $minnum;
+
+    /**
+    * @var Int32 最大数量 default(300) 
+    */
+    public $maxnum;
+
+    /**
+    * @var Int32 补充频率(单位:毫秒)  
+    */
+    public $frequency;
+
+    /**
+    * @var String 波次事件ids(逗号分隔)  
+    */
+    public $events;
+
+    /**
+    * @var Int32 bossID default(0) 
+    */
+    public $bossId;
+
+    /**
+    * @var Int32 第二个bossID default(0) 
+    */
+    public $bossId2;
+
+    /**
+    * @var String 通向下一波的条件(1:击杀数量(不限种类)满足xxx后跳转; 2:倒计时xx秒结束后跳转; 3: 击杀指定id的怪物后跳转, 4: 限定xx秒内击杀指定id的怪物(boss)后跳转)  
+    */
+    public $condition;
+
+    /**
+    * @var String 【挑战模式】本层奖励: (id,数量;id,数量;...)  
+    */
+    public $rewards;
+
+    /**
+    * @var String 通关宝石奖励(min-max;qual:weight,qual:weight,...)  
+    */
+    public $rewardGem;
+
+    /**
+    * @var Int32 通关金币奖励 default(0) 
+    */
+    public $rewardGold;
+
+    /**
+    * @var Int32 通关(指挥官)经验奖励 default(0) 
+    */
+    public $rewardExp;
+
+    /**
+    * @var String 通关图纸奖励(数量min-max)  
+    */
+    public $rewardTuZhi;
+
+}
+

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

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
  // author: gwang 
- // 日期: 2024-05-30 09:18:36
+ // 日期: 2024-05-30 10:57:10
 ////////////////////
 ////////////////////
 
 
 
 
@@ -84,7 +84,7 @@ class sm_waves
     public $rewardExp;
     public $rewardExp;
 
 
     /**
     /**
-    * @var Int32 通关图纸奖励(数量) default(0) 
+    * @var String 通关图纸奖励(数量min-max)  
     */
     */
     public $rewardTuZhi;
     public $rewardTuZhi;
 
 

+ 10 - 4
Gameserver/App/model/User/Enum_GateType.php

@@ -2,20 +2,26 @@
 
 
 namespace loyalsoft;
 namespace loyalsoft;
 
 
-/* 
+/*
  * To change this license header, choose License Headers in Project Properties.
  * To change this license header, choose License Headers in Project Properties.
  * To change this template file, choose Tools | Templates
  * To change this template file, choose Tools | Templates
  * and open the template in the editor.
  * and open the template in the editor.
  */
  */
+
 class Enum_GateType extends Enum {
 class Enum_GateType extends Enum {
-    
+
     /**
     /**
-     * 1 主线剧情, 
+     * 1 主线剧情,
      */
      */
     const MainStoryGate = 1;
     const MainStoryGate = 1;
-    
+
     /**
     /**
      * 2 主线挑战关卡
      * 2 主线挑战关卡
      */
      */
     const MainChallengeGate = 2;
     const MainChallengeGate = 2;
+
+    /**
+     * 9 挑战模式
+     */
+    const ChallengeMode = 9;
 }
 }

+ 21 - 1
Gameserver/App/model/User/Info_Gates.php

@@ -145,7 +145,7 @@ class Info_Gates extends Object_ext {
     }
     }
 
 
     /**
     /**
-     * @return 解锁下一剧情关卡
+     * @return int 解锁下一剧情关卡
      */
      */
     public function UnlockNextPlotGate() {
     public function UnlockNextPlotGate() {
         $nextId = $this->CurrentGateId;
         $nextId = $this->CurrentGateId;
@@ -165,4 +165,24 @@ class Info_Gates extends Object_ext {
 
 
         return $nextId;
         return $nextId;
     }
     }
+
+    /**
+     * @param int $gateId 通关的关卡id
+     */
+    public function UnlockMainChallengeGate($gateId) {
+        $dic = GameConfig::gate();
+        $index = 0;                                                   # 挑战关卡解锁逻辑. -gwang 2024年4月15日
+        foreach ($dic as $id => $item) {
+            if (Ins_GateInfo::GateTypeFromId($id) == Enum_GateType::MainChallengeGate #
+                    && $item->challengeGateId == $gateId) {
+                $index += 1;
+                $gate = new Ins_GateInfo();
+                $gate->GateId = $id;
+                ctx()->gates->GateList->$id = $gate;
+            }
+            if ($index >= 3) {                                                  # 最多3个难度
+                break;
+            }
+        }
+    }
 }
 }

+ 76 - 42
Gameserver/App/process/FightProc.php

@@ -529,7 +529,8 @@ class FightProc {
      * @return type
      * @return type
      */
      */
     public static function Settle() {
     public static function Settle() {
-        list($resultType, $gateId, $gold, $curTs, $pickups) = req()->paras;
+        list($resultType, $gateId, $gold, $curTs, $pickups,
+                $finalLayer, $finalHpPercent, $killMonsterNum, $killBossNum) = req()->paras;
         # 客户端需要增加参数: killmonserNum,killBosssNum, finalHpPercent(最终血量百分比)
         # 客户端需要增加参数: killmonserNum,killBosssNum, finalHpPercent(最终血量百分比)
         $gateMo = GameConfig::gate_getItem($gateId);
         $gateMo = GameConfig::gate_getItem($gateId);
         my_Assert($gateMo != null, ErrCode::err_const_no);
         my_Assert($gateMo != null, ErrCode::err_const_no);
@@ -542,43 +543,72 @@ class FightProc {
         if ($resultType) {                                                      # 胜利
         if ($resultType) {                                                      # 胜利
             if (ctx()->gates->GateList->$gateId->pass == 0) {
             if (ctx()->gates->GateList->$gateId->pass == 0) {
                 ctx()->gates->GateList->$gateId->pass = 1;
                 ctx()->gates->GateList->$gateId->pass = 1;
-                TaskProc::Day7TaskReset($gateId);
+                TaskProc::Day7TaskReset($gateId);                               # 刷新七日任务
             }
             }
-            TaskProc::OnPassGate_X($gateId);
-            StoreProc::AddMultiItemInStore($gateMo->reward_win);
+            TaskProc::OnPassGate_X($gateId);                                    # 刷新任务进度: 通关第X关
+
             if (Ins_GateInfo::GateTypeFromId($gateId) == Enum_GateType::MainStoryGate) {
             if (Ins_GateInfo::GateTypeFromId($gateId) == Enum_GateType::MainStoryGate) {
-                ctx()->gates->UnlockNextPlotGate();
-                $dic = GameConfig::gate();
-                $index = 0;                                                   # 挑战关卡解锁逻辑. -gwang 2024年4月15日
-                foreach ($dic as $id => $item) {
-                    if (Ins_GateInfo::GateTypeFromId($id) == Enum_GateType::MainChallengeGate && $item->challengeGateId == $gateId) {
-                        $index += 1;
-                        $gate = new Ins_GateInfo();
-                        $gate->GateId = $id;
-                        ctx()->gates->GateList->$id = $gate;
-                    }
-                    if ($index >= 3) {
+                ctx()->gates()->UnlockNextPlotGate();                           # 解锁下一主线关卡
+//                ctx()->gates()->UnlockMainChallengeGate($gateId);              # 挑战关卡解锁逻辑. -gwang 2024年4月15日
+            } else {                                                            # 不是主线关卡, 暂时没有其他逻辑
+            }
+//            StoreProc::AddMultiItemInStore($gateMo->reward_win);                # 发放胜利奖励(2024.5.30 过期)
+        }
+//        else {                                                                # 失败
+////            StoreProc::AddMultiItemInStore($gateMo->reward_fail);               # 发放失败奖励(2024.5.30 过期)
+//        }
+
+        StoreProc::AddMultiItemInStore($pickups);                               # 战场拾取道具直接入背包
+        ctx()->base()->Add_Gold($gold);                                         # 战场拾取的金币直接入背包
+        //ctx()->base()->Add_Exp($exp);
+        $waveMo = GameConfig::waveItem_getItem($gateId, $finalLayer);
+        my_Assert(null != $waveMo, ErrCode::err_const_no);
+        ctx()->base()->Add_Exp($waveMo->rewardExp);                             # 指挥官经验
+        ctx()->base()->Add_Gold($waveMo->rewardGold);                           # 金币奖励
+        # 图纸奖励: 数量min-max, 部位随机
+        if (str_len($waveMo->rewardTuZhi) > 0 && str_contains($waveMo->rewardTuZhi, '-')) {
+            list($tz_min, $tz_max) = str_split($waveMo->rewardTuZhi);           # 图纸数量
+            $tz_n = rand($tz_min, $tz_max);
+            # 图纸部位数据源 1001, 1002, 1003, 1004, 1005, 1006
+            for ($i = 0; $i < $tz_n; $i++) {
+                $id = 1000 + rand(1, 6);
+                StoreProc::AddMultiItemInStore("$id,1");                        # 获得图纸
+            }
+        }
+        # 宝石奖励: 数量min-max;品质:权重,品质:权重...
+        if (strlen($waveMo->rewardGem) > 0) {
+            list($gs_num, $gs_props) = str_split($waveMo->rewardGem, ';');
+            list($gem_min, $gem_max) = str_split($gs_num);                      # 宝石数量
+            $gem_n = rand($gem_min, $gem_max);
+            $arr = str_split($gs_props, ",");
+            $pool = array();
+            $n = 0;
+            foreach ($arr as $str) {
+                list($qual, $props) = str_split($str, ':');
+                $pool[] = array('q' => $qual, 'p' => $props);
+                $n += $props;
+            }
+            for ($i = 0; $i < $gem_n; $i++) {                                   # 随机n块宝石
+                $r = rand($n);                                                  # 投色子
+                $l = 0;
+                foreach ($pool as $item) {
+                    if ($r < ($l + $item->p)) {
+                        $gemId = $item->q * 10000 + rand(6) * 1000;
+                        StoreProc::PutGemInStore($gemId);                       # 发放宝石并退出本次投色子
                         break;
                         break;
                     }
                     }
+                    $l += $item->p;                                             # 累计到下一段
                 }
                 }
-            } else {
-
             }
             }
-        } else {                                                                # 失败
-            StoreProc::AddMultiItemInStore($gateMo->reward_fail);
         }
         }
 
 
-        StoreProc::AddMultiItemInStore($pickups);                               # 战场拾取道具
-        ctx()->baseInfo->Add_Gold($gold);
-        //ctx()->baseInfo->Add_Exp($exp);
-
-        if (Ins_GateInfo::GateTypeFromId($gateId) == Enum_GateType::MainStoryGate) {
+        if (Ins_GateInfo::GateTypeFromId($gateId) == Enum_GateType::MainStoryGate) {            # 主线剧情,
             TaskProc::OnFightNumMainGate();
             TaskProc::OnFightNumMainGate();
-        } else if (Ins_GateInfo::GateTypeFromId($gateId) == Enum_GateType::MainChallengeGate) {
+        } else if (Ins_GateInfo::GateTypeFromId($gateId) == Enum_GateType::MainChallengeGate) { # 主线剧情对应的难度挑战
             TaskProc::OnFightNumChallengeGate();
             TaskProc::OnFightNumChallengeGate();
         }
         }
-        TaskProc::OnKillCommonNumMonster(1000);
-        TaskProc::OnKillleaderNumMonster(500);
+        TaskProc::OnKillCommonNumMonster($killMonsterNum);
+        TaskProc::OnKillleaderNumMonster($killBossNum);
 
 
         UserProc::updateUserInfo();
         UserProc::updateUserInfo();
         $ret = array(
         $ret = array(
@@ -654,6 +684,8 @@ class FightProc {
         return Resp::ok($ret);
         return Resp::ok($ret);
     }
     }
 
 
+// <editor-fold defaultstate="collapsed" desc="排行榜">
+
     /**
     /**
      * 参与主线关卡排行榜
      * 参与主线关卡排行榜
      * @param type $gateIndex
      * @param type $gateIndex
@@ -847,44 +879,46 @@ class FightProc {
      * @return type
      * @return type
      */
      */
     public static function ReceiveRankReward_MainGate() {
     public static function ReceiveRankReward_MainGate() {
-        list($gateId) = req()->paras;               
-        
+        list($gateId) = req()->paras;
+
         my_Assert(!in_array($gateId, ctx()->privateState->rankReward_drawed_MainGate), ErrCode::rankReward_HasReceive);
         my_Assert(!in_array($gateId, ctx()->privateState->rankReward_drawed_MainGate), ErrCode::rankReward_HasReceive);
-        
+
         $mo = GameConfig::rank_passgatereward_getItem($gateId);
         $mo = GameConfig::rank_passgatereward_getItem($gateId);
         my_Assert($mo != null, ErrCode::err_const_no);
         my_Assert($mo != null, ErrCode::err_const_no);
-                       
-        $memKey = MemKey_GameRun::RankReward_MainGateIndex_Zone_hash(req()->zoneid);              
-        if(gMem()->hexists($memKey,$gateId)){
+
+        $memKey = MemKey_GameRun::RankReward_MainGateIndex_Zone_hash(req()->zoneid);
+        if (gMem()->hexists($memKey, $gateId)) {
             StoreProc::AddMultiItemInStore($mo->reward);
             StoreProc::AddMultiItemInStore($mo->reward);
             ctx()->privateState->rankReward_drawed_MainGate[] = $gateId;
             ctx()->privateState->rankReward_drawed_MainGate[] = $gateId;
         }
         }
-        
+
         UserProc::updateUserInfo();
         UserProc::updateUserInfo();
         $ret = array();
         $ret = array();
         return Resp::ok($ret);
         return Resp::ok($ret);
     }
     }
-    
+
     /**
     /**
      * 6816 领取战力荣誉榜奖励
      * 6816 领取战力荣誉榜奖励
      * @return type
      * @return type
      */
      */
     public static function ReceiveRankReward_FightPower() {
     public static function ReceiveRankReward_FightPower() {
-        list($fightPower) = req()->paras;               
-        
+        list($fightPower) = req()->paras;
+
         my_Assert(!in_array($fightPower, ctx()->privateState->rankReward_drawed_fightPower), ErrCode::rankReward_HasReceive);
         my_Assert(!in_array($fightPower, ctx()->privateState->rankReward_drawed_fightPower), ErrCode::rankReward_HasReceive);
-        
+
         $mo = GameConfig::rank_passgatereward_getItem($fightPower);
         $mo = GameConfig::rank_passgatereward_getItem($fightPower);
         my_Assert($mo != null, ErrCode::err_const_no);
         my_Assert($mo != null, ErrCode::err_const_no);
-                       
-        $memKey = MemKey_GameRun::RankReward_FightPower_Zone_hash(req()->zoneid);              
-        if(gMem()->hexists($memKey,$fightPower)){
+
+        $memKey = MemKey_GameRun::RankReward_FightPower_Zone_hash(req()->zoneid);
+        if (gMem()->hexists($memKey, $fightPower)) {
             StoreProc::AddMultiItemInStore($mo->reward);
             StoreProc::AddMultiItemInStore($mo->reward);
             ctx()->privateState->rankReward_drawed_fightPower[] = $fightPower;
             ctx()->privateState->rankReward_drawed_fightPower[] = $fightPower;
         }
         }
-        
+
         UserProc::updateUserInfo();
         UserProc::updateUserInfo();
         $ret = array();
         $ret = array();
         return Resp::ok($ret);
         return Resp::ok($ret);
     }
     }
+
+    // </editor-fold>
 }
 }