少年修仙传客户端代码仓库
client_linchunjie
2019-01-04 e71baafc19d2819a14bb930cf17c12cab7157e38
System/GatheringSoul/GatheringSoulModel.cs
@@ -604,11 +604,22 @@
        public bool SatisfyReplace(int hole, GatherSoulItem item)
        {
            if (item.itemType == GATHERSOUL_ESSENCE_TYPE)
            {
                return false;
            }
            GatherSoulItem holeItem;
            if (TryGetItem(hole, out holeItem))
            {
                var sameHole = IsSamePropertyCompareHoles(hole, item);
                var multiProperty = false;
                if (item.ExistSameProperty(holeItem.id))
                {
                    multiProperty = gatherSoulPropertys[item.id].Count
                        > gatherSoulPropertys[holeItem.id].Count;
                }
                if (item.itemType == holeItem.itemType
                    && IsSamePropertyCompareHoles(hole, item) == -1)
                    && (sameHole == -1 || multiProperty))
                {
                    return true;
                }
@@ -899,21 +910,26 @@
                    break;
                }
            }
            if (tryEquipHole != -1)
            TryExecuteReplaceSoul(tryEquipHole, item);
        }
        public void TryExecuteReplaceSoul(int hole, GatherSoulItem item)
        {
            if (hole != -1)
            {
                GatherSoulItem holeItem;
                if (TryGetItem(tryEquipHole, out holeItem))
                if (TryGetItem(hole, out holeItem))
                {
                    var sameHole = -1;
                    if (gatherSoulPropertys[item.id].Count > gatherSoulPropertys[holeItem.id].Count)
                    {
                        sameHole = IsSamePropertyCompareHoles(tryEquipHole, item);
                        sameHole = IsSamePropertyCompareHoles(hole, item);
                    }
                    if (sameHole != -1)
                    {
                        SendEquipPack((int)PackType.rptInterimPack, sameHole, (int)PackType.rptGatherSoul, 0);
                    }
                    SendEquipPack((int)PackType.rptGatherSoul, item.index, (int)PackType.rptInterimPack, tryEquipHole);
                    SendEquipPack((int)PackType.rptGatherSoul, item.index, (int)PackType.rptInterimPack, hole);
                }
            }
            else if (item.itemType == GATHERSOUL_CORE_TYPE)
@@ -930,7 +946,7 @@
                    {
                        SendEquipPack((int)PackType.rptInterimPack, sameHole, (int)PackType.rptGatherSoul, 0);
                    }
                    SendEquipPack((int)PackType.rptGatherSoul, item.index, (int)PackType.rptInterimPack, tryEquipHole);
                    SendEquipPack((int)PackType.rptGatherSoul, item.index, (int)PackType.rptInterimPack, hole);
                }
            }
        }