Browse Source

推荐搭配有必需品时,优先按必需品推荐

zhaoyang 3 năm trước cách đây
mục cha
commit
56b2ae0c92
1 tập tin đã thay đổi với 41 bổ sung21 xóa
  1. 41 21
      GameClient/Assets/Game/HotUpdate/DressUp/DressUpObjDataCache.cs

+ 41 - 21
GameClient/Assets/Game/HotUpdate/DressUp/DressUpObjDataCache.cs

@@ -617,27 +617,6 @@ namespace GFGGame
                 }
             }
 
-            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]);
-                    int neidaScore = neidaIndex >= 0 ? DressUpMenuItemDataManager.GetItemScore(recommendList[neidaIndex]) : 0;
-                    if (lianyiqunScore > shangyiScore + xiazhuangScore + neidaScore)
-                    {
-                        recommendList.RemoveAt(xiazhuangIndex);
-                        recommendList.RemoveAt(xiazhuangIndex);
-                    }
-                    else
-                    {
-                        recommendList.RemoveAt(liangyiqunIndex);
-                    }
-                }
-            }
             //推荐搭配自动穿必穿品
             if (fightCfg.needItemId > 0 && DressUpMenuItemDataManager.CheckHasItem(fightCfg.needItemId) && recommendList.IndexOf(fightCfg.needItemId) < 0)
             {
@@ -659,6 +638,47 @@ namespace GFGGame
                 SuitCfg cfg = SuitCfgArray.Instance.GetCfg(fightCfg.needSuitId);
                 recommendList.AddRange(cfg.partsArr);
             }
+
+            if (liangyiqunIndex >= 0 && (shangyiIndex >= 0 || xiazhuangIndex >= 0))
+            {
+                if (shangyiIndex < 0 && xiazhuangIndex >= 0) recommendList.RemoveAt(xiazhuangIndex);//上衣下装只有一件,则保留连衣裙
+                if (xiazhuangIndex < 0 && shangyiIndex >= 0) recommendList.RemoveAt(shangyiIndex);
+
+                if (shangyiIndex >= 0 && xiazhuangIndex >= 0)//同时拥有上衣、下装、连衣裙
+                {
+                    int lianyiqunScore = DressUpMenuItemDataManager.GetItemScore(recommendList[liangyiqunIndex]);
+                    int shangyiScore = DressUpMenuItemDataManager.GetItemScore(recommendList[shangyiIndex]);
+                    int xiazhuangScore = DressUpMenuItemDataManager.GetItemScore(recommendList[xiazhuangIndex]);
+                    int neidaScore = neidaIndex >= 0 ? DressUpMenuItemDataManager.GetItemScore(recommendList[neidaIndex]) : 0;
+                    int subType = ItemUtilCS.GetItemSubType(fightCfg.needItemId);
+                    if (fightCfg.needItemId > 0 && recommendList.IndexOf(fightCfg.needItemId) >= 0 && (subType == ConstDressUpItemType.SHANG_YI || subType == ConstDressUpItemType.XIA_ZHUANG || subType == ConstDressUpItemType.NEI_DA || subType == ConstDressUpItemType.LIAN_YI_QUN))//推荐列表里有必需品且,必需品类型为上衣或下装或连衣裙,有先穿戴必须品,其次穿戴高分服装
+                    {
+                        if (subType == ConstDressUpItemType.LIAN_YI_QUN)
+                        {
+                            if (shangyiIndex >= 0) recommendList.RemoveAt(shangyiIndex);
+                            if (xiazhuangIndex >= 0) recommendList.RemoveAt(xiazhuangIndex);
+                            if (neidaIndex >= 0) recommendList.RemoveAt(neidaIndex);
+                        }
+                        else if (subType == ConstDressUpItemType.SHANG_YI || subType == ConstDressUpItemType.XIA_ZHUANG || subType == ConstDressUpItemType.NEI_DA)
+                        {
+                            if (liangyiqunIndex >= 0) recommendList.RemoveAt(liangyiqunIndex);
+                        }
+                    }
+                    else
+                    {
+                        if (lianyiqunScore > shangyiScore + xiazhuangScore + neidaScore)
+                        {
+                            if (shangyiIndex >= 0) recommendList.RemoveAt(shangyiIndex);
+                            if (xiazhuangIndex >= 0) recommendList.RemoveAt(xiazhuangIndex);
+                            if (neidaIndex >= 0) recommendList.RemoveAt(neidaIndex);
+                        }
+                        else
+                        {
+                            if (liangyiqunIndex >= 0) recommendList.RemoveAt(liangyiqunIndex);
+                        }
+                    }
+                }
+            }
             foreach (int itemID in recommendList)
             {
                 AddOrRemove(itemID, false, true);