王刚 1 жил өмнө
parent
commit
d5d2b0f51d

+ 6 - 5
Gameserver/App/model/User/Info_Gates.php

@@ -153,15 +153,16 @@ class Info_Gates extends Object_ext {
     /**
      * @return int 解锁下一剧情关卡
      */
-    public function UnlockNextPlotGate() {
-        $nextId = $this->CurrentGateId;
+    public function UnlockNextPlotGate($gateId) {
+        $nextId = $gateId;
         foreach (GameConfig::gate() as $k => $v) {
             isEditor() and $v = new \sm_gate();
             if ($v->unlockGateId == $this->CurrentGateId) {
                 $nextId = $v->gateId;
             }
         }
-        if (!StlUtil::dictHasProperty($this->GateList, $nextId)) {
+        if (Ins_GateInfo::gateNum($this->UnlockedGatesMaxId) < Ins_GateInfo::gateNum($nextId)# 下一关尚未解锁
+                && !StlUtil::dictHasProperty($this->GateList, $nextId)) {
 //            $this->CurrentGateId = $nextId;                                   # 不再自动推到下一关, -2024.5.31
             $this->UnlockedGatesMaxId = $nextId;
             $gate = new Ins_GateInfo();
@@ -199,8 +200,8 @@ class Info_Gates extends Object_ext {
         $maxIndex = 0;
         $maxGateId = 0;
         foreach ($this->GateList as $gateId => $Ins_GateInfo) {
-            if ($Ins_GateInfo->pass > 0 && Ins_GateInfo::GateMapTypeFromId($gateId) > $maxIndex) {
-                $maxIndex = Ins_GateInfo::GateMapTypeFromId($gateId);
+            if ($Ins_GateInfo->pass > 0 && Ins_GateInfo::gateNum($gateId) > $maxIndex) {
+                $maxIndex = Ins_GateInfo::gateNum($gateId);
                 $maxGateId = $gateId;
             }
         }

+ 1 - 1
Gameserver/App/model/User/Ins_GateInfo.php

@@ -86,7 +86,7 @@ class Ins_GateInfo {
      * @param type $gateId
      * @return int
      */
-    public static function GateMapTypeFromId($gateId) {
+    public static function gateNum($gateId) {
         return Ints::Slice($gateId, 6, 3);
     }
 }

+ 75 - 75
Gameserver/App/process/FightProc.php

@@ -632,71 +632,70 @@ class FightProc {
         return Resp::ok($ret);
     }
 
-    /**
-     * [6801]关卡战斗结算
-     * @return type
-     */
-    public static function Settle_bak() {
-        list($resultType, $gateId, $gold, $curTs, $pickups) = req()->paras;
-        # 客户端需要增加参数: killmonserNum,killBosssNum, finalHpPercent(最终血量百分比)
-        $gateMo = GameConfig::gate_getItem($gateId);
-        my_Assert($gateMo != null, ErrCode::err_const_no);
-        my_Assert(StlUtil::dictHasProperty(ctx()->gates->GateList, $gateId), ErrCode::gate_NoUserGateInfo);
-        $gateInfo = ctx()->gates->GateList->$gateId;
-        $ts = $gateInfo->MaxSeconds;
-        if ($curTs >= $ts) {
-            $gateInfo->MaxSeconds = $curTs;
-        }
-        if ($resultType) {                                                      # 胜利
-            if (ctx()->gates->GateList->$gateId->pass == 0) {
-                ctx()->gates->GateList->$gateId->pass = 1;
-                TaskProc::Day7TaskReset($gateId);
-            }
-            TaskProc::OnPassGate_X($gateId);
-            StoreProc::AddMultiItemInStore($gateMo->reward_win);
-            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) {
-                        break;
-                    }
-                }
-            } 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) {
-            TaskProc::OnFightNumMainGate();
-        } else if (Ins_GateInfo::GateTypeFromId($gateId) == Enum_GateType::MainChallengeGate) {
-            TaskProc::OnFightNumChallengeGate();
-        }
-        TaskProc::OnKillCommonNumMonster(1000);
-        TaskProc::OnKillleaderNumMonster(500);
-
-        UserProc::updateUserInfo();
-        $ret = array(
-            'gates' => ctx()->gates,
-            'store' => ctx()->store,
-            'task' => ctx()->task,
-        );
-        return Resp::ok($ret);
-    }
-
+//    /**
+//     * [6801]关卡战斗结算
+//     * @return type
+//     */
+//    public static function Settle_bak() {
+//        list($resultType, $gateId, $gold, $curTs, $pickups) = req()->paras;
+//        # 客户端需要增加参数: killmonserNum,killBosssNum, finalHpPercent(最终血量百分比)
+//        $gateMo = GameConfig::gate_getItem($gateId);
+//        my_Assert($gateMo != null, ErrCode::err_const_no);
+//        my_Assert(StlUtil::dictHasProperty(ctx()->gates->GateList, $gateId), ErrCode::gate_NoUserGateInfo);
+//        $gateInfo = ctx()->gates->GateList->$gateId;
+//        $ts = $gateInfo->MaxSeconds;
+//        if ($curTs >= $ts) {
+//            $gateInfo->MaxSeconds = $curTs;
+//        }
+//        if ($resultType) {                                                      # 胜利
+//            if (ctx()->gates->GateList->$gateId->pass == 0) {
+//                ctx()->gates->GateList->$gateId->pass = 1;
+//                TaskProc::Day7TaskReset($gateId);
+//            }
+//            TaskProc::OnPassGate_X($gateId);
+//            StoreProc::AddMultiItemInStore($gateMo->reward_win);
+//            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) {
+//                        break;
+//                    }
+//                }
+//            } 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) {
+//            TaskProc::OnFightNumMainGate();
+//        } else if (Ins_GateInfo::GateTypeFromId($gateId) == Enum_GateType::MainChallengeGate) {
+//            TaskProc::OnFightNumChallengeGate();
+//        }
+//        TaskProc::OnKillCommonNumMonster(1000);
+//        TaskProc::OnKillleaderNumMonster(500);
+//
+//        UserProc::updateUserInfo();
+//        $ret = array(
+//            'gates' => ctx()->gates,
+//            'store' => ctx()->store,
+//            'task' => ctx()->task,
+//        );
+//        return Resp::ok($ret);
+//    }
 // <editor-fold defaultstate="collapsed" desc="排行榜">
 
     /**
@@ -1018,37 +1017,38 @@ class FightProc {
             }
         }
     }
-    
+
     /*
      * 统计战力 战斗力=0.75*攻击+0.12*生命+1*伤害减免+1*攻击速度+2*暴击伤害倍率
      */
+
     public static function countUserFightPower() {
         $CurrentHeroId = ctx()->heros->CurrentHeroId;
         //$hero = ctx()->heros->Dic->$CurrentHeroId;
-        
+
         $mo = GameConfig::hero_getItem($CurrentHeroId);
         my_Assert($mo != null, ErrCode::err_const_no);
-        
+
         $heroBashAttack = $mo->attack;
         $heroBashHp = $mo->hp;
-        
+
         $equipDic = ctx()->store->equip;
         $attck = 0;
         $hp = 0;
         foreach ($equipDic as $index => $ins_equip) {
-            $attck += GameConfig::equip_levelupgrade_getItem($ins_equip->level)->attckNum; 
+            $attck += GameConfig::equip_levelupgrade_getItem($ins_equip->level)->attckNum;
             $hp += GameConfig::equip_levelupgrade_getItem($ins_equip->level)->hpNum;
         }
-        
+
         $heroAttck = $heroBashAttack + $attck;
         $heroHp = $heroBashHp + $hp;
-        
+
         $dec_demage = $mo->dec_demage;
         $bigHit_Val = $mo->bigHit_Val;
         $mul_bullet_speed = $mo->mul_bullet_speed;
-        
-        $val = 0.75*$heroAttck+0.12*$heroHp+1*$dec_demage+1*$mul_bullet_speed+2*$$bigHit_Val; 
-        
+
+        $val = 0.75 * $heroAttck + 0.12 * $heroHp + 1 * $dec_demage + 1 * $mul_bullet_speed + 2 * $$bigHit_Val;
+
         return intval($val);
     }