Browse Source

推荐搭配

zhaoyang 3 years ago
parent
commit
8e0cb3d238

+ 24 - 1
GameClient/Assets/Game/HotUpdate/Data/DressUpMenuItemDataManager.cs

@@ -188,6 +188,7 @@ namespace GFGGame
         {
             List<int> recommendTypeList = new List<int>();
             List<int> recommendList = new List<int>();
+            List<int> recommendSpecialList = new List<int>();
             List<int> tempAllList = _itemDatas.GetRange(0, _itemDatas.Count);
             if (toSort)
             {
@@ -200,11 +201,33 @@ namespace GFGGame
                 {
                     if (!recommendTypeList.Contains(subType))
                     {
-                        recommendList.Add(itemID);
+                        if (subType < ConstDressUpItemType.TE_SHU)
+                        {
+                            recommendList.Add(itemID);
+                        }
                         recommendTypeList.Add(subType);
                     }
                 }
             }
+            recommendSpecialList = DressUpMenuItemDataManager.getItemDatasByType(ConstDressUpItemType.TE_SHU);
+            recommendSpecialList = DressUpMenuItemDataManager.SortItemListByHighScore(recommendSpecialList);
+
+            List<int> specialSubList = new List<int>();
+            List<int> specialIdList = new List<int>();
+            foreach (int itemID in recommendSpecialList)
+            {
+                int subType = ItemUtilCS.GetItemSubType(itemID);
+                if (subType > ConstDressUpItemType.TE_SHU)
+                {
+                    if (specialSubList.Count >= 3) continue;
+                    if (specialSubList.IndexOf(subType) < 0)
+                    {
+                        specialSubList.Add(subType);
+                        specialIdList.Add(itemID);
+                    }
+                }
+            }
+            recommendList.AddRange(specialIdList);
             return recommendList;
         }
 

+ 45 - 1
GameClient/Assets/Game/HotUpdate/DressUp/DressUpObjDataCache.cs

@@ -578,10 +578,54 @@ namespace GFGGame
             List<int> recommendList = DressUpMenuItemDataManager.GetRecommendItemList();
             StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(InstanceZonesDataManager.currentLevelCfgId);
             StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(levelCfg.fightID);
+            int liangyiqunIndex = -1;
+            int shangyiIndex = -1;
+            int xiazhuangIndex = -1;
+            for (int i = 0; i < recommendList.Count; i++)
+            {
+                int subType = ItemUtilCS.GetItemSubType(recommendList[i]);
+                if (subType == ConstDressUpItemType.LIAN_YI_QUN)
+                {
+                    liangyiqunIndex = i;
+                    continue;
+                }
+                if (subType == ConstDressUpItemType.SHANG_YI)
+                {
+                    shangyiIndex = i;
+                    continue;
+
+                }
+                if (subType == ConstDressUpItemType.XIA_ZHUANG)
+                {
+                    xiazhuangIndex = i;
+                    continue;
+
+                }
+            }
+
+            if (liangyiqunIndex >= 0 && (shangyiIndex >= 0 || xiazhuangIndex >= 0))
+            {
+                if (shangyiIndex < 0) recommendList.RemoveAt(xiazhuangIndex);//上衣下装只有一件,则保留连衣裙
+                if (xiazhuangIndex < 0) recommendList.RemoveAt(xiazhuangIndex);
+                if (shangyiIndex >= 0 && xiazhuangIndex >= 0)
+                {
+                    int lianyiqunScore = DressUpMenuItemDataManager.GetItemScore(recommendList[liangyiqunIndex]);
+                    int shangyiScore = DressUpMenuItemDataManager.GetItemScore(recommendList[shangyiIndex]);
+                    int xiazhuangScore = DressUpMenuItemDataManager.GetItemScore(recommendList[xiazhuangIndex]);
+                    if (lianyiqunScore > shangyiScore + xiazhuangScore)
+                    {
+                        recommendList.RemoveAt(xiazhuangIndex);
+                        recommendList.RemoveAt(xiazhuangIndex);
+                    }
+                    else
+                    {
+                        recommendList.RemoveAt(liangyiqunIndex);
+                    }
+                }
+            }
             //推荐搭配自动穿必穿品
             if (fightCfg.needItemId > 0 && DressUpMenuItemDataManager.CheckHasItem(fightCfg.needItemId) && recommendList.IndexOf(fightCfg.needItemId) < 0)
             {
-
                 recommendList.Add(fightCfg.needItemId);
             }
             else if (fightCfg.needSuitId > 0 && DressUpMenuSuitDataManager.CheckHaveSuit(fightCfg.needSuitId))

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

@@ -406,8 +406,16 @@ namespace GFGGame
 
         private void OnClickBtnRecommend()
         {
+            if (this.currentListType == DressUpListType.List4)
+            {
+                this.hideListParts2();
+                this.showListParts(ConstDressUpItemType.TAO_ZHUANG, true);
+            }
+            EquipDataCache.cacher.TryCancelSuit(_currentSuitId);
             InstanceZonesDataManager.usedRecommend = true;
             EquipDataCache.cacher.PutOnRecommendItems();
+            UpdateListPartsSelected();
+            UpdateListSuitPartsSelected();
         }
 
         private void InitLists()

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

@@ -75,6 +75,7 @@ namespace GFGGame
             _ui.m_proScore.target.max = fightCfg.score3;
             _ui.m_proScore.m_comBar.target.width = 0;
             _ui.m_proScore.m_imgFirstScore.x = (((float)fightCfg.score1 / (float)fightCfg.score3)) * _ui.m_proScore.target.width;
+            _ui.m_proScore.m_txtCount.text = "总分:0";
 
             _stopFight = false;
             _index = 0;