|
@@ -85,13 +85,30 @@ namespace GameLogic.Equipment
|
|
|
/// <param name="zy"></param>
|
|
|
public void EquipZyEqs(int zy)
|
|
|
{
|
|
|
- if (zyEqDic.TryGetValue(zy, out equipZyEqDic))
|
|
|
+ if (zyEqDic.TryGetValue(zy, out var bwDic))
|
|
|
{
|
|
|
- // List<ItemInfo> eqList = zyEqDic[zy];
|
|
|
- // foreach (ItemInfo eqItemInfo in eqList)
|
|
|
- // {
|
|
|
- //
|
|
|
- // }
|
|
|
+ foreach (KeyValuePair<int, List<ItemInfo>> keyValuePair in bwDic)
|
|
|
+ {
|
|
|
+ ItemInfo bestBwEq = null;
|
|
|
+ foreach (ItemInfo bwItem in keyValuePair.Value)
|
|
|
+ {
|
|
|
+ bwItem.eqInfo.isEquip = false;
|
|
|
+ if (bestBwEq == null)
|
|
|
+ {
|
|
|
+ bestBwEq = bwItem;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (bwItem.eqInfo.Attack > bestBwEq.eqInfo.Attack ||
|
|
|
+ bwItem.eqInfo.Defense > bestBwEq.eqInfo.Defense ||
|
|
|
+ bwItem.eqInfo.Hp > bestBwEq.eqInfo.Hp)
|
|
|
+ {
|
|
|
+ bestBwEq = bwItem;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (bestBwEq != null)
|
|
|
+ bestBwEq.eqInfo.isEquip = true;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -106,17 +123,29 @@ namespace GameLogic.Equipment
|
|
|
int bw = eqItemInfo.eqInfo.basicEquipConfig.Type;
|
|
|
if (zyEqDic.TryGetValue(pro, out var bwDic))
|
|
|
{
|
|
|
-
|
|
|
- if (bwDic.ContainsKey(bw))
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if (bwDic.TryGetValue(bw, out var eqBwList))
|
|
|
{
|
|
|
- bwDic[bw].Add(eqItemInfo);
|
|
|
+ eqBwList.Add(eqItemInfo);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- List<ItemInfo> eqBwList = new List<ItemInfo>();
|
|
|
+ eqBwList = new List<ItemInfo>();
|
|
|
eqBwList.Add(eqItemInfo);
|
|
|
bwDic.Add(bw, eqBwList);
|
|
|
}
|
|
|
+ // if (bwDic.ContainsKey(bw))
|
|
|
+ // {
|
|
|
+ // bwDic[bw].Add(eqItemInfo);
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // List<ItemInfo> eqBwList = new List<ItemInfo>();
|
|
|
+ // eqBwList.Add(eqItemInfo);
|
|
|
+ // bwDic.Add(bw, eqBwList);
|
|
|
+ // }
|
|
|
}
|
|
|
else
|
|
|
{
|