Browse Source

关卡优化

guodong 3 years ago
parent
commit
ea0e0983ed

+ 1 - 1
GameClient/Assets/Game/CSShare

@@ -1 +1 @@
-Subproject commit b4be7aa5b435b77b6465e7fd98e4ae2896ea63c3
+Subproject commit 73fa584af9006605caa00fba9987d40051ab2a1a

+ 3 - 3
GameClient/Assets/Game/HotUpdate/Controller/GuideController.cs

@@ -38,10 +38,10 @@ namespace GFGGame
             && (!checkIndex || checkIndex && GuideDataManager.IsGuideIndexFinish(cfg.id, index - 1) == true && GuideDataManager.IsGuideIndexFinish(cfg.id, index) == false)
             && (!checkIndex || checkIndex && GuideDataManager.IsGuideIndexFinish(cfg.id, index - 1) == true && GuideDataManager.IsGuideIndexFinish(cfg.id, index) == false)
             && (GuideDataManager.currentGuideId == 0 || GuideDataManager.currentGuideId == cfg.id && GuideDataManager.currentGuideIdIndex != index)
             && (GuideDataManager.currentGuideId == 0 || GuideDataManager.currentGuideId == cfg.id && GuideDataManager.currentGuideIdIndex != index)
             && (StoryDataManager.CurrentChapterOrder == 0 || StoryDataManager.CheckCurrentLevelPass() == false)
             && (StoryDataManager.CurrentChapterOrder == 0 || StoryDataManager.CheckCurrentLevelPass() == false)
-            && StoryDataManager.CheckLevelPass(cfg.chapterId, cfg.level - 1)
-            && !StoryDataManager.CheckLevelPass(cfg.chapterId, cfg.level))
+            && InstanceZonesDataManager.CheckLevelPass(cfg.storyLevelId - 1)
+            && !InstanceZonesDataManager.CheckLevelPass(cfg.storyLevelId))
             ||
             ||
-            (cfg.chapterId == 0
+            (cfg.storyLevelId == 0
             && GuideDataManager.GetGuideCountCopy(guideKey) <= 0
             && GuideDataManager.GetGuideCountCopy(guideKey) <= 0
             ))
             ))
             {
             {

+ 5 - 6
GameClient/Assets/Game/HotUpdate/Data/FunctionOpenDataManager.cs

@@ -36,14 +36,14 @@ namespace GFGGame
         /// <summary>
         /// <summary>
         /// 根据章节Id检测是否有新功能开启
         /// 根据章节Id检测是否有新功能开启
         /// </summary>
         /// </summary>
-        public void CheckHasChapterFunOpen(int chapterId, int level)
+        public void CheckHasChapterFunOpen(int storyLevelCfgId)
         {
         {
             FunctionOpenCfg[] cfgs = FunctionOpenCfgArray.Instance.dataArray;
             FunctionOpenCfg[] cfgs = FunctionOpenCfgArray.Instance.dataArray;
             List<string> listCfg = new List<string>();
             List<string> listCfg = new List<string>();
             for (int i = 0; i < cfgs.Length; i++)
             for (int i = 0; i < cfgs.Length; i++)
             {
             {
                 if (cfgs[i].show == 0) continue;
                 if (cfgs[i].show == 0) continue;
-                if (cfgs[i].chapterId != chapterId || cfgs[i].level != level || !CheckIsChapterFunOpen(cfgs[i], false)) continue;
+                if (cfgs[i].storyLevelId != storyLevelCfgId || !CheckIsChapterFunOpen(cfgs[i], false)) continue;
                 if (!CheckIsLvFunOpen(cfgs[i], false)) continue;
                 if (!CheckIsLvFunOpen(cfgs[i], false)) continue;
                 listCfg.Add(cfgs[i].id);
                 listCfg.Add(cfgs[i].id);
             }
             }
@@ -77,12 +77,11 @@ namespace GFGGame
         private bool CheckIsChapterFunOpen(FunctionOpenCfg cfg, bool showTips = true)
         private bool CheckIsChapterFunOpen(FunctionOpenCfg cfg, bool showTips = true)
         {
         {
 
 
-            if (cfg.chapterId > 0 && cfg.level <= 0 || cfg.level > 0 && cfg.chapterId <= 0)
+            if (cfg.storyLevelId <= 0)
             {
             {
-                if (showTips) PromptController.Instance.ShowFloatTextPrompt("功能暂未开启,敬请期待");
-                return false;
+                return true;
             }
             }
-            if (cfg.chapterId > 0 && StoryDataManager.CheckLevelPass(cfg.chapterId, cfg.level))
+            if (InstanceZonesDataManager.CheckLevelPass(cfg.storyLevelId))
             {
             {
                 return true;
                 return true;
             }
             }

+ 5 - 3
GameClient/Assets/Game/HotUpdate/Data/InstanceZonesDataManager.cs

@@ -20,7 +20,7 @@ namespace GFGGame
         public static int GetPassLevelCfgId(int type, int subType, int chapterId)
         public static int GetPassLevelCfgId(int type, int subType, int chapterId)
         {
         {
             var key = CalculateHelper.GenerateInstanceZonesLevelStateKey(type, subType, chapterId);
             var key = CalculateHelper.GenerateInstanceZonesLevelStateKey(type, subType, chapterId);
-            if(_passLevel.TryGetValue(key, out var value))
+            if (_passLevel.TryGetValue(key, out var value))
             {
             {
                 return value;
                 return value;
             }
             }
@@ -31,7 +31,7 @@ namespace GFGGame
         {
         {
             var levelCfgId = GetPassLevelCfgId(type, subType, chapterId);
             var levelCfgId = GetPassLevelCfgId(type, subType, chapterId);
             var levelCfg = StoryLevelCfgArray.Instance.GetCfg(levelCfgId);
             var levelCfg = StoryLevelCfgArray.Instance.GetCfg(levelCfgId);
-            if(levelCfg != null)
+            if (levelCfg != null)
             {
             {
                 return levelCfg.order;
                 return levelCfg.order;
             }
             }
@@ -46,12 +46,14 @@ namespace GFGGame
         public static bool CheckLevelPass(int levelCfgId)
         public static bool CheckLevelPass(int levelCfgId)
         {
         {
             var levelCfg = StoryLevelCfgArray.Instance.GetCfg(levelCfgId);
             var levelCfg = StoryLevelCfgArray.Instance.GetCfg(levelCfgId);
-            if(levelCfg != null)
+            if (levelCfg != null)
             {
             {
                 var passLevelOrder = InstanceZonesDataManager.GetPassLevelOrder(levelCfg.type, levelCfg.subType, levelCfg.chapterId);
                 var passLevelOrder = InstanceZonesDataManager.GetPassLevelOrder(levelCfg.type, levelCfg.subType, levelCfg.chapterId);
                 return levelCfg.order <= passLevelOrder;
                 return levelCfg.order <= passLevelOrder;
             }
             }
             return false;
             return false;
         }
         }
+
+
     }
     }
 }
 }

+ 11 - 5
GameClient/Assets/Game/HotUpdate/Data/StoryDataManager.cs

@@ -3,6 +3,7 @@ using System.Collections.Generic;
 using System;
 using System;
 using UnityEngine;
 using UnityEngine;
 using ET;
 using ET;
+using ProtoBuf.Meta;
 
 
 namespace GFGGame
 namespace GFGGame
 {
 {
@@ -146,14 +147,19 @@ namespace GFGGame
 
 
         public static bool CheckOpenMainUI()
         public static bool CheckOpenMainUI()
         {
         {
-            return CheckLevelPass(1, 4) && GuideDataManager.GetGuideCountCopy(ConstGuideId.SINGLE_FIGHT) > 0;
+            return InstanceZonesDataManager.CheckLevelPass(10004) && GuideDataManager.GetGuideCountCopy(ConstGuideId.SINGLE_FIGHT) > 0;
         }
         }
 
 
         //检查指定章节对应的普通章节是否通关
         //检查指定章节对应的普通章节是否通关
-        public static bool CheckNormalChapterPass(int chapterId)
+        public static bool CheckNeedChapterPass(int chapterId)
         {
         {
-            int normalChapterId = StoryUtil.GetChapterOrder(chapterId);
-            return normalChapterId <= GameGlobal.myNumericComponent.GetAsInt(NumericType.Chapter);
+            var chapterCfg = StoryChapterCfgArray.Instance.GetCfg(chapterId);
+            if (chapterCfg != null)
+{
+                var passLevelOrder = InstanceZonesDataManager.GetPassLevelOrder(chapterCfg.type, chapterCfg.subType, chapterCfg.id);
+                return chapterCfg.levelCount <= passLevelOrder;
+            }
+            return false;
         }
         }
 
 
         public static bool CheckChapterUnlock(int chapterId)
         public static bool CheckChapterUnlock(int chapterId)
@@ -166,7 +172,7 @@ namespace GFGGame
             if (CalculateHelper.CheckChapterIsHard(chapterId))
             if (CalculateHelper.CheckChapterIsHard(chapterId))
             {
             {
                 //对应普通剧情的章需要开启
                 //对应普通剧情的章需要开启
-                if (!CheckNormalChapterPass(chapterId))
+                if (!CheckNeedChapterPass(chapterId))
                 {
                 {
                     return false;
                     return false;
                 }
                 }

+ 2 - 2
GameClient/Assets/Game/HotUpdate/ServerProxy/StorySProxy.cs

@@ -38,7 +38,7 @@ namespace GFGGame
                 {
                 {
                     List<ItemData> bonusList = StoryBonusDataCache.GetBonusList(response.LevelCfgId, true, true);
                     List<ItemData> bonusList = StoryBonusDataCache.GetBonusList(response.LevelCfgId, true, true);
                     BonusController.TryShowBonusList(bonusList);
                     BonusController.TryShowBonusList(bonusList);
-                    FunctionOpenDataManager.Instance.CheckHasChapterFunOpen(GameGlobal.myNumericComponent.GetAsInt(NumericType.Chapter) + 1, GameGlobal.myNumericComponent.GetAsInt(NumericType.ChapterLvl));//首次通过要检查是否有功能开启
+                    FunctionOpenDataManager.Instance.CheckHasChapterFunOpen(response.LevelCfgId);//首次通过要检查是否有功能开启
                     StoryController.OnFinishStoryLevel(levelCfgId, true);
                     StoryController.OnFinishStoryLevel(levelCfgId, true);
                     return;
                     return;
                 }
                 }
@@ -81,7 +81,7 @@ namespace GFGGame
                     if(response.HasOnceBonus)
                     if(response.HasOnceBonus)
                     {
                     {
                         //首次通过要检查是否有功能开启
                         //首次通过要检查是否有功能开启
-                        FunctionOpenDataManager.Instance.CheckHasChapterFunOpen(GameGlobal.myNumericComponent.GetAsInt(NumericType.Chapter) + 1, GameGlobal.myNumericComponent.GetAsInt(NumericType.ChapterLvl));
+                        FunctionOpenDataManager.Instance.CheckHasChapterFunOpen(response.LevelCfgId);
                     }
                     }
                     ViewManager.Show(ViewName.STORY_FIGHT_RESULT_VIEW, new StoryFightResultData
                     ViewManager.Show(ViewName.STORY_FIGHT_RESULT_VIEW, new StoryFightResultData
                     {
                     {

+ 7 - 5
GameClient/Assets/Game/HotUpdate/Views/ClothingSynthetic/SuitSyntheticView.cs

@@ -105,14 +105,16 @@ namespace GFGGame
             SuitSyntheticCfg suitSyntheticCfg = SuitSyntheticCfgArray.Instance.GetCfg(suitId);
             SuitSyntheticCfg suitSyntheticCfg = SuitSyntheticCfgArray.Instance.GetCfg(suitId);
             if (suitSyntheticCfg.storyLevelId > 0)
             if (suitSyntheticCfg.storyLevelId > 0)
             {
             {
-                int chapter = 0;
-                int level = 0;
-                CalculateHelper.GetStoryChapterLevel(suitSyntheticCfg.storyLevelId, out chapter, out level);
-                bool isLevelPass = StoryDataManager.CheckLevelPass(chapter, level);
+                //int chapter = 0;
+                //int level = 0;
+                //CalculateHelper.GetStoryChapterLevel(suitSyntheticCfg.storyLevelId, out var chapter, out var level);
+                bool isLevelPass = InstanceZonesDataManager.CheckLevelPass(suitSyntheticCfg.storyLevelId);
                 if (!isLevelPass)
                 if (!isLevelPass)
                 {
                 {
                     isLock = true;
                     isLock = true;
-                    listItem.m_txtLockDesc.text = string.Format("通关第{0}章第{1}关", chapter, level);
+                    var levelCfg = StoryLevelCfgArray.Instance.GetCfg(suitSyntheticCfg.storyLevelId);
+                    var chapterCfg = StoryChapterCfgArray.Instance.GetCfg(levelCfg.chapterId);
+                    listItem.m_txtLockDesc.text = string.Format("通关第{0}章第{1}关", chapterCfg.order, levelCfg.order);
                 }
                 }
             }
             }
             if (suitSyntheticCfg.preSuitId > 0)
             if (suitSyntheticCfg.preSuitId > 0)

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryChapterListView.cs

@@ -137,7 +137,7 @@ namespace GFGGame
                     }
                     }
                     else
                     else
                     {
                     {
-                        if (CalculateHelper.CheckChapterIsHard(chapterID) && !StoryDataManager.CheckNormalChapterPass(chapterID))
+                        if (CalculateHelper.CheckChapterIsHard(chapterID) && !StoryDataManager.CheckNeedChapterPass(chapterID))
                         {
                         {
                             listItem.m_content.m_txtLockDesc.text = "通关同一普通章节开启";
                             listItem.m_content.m_txtLockDesc.text = "通关同一普通章节开启";
                         }
                         }

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryChapterView.cs

@@ -142,7 +142,7 @@ namespace GFGGame
 
 
                         }
                         }
                         // levelItem.m_iconUnPass.visible = 
                         // levelItem.m_iconUnPass.visible = 
-                        levelItem.m_holder.visible = !StoryDataManager.CheckLevelPass(_chapterID, levelCfg.order);
+                        levelItem.m_holder.visible = !InstanceZonesDataManager.CheckLevelPass(levelCfg.id);
                         // if (levelItem.m_holder.visible)
                         // if (levelItem.m_holder.visible)
                         // {
                         // {
                         // }
                         // }

BIN
GameClient/Assets/ResIn/Config/excelConfig.sqlite.bytes