guodong 3 năm trước cách đây
mục cha
commit
b6f6a86cff
33 tập tin đã thay đổi với 448 bổ sung451 xóa
  1. 3 3
      GameClient/Assets/Editor/Excel/ExcelChecker.cs
  2. 0 13
      GameClient/Assets/Editor/Excel/ItemApproachScanner.cs
  3. 1 1
      GameClient/Assets/Game/CSShare
  4. 0 3
      GameClient/Assets/Game/HotUpdate/Constant/ConstStoryType.cs
  5. 13 3
      GameClient/Assets/Game/HotUpdate/Controller/BonusController.cs
  6. 1 0
      GameClient/Assets/Game/HotUpdate/Controller/GameController.cs
  7. 0 15
      GameClient/Assets/Game/HotUpdate/Data/Cache/DropOutDataCache.cs
  8. 7 1
      GameClient/Assets/Game/HotUpdate/Data/Cache/LuckyBoxBonusDataCache.cs
  9. 8 5
      GameClient/Assets/Game/HotUpdate/Data/Cache/StoryBonusDataCache.cs
  10. 1 1
      GameClient/Assets/Game/HotUpdate/Data/Handler/RoleDataHandler.cs
  11. 1 1
      GameClient/Assets/Game/HotUpdate/Data/ScoreSystemData.cs
  12. 175 257
      GameClient/Assets/Game/HotUpdate/Data/StoryDataManager.cs
  13. 2 2
      GameClient/Assets/Game/HotUpdate/DressUp/DressUpObjDataCache.cs
  14. 1 1
      GameClient/Assets/Game/HotUpdate/ExcelConfig/Manager/StoryCfgManager.cs
  15. 6 6
      GameClient/Assets/Game/HotUpdate/Net/Proxy/GameProxy.cs
  16. 114 0
      GameClient/Assets/Game/HotUpdate/ServerProxy/StorySProxy.cs
  17. 11 0
      GameClient/Assets/Game/HotUpdate/ServerProxy/StorySProxy.cs.meta
  18. 2 2
      GameClient/Assets/Game/HotUpdate/ServerProxy/SuitServerProxy.cs
  19. 7 32
      GameClient/Assets/Game/HotUpdate/Utils/ItemUtil.cs
  20. 2 13
      GameClient/Assets/Game/HotUpdate/Utils/StoryUtil.cs
  21. 2 2
      GameClient/Assets/Game/HotUpdate/Views/ClothingSynthetic/ClothingSyntheticView.cs
  22. 2 2
      GameClient/Assets/Game/HotUpdate/Views/ClothingSynthetic/SuitSyntheticView.cs
  23. 4 4
      GameClient/Assets/Game/HotUpdate/Views/DressUp/DressUpFightView.cs
  24. 2 2
      GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryChapterListView.cs
  25. 2 2
      GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryChapterView.cs
  26. 36 10
      GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryController.cs
  27. 3 3
      GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryFightQuicklyView.cs
  28. 2 3
      GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryFightSingleScoreView.cs
  29. 3 4
      GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryFightTargetScoreView.cs
  30. 1 1
      GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryFightTargetView.cs
  31. 4 4
      GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryLevelInfoView.cs
  32. 32 55
      GameClient/Assets/Game/HotUpdate/Views/MainStory/StroyFightResultView.cs
  33. BIN
      GameClient/Assets/ResIn/Config/excelConfig.sqlite.bytes

+ 3 - 3
GameClient/Assets/Editor/Excel/ExcelChecker.cs

@@ -203,7 +203,7 @@ namespace GFGEditor
             foreach(ClothingSyntheticCfg cfg in dataArray)
             {
                 CheckItemIdExist(cfg.costID, "合成ClothingSyntheticCfg.costID");
-                CheckItemsExist(cfg.materiars, "合成ClothingSyntheticCfg.materiars");
+                CheckItemsExist(cfg.materiarsArr, "合成ClothingSyntheticCfg.materiars");
             }
         }
 
@@ -363,9 +363,9 @@ namespace GFGEditor
             }
         }
 
-        private static void CheckStoryLevelCfgExist(string id, string keyName)
+        private static void CheckStoryLevelCfgExist(int id, string keyName)
         {
-            if(id.Length > 0)
+            if(id > 0)
             {
                 StoryLevelCfgArray cfgArray = StoryLevelCfgArray.Instance;
                 StoryLevelCfg cfg = cfgArray.GetCfg(id);

+ 0 - 13
GameClient/Assets/Editor/Excel/ItemApproachScanner.cs

@@ -259,19 +259,6 @@ namespace GFGEditor
             return false;
         }
 
-        private static bool CheckItemInBonus(int itemId, string bosnu)
-        {
-            List<ItemData> aList = ItemUtil.CreateItemDataList(bosnu);
-            foreach (ItemData itemData in aList)
-            {
-                if (itemId == itemData.id)
-                {
-                    return true;
-                }
-            }
-            return false;
-        }
-
         private static bool CheckItemInDropOut(int itemId, int[] dropIds)
         {
             List<ItemData> result = new List<ItemData>();

+ 1 - 1
GameClient/Assets/Game/CSShare

@@ -1 +1 @@
-Subproject commit 2d0f99aee53069f7a3bb6c04876470e024302803
+Subproject commit 1cde2f7fdd73b6dd0d08484fd22fb4a4326a61d7

+ 0 - 3
GameClient/Assets/Game/HotUpdate/Constant/ConstStoryType.cs

@@ -4,8 +4,5 @@ namespace GFGGame
     {
         public const int NORMAL_TYPE = 0;
         public const int HARD_TYPE = 1;
-
-        //¾«Ó¢Õ½ڷֽçÐòºÅ
-        public const int START_ID_OF_HARD = 10000;
     }
 }

+ 13 - 3
GameClient/Assets/Game/HotUpdate/Controller/BonusController.cs

@@ -8,10 +8,20 @@ namespace GFGGame
 {
     public class BonusController
     {
-        public static void ShowBonusList(int[][] bonusInfos)
+        public static void TryShowBonusList(int[][] bonusInfos)
         {
-            List<ItemData> bonusList = ItemUtil.CreateItemDataList(bonusInfos);
-            ViewManager.Show(ViewName.GET_BONUS_VIEW, bonusList);
+            if (bonusInfos != null && bonusInfos.Length > 0)
+            {
+                List<ItemData> bonusList = ItemUtil.CreateItemDataList(bonusInfos);
+                ViewManager.Show(ViewName.GET_BONUS_VIEW, bonusList);
+            }
+        }
+        public static void TryShowBonusList(List<ItemData> bonusList)
+        {
+            if(bonusList != null && bonusList.Count > 0)
+            {
+                ViewManager.Show(ViewName.GET_BONUS_VIEW, bonusList);
+            }
         }
     }
 }

+ 1 - 0
GameClient/Assets/Game/HotUpdate/Controller/GameController.cs

@@ -170,6 +170,7 @@ namespace GFGGame
 
             ItemHelper.GetItemAttributeInfos().Coroutine();
             SuitFosterHelper.SendGetSuitInfos().Coroutine();
+            StorySProxy.GetStoryInfos().Coroutine();
         }
 
         public static void PrepareUpdateTreasure()

+ 0 - 15
GameClient/Assets/Game/HotUpdate/Data/Cache/DropOutDataCache.cs

@@ -7,21 +7,6 @@ namespace GFGGame
     {
         private static Dictionary<int, List<DropOutData>> _probDic = new Dictionary<int, List<DropOutData>>();
 
-        public static List<ItemData> GetDropItemDatas(string dropIdsStr, bool doRandome)
-        {
-            List<ItemData> result = new List<ItemData>();
-            string[] dropIdStrArr = dropIdsStr.Split(';');
-            foreach(string value in dropIdStrArr)
-            {
-                int dropId = int.Parse(value);
-                ItemData itemData = GetDropItemData(dropId, doRandome);
-                if(itemData != null)
-                {
-                    result.Add(itemData);
-                }
-            }
-            return result;
-        }
 
         public static List<ItemData> GetDropItemDatas(int[] dropIds, bool doRandome)
         {

+ 7 - 1
GameClient/Assets/Game/HotUpdate/Data/Cache/LuckyBoxBonusDataCache.cs

@@ -65,7 +65,13 @@ namespace GFGGame
             List<ItemData> bonusList = null;
             if (isGuide)
             {
-                List<ItemData> guideBonusList = ItemUtil.CreateItemDataList("10332*1;10334*1;10335*1;10336*1;10338*1");
+                int[][] temp = new int[5][];
+                temp[0] = new int[] { 10332, 1 };
+                temp[1] = new int[] { 10334, 1 };
+                temp[2] = new int[] { 10335, 1 };
+                temp[3] = new int[] { 10336, 1 };
+                temp[4] = new int[] { 10338, 1 };
+                List<ItemData> guideBonusList = ItemUtil.CreateItemDataList(temp);
                 count = count - guideBonusList.Count;
                 bonusList = DropOutDataCache.GetDropItemDatas(_dropOutId, count);
                 while (guideBonusList.Count > 1)

+ 8 - 5
GameClient/Assets/Game/HotUpdate/Data/Cache/StoryBonusDataCache.cs

@@ -6,9 +6,9 @@ namespace GFGGame
 {
     public class StoryBonusDataCache
     {
-        private static Dictionary<string, StoryBonusData> _bonusDic = new Dictionary<string, StoryBonusData>();
+        private static Dictionary<int, StoryBonusData> _bonusDic = new Dictionary<int, StoryBonusData>();
 
-        public static List<ItemData> GetBonusList(string levelID, bool hasOnce, bool doRandom = false)
+        public static List<ItemData> GetBonusList(int levelID, bool hasOnce, bool doRandom = false)
         {
             StoryBonusData bonusData = GetBonusData(levelID);
             List<ItemData> bonusList = new List<ItemData>();
@@ -24,8 +24,11 @@ namespace GFGGame
                     {
                         StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(levelID);
                         StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(levelCfg.fightID);
-                        List<ItemData> randomList = DropOutDataCache.GetDropItemDatas(fightCfg.bonusRandomArr, true);
-                        bonusList.AddRange(randomList);
+                        if(fightCfg != null)
+                        {
+                            List<ItemData> randomList = DropOutDataCache.GetDropItemDatas(fightCfg.bonusRandomArr, true);
+                            bonusList.AddRange(randomList);
+                        }
                     }
                     else
                     {
@@ -56,7 +59,7 @@ namespace GFGGame
             return ItemUtil.CreateItemDataList(bonus);
         }
 
-        public static StoryBonusData GetBonusData(string levelID)
+        public static StoryBonusData GetBonusData(int levelID)
         {
             StoryBonusData bonusData = null;
             if (!_bonusDic.ContainsKey(levelID))

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Data/Handler/RoleDataHandler.cs

@@ -39,7 +39,7 @@ namespace GFGGame
                 _heartbeatCDEnd = currentTimeSecs + INTERVAL_HEARTBEAT;
             }
             int day = ServerDataManager.CurrentDay;
-            int recommendDay = StoryDataManager.recommendDay;
+            int recommendDay = GameGlobal.myNumericComponent.GetAsInt(ET.NumericType.RecommendCount);
             if(recommendDay >= 0 && recommendDay != day) 
             {
                 StoryDataManager.ResetDailyData();

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Data/ScoreSystemData.cs

@@ -61,7 +61,7 @@ namespace GFGGame
             int[] equipDatas = EquipDataCache.cacher.equipDatas;
             int partScore = 0;
             double tagProportion = 0;
-            StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(StoryDataManager.currentLevelID);
+            StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(StoryDataManager.currentLevelCfgId);
             StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(levelCfg.fightID);
 
             for (int i = 0; i < equipDatas.Length; i++)

+ 175 - 257
GameClient/Assets/Game/HotUpdate/Data/StoryDataManager.cs

@@ -11,7 +11,8 @@ namespace GFGGame
         public static string priorId = "prior";//首次登录前置剧情id
         public static int currentChapter = 0;
         public static int currentLevel = 0;
-        public static string currentLevelID;
+        //配置表的id
+        public static int currentLevelCfgId;
         public static int currentScoreType;
         public static int currentCardId = 0;
         public static bool usedRecommend;
@@ -19,107 +20,93 @@ namespace GFGGame
         public static int _passLevel = 0;
         private static int _passChapterJY = 10000;
         private static int _passLevelJY = 0;
-        private static int _recommendCount = 0;
         public static int recommendDay = -1;
-        public static int recommendCount
-        {
-            get
-            {
-                return _recommendCount;
-            }
-        }
 
-        private static Dictionary<string, int> _highestScoreDic = new Dictionary<string, int>();
-        private static Dictionary<int, int> _chapterStarCountDic = new Dictionary<int, int>();
-        private static Dictionary<int, Dictionary<int, int>> _chapterBonusDic = new Dictionary<int, Dictionary<int, int>>();
+        //关卡最高分数记录
+        private static Dictionary<int, int> _highestScoreDic = new Dictionary<int, int>();
+        //关卡星数记录
+        private static Dictionary<int, int> _starDic = new Dictionary<int, int>();
+        //关卡宝箱状态记录
+        private static Dictionary<int, int[]> _chapterBonusDic = new Dictionary<int, int[]>();
 
-        public static void InitServerData(RoleInfo roleInfo)
+        public static void InitScoreList(List<int> ks, List<int> vs)
         {
             usedRecommend = false;
-            _recommendCount = roleInfo.recommendCount;
-            recommendDay = roleInfo.recommendDay;
+            _highestScoreDic.Clear();
+            for (var i = 0; i < ks.Count; ++i)
+            {
+                _highestScoreDic.Add(ks[i], vs[i]);
+            }
         }
 
-        public static void InitScoreList(List<StoryScore> list)
+        public static void InitStarList(List<int> ks, List<int> vs)
         {
-            _highestScoreDic.Clear();
-            if (list != null)
+            _starDic.Clear();
+            for(var i = 0; i < ks.Count; ++i)
             {
-                foreach (StoryScore value in list)
-                {
-                    _highestScoreDic[value.lvlId] = value.score;
-                }
+                _starDic.Add(ks[i], vs[i]);
             }
         }
 
-        public static void InitStarList(List<StoryStar> list)
+        public static void InitBoxBonusStates(List<int> ks, List<int> vs)
         {
-            _chapterStarCountDic.Clear();
             _chapterBonusDic.Clear();
-            if (list != null)
+            for (var i = 0; i < ks.Count; ++i)
             {
-                foreach (StoryStar value in list)
-                {
-                    int chapterID = value.chapterId;
-                    _chapterStarCountDic[chapterID] = value.star;
-                    if (value.boxStatus != null && value.boxStatus.Length > 0)
-                    {
-                        Dictionary<int, int> statusDic = null;
-                        if (_chapterBonusDic.ContainsKey(chapterID))
-                        {
-                            statusDic = _chapterBonusDic[chapterID];
-                        }
-                        else
-                        {
-                            statusDic = new Dictionary<int, int>();
-                            _chapterBonusDic.Add(chapterID, statusDic);
-                        }
-                        string[] statusStrs = value.boxStatus.Split(';');
-                        for (int i = 0; i < statusStrs.Length; i++)
-                        {
-                            string statusStr = statusStrs[i];
-                            int status = int.Parse(statusStr);
-                            statusDic[i] = status;
-                        }
-                    }
-                }
+                var states = new int[] { 0, 0, 0 };
+                var value = vs[i];
+                CalculateHelper.GenerateChapterBoxStates(states, value);
+                _chapterBonusDic.Add(ks[i], states);
             }
         }
 
-        public static void ResetDailyData()
+        public static void UpdateBoxBonusStates(int chapter, int stateInt)
         {
-            _recommendCount = GameConst.MAX_COUNT_RECOMMEND;
-            int day = ServerDataManager.CurrentDay;
-            recommendDay = day;
-            GameProxy.ReqUpdateRecommendCount(_recommendCount);
+            if (!_chapterBonusDic.TryGetValue(chapter, out var states))
+            {
+                states = new int[] { 0, 0, 0 };
+                _chapterBonusDic.Add(chapter, states);
+            }
+            CalculateHelper.GenerateChapterBoxStates(states, stateInt);
         }
 
-        public static void SetPassData(int chapter, int chapterLvl)
+        //检查更新最高分
+        public static void TryUpdateScore(int levelCfgId, int score)
         {
-            if (StoryUtil.CheckChapterIsHard(chapter))
+            _highestScoreDic.TryGetValue(levelCfgId, out var scoreHighest);
+            if (score > scoreHighest)
             {
-                //_passChapterJY = chapter;
-                //_passLevelJY = chapterLvl;
+                _highestScoreDic[currentLevelCfgId] = score;
             }
-            else
+        }
+
+        //检查并更新关卡星数
+        public static void TryUpdateLevelStar(int levelCfgId, int star)
+        {
+            _starDic.TryGetValue(levelCfgId, out var OldStar);
+            if(star > OldStar)
             {
-                //_passChapter = chapter;
-                //_passLevel = chapterLvl;
+                _starDic[levelCfgId] = star;
             }
         }
 
+        public static void ResetDailyData()
+        {
+            //_recommendCount = GameConst.MAX_COUNT_RECOMMEND;
+            int day = ServerDataManager.CurrentDay;
+            //recommendDay = day;
+            //GameProxy.ReqUpdateRecommendCount(_recommendCount);
+        }
 
+        //获取宝箱奖励状态
         public static int GetChapterBonusStatus(int chapterID, int index)
         {
             if (_chapterBonusDic.ContainsKey(chapterID))
             {
-                Dictionary<int, int> statusDic = _chapterBonusDic[chapterID];
-                if (statusDic != null)
+                var states = _chapterBonusDic[chapterID];
+                if (states != null)
                 {
-                    if (statusDic.ContainsKey(index))
-                    {
-                        return statusDic[index];
-                    }
+                    return states[index];
                 }
             }
             return ConstBonusStatus.CAN_NOT_GET;
@@ -128,63 +115,30 @@ namespace GFGGame
         public static List<ItemData> GetChapterBonus(int chapterID, int index)
         {
             List<ItemData> bonusList = StoryBonusDataCache.GetChapterBonusList(chapterID, index);
-            foreach (ItemData itemData in bonusList)
-            {
-                ItemDataManager.Add(itemData.id, itemData.num);
-            }
-            Dictionary<int, int> statusDic = null;
-            if (_chapterBonusDic.ContainsKey(chapterID))
-            {
-                statusDic = _chapterBonusDic[chapterID];
-            }
-            else
-            {
-                statusDic = new Dictionary<int, int>();
-                _chapterBonusDic.Add(chapterID, statusDic);
-                statusDic[0] = ConstBonusStatus.CAN_NOT_GET;
-                statusDic[1] = ConstBonusStatus.CAN_NOT_GET;
-                statusDic[2] = ConstBonusStatus.CAN_NOT_GET;
-            }
-            statusDic[index] = ConstBonusStatus.GOT;
-            string boxStatus = GetBoxStatus(currentChapter);
-            int starCountChapter = GetChapterStarCount(currentChapter);
-            GameProxy.ReqUpdateStoryStar(currentChapter, starCountChapter, boxStatus);
+            //foreach (ItemData itemData in bonusList)
+            //{
+            //    ItemDataManager.Add(itemData.id, itemData.num);
+            //}
+            //Dictionary<int, int> statusDic = null;
+            //if (_chapterBonusDic.ContainsKey(chapterID))
+            //{
+            //    statusDic = _chapterBonusDic[chapterID];
+            //}
+            //else
+            //{
+            //    statusDic = new Dictionary<int, int>();
+            //    _chapterBonusDic.Add(chapterID, statusDic);
+            //    statusDic[0] = ConstBonusStatus.CAN_NOT_GET;
+            //    statusDic[1] = ConstBonusStatus.CAN_NOT_GET;
+            //    statusDic[2] = ConstBonusStatus.CAN_NOT_GET;
+            //}
+            //statusDic[index] = ConstBonusStatus.GOT;
+            //string boxStatus = GetBoxStatus(currentChapter);
+            //int starCountChapter = GetChapterStarCount(currentChapter);
+            //GameProxy.ReqUpdateStoryStar(currentChapter, starCountChapter, boxStatus);
             return bonusList;
         }
 
-        public static void UpdateChapterBonusStatus(int chapterID, int starCount)
-        {
-            StoryChapterCfg storyChapterCfg = StoryChapterCfgArray.Instance.GetCfg(chapterID);
-            if (starCount >= storyChapterCfg.bonusStar1)
-            {
-                Dictionary<int, int> statusDic = null;
-                if (_chapterBonusDic.ContainsKey(chapterID))
-                {
-                    statusDic = _chapterBonusDic[chapterID];
-                }
-                else
-                {
-                    statusDic = new Dictionary<int, int>();
-                    _chapterBonusDic.Add(chapterID, statusDic);
-                    statusDic[0] = ConstBonusStatus.CAN_NOT_GET;
-                    statusDic[1] = ConstBonusStatus.CAN_NOT_GET;
-                    statusDic[2] = ConstBonusStatus.CAN_NOT_GET;
-                }
-                if (statusDic[0] == ConstBonusStatus.CAN_NOT_GET)
-                {
-                    statusDic[0] = ConstBonusStatus.CAN_GET;
-                }
-                if (starCount >= storyChapterCfg.bonusStar2 && statusDic[1] == ConstBonusStatus.CAN_NOT_GET)
-                {
-                    statusDic[1] = ConstBonusStatus.CAN_GET;
-                }
-                if (starCount >= storyChapterCfg.bonusStar3 && statusDic[2] == ConstBonusStatus.CAN_NOT_GET)
-                {
-                    statusDic[2] = ConstBonusStatus.CAN_GET;
-                }
-            }
-        }
-
         public static bool CheckOpenMainUI()
         {
             return CheckLevelPass(1, 4) && GuideDataManager.GetGuideCountCopy(ConstGuideId.SINGLE_FIGHT) > 0;
@@ -204,7 +158,7 @@ namespace GFGGame
             {
                 return false;
             }
-            if (StoryUtil.CheckChapterIsHard(chapterId))
+            if (CalculateHelper.CheckChapterIsHard(chapterId))
             {
                 //对应普通剧情的章需要开启
                 if (!CheckNormalChapterPass(chapterId))
@@ -231,15 +185,7 @@ namespace GFGGame
         {
             int passChapter = GetPassChapter(chapterId);
             int passLevel = GetPassLevel(chapterId);
-            if (chapterId <= passChapter)
-            {
-                return true;
-            }
-            if (chapterId == passChapter + 1 && level <= passLevel)
-            {
-                return true;
-            }
-            return false;
+            return CalculateHelper.CheckLevelPass(chapterId, level, passChapter, passLevel);
         }
 
 
@@ -264,7 +210,7 @@ namespace GFGGame
             return CheckLevelPass(currentChapter, currentLevel);
         }
 
-        public static int GetScoreHighest(string levelID)
+        public static int GetScoreHighest(int levelID)
         {
             if (_highestScoreDic.ContainsKey(levelID))
             {
@@ -273,73 +219,57 @@ namespace GFGGame
             return 0;
         }
 
-        public static void GetStoryId(string levelIdStr, out int chapterIdP, out int levelIdP)
+        public static bool GetFightResult(int score, out int npcScore)
         {
-            string[] ids = levelIdStr.Split('_');
-            chapterIdP = int.Parse(ids[0]);
-            levelIdP = int.Parse(ids[1]);
-        }
+            npcScore = 0;
+            bool equipedNeeded = EquipDataCache.cacher.CheckEquipedFightNeeded();
+            if (!equipedNeeded)
+            {
+                PromptController.Instance.ShowFloatTextPrompt("未穿必需物品");
+                return false;//没穿必需品
+            }
 
-        public static int GetResultStarCount(int score)
-        {
-            if (!EquipDataCache.cacher.CheckEquipedFightNeeded())
+            int starCount = StoryDataManager.GetResultStarCount(score);
+            if (starCount <= 0)
             {
-                return 0;
+                return false;//低于一星
             }
-            return CalculateHelper.GetStoryChapterStar(currentLevelID, score);
-        }
 
-        public static int GetStarCountHistory(string levelID, int score)
-        {
-            int chapterIdT = 0;
-            int levelIdT = 0;
-            GetStoryId(levelID, out chapterIdT, out levelIdT);
-            if (!CheckLevelPass(chapterIdT, levelIdT))
+            StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(StoryDataManager.currentLevelCfgId);
+            StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(levelCfg.fightID);
+            bool hasFightTarget = fightCfg.targetName != null && fightCfg.targetName.Length > 0;
+            if (hasFightTarget)
             {
-                return 0;
+                npcScore = EquipDataCache.cacher.npcTotalScore;
+                if(score < npcScore)
+                {
+                    return false;//分数低于对战对象
+                }
             }
-            return CalculateHelper.GetStoryChapterStar(levelID, score);
-        }
 
-        public static bool CheckCurrentScoreEnough(int score)
+            return true;
+        }
+        public static int GetResultStarCount(int score)
         {
-            StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(currentLevelID);
-            StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(levelCfg.fightID);
-            return (score > fightCfg.score1);
+            return CalculateHelper.GetStoryChapterStar(currentLevelCfgId, score);
         }
 
-        public static void SetScore(int score, int starCount)
+        public static int GetStarCountHistory(int levelID)
         {
-            int scoreHighest = 0;
-            if (_highestScoreDic.ContainsKey(currentLevelID))
-            {
-                scoreHighest = _highestScoreDic[currentLevelID];
-            }
-            if (score > scoreHighest)
-            {
-                _highestScoreDic[currentLevelID] = score;
-                GameProxy.ReqUpdateStoryScore(currentLevelID, score);
+            _starDic.TryGetValue(levelID, out var star);
+            return star;
+        }
 
-                int starCountSaved = GetStarCountHistory(currentLevelID, scoreHighest);
-                int starCountChapter = 0;
-                if (_chapterStarCountDic.ContainsKey(currentChapter))
-                {
-                    starCountChapter = _chapterStarCountDic[currentChapter];
-                }
-                if (starCount > starCountSaved)
-                {
-                    starCountChapter = starCountChapter + starCount - starCountSaved;
-                    _chapterStarCountDic[currentChapter] = starCountChapter;
-                    UpdateChapterBonusStatus(currentChapter, starCountChapter);
-                    string boxStatus = GetBoxStatus(currentChapter);
-                    GameProxy.ReqUpdateStoryStar(currentChapter, starCountChapter, boxStatus);
-                }
-            }
+        public static bool CheckCurrentScoreEnough(int score)
+        {
+            StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(currentLevelCfgId);
+            StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(levelCfg.fightID);
+            return (score > fightCfg.score1);
         }
 
         public static int GetPassChapter(int fromChapter)
         {
-            if (StoryUtil.CheckChapterIsHard(fromChapter))
+            if (CalculateHelper.CheckChapterIsHard(fromChapter))
             {
                 return GameGlobal.myNumericComponent.GetAsInt(NumericType.ChapterJY);
             }
@@ -348,7 +278,7 @@ namespace GFGGame
 
         public static int GetPassLevel(int fromChapter)
         {
-            if (StoryUtil.CheckChapterIsHard(fromChapter))
+            if (CalculateHelper.CheckChapterIsHard(fromChapter))
             {
                 return GameGlobal.myNumericComponent.GetAsInt(NumericType.ChapterLvlJY);
             }
@@ -360,93 +290,81 @@ namespace GFGGame
             fistPassLastLvl = false;
             curLvfirstPass = false;
             List<ItemData> currentBonusList = new List<ItemData>();
-            if (!CheckCurrentLevelPass())
-            {
-                curLvfirstPass = true;
-                int tempPassLevel = currentLevel;
-                int tempPassChapter = GetPassChapter(currentChapter);
-                int nextLevel = currentLevel + 1;
-                string nextLevelID = currentChapter + "_" + nextLevel;
-                StoryLevelCfg nextLevelCfg = StoryLevelCfgArray.Instance.GetCfg(nextLevelID);
-                if (nextLevelCfg == null)
-                {
-                    tempPassChapter = currentChapter;
-                    tempPassLevel = 0;
-                    fistPassLastLvl = true;
-                }
-                SetPassData(tempPassChapter, tempPassLevel);
-                //GameProxy.ReqUpdateStoryProgress(_passChapter, _passLevel, _passChapterJY, _passLevelJY);
-                currentBonusList = StoryBonusDataCache.GetBonusList(currentLevelID, true, true);
-            }
-            else
-            {
-                currentBonusList = StoryBonusDataCache.GetBonusList(currentLevelID, false, true);
-            }
-            StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(StoryDataManager.currentLevelID);
-            //消耗体力
-            if (currentBonusList != null && currentBonusList.Count > 0)
-            {
-                if (GameGlobal.myNumericComponent.GetAsInt(NumericType.Power) >= levelCfg.power)
-                {
-                    RoleDataManager.power -= levelCfg.power;
-                }
-                else
-                {
-                    RoleDataManager.power = 0;
-                }
-            }
+            //if (!CheckCurrentLevelPass())
+            //{
+            //    curLvfirstPass = true;
+            //    int tempPassLevel = currentLevel;
+            //    int tempPassChapter = GetPassChapter(currentChapter);
+            //    int nextLevel = currentLevel + 1;
+            //    int nextLevelID = currentChapter*GameConst.STORY_LEVEL_KEY_NUM + nextLevel;
+            //    StoryLevelCfg nextLevelCfg = StoryLevelCfgArray.Instance.GetCfg(nextLevelID);
+            //    if (nextLevelCfg == null)
+            //    {
+            //        tempPassChapter = currentChapter;
+            //        tempPassLevel = 0;
+            //        fistPassLastLvl = true;
+            //    }
+            //SetPassData(tempPassChapter, tempPassLevel);
+            //GameProxy.ReqUpdateStoryProgress(_passChapter, _passLevel, _passChapterJY, _passLevelJY);
+            //currentBonusList = StoryBonusDataCache.GetBonusList(currentLevelID, true, true);
+            //}
+            //else
+            //{
+            //currentBonusList = StoryBonusDataCache.GetBonusList(currentLevelID, false, true);
+            //}
+            //StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(StoryDataManager.currentLevelID);
+            ////消耗体力
+            //if (currentBonusList != null && currentBonusList.Count > 0)
+            //{
+            //    if (GameGlobal.myNumericComponent.GetAsInt(NumericType.Power) >= levelCfg.power)
+            //    {
+            //        RoleDataManager.power -= levelCfg.power;
+            //    }
+            //    else
+            //    {
+            //        RoleDataManager.power = 0;
+            //    }
+            //}
             //消耗推荐次数
-            if (usedRecommend)
-            {
-                usedRecommend = false;
-                _recommendCount--;
-                GameProxy.ReqUpdateRecommendCount(_recommendCount);
-            }
+            //if (usedRecommend)
+            //{
+            //    usedRecommend = false;
+            //    //_recommendCount--;
+            //    //GameProxy.ReqUpdateRecommendCount(_recommendCount);
+            //}
             //经验奖励
-            if (levelCfg.fightID != null && levelCfg.fightID.Length > 0)
-            {
-                StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(levelCfg.fightID);
-                RoleDataManager.exp += fightCfg.exp;
-            }
-            foreach (ItemData itemData in currentBonusList)
-            {
-                ItemDataManager.Add(itemData.id, itemData.num);
-            }
+            //if (levelCfg.fightID != null && levelCfg.fightID.Length > 0)
+            //{
+            //    StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(levelCfg.fightID);
+            //    RoleDataManager.exp += fightCfg.exp;
+            //}
+            //foreach (ItemData itemData in currentBonusList)
+            //{
+            //    ItemDataManager.Add(itemData.id, itemData.num);
+            //}
             return currentBonusList;
         }
 
         public static int GetChapterStarCount(int chapterID)
         {
-            if (_chapterStarCountDic.ContainsKey(chapterID))
+            var star = 0;
+            foreach(var item in _starDic)
             {
-                return _chapterStarCountDic[chapterID];
+                var tempChapter = item.Key / GameConst.STORY_LEVEL_KEY_NUM;
+                if(tempChapter == chapterID)
+                {
+                    star += item.Value;
+                }
             }
-            return 0;
+            return star;
         }
 
-        public static int GetCanFightTime(string levelID)
+        public static int GetCanFightTime(int levelID)
         {
             StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(levelID);
-            int time = (int)Math.Floor((float)GameGlobal.myNumericComponent.GetAsInt(NumericType.Power) / levelCfg.power);
-            return time;
+            int times = (int)Math.Floor((float)GameGlobal.myNumericComponent.GetAsInt(NumericType.Power) / levelCfg.power);
+            return times;
         }
 
-        private static string GetBoxStatus(int chapterId)
-        {
-            string boxStatus = "0;0;0";
-            if (_chapterBonusDic.ContainsKey(chapterId))
-            {
-                boxStatus = "{0};{1};{2}";
-                Dictionary<int, int> tempDic = _chapterBonusDic[chapterId];
-                int value0 = GetChapterBonusStatus(chapterId, 0);
-                int value1 = GetChapterBonusStatus(chapterId, 1);
-                int value2 = GetChapterBonusStatus(chapterId, 2);
-                boxStatus = string.Format(boxStatus, value0, value1, value2);
-            }
-            return boxStatus;
-        }
-
-
-
     }
 }

+ 2 - 2
GameClient/Assets/Game/HotUpdate/DressUp/DressUpObjDataCache.cs

@@ -510,7 +510,7 @@ namespace GFGGame
         {
             TakeOffAll(false);
             List<int> recommendList = DressUpMenuItemDataManager.GetRecommendItemList();
-            StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(StoryDataManager.currentLevelID);
+            StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(StoryDataManager.currentLevelCfgId);
             StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(levelCfg.fightID);
             //推荐搭配自动穿必穿品
             if (fightCfg.needItemId > 0 && DressUpMenuItemDataManager.CheckHasItem(fightCfg.needItemId) && recommendList.IndexOf(fightCfg.needItemId) < 0)
@@ -539,7 +539,7 @@ namespace GFGGame
 
         public bool CheckEquipedFightNeeded()
         {
-            StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(StoryDataManager.currentLevelID);
+            StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(StoryDataManager.currentLevelCfgId);
             StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(levelCfg.fightID);
             if (fightCfg.needItemId > 0)
             {

+ 1 - 1
GameClient/Assets/Game/HotUpdate/ExcelConfig/Manager/StoryCfgManager.cs

@@ -14,7 +14,7 @@ namespace GFGGame
             StoryChapterCfg[] dataArray = StoryChapterCfgArray.Instance.dataArray;
             foreach(StoryChapterCfg cfg in dataArray)
             {
-                if(StoryUtil.CheckChapterIsHard(cfg.id))
+                if(CalculateHelper.CheckChapterIsHard(cfg.id))
                 {
                     _hardCfgs.Add(cfg);
                 }

+ 6 - 6
GameClient/Assets/Game/HotUpdate/Net/Proxy/GameProxy.cs

@@ -69,8 +69,8 @@ namespace GFGGame
             Dictionary<string, object> data = JsonUtil.createJsonDic("chapter", chapter, "chapterLvl", chapterLvl, "chapterJY", chapterJY, "chapterLvlJY", chapterLvlJY, "id", RoleDataManager.roleId);
             Post(GameProtoId.UPDATE_STORY_PROGRESS, "roleInfo", data, (GameResult result) =>
             {
-                StoryDataManager.SetPassData(chapter, chapterLvl);
-                StoryDataManager.SetPassData(chapterJY, chapterLvlJY);
+                //StoryDataManager.SetPassData(chapter, chapterLvl);
+                //StoryDataManager.SetPassData(chapterJY, chapterLvlJY);
             });
         }
 
@@ -81,11 +81,11 @@ namespace GFGGame
             {
                 if (result != null && result.storyScoreList != null)
                 {
-                    StoryDataManager.InitScoreList(result.storyScoreList);
+                    //StoryDataManager.InitScoreList(result.storyScoreList);
                 }
                 else
                 {
-                    StoryDataManager.InitScoreList(null);
+                    //StoryDataManager.InitScoreList(null);
                 }
             });
         }
@@ -106,11 +106,11 @@ namespace GFGGame
             {
                 if (result != null && result.storyStarList != null)
                 {
-                    StoryDataManager.InitStarList(result.storyStarList);
+                    //StoryDataManager.InitStarList(result.storyStarList);
                 }
                 else
                 {
-                    StoryDataManager.InitStarList(null);
+                    //StoryDataManager.InitStarList(null);
                 }
             });
         }

+ 114 - 0
GameClient/Assets/Game/HotUpdate/ServerProxy/StorySProxy.cs

@@ -0,0 +1,114 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using ET;
+
+namespace GFGGame
+{
+    public class StorySProxy
+    {
+        //请求剧情关卡数据
+        public static async ETTask GetStoryInfos()
+        {
+            M2C_GetStoryInfos response = null;
+            response = (M2C_GetStoryInfos)await MessageHelper.SendToServer(new C2M_GetStoryInfos());
+            if(response != null)
+            {
+                if(response.Error == ErrorCode.ERR_Success)
+                {
+                    StoryDataManager.InitScoreList(response.ksScore, response.vsScore);
+                    StoryDataManager.InitStarList(response.ksStar, response.vsStar);
+                    StoryDataManager.InitBoxBonusStates(response.ksBonusState, response.vsBonusState);
+                }
+            }
+        }
+
+        //完成剧情对话关卡
+        public static async ETTask FinishStoryDialogLevel(int levelCfgId)
+        {
+            M2C_FinishStoryDialog response = null;
+            response = (M2C_FinishStoryDialog)await MessageHelper.SendToServer(new C2M_FinishStoryDialog()
+            {
+                LevelCfgId = levelCfgId
+            });
+            if (response != null)
+            {
+                if (response.Error == ErrorCode.ERR_Success)
+                {
+                    List<ItemData> bonusList = StoryBonusDataCache.GetBonusList(response.LevelCfgId, true, true);
+                    BonusController.TryShowBonusList(bonusList);
+                }
+            }
+        }
+
+        //完成剧情战斗关卡
+        public static async ETTask FinishStoryFightLevel(int levelCfgId, int score, int npcScore, bool useRecomend)
+        {
+            M2C_FinishStoryFightLevel response = null;
+            response = (M2C_FinishStoryFightLevel)await MessageHelper.SendToServer(new C2M_FinishStoryFightLevel()
+            {
+                LevelCfgId = levelCfgId,
+                Score = score,
+                NpcScore = npcScore,
+                UseRecommend = useRecomend
+            });
+            if(response != null)
+            {
+                if(response.Error == ErrorCode.ERR_Success)
+                {
+                    //更新数据
+                    StoryDataManager.TryUpdateScore(response.LevelCfgId, response.Score);
+                    StoryDataManager.TryUpdateLevelStar(response.LevelCfgId, response.Star);
+                    CalculateHelper.GetStoryChapterLevel(response.LevelCfgId, out var chapter, out var level);
+                    StoryDataManager.UpdateBoxBonusStates(chapter, response.BoxStates);
+                    //展示奖励
+                    List<ItemData> bonusList = StoryBonusDataCache.GetBonusList(response.LevelCfgId, response.HasOnceBonus);
+                    if(response.RandomBonusList != null)
+                    {
+                        foreach(var item in response.RandomBonusList)
+                        {
+                            var itemData = ItemUtil.createItemData(item.ConfigId, item.Count);
+                            bonusList.Add(itemData);
+                        }
+                    }
+
+                    if(response.HasOnceBonus)
+                    {
+                        //首次通过要检查是否有功能开启
+                        FunctionOpenDataManager.Instance.CheckHasChapterFunOpen(GameGlobal.myNumericComponent.GetAsInt(NumericType.Chapter) + 1, GameGlobal.myNumericComponent.GetAsInt(NumericType.ChapterLvl));
+                    }
+                    ViewManager.Show(ViewName.STORY_FIGHT_RESULT_VIEW, new StoryFightResultData
+                    {
+                        Result = true,
+                        Score = response.Score,
+                        FirstPass = response.HasOnceBonus,
+                        Star = response.Star,
+                        BonusList = bonusList
+                    }, null, true);
+                    return;
+                }
+            }
+            //异常返回到关卡列表界面
+            ViewManager.Show(ViewName.STORY_CHAPTER_VIEW, StoryDataManager.currentChapter, ViewManager.GetGoBackDatas(ViewName.STORY_CHAPTER_VIEW));
+        }
+
+        //完成剧情战斗关卡失败,更新最高分
+        public static async ETTask FinishStoryFightLevelFail(int levelCfgId, int score)
+        {
+            M2C_FinishStoryFightLevelFail response = null;
+            response = (M2C_FinishStoryFightLevelFail)await MessageHelper.SendToServer(new C2M_FinishStoryFightLevelFail()
+            {
+                LevelCfgId = levelCfgId,
+                Score = score,
+            });
+            if (response != null)
+            {
+                if (response.Error == ErrorCode.ERR_Success)
+                {
+                    StoryDataManager.TryUpdateScore(response.LevelCfgId, response.Score); 
+                }
+            }
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/ServerProxy/StorySProxy.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 4fa34e91f96d1e5409ae10e83d561406
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

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

@@ -14,7 +14,7 @@ namespace GFGGame
                 {
                     DressUpMenuSuitDataManager.SetSuitGuideBoxBonusCompleted(m2C_GetSuitGuideBoxBonus.SuitId);
                     SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(suitId);
-                    BonusController.ShowBonusList(suitCfg.boxBonusArr);
+                    BonusController.TryShowBonusList(suitCfg.boxBonusArr);
                 }
             }
         }
@@ -28,7 +28,7 @@ namespace GFGGame
                 {
                     DressUpMenuSuitDataManager.SetSuitSyntheticBoxBonusCompleted(m2C_GetSuitSyntheticBoxBonus.SuitId);
                     SuitSyntheticCfg suitCfg = SuitSyntheticCfgArray.Instance.GetCfg(suitId);
-                    BonusController.ShowBonusList(suitCfg.boxBonusArr);
+                    BonusController.TryShowBonusList(suitCfg.boxBonusArr);
                 }
             }
         }

+ 7 - 32
GameClient/Assets/Game/HotUpdate/Utils/ItemUtil.cs

@@ -180,22 +180,6 @@ namespace GFGGame
             return itemCfg.rarity;
         }
 
-        public static List<ItemData> CreateItemDataList(string bonus, bool isOnceBonus = false)
-        {
-            List<ItemData> itemList = new List<ItemData>();
-            string[] bonusList = bonus.Split(';');
-            foreach (string i in bonusList)
-            {
-                if (i.Length > 0)
-                {
-                    ItemData itemData = createItemData(i);
-                    itemList.Add(itemData);
-                    itemData.isOnceBonus = isOnceBonus;
-                }
-            }
-            return itemList;
-        }
-
         public static List<ItemData> CreateItemDataList(int[][] bonus, bool isOnceBonus = false)
         {
             List<ItemData> itemList = new List<ItemData>();
@@ -208,20 +192,6 @@ namespace GFGGame
             return itemList;
         }
 
-        public static ItemData createItemData(string bonus)
-        {
-            string[] arr = bonus.Split('*');
-            int itemID = int.Parse(arr[0]);
-            int itemNum = 1;
-            if (arr.Length > 1)
-            {
-                itemNum = int.Parse(arr[1]);
-            }
-            ItemData itemData = ItemDataPool.GetItemData(itemID);
-            itemData.num = itemNum;
-            return itemData;
-        }
-
         public static ItemData createItemData(int[] bonus)
         {
             int itemID = bonus[0];
@@ -230,8 +200,13 @@ namespace GFGGame
             {
                 itemNum = bonus[1];
             }
-            ItemData itemData = ItemDataPool.GetItemData(itemID);
-            itemData.num = itemNum;
+            return createItemData(itemID, itemNum);
+        }
+
+        public static ItemData createItemData(int itemId, int count)
+        {
+            ItemData itemData = ItemDataPool.GetItemData(itemId);
+            itemData.num = count;
             return itemData;
         }
 

+ 2 - 13
GameClient/Assets/Game/HotUpdate/Utils/StoryUtil.cs

@@ -70,11 +70,6 @@ namespace GFGGame
             return "第" + NumberUtil.GetChiniseNumberText(order) + "章";
         }
 
-        public static bool CheckChapterIsHard(int chapterId)
-        {
-            return chapterId >= ConstStoryType.START_ID_OF_HARD;
-        }
-
         /// <summary>
         /// 获得章节显示的序号
         /// </summary>
@@ -82,9 +77,9 @@ namespace GFGGame
         /// <returns></returns>
         public static int GetNormalChapterId(int chapterId)
         {
-            if(CheckChapterIsHard(chapterId))
+            if(CalculateHelper.CheckChapterIsHard(chapterId))
             {
-                return chapterId - ConstStoryType.START_ID_OF_HARD;
+                return chapterId - GameConst.START_ID_OF_HARD;
             }
             return chapterId;
         }
@@ -105,11 +100,5 @@ namespace GFGGame
             }
         }
 
-        public static void GetStoryLevelId(string levelId, out int chapter, out int level)
-        {
-            string[] splitValues = levelId.Split('_');
-            chapter = int.Parse(splitValues[0]);
-            level = int.Parse(splitValues[1]);
-        }
     }
 }

+ 2 - 2
GameClient/Assets/Game/HotUpdate/Views/ClothingSynthetic/ClothingSyntheticView.cs

@@ -148,7 +148,7 @@ namespace GFGGame
             }
             //合成
             ClothingSyntheticCfg clothingSyntheticCfg = ClothingSyntheticCfgArray.Instance.GetCfg(_selectedItemId);
-            _materiarsOfSelectedItem = ItemUtil.CreateItemDataList(clothingSyntheticCfg.materiars);
+            _materiarsOfSelectedItem = ItemUtil.CreateItemDataList(clothingSyntheticCfg.materiarsArr);
             int count = _materiarsOfSelectedItem.Count;
             for (int i = 0; i < count; i++)
             {
@@ -305,7 +305,7 @@ namespace GFGGame
             ClothingSyntheticCfg clothingSyntheticCfg = ClothingSyntheticCfgArray.Instance.GetCfg(_selectedItemId);
             string costName = ItemUtil.GetItemName(clothingSyntheticCfg.costID);
             _ui.m_txtCost.SetVar("v1", "" + clothingSyntheticCfg.costNum).SetVar("v2", costName).FlushVars();
-            _materiarsOfSelectedItem = ItemUtil.CreateItemDataList(clothingSyntheticCfg.materiars);
+            _materiarsOfSelectedItem = ItemUtil.CreateItemDataList(clothingSyntheticCfg.materiarsArr);
             int count = _ui.m_listMaterias.numChildren;
             for (int i = 0; i < count; i++)
             {

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

@@ -103,11 +103,11 @@ namespace GFGGame
             bool haveSuit = DressUpMenuSuitDataManager.CheckHaveSuit(suitId);
             bool isLock = false;
             SuitSyntheticCfg suitSyntheticCfg = SuitSyntheticCfgArray.Instance.GetCfg(suitId);
-            if (suitSyntheticCfg.storyLevelId.Length > 0)
+            if (suitSyntheticCfg.storyLevelId > 0)
             {
                 int chapter = 0;
                 int level = 0;
-                StoryUtil.GetStoryLevelId(suitSyntheticCfg.storyLevelId, out chapter, out level);
+                CalculateHelper.GetStoryChapterLevel(suitSyntheticCfg.storyLevelId, out chapter, out level);
                 bool isLevelPass = StoryDataManager.CheckLevelPass(chapter, level);
                 if (!isLevelPass)
                 {

+ 4 - 4
GameClient/Assets/Game/HotUpdate/Views/DressUp/DressUpFightView.cs

@@ -9,7 +9,7 @@ namespace GFGGame
     {
         private UI_DressUpFightUI _ui;
         private int _fightID;
-        private string _levelID;
+        private int _levelID;
         private float listType1X = 0;
         private float partsListX = 0;
         private DressUpListType currentListType;
@@ -104,11 +104,11 @@ namespace GFGGame
             base.OnShown();
             StoryDataManager.usedRecommend = false;
             // _ui.m_comboBox.title = "我的套装";
-            _ui.m_txtRecommendCount.SetVar("v1", "" + StoryDataManager.recommendCount).FlushVars();
-            _ui.m_btnRecommend.enabled = StoryDataManager.recommendCount > 0;
+            _ui.m_txtRecommendCount.SetVar("v1", "" + GameGlobal.myNumericComponent.GetAsInt(ET.NumericType.RecommendCount)).FlushVars();
+            _ui.m_btnRecommend.enabled = GameGlobal.myNumericComponent.GetAsInt(ET.NumericType.RecommendCount) > 0;
             _scoreIndex = _ui.m_partsList.m_comboBoxRarity.selectedIndex;
             _ui.m_btnAutoPlay.visible = FunctionOpenDataManager.Instance.CheckIsFunOpenById(ConstFunctionId.FUNCTION_AUTOPLAY_FIGHT, false);
-            _levelID = (string)viewData;
+            _levelID = (int)viewData;
             _levelCfg = StoryLevelCfgArray.Instance.GetCfg(_levelID);
             _fightCfg = StoryFightCfgArray.Instance.GetCfg(_levelCfg.fightID);
             if (!string.IsNullOrEmpty(_fightCfg.music))

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

@@ -43,7 +43,7 @@ namespace GFGGame
         protected override void OnShown()
         {
             base.OnShown();
-            if (StoryUtil.CheckChapterIsHard(StoryDataManager.currentChapter))
+            if (CalculateHelper.CheckChapterIsHard(StoryDataManager.currentChapter))
             {
                 storyType = ConstStoryType.HARD_TYPE;
             }
@@ -144,7 +144,7 @@ namespace GFGGame
                     }
                     else
                     {
-                        if (StoryUtil.CheckChapterIsHard(chapterID) && !StoryDataManager.CheckNormalChapterPass(chapterID))
+                        if (CalculateHelper.CheckChapterIsHard(chapterID) && !StoryDataManager.CheckNormalChapterPass(chapterID))
                         {
                             listItem.m_content.m_txtLockDesc.text = "通关同一普通章节开启";
                         }

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

@@ -117,7 +117,7 @@ namespace GFGGame
                         levelItem.target.visible = true;
                         levelItem.target.onClick.Clear();
                         levelItem.target.onClick.Add(OnClickLevelItem);
-                        string levelID = _chapterID + "_" + level;
+                        int levelID = _chapterID*GameConst.STORY_LEVEL_KEY_NUM + level;
                         string showId = StoryUtil.GetNormalChapterId(_chapterID) + "_" + level;
                         levelItem.m_txtOrder.text = showId;
                         StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(levelID);
@@ -134,7 +134,7 @@ namespace GFGGame
                                 else
                                 {
                                     levelItem.m_flower.target.visible = true;
-                                    int starCount = StoryDataManager.GetStarCountHistory(levelID, score);
+                                    int starCount = StoryDataManager.GetStarCountHistory(levelID);
                                     StoryUtil.UpdateStar(starCount, levelItem.m_flower.target);
                                 }
                             }

+ 36 - 10
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryController.cs

@@ -7,9 +7,9 @@ namespace GFGGame
     {
         public static void ShowLevelView(int chapterID, int level)
         {
-            string levelID = chapterID + "_" + level;
+            int levelID = chapterID*GameConst.STORY_LEVEL_KEY_NUM + level;
             StoryDataManager.currentChapter = chapterID;
-            StoryDataManager.currentLevelID = levelID;
+            StoryDataManager.currentLevelCfgId = levelID;
             StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(levelID);
             StoryDataManager.currentLevel = level;
             if (levelCfg.fightID.Length > 0)
@@ -30,20 +30,46 @@ namespace GFGGame
         public static void ShowPriorStoryDialog()
         {
             StoryDataManager.currentChapter = 1;
-            StoryDataManager.currentLevelID = "1_1";
+            StoryDataManager.currentLevelCfgId = 1001;
             ViewManager.Show(ViewName.STORY_DIALOG_VIEW, new object[] { StoryDataManager.priorId, false, new OnCompleteStoryDialogCall(OnCompleteChapterStoryDialog) }, null, true);
         }
 
+        public static async ETTask CheckStoryFightResult()
+        {
+            var score = EquipDataCache.cacher.totalScore;
+            //客户端先做判断,成功和失败处理不同
+            var success = StoryDataManager.GetFightResult(score, out var npcScore);
+            if(success)
+            {
+                await StorySProxy.FinishStoryFightLevel(StoryDataManager.currentLevelCfgId, score, npcScore, StoryDataManager.usedRecommend);
+            }
+            else
+            {
+                ViewManager.Show(ViewName.STORY_FIGHT_RESULT_VIEW, new StoryFightResultData
+                {
+                    Result = false,
+                    Score = score,
+                    FirstPass = false,
+                    Star = 0
+                }, null, true);
+                //失败仅判断并更新最高分
+                if(score > StoryDataManager.GetScoreHighest(StoryDataManager.currentCardId))
+                {
+                    StorySProxy.FinishStoryFightLevelFail(StoryDataManager.currentLevelCfgId, score).Coroutine();
+                }
+            }
+        }
+
         private static void OnCompleteChapterStoryDialog(bool isSkip, object param)
         {
 
-            List<ItemData> bonusList = null;
+            //List<ItemData> bonusList = null;
             bool _fistPassLastLvl = false;
             bool _curLvfirstPass = false;
             if (!StoryDataManager.CheckCurrentLevelPass())
             {
-
-                bonusList = StoryDataManager.PassCurrentLevel(out _fistPassLastLvl, out _curLvfirstPass);
+                //bonusList = StoryDataManager.PassCurrentLevel(out _fistPassLastLvl, out _curLvfirstPass);
+                StorySProxy.FinishStoryDialogLevel(StoryDataManager.currentLevelCfgId).Coroutine();
             }
             if (_fistPassLastLvl)
             {
@@ -57,10 +83,10 @@ namespace GFGGame
             {
                 FunctionOpenDataManager.Instance.CheckHasChapterFunOpen(GameGlobal.myNumericComponent.GetAsInt(NumericType.Chapter) + 1, GameGlobal.myNumericComponent.GetAsInt(NumericType.ChapterLvl));//首次通过要检查是否有功能开启
             }
-            if (bonusList != null && bonusList.Count > 0)
-            {
-                ViewManager.Show(ViewName.GET_BONUS_VIEW, bonusList);
-            }
+            //if (bonusList != null && bonusList.Count > 0)
+            //{
+            //    ViewManager.Show(ViewName.GET_BONUS_VIEW, bonusList);
+            //}
         }
 
 

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

@@ -10,7 +10,7 @@ namespace GFGGame
     {
         private UI_StoryFightQuicklyUI _ui;
         private int _fightID;
-        private string _levelID;
+        private int _levelID;
         private int _storyType;
 
         private List<List<ItemData>> _totalBonusList;
@@ -44,8 +44,8 @@ namespace GFGGame
         {
             base.OnShown();
             int count = (int)viewData;
-            _levelID = StoryDataManager.currentLevelID;
-            _storyType = int.Parse(_levelID.Split('_')[0]) / 10000;
+            _levelID = StoryDataManager.currentLevelCfgId;
+            _storyType = _levelID/GameConst.STORY_LEVEL_KEY_NUM / 10000;
 
             StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(_levelID);
             StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(levelCfg.fightID);

+ 2 - 3
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryFightSingleScoreView.cs

@@ -51,7 +51,7 @@ namespace GFGGame
 
             ScoreSystemData.Instance.SetEquipDicWithType();
 
-            StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(StoryDataManager.currentLevelID);
+            StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(StoryDataManager.currentLevelCfgId);
             StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(levelCfg.fightID);
             _ui.m_proScore.target.max = fightCfg.score3;
             _ui.m_proScore.target.value = 0;
@@ -246,8 +246,7 @@ namespace GFGGame
         private void Skip(object param = null)
         {
             Reset();
-            this.Hide();
-            ViewManager.Show(ViewName.STORY_FIGHT_RESULT_VIEW);
+            StoryController.CheckStoryFightResult().Coroutine();
         }
         private void OnBtnBackClick()
         {

+ 3 - 4
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryFightTargetScoreView.cs

@@ -109,7 +109,7 @@ namespace GFGGame
             EventAgent.AddEventListener(ConstMessage.CARD_SKILL, UpdateCircleResult);
 
             SceneController.UpdateRole(EquipDataCache.cacher.equipDatas, _sceneObject);
-            StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(StoryDataManager.currentLevelID);
+            StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(StoryDataManager.currentLevelCfgId);
             StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(levelCfg.fightID);
             SceneController.UpdateFightTarget(fightCfg.targetRes, _sceneObject);
             _ui.m_selfName.m_txtName.text = RoleDataManager.roleName;
@@ -195,7 +195,7 @@ namespace GFGGame
             EquipDataCache.cacher.totalScore = (int)Math.Round(_score);
 
 
-            StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(StoryDataManager.currentLevelID);
+            StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(StoryDataManager.currentLevelCfgId);
             StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(levelCfg.fightID);
             double targetScore = fightCfg.targetPartsScoreArr[_index] * ConstScoreSystem.PART_SCORE;
             Debug.Log("targetScore:" + targetScore);
@@ -454,6 +454,7 @@ namespace GFGGame
         protected override void OnHide()
         {
             base.OnHide();
+            Reset();
             if (_sceneObject != null)
             {
                 GameObject.Destroy(_sceneObject);
@@ -466,8 +467,6 @@ namespace GFGGame
         private void Skip(object param = null)
         {
             EventAgent.RemoveEventListener(ConstMessage.CARD_SKILL, UpdateCircleResult);
-            Reset();
-            this.Hide();
             ViewManager.Show(ViewName.STORY_FIGHT_RESULT_VIEW);
         }
         private void Reset()

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

@@ -42,7 +42,7 @@ namespace GFGGame
                 _sceneObject = GameObject.Instantiate(_scenePrefab);
             }
             SceneController.UpdateRole(EquipDataCache.cacher.equipDatas, _sceneObject, true);
-            StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(StoryDataManager.currentLevelID);
+            StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(StoryDataManager.currentLevelCfgId);
             StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(levelCfg.fightID);
             SceneController.UpdateFightTarget(fightCfg.targetRes, _sceneObject);
             _ui.m_roleName.m_txtName.text = RoleDataManager.roleName;

+ 4 - 4
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryLevelInfoView.cs

@@ -10,7 +10,7 @@ namespace GFGGame
     {
         private UI_StoryLevelInfoUI _ui;
         private int _fightID;
-        private string _levelID;
+        private int _levelID;
         private int _storyType;
         private List<ItemData> _bonusList = new List<ItemData>();
         private int _fightTimes;
@@ -44,8 +44,8 @@ namespace GFGGame
         protected override void OnShown()
         {
             base.OnShown();
-            _levelID = (string)viewData;
-            _storyType = int.Parse(_levelID.Split('_')[0]) / 10000;
+            _levelID = (int)viewData;
+            _storyType = _levelID/GameConst.STORY_LEVEL_KEY_NUM / 10000;
             _ui.m_btnStart.touchable = true;
             UpdateView();
 
@@ -200,7 +200,7 @@ namespace GFGGame
                 }
                 _ui.m_txtHighestScore.text = scoreStr;
                 _ui.m_flower.target.visible = true;
-                int starCount = StoryDataManager.GetStarCountHistory(_levelID, score);
+                int starCount = StoryDataManager.GetStarCountHistory(_levelID);
                 StoryUtil.UpdateStar(starCount, _ui.m_flower.target);
             }
             else

+ 32 - 55
GameClient/Assets/Game/HotUpdate/Views/MainStory/StroyFightResultView.cs

@@ -7,16 +7,26 @@ using ET;
 
 namespace GFGGame
 {
+    public struct StoryFightResultData
+    {
+        public bool Result;
+        public int Score;
+        public int Star;
+        public bool FirstPass;
+        public List<ItemData> BonusList;
+    }
+
     public class StroyFightResultView : BaseView
     {
         private UI_StoryFightResultUI _ui;
         private GameObject _sceneObject;
         private GameObject _scenePrefab;
         private List<ItemData> _currentBonusList;
-        private bool _fistPassLastLvl;
-        private bool _curLvfirstPass = false;
 
-        private bool resule = false;
+        private bool result = false;
+        private bool _fistPassLastLvl = false;
+
+
         public override void Dispose()
         {
             if (_scenePrefab != null)
@@ -52,37 +62,37 @@ namespace GFGGame
         protected override void OnShown()
         {
             base.OnShown();
+            var resultData = (StoryFightResultData)this.viewData;
             // Timers.inst.AddUpdate(UpdateToCheckGuide);
 
             if (_sceneObject == null)
             {
                 _sceneObject = GameObject.Instantiate(_scenePrefab);
             }
-            StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(StoryDataManager.currentLevelID);
-            StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(levelCfg.fightID);
-            bool hasFightTarget = fightCfg.targetName != null && fightCfg.targetName.Length > 0;
+            _currentBonusList = resultData.BonusList;
+            //判断是否是首次打通最后一关
+            int nextLevelID = StoryDataManager.currentLevelCfgId + 1;
+            StoryLevelCfg nextLevelCfg = StoryLevelCfgArray.Instance.GetCfg(nextLevelID);
+            _fistPassLastLvl = (nextLevelCfg == null) && resultData.FirstPass;
 
-            int score = EquipDataCache.cacher.totalScore;
             SceneController.UpdateRole(EquipDataCache.cacher.equipDatas, _sceneObject);
-            _ui.m_selfScore.m_txtScore.text = "" + score;
+            _ui.m_selfScore.m_txtScore.text = "" + resultData.Score;
             _ui.m_expBar.m_txtLvl.text = "" + GameGlobal.myNumericComponent.GetAsInt(NumericType.Lvl);
             RoleLevelCfg roleLevelCfg = RoleLevelCfgArray.Instance.GetCfg(GameGlobal.myNumericComponent.GetAsInt(NumericType.Lvl));
             _ui.m_expBar.m_pbExp.max = roleLevelCfg.exp;
             _ui.m_expBar.m_pbExp.value = GameGlobal.myNumericComponent.GetAsInt(NumericType.Exp);
 
-            resule = GetFightResult();
-            int starCount = !resule ? 0 : StoryDataManager.GetResultStarCount(score);
-            StoryUtil.UpdateStar(starCount, _ui.m_selfScore.m_flower.target);
-            _ui.m_selfScore.m_bg.url = "ui://Main/zd_jsjm_jszi_" + starCount;
+            result = resultData.Result;
+            StoryUtil.UpdateStar(resultData.Star, _ui.m_selfScore.m_flower.target);
+            _ui.m_selfScore.m_bg.url = "ui://Main/zd_jsjm_jszi_" + resultData.Star;
             TextFormat tf = _ui.m_selfScore.m_txtScore.textFormat;
             UpdateToCheckGuide(null);
-            if (!resule)
+            if (!result)
             {
                 tf.font = "ui://Main/Font3";
                 _ui.m_expBar.m_txtLvlAdded.text = "0";
                 _ui.m_expBar.target.visible = false;
                 _ui.m_btnClose.enabled = true;
-                int targetY = (int)_ui.m_expBar.target.y - 250;
             }
             else
             {
@@ -90,44 +100,15 @@ namespace GFGGame
                 _ui.m_expBar.target.visible = true;
                 _ui.m_btnClose.enabled = false;
                 //过关
+                StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(StoryDataManager.currentLevelCfgId);
+                StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(levelCfg.fightID);
                 _ui.m_expBar.m_txtLvlAdded.text = "" + fightCfg.exp;
-                _currentBonusList = StoryDataManager.PassCurrentLevel(out _fistPassLastLvl, out _curLvfirstPass);
-                if (_curLvfirstPass)
-                {
-                    FunctionOpenDataManager.Instance.CheckHasChapterFunOpen(GameGlobal.myNumericComponent.GetAsInt(NumericType.Chapter) + 1, GameGlobal.myNumericComponent.GetAsInt(NumericType.ChapterLvl));//首次通过要检查是否有功能开启
-                }
+                Timers.inst.Add(0.5f, 1, AddExp);
             }
-            Timers.inst.Add(0.5f, 1, AddExp);
             _ui.m_selfScore.m_txtScore.textFormat = tf;
 
         }
 
-        private bool GetFightResult()
-        {
-            bool equipedNeeded = EquipDataCache.cacher.CheckEquipedFightNeeded();
-            if (!equipedNeeded)
-            {
-                PromptController.Instance.ShowFloatTextPrompt("未穿必需物品");
-                return false;//没穿必需品
-            }
-
-            int starCount = StoryDataManager.GetResultStarCount(EquipDataCache.cacher.totalScore);
-            StoryDataManager.SetScore(EquipDataCache.cacher.totalScore, starCount);
-            if (starCount <= 0)
-            {
-                return false;//低于一星
-            }
-
-            StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(StoryDataManager.currentLevelID);
-            StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(levelCfg.fightID);
-            bool hasFightTarget = fightCfg.targetName != null && fightCfg.targetName.Length > 0;
-            if (hasFightTarget && EquipDataCache.cacher.totalScore < EquipDataCache.cacher.npcTotalScore)
-            {
-                return false;//分数低于对战对象
-            }
-
-            return true;
-        }
         protected override void OnHide()
         {
             base.OnHide();
@@ -142,7 +123,6 @@ namespace GFGGame
 
         private void OnClickBtnClose()
         {
-            List<ItemData> bonusList = _currentBonusList;
             this.Hide();
             if (_fistPassLastLvl)
             {
@@ -152,10 +132,8 @@ namespace GFGGame
             {
                 ViewManager.Show(ViewName.STORY_CHAPTER_VIEW, StoryDataManager.currentChapter, ViewManager.GetGoBackDatas(ViewName.STORY_CHAPTER_VIEW));
             }
-            if (bonusList != null && bonusList.Count > 0)
-            {
-                ViewManager.Show(ViewName.GET_BONUS_VIEW, bonusList);
-            }
+            //尝试显示奖励
+            BonusController.TryShowBonusList(_currentBonusList);
             StoryDataManager.currentCardId = -1;
         }
 
@@ -169,15 +147,14 @@ namespace GFGGame
             }
             _ui.m_expBar.m_pbExp.TweenValue(exp, 0.2f);
             _ui.m_btnClose.enabled = true;
-            int targetY = (int)_ui.m_expBar.target.y - 250;
 
         }
         protected override void UpdateToCheckGuide(object param)
         {
             if (!ViewManager.CheckIsTopView(this.viewCom)) return;
-            if (!resule) GuideController.TryGuide(null, ConstGuideId.FIRST_FIGHT_FAILED, 1, "不要气馁呀,可以通过再次挑战已通关的关卡、摘星、绣坊等途径获取更多的物资来提升自己的战斗力哦!", false, 0, true, false, (int)(this.viewCom.height - 150));
-            if (resule) GuideController.TryGuide(null, ConstGuideId.FIRST_FIGHT_SINGLE_WIN, 1, "这条连衣裙可真好看!点击空白区域继续", false, 0, true, false, (int)(this.viewCom.height - 150));
-            if (resule) GuideController.TryGuide(null, ConstGuideId.FIRST_FIGHT_TARGET_WIN, 1, "你太厉害了,初次对战就获得了这么好的战绩,继续加油吧", false, 0, true, false, (int)(this.viewCom.height - 350));
+            if (!result) GuideController.TryGuide(null, ConstGuideId.FIRST_FIGHT_FAILED, 1, "不要气馁呀,可以通过再次挑战已通关的关卡、摘星、绣坊等途径获取更多的物资来提升自己的战斗力哦!", false, 0, true, false, (int)(this.viewCom.height - 150));
+            if (result) GuideController.TryGuide(null, ConstGuideId.FIRST_FIGHT_SINGLE_WIN, 1, "这条连衣裙可真好看!点击空白区域继续", false, 0, true, false, (int)(this.viewCom.height - 150));
+            if (result) GuideController.TryGuide(null, ConstGuideId.FIRST_FIGHT_TARGET_WIN, 1, "你太厉害了,初次对战就获得了这么好的战绩,继续加油吧", false, 0, true, false, (int)(this.viewCom.height - 350));
         }
 
         protected override void TryCompleteGuide()

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