zhaoyang 3 år sedan
förälder
incheckning
10d4b4012c

+ 1 - 1
GameClient/Assets/Editor/Excel/Scanner/FieldScanner.cs

@@ -20,7 +20,7 @@ namespace GFGEditor
             for (int i = 0; i < dataArray.Length; i++)
             {
                 FieldCfg cfg = dataArray[i];
-                List<StoryLevelCfg> storyLevelCfgs = StoryLevelCfgArray.Instance.GetCfgs(cfg.type, cfg.subType, cfg.id);
+                List<StoryLevelCfg> storyLevelCfgs = StoryLevelCfgArray.Instance.GetCfgs(cfg.type, 0, cfg.id);
                 int num = storyLevelCfgs.Count;
                 int needPower = 0;
                 for (int j = 0; j < num; j++)

+ 27 - 23
GameClient/Assets/Game/HotUpdate/Data/FieldDataManager.cs

@@ -44,9 +44,9 @@ namespace GFGGame
         /// </summary>
         public int costNum;
         /// <summary>
-        /// 难度,由ConstInstanceZonesSubType定义
+        /// 章节id
         /// </summary>
-        public int hardLvl;
+        public int chapterId;
 
     }
 
@@ -96,9 +96,13 @@ namespace GFGGame
         /// <summary>
         /// 当前难度
         /// </summary>
-        public int difficulty = 0;
-        //当前关卡进度
-        public int currFightIndex = 0;
+        // public int difficulty = 0;
+        /// <summary>
+        ///当前副本Id
+        /// </summary>
+        public int chapterId;
+        //当前战斗关卡等级,起始为1
+        public int currFightLv = 1;
 
         public void UpdateTask(int taskId, int state)
         {
@@ -128,25 +132,25 @@ namespace GFGGame
                 return fieldInfos.highestLvls[difficulty];
             }
         }
-        /// <summary>
-        /// 根据挑战难度获取副本配置
-        /// </summary>
-        /// <param name="difficulty"></param>
-        /// <returns></returns>
-        public FieldCfg GetFieldCfgByDifficulty(int difficulty)
-        {
-            return FieldCfgArray.Instance.GetCfgs(difficulty)[0];
-        }
+        // /// <summary>
+        // /// 根据挑战难度获取副本配置
+        // /// </summary>
+        // /// <param name="difficulty"></param>
+        // /// <returns></returns>
+        // public FieldCfg GetFieldCfgByDifficulty(int difficulty)
+        // {
+        //     return FieldCfgArray.Instance.GetCfgs(difficulty)[0];
+        // }
 
-        /// <summary>
-        /// 根据挑战难度获取当前战斗Id
-        /// </summary>
-        /// <returns></returns>
-        public int GetLevelIdByDifficulty(int difficulty, int index)
-        {
-            FieldCfg cfg = GetFieldCfgByDifficulty(difficulty);
-            return StoryLevelCfgArray.Instance.GetCfgs(cfg.type, cfg.subType, cfg.id)[index].id;
-        }
+        // /// <summary>
+        // /// 根据挑战难度获取当前战斗Id
+        // /// </summary>
+        // /// <returns></returns>
+        // public int GetLevelIdByDifficulty(int difficulty, int index)
+        // {
+        //     FieldCfg cfg = GetFieldCfgByDifficulty(difficulty);
+        //     return StoryLevelCfgArray.Instance.GetCfgs(cfg.type, cfg.subType, cfg.id)[index].id;
+        // }
         /// <summary>
         /// 获取任务列表
         /// </summary>

+ 3 - 2
GameClient/Assets/Game/HotUpdate/ServerProxy/FieldSProxy.cs

@@ -1,3 +1,4 @@
+using System;
 using System.Collections.Generic;
 using ET;
 using GFGGame;
@@ -44,10 +45,10 @@ namespace GFGGame
                     fieldResult.passLvl = response.PassLvl;
                     fieldResult.bonusList = ItemUtil.CreateItemDataList(response.BonusList);
                     fieldResult.costNum = response.CostNum;
-                    fieldResult.hardLvl = response.HardLvl;
+                    fieldResult.chapterId = response.ChapterId;
 
                     FieldInfos fieldInfos = FieldDataManager.Instance.fieldInfos;
-                    fieldInfos.highestLvls[response.HardLvl] = response.HighestLvl;
+                    fieldInfos.highestLvls[Array.IndexOf(FieldCfgArray.Instance.dataArray, fieldResult.chapterId)] = response.HighestLvl;
                     fieldInfos.bonusWeekly = response.BonusWeekly;
                     for (int i = 0; i < response.kTaskIds.Count; i++)
                     {

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/Field/FieldFightEndView.cs

@@ -34,7 +34,7 @@ namespace GFGGame
         }
         private void UpdateView()
         {
-            FieldCfg fieldCfg = FieldCfgArray.Instance.GetCfgs(FieldDataManager.Instance.difficulty)[0];
+            FieldCfg fieldCfg = FieldCfgArray.Instance.GetCfg(FieldDataManager.Instance.chapterId);
             string num = StringUtil.GetColorText(string.Format("{0}/{1}", 0, fieldCfg.num), "#BB674E");
             _ui.m_txtNum.text = string.Format("第{0}轮", num);
         }

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/Field/FieldFightInfoView.cs

@@ -39,7 +39,7 @@ namespace GFGGame
         {
             _ui.m_txtName.text = _storyFightCfg.targetName;
             _ui.m_txtDesc.text = _storyLevelCfg.desc;
-            FieldCfg fieldCfg = FieldCfgArray.Instance.GetCfgs(FieldDataManager.Instance.difficulty)[0];
+            FieldCfg fieldCfg = FieldCfgArray.Instance.GetCfg(FieldDataManager.Instance.chapterId);
             string num = StringUtil.GetColorText(string.Format("{0}/{1}", 0, fieldCfg.num), "#BB674E");
             _ui.m_txtNum.text = string.Format("第{0}轮", num);
             _ui.m_loaNpc.url = ResPathUtil.GetNpcHeadPath(_storyFightCfg.targetRes);

+ 17 - 14
GameClient/Assets/Game/HotUpdate/Views/Field/FieldView.cs

@@ -9,9 +9,10 @@ namespace GFGGame
     {
         private UI_FieldUI _ui;
 
-        private int _curLevelId;
+        // private int _curLevelId;
         private FieldCfg _curCfg;
         private FieldDataManager _dataManager;
+        private int _selectedIndex = 0;
         public override void Dispose()
         {
             base.Dispose();
@@ -35,11 +36,12 @@ namespace GFGGame
         protected override void OnShown()
         {
             base.OnShown();
+            _selectedIndex = 0;
+            _ui.m_c1.selectedIndex = _selectedIndex;
+
+            _curCfg = FieldCfgArray.Instance.dataArray[_selectedIndex];
             _dataManager = FieldDataManager.Instance;
-            _dataManager.difficulty = _ui.m_c1.selectedIndex;
-            _dataManager.currFightIndex = 0;
-            _curCfg = _dataManager.GetFieldCfgByDifficulty(_ui.m_c1.selectedIndex);
-            _curLevelId = _dataManager.GetLevelIdByDifficulty(_dataManager.difficulty, _dataManager.currFightIndex);
+            _dataManager.chapterId = _curCfg.id;
 
             FieldCfg[] cfgs = FieldCfgArray.Instance.dataArray;
             for (int i = 0; i < cfgs.Length; i++)
@@ -64,11 +66,11 @@ namespace GFGGame
 
         private void OnDifficultyChange()
         {
-            FieldCfg cfg = _dataManager.GetFieldCfgByDifficulty(_ui.m_c1.selectedIndex);
+            FieldCfg cfg = FieldCfgArray.Instance.dataArray[_selectedIndex];
             bool isPass = InstanceZonesDataManager.CheckLevelPass(cfg.storyLvId);
             if (!isPass && _ui.m_c1.selectedIndex != ConstInstanceZonesSubType.Normal)
             {
-                _ui.m_c1.selectedIndex = _dataManager.difficulty;
+                _ui.m_c1.selectedIndex = _selectedIndex;
                 StoryLevelCfg storyLevelCfg = StoryLevelCfgArray.Instance.GetCfg(cfg.storyLvId);
                 string str = string.Format("完成主线{0}-{1}解锁", storyLevelCfg.chapterId, storyLevelCfg.order);
                 PromptController.Instance.ShowFloatTextPrompt(str);
@@ -76,19 +78,19 @@ namespace GFGGame
             }
             if (_dataManager.fieldInfos.highestLvls[_ui.m_c1.selectedIndex] < cfg.num && _ui.m_c1.selectedIndex != ConstInstanceZonesSubType.Normal)
             {
-                _ui.m_c1.selectedIndex = _dataManager.difficulty;
+                _ui.m_c1.selectedIndex = _selectedIndex;
                 PromptController.Instance.ShowFloatTextPrompt("需通关前置关卡");
                 return;
             }
-            _dataManager.difficulty = _ui.m_c1.selectedIndex;
-            _curCfg = _dataManager.GetFieldCfgByDifficulty(_ui.m_c1.selectedIndex);
-            _curLevelId = _dataManager.GetLevelIdByDifficulty(_ui.m_c1.selectedIndex, _dataManager.currFightIndex);
+            _selectedIndex = _ui.m_c1.selectedIndex;
+            _curCfg = cfg;
+            _dataManager.chapterId = _curCfg.id;
             UpdateView();
         }
         private void UpdateView()
         {
             _ui.m_txtScore.text = ConstDressUpScoreType.scoreTypeList()[_dataManager.fieldInfos.theme].ToString();
-            _ui.m_txtMaxLv.text = string.Format("最高记录:{0}/{1}", _dataManager.fieldInfos.highestLvls[_dataManager.difficulty], _curCfg.num);
+            _ui.m_txtMaxLv.text = string.Format("最高记录:{0}/{1}", _dataManager.fieldInfos.highestLvls[_selectedIndex], _curCfg.num);
             _ui.m_txtConsume.text = string.Format("x{0}", _curCfg.needPower);
         }
         private void OnClickBtnGo()
@@ -115,8 +117,9 @@ namespace GFGGame
         }
         private void StartFight()
         {
-            ViewManager.Show(ViewName.DRESS_UP_FIGHT_VIEW, _curLevelId, new object[] { typeof(FieldView).Name, this.viewData }, true);
-            InstanceZonesDataManager.currentLevelCfgId = _curLevelId;
+            int curLevelId = StoryLevelCfgArray.Instance.GetCfgs(_curCfg.type, 0, _curCfg.id)[0].id;
+            ViewManager.Show(ViewName.DRESS_UP_FIGHT_VIEW, curLevelId, new object[] { typeof(FieldView).Name, this.viewData }, true);
+            InstanceZonesDataManager.currentLevelCfgId = curLevelId;
         }
         private void OnBtnTaskClick()
         {

+ 9 - 3
GameClient/Assets/Game/HotUpdate/Views/MainStory/StroyFightResultView.cs

@@ -137,16 +137,22 @@ namespace GFGGame
             }
         }
 
-        private void OnClickBtnClose(object param)
+        private async void OnClickBtnClose(object param)
         {
             this.Hide();
             if (_levelCfg.type == ConstInstanceZonesType.Field)
             {
                 _ui.m_c1.selectedIndex = 1;
                 Timers.inst.Remove(OnClickBtnClose);
-                if (!this._resultData.Result||FieldDataManager.Instance.currFightIndex)
-                {
 
+                if (!this._resultData.Result || FieldDataManager.Instance.currFightLv == FieldCfgArray.Instance.GetCfg(FieldDataManager.Instance.chapterId).num)
+                {
+                    bool result = await FieldSProxy.ReqFieldInstanceResult();
+                    if (result)
+                    {
+                        ViewManager.Show<FieldView>();
+                        ViewManager.Show<FieldFightEndView>();
+                    }
                 }
                 else
                 {

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