|
@@ -20,6 +20,7 @@ namespace GFGGame
|
|
return _equipData.bgId;
|
|
return _equipData.bgId;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
public int suitId
|
|
public int suitId
|
|
{
|
|
{
|
|
get
|
|
get
|
|
@@ -51,6 +52,7 @@ namespace GFGGame
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
public List<int> equipDatas
|
|
public List<int> equipDatas
|
|
{
|
|
{
|
|
get
|
|
get
|
|
@@ -111,6 +113,7 @@ namespace GFGGame
|
|
FightDataManager.Instance.score -= ItemDataManager.GetItemAdditionScore(value, InstanceZonesDataManager.currentScoreType, InstanceZonesDataManager.currentFightTags);
|
|
FightDataManager.Instance.score -= ItemDataManager.GetItemAdditionScore(value, InstanceZonesDataManager.currentScoreType, InstanceZonesDataManager.currentFightTags);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
//检测当前穿戴是否是一件完整套装,且只穿了一件套装,返回套装id
|
|
//检测当前穿戴是否是一件完整套装,且只穿了一件套装,返回套装id
|
|
public int CheckCurDressIsSuit()
|
|
public int CheckCurDressIsSuit()
|
|
{
|
|
{
|
|
@@ -143,6 +146,7 @@ namespace GFGGame
|
|
|
|
|
|
return dressSuitId;
|
|
return dressSuitId;
|
|
}
|
|
}
|
|
|
|
+
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 仅判断换装部件是否已穿着
|
|
/// 仅判断换装部件是否已穿着
|
|
/// </summary>
|
|
/// </summary>
|
|
@@ -333,7 +337,13 @@ namespace GFGGame
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- private void UpdateBody()
|
|
|
|
|
|
+
|
|
|
|
+ private void InitRoleView()
|
|
|
|
+ {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void UpdateBodyView()
|
|
{
|
|
{
|
|
if (IsAction)
|
|
if (IsAction)
|
|
{
|
|
{
|
|
@@ -361,7 +371,7 @@ namespace GFGGame
|
|
if (checkDefault)
|
|
if (checkDefault)
|
|
{
|
|
{
|
|
checkDefaultItem();
|
|
checkDefaultItem();
|
|
- UpdateBody();
|
|
|
|
|
|
+ UpdateBodyView();
|
|
}
|
|
}
|
|
RoleLevelCfg roleLevelCfg = RoleLevelCfgArray.Instance.GetCfg(GameGlobal.myNumericComponent.GetAsInt(NumericType.Lvl));
|
|
RoleLevelCfg roleLevelCfg = RoleLevelCfgArray.Instance.GetCfg(GameGlobal.myNumericComponent.GetAsInt(NumericType.Lvl));
|
|
FightDataManager.Instance.score = roleLevelCfg.baseScore;
|
|
FightDataManager.Instance.score = roleLevelCfg.baseScore;
|
|
@@ -382,11 +392,12 @@ namespace GFGGame
|
|
if (IsAction)
|
|
if (IsAction)
|
|
{
|
|
{
|
|
var tempList = equipDatas;
|
|
var tempList = equipDatas;
|
|
- foreach (int itemID in tempList)
|
|
|
|
|
|
+ foreach (int itemId in tempList)
|
|
{
|
|
{
|
|
- if (!DressUpMenuItemDataManager.CheckIsSceneType(itemID))
|
|
|
|
|
|
+ bool replaceableByAction = DressUpMenuSuitDataManager.CheckItemReaplaceableByAction(itemId, suitId);
|
|
|
|
+ if (!DressUpMenuItemDataManager.CheckIsSceneType(itemId) && !replaceableByAction)
|
|
{
|
|
{
|
|
- AddOrRemove(itemID, false, false, true);
|
|
|
|
|
|
+ AddOrRemove(itemId, false, false, true);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -396,14 +407,15 @@ namespace GFGGame
|
|
int[] items = suitCfg.partsArr;
|
|
int[] items = suitCfg.partsArr;
|
|
foreach (int itemId in items)
|
|
foreach (int itemId in items)
|
|
{
|
|
{
|
|
- if (!DressUpMenuItemDataManager.CheckIsSceneType(itemId))
|
|
|
|
|
|
+ bool replaceableByAction = DressUpMenuSuitDataManager.CheckItemReaplaceableByAction(itemId, suitId);
|
|
|
|
+ if (!DressUpMenuItemDataManager.CheckIsSceneType(itemId) || replaceableByAction)
|
|
{
|
|
{
|
|
AddOrRemove(itemId, false, true);
|
|
AddOrRemove(itemId, false, true);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
checkDefaultItem();
|
|
checkDefaultItem();
|
|
- UpdateBody();
|
|
|
|
|
|
+ UpdateBodyView();
|
|
}
|
|
}
|
|
|
|
|
|
public void TryCancelSuit(int itemID)
|
|
public void TryCancelSuit(int itemID)
|
|
@@ -421,7 +433,7 @@ namespace GFGGame
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- public void UpdateRole()
|
|
|
|
|
|
+ public void UpdateRoleView()
|
|
{
|
|
{
|
|
PutOnEquipData(GetEquiptDataClone());
|
|
PutOnEquipData(GetEquiptDataClone());
|
|
}
|
|
}
|
|
@@ -455,26 +467,27 @@ namespace GFGGame
|
|
}
|
|
}
|
|
}
|
|
}
|
|
int subType = 0;
|
|
int subType = 0;
|
|
- foreach (int itemID in items)
|
|
|
|
|
|
+ foreach (int itemId in items)
|
|
{
|
|
{
|
|
- if (!CheckOwn || DressUpMenuItemDataManager.CheckHasItem(itemID))
|
|
|
|
|
|
+ if (!CheckOwn || DressUpMenuItemDataManager.CheckHasItem(itemId))
|
|
{
|
|
{
|
|
- bool isSceneType = DressUpMenuItemDataManager.CheckIsSceneType(itemID);
|
|
|
|
- subType = ItemUtilCS.GetItemSubType(itemID);
|
|
|
|
- if (!_equipData.isAction || isSceneType)
|
|
|
|
|
|
+ bool isSceneType = DressUpMenuItemDataManager.CheckIsSceneType(itemId);
|
|
|
|
+ subType = ItemUtilCS.GetItemSubType(itemId);
|
|
|
|
+ bool replaceableByAction = DressUpMenuSuitDataManager.CheckItemReaplaceableByAction(itemId, suitId);
|
|
|
|
+ if (!_equipData.isAction || isSceneType || replaceableByAction)
|
|
{
|
|
{
|
|
if (!noSceneType || !isSceneType)
|
|
if (!noSceneType || !isSceneType)
|
|
{
|
|
{
|
|
if (excludeType == null || Array.IndexOf(excludeType, subType) < 0)
|
|
if (excludeType == null || Array.IndexOf(excludeType, subType) < 0)
|
|
{
|
|
{
|
|
- AddOrRemove(itemID, false, true);
|
|
|
|
|
|
+ AddOrRemove(itemId, false, true);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
checkDefaultItem();
|
|
checkDefaultItem();
|
|
- UpdateBody();
|
|
|
|
|
|
+ UpdateBodyView();
|
|
}
|
|
}
|
|
|
|
|
|
public void PutOnSuitSavedByPos(int index, bool showBg = true)
|
|
public void PutOnSuitSavedByPos(int index, bool showBg = true)
|
|
@@ -498,192 +511,38 @@ namespace GFGGame
|
|
_equipData.suitId = equipData.suitId;
|
|
_equipData.suitId = equipData.suitId;
|
|
_equipData.isAction = equipData.isAction;
|
|
_equipData.isAction = equipData.isAction;
|
|
checkDefaultItem();
|
|
checkDefaultItem();
|
|
- UpdateBody();
|
|
|
|
|
|
+ UpdateBodyView();
|
|
|
|
|
|
}
|
|
}
|
|
- public void PutOnSuitSavedInFight(int index)
|
|
|
|
- {
|
|
|
|
- TakeOffAll(false);
|
|
|
|
- CustomSuitData suitSavedData = CustomSuitDataManager.GetSuitList(index);
|
|
|
|
- if (suitSavedData.EquipData.suitId > 0)
|
|
|
|
- {
|
|
|
|
- PutOnSuitCfg(suitSavedData.EquipData.suitId, false, true);
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- foreach (int itemID in suitSavedData.EquipData.equipDatas)
|
|
|
|
- {
|
|
|
|
- if (!DressUpMenuItemDataManager.CheckIsSceneType(itemID))
|
|
|
|
- {
|
|
|
|
- AddOrRemove(itemID, false, true);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- checkDefaultItem();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // public void PutOnCurrentSuitSaved()
|
|
|
|
- // {
|
|
|
|
- // PutOnSuitSaved(CustomSuitDataManager.currentIndex);
|
|
|
|
- // }
|
|
|
|
|
|
|
|
- public void PutOnDefaultSuitSaved(bool withBg = true)
|
|
|
|
|
|
+ public void PutOnDefaultSuitSaved(bool showBg = true)
|
|
{
|
|
{
|
|
TakeOffAll(false);
|
|
TakeOffAll(false);
|
|
- CustomSuitData suitSavedData = CustomSuitDataManager.CreateDefaultSuitData(0);
|
|
|
|
- foreach (int itemID in suitSavedData.EquipData.equipDatas)
|
|
|
|
|
|
+ var equipData = EquipData.CreateDefault();
|
|
|
|
+ foreach (int itemID in equipData.equipDatas)
|
|
{
|
|
{
|
|
AddOrRemove(itemID, false, true);
|
|
AddOrRemove(itemID, false, true);
|
|
}
|
|
}
|
|
- if (withBg)
|
|
|
|
|
|
+ if (showBg)
|
|
{
|
|
{
|
|
- if (suitSavedData.EquipData.bgId > 0)
|
|
|
|
|
|
+ if (equipData.bgId > 0)
|
|
{
|
|
{
|
|
- AddOrRemove(suitSavedData.EquipData.bgId, false);
|
|
|
|
|
|
+ AddOrRemove(equipData.bgId, false);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
checkDefaultItem();
|
|
checkDefaultItem();
|
|
- UpdateBody();
|
|
|
|
|
|
+ UpdateBodyView();
|
|
}
|
|
}
|
|
|
|
|
|
- public void PutOnRecommendItems()
|
|
|
|
|
|
+ public void PutOnItemList(List<int> itemList)
|
|
{
|
|
{
|
|
TakeOffAll(false);
|
|
TakeOffAll(false);
|
|
- 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;
|
|
|
|
- int neidaIndex = -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 (subType == ConstDressUpItemType.NEI_DA)
|
|
|
|
- {
|
|
|
|
- neidaIndex = i;
|
|
|
|
- continue;
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- 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 = ItemDataManager.GetItemAdditionScore(recommendList[liangyiqunIndex], InstanceZonesDataManager.currentScoreType);
|
|
|
|
- int shangyiScore = ItemDataManager.GetItemAdditionScore(recommendList[shangyiIndex], InstanceZonesDataManager.currentScoreType);
|
|
|
|
- int xiazhuangScore = ItemDataManager.GetItemAdditionScore(recommendList[xiazhuangIndex], InstanceZonesDataManager.currentScoreType);
|
|
|
|
- int neidaScore = neidaIndex >= 0 ? ItemDataManager.GetItemAdditionScore(recommendList[neidaIndex], InstanceZonesDataManager.currentScoreType) : 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)
|
|
|
|
- {
|
|
|
|
- shangyiIndex = CheckIndex(ConstDressUpItemType.SHANG_YI, recommendList);
|
|
|
|
- if (shangyiIndex >= 0) recommendList.RemoveAt(shangyiIndex);
|
|
|
|
- xiazhuangIndex = CheckIndex(ConstDressUpItemType.XIA_ZHUANG, recommendList);
|
|
|
|
- if (xiazhuangIndex >= 0) recommendList.RemoveAt(xiazhuangIndex);
|
|
|
|
- neidaIndex = CheckIndex(ConstDressUpItemType.NEI_DA, recommendList);
|
|
|
|
- if (neidaIndex >= 0) recommendList.RemoveAt(neidaIndex);
|
|
|
|
- }
|
|
|
|
- else if (subType == ConstDressUpItemType.SHANG_YI || subType == ConstDressUpItemType.XIA_ZHUANG || subType == ConstDressUpItemType.NEI_DA)
|
|
|
|
- {
|
|
|
|
- liangyiqunIndex = CheckIndex(ConstDressUpItemType.LIAN_YI_QUN, recommendList);
|
|
|
|
- if (liangyiqunIndex >= 0) recommendList.RemoveAt(liangyiqunIndex);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- if (lianyiqunScore > shangyiScore + xiazhuangScore + neidaScore)
|
|
|
|
- {
|
|
|
|
- shangyiIndex = CheckIndex(ConstDressUpItemType.SHANG_YI, recommendList);
|
|
|
|
- if (shangyiIndex >= 0) recommendList.RemoveAt(shangyiIndex);
|
|
|
|
- xiazhuangIndex = CheckIndex(ConstDressUpItemType.XIA_ZHUANG, recommendList);
|
|
|
|
- if (xiazhuangIndex >= 0) recommendList.RemoveAt(xiazhuangIndex);
|
|
|
|
- neidaIndex = CheckIndex(ConstDressUpItemType.NEI_DA, recommendList);
|
|
|
|
- if (neidaIndex >= 0) recommendList.RemoveAt(neidaIndex);
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- liangyiqunIndex = CheckIndex(ConstDressUpItemType.LIAN_YI_QUN, recommendList);
|
|
|
|
- if (liangyiqunIndex >= 0) recommendList.RemoveAt(liangyiqunIndex);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- //推荐搭配自动穿必穿品
|
|
|
|
- if (fightCfg.needItemId > 0 && DressUpMenuItemDataManager.CheckHasItem(fightCfg.needItemId) && recommendList.IndexOf(fightCfg.needItemId) < 0)
|
|
|
|
- {
|
|
|
|
- int subType = ItemUtilCS.GetItemSubType(fightCfg.needItemId);
|
|
|
|
- for (int i = 0; i < recommendList.Count; i++)
|
|
|
|
- {
|
|
|
|
- int recommendSubType = ItemUtilCS.GetItemSubType(recommendList[i]);
|
|
|
|
- if (recommendSubType == subType)
|
|
|
|
- {
|
|
|
|
- recommendList.RemoveAt(i);
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- recommendList.Add(fightCfg.needItemId);
|
|
|
|
- }
|
|
|
|
- else if (fightCfg.needSuitId > 0 && DressUpMenuSuitDataManager.CheckHaveSuit(fightCfg.needSuitId))
|
|
|
|
- {
|
|
|
|
- recommendList.Clear();
|
|
|
|
- SuitCfg cfg = SuitCfgArray.Instance.GetCfg(fightCfg.needSuitId);
|
|
|
|
- recommendList.AddRange(cfg.partsArr);
|
|
|
|
- }
|
|
|
|
- foreach (int itemID in recommendList)
|
|
|
|
|
|
+ foreach (int itemID in itemList)
|
|
{
|
|
{
|
|
AddOrRemove(itemID, false, true);
|
|
AddOrRemove(itemID, false, true);
|
|
}
|
|
}
|
|
checkDefaultItem();
|
|
checkDefaultItem();
|
|
- UpdateBody();
|
|
|
|
- }
|
|
|
|
- private int CheckIndex(int _subType, List<int> recommendList)
|
|
|
|
- {
|
|
|
|
- for (int i = 0; i < recommendList.Count; i++)
|
|
|
|
- {
|
|
|
|
- int itemSubType = ItemUtilCS.GetItemSubType(recommendList[i]);
|
|
|
|
- if (itemSubType == _subType)
|
|
|
|
- {
|
|
|
|
- return i;
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- return -1;
|
|
|
|
- }
|
|
|
|
- public bool CheckEquipedFightNeeded()
|
|
|
|
- {
|
|
|
|
- StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(InstanceZonesDataManager.currentLevelCfgId);
|
|
|
|
- StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(levelCfg.fightID);
|
|
|
|
- if (fightCfg.needItemId > 0)
|
|
|
|
- {
|
|
|
|
- return CheckDressUpItemIsOn(fightCfg.needItemId);
|
|
|
|
- }
|
|
|
|
- else if (fightCfg.needSuitId > 0)
|
|
|
|
- {
|
|
|
|
- return CheckSuitIsOn(fightCfg.needSuitId);
|
|
|
|
- }
|
|
|
|
- return true;
|
|
|
|
|
|
+ UpdateBodyView();
|
|
}
|
|
}
|
|
|
|
|
|
public int GetItemIdBuyType(int subType)
|
|
public int GetItemIdBuyType(int subType)
|