|
@@ -9,7 +9,7 @@ namespace GFGGame
|
|
{
|
|
{
|
|
get
|
|
get
|
|
{
|
|
{
|
|
- if(_dressUpObj == null)
|
|
|
|
|
|
+ if (_dressUpObj == null)
|
|
{
|
|
{
|
|
_dressUpObj = new DressUpObj();
|
|
_dressUpObj = new DressUpObj();
|
|
}
|
|
}
|
|
@@ -77,6 +77,17 @@ namespace GFGGame
|
|
dressUpObj.PutOnDressUpData(suitSavedData.dressUpData);
|
|
dressUpObj.PutOnDressUpData(suitSavedData.dressUpData);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //返回当前饰品穿戴数量
|
|
|
|
+ public static int GetCurrentOrnamentCount()
|
|
|
|
+ {
|
|
|
|
+ int count = 0;
|
|
|
|
+ for (int i = 0; i < dressUpObj.itemList.Count; i++)
|
|
|
|
+ {
|
|
|
|
+ if (DressUpMenuItemCfg1Array.Instance.CheckIsOrnamentsType(dressUpObj.itemList[i])) count++;
|
|
|
|
+ }
|
|
|
|
+ return count;
|
|
|
|
+ }
|
|
|
|
+
|
|
public static void PutOnRecommendItems()
|
|
public static void PutOnRecommendItems()
|
|
{
|
|
{
|
|
List<int> recommendList = DressUpMenuItemDataManager.GetRecommendItemList();
|
|
List<int> recommendList = DressUpMenuItemDataManager.GetRecommendItemList();
|
|
@@ -184,6 +195,75 @@ namespace GFGGame
|
|
dressUpObj.PutOnItemList(recommendList);
|
|
dressUpObj.PutOnItemList(recommendList);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public static void PutOnRecommendItems2()
|
|
|
|
+ {
|
|
|
|
+ GetRecommendItems(out Dictionary<int, List<int>> needListBySubType, out Dictionary<int, List<int>> recommendListBySubType);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //获取每个类型里分数最高的服装部件Dictionary
|
|
|
|
+ private static void GetRecommendItems(out Dictionary<int, List<int>> needListBySubType, out Dictionary<int, List<int>> recommendListBySubType)
|
|
|
|
+ {
|
|
|
|
+ StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(InstanceZonesDataManager.currentLevelCfgId);
|
|
|
|
+ StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(levelCfg.fightID);
|
|
|
|
+
|
|
|
|
+ needListBySubType = new Dictionary<int, List<int>>();
|
|
|
|
+ recommendListBySubType = new Dictionary<int, List<int>>();
|
|
|
|
+
|
|
|
|
+ Dictionary<int, List<int>> itemDatasDic = DressUpMenuItemDataManager.ItemDatasBySubTypeDic;
|
|
|
|
+
|
|
|
|
+ foreach (int subType in itemDatasDic.Keys)
|
|
|
|
+ {
|
|
|
|
+ if (DressUpMenuItemCfg1Array.Instance.CheckIsSceneTypeBySubType(subType)) continue;
|
|
|
|
+ if (!needListBySubType.ContainsKey(subType))
|
|
|
|
+ {
|
|
|
|
+ needListBySubType.Add(subType, new List<int>());
|
|
|
|
+ }
|
|
|
|
+ List<int> itemDatas = new List<int>(itemDatasDic[subType]);
|
|
|
|
+ DressUpMenuItemDataManager.SortItemListByHighScore(itemDatas);
|
|
|
|
+
|
|
|
|
+ if (fightCfg.needSuitId > 0)
|
|
|
|
+ {
|
|
|
|
+ int[] suitParts = SuitCfgArray.Instance.GetCfg(fightCfg.needSuitId).partsArr;
|
|
|
|
+ for (int i = 0; i < suitParts.Length; i++)
|
|
|
|
+ {
|
|
|
|
+ if (itemDatas.IndexOf(suitParts[i]) >= 0)//当前类型里是否包含此部件,
|
|
|
|
+ {
|
|
|
|
+ needListBySubType[subType].Add(suitParts[i]);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (fightCfg.needItemId > 0)
|
|
|
|
+ {
|
|
|
|
+ if (itemDatas.IndexOf(fightCfg.needItemId) >= 0 && needListBySubType[subType].IndexOf(fightCfg.needItemId) < 0)
|
|
|
|
+ {
|
|
|
|
+ needListBySubType[subType].Add(fightCfg.needItemId);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ DressUpMenuItemDataManager.SortItemListByHighScore(needListBySubType[subType]);
|
|
|
|
+ int maxCount = subType == (int)ConstDressUpItemType.TE_SHU ? 3 : 1;//特殊部件最多穿3个,其他部件只能穿一个;
|
|
|
|
+ needListBySubType[subType] = needListBySubType[subType].GetRange(0, maxCount);//多余3个取前三
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ int index = 0;
|
|
|
|
+ while (recommendListBySubType[subType].Count < maxCount && itemDatasDic[subType].Count > index)//不足3个从列表里补足
|
|
|
|
+ {
|
|
|
|
+ int partId = itemDatasDic[subType][index];
|
|
|
|
+ if (needListBySubType[subType].IndexOf(partId) < 0)//必需品列表里还没有此部件才会被添加进去
|
|
|
|
+ {
|
|
|
|
+ if (!recommendListBySubType.ContainsKey(subType))
|
|
|
|
+ {
|
|
|
|
+ recommendListBySubType.Add(subType, new List<int>());
|
|
|
|
+ }
|
|
|
|
+ recommendListBySubType[subType].Add(partId);
|
|
|
|
+ }
|
|
|
|
+ index++;
|
|
|
|
+ }
|
|
|
|
+ DressUpMenuItemDataManager.SortItemListByHighScore(recommendListBySubType[subType]);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
private static int CheckIndex(int _subType, List<int> recommendList)
|
|
private static int CheckIndex(int _subType, List<int> recommendList)
|
|
{
|
|
{
|
|
for (int i = 0; i < recommendList.Count; i++)
|
|
for (int i = 0; i < recommendList.Count; i++)
|