少年修仙传客户端代码仓库
client_linchunjie
2018-12-19 674bce8f052e8633008cc0d03a7eb9197037bc73
【1.4】聚魂功能
6个文件已修改
163 ■■■■■ 已修改文件
System/GatheringSoul/GatherSoulEquipListWin.cs 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/GatheringSoul/GatherSoulItemBehaviour.cs 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/GatheringSoul/GatherSoulResolveItem.cs 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/GatheringSoul/GatherSoulResolveWin.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/GatheringSoul/GatheringSoulModel.cs 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/GatheringSoul/VirtualPackModel.cs 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/GatheringSoul/GatherSoulEquipListWin.cs
@@ -86,13 +86,28 @@
            for (int i = 0; i < equipList.Count; i++)
            {
                var item = equipList[i];
                if (removeIndexs.Contains(i))
                {
                    continue;
                }
                for (int k = i + 1; k < equipList.Count; k++)
                {
                    var compare = item.Compare(equipList[k]);
                    if (item.ExistSameProperty(equipList[k].id)
                        && (compare == 1 || compare == 0))
                    if (removeIndexs.Contains(k))
                    {
                        removeIndexs.Add(k);
                        continue;
                    }
                    var compare = item.Compare(equipList[k]);
                    if (item.ExistSameProperty(equipList[k].id))
                    {
                        if(compare == 1 || compare == 0)
                        {
                            removeIndexs.Add(k);
                        }
                        else
                        {
                            removeIndexs.Add(i);
                            break;
                        }
                    }
                }
            }
@@ -114,6 +129,7 @@
            {
                var item = equipList[cell.index];
                model.ExecuteEquipSoul(item, selectHole);
                CloseImmediately();
            }
        }
    }
System/GatheringSoul/GatherSoulItemBehaviour.cs
@@ -13,6 +13,7 @@
        [SerializeField] RectTransform m_ContainerItem;
        [SerializeField] Image m_ItemBottom;
        [SerializeField] Image m_Icon;
        [SerializeField] RectTransform m_ContainerLevel;
        [SerializeField] Text m_Level;
        [SerializeField] Text m_ItemName;
        [SerializeField] Text m_Count;
@@ -91,6 +92,10 @@
            if (config != null)
            {
                m_Icon.SetSprite(config.IconKey);
                if (m_ContainerLevel != null)
                {
                    m_ContainerLevel.gameObject.SetActive(config.Type != GatheringSoulModel.GATHERSOUL_ESSENCE_TYPE);
                }
                if (m_Level != null)
                {
                    m_Level.text = displayItem.level.ToString();
@@ -160,14 +165,15 @@
                        {
                            data.SetTipsFuncBtn(ItemWinBtnType.Replace, OnTipFunc);
                        }
                        var propertyCount = soulModel.gatherSoulPropertys[item.id].Count;
                        if (propertyCount == 1)
                        GatherSoulComposeModel.Compose compose;
                        if(composeModel.TryGetCompose(item.id,out compose)
                            && compose.requireItems.Count > 0)
                        {
                            data.SetTipsFuncBtn(ItemWinBtnType.Resolve, OnTipFunc);
                            data.SetTipsFuncBtn(ItemWinBtnType.split, OnTipFunc);
                        }
                        else
                        {
                            data.SetTipsFuncBtn(ItemWinBtnType.split, OnTipFunc);
                            data.SetTipsFuncBtn(ItemWinBtnType.Resolve, OnTipFunc);
                        }
                    }
                    itemTipsModel.SetItemTipsModel(data);
@@ -175,9 +181,12 @@
            }
            else
            {
                var data = new ItemAttrData(displayItem.itemId);
                data.SetGatherSoul(displayItem.level, -1);
                itemTipsModel.SetItemTipsModel(data);
                if (displayItem.itemId != 0)
                {
                    var data = new ItemAttrData(displayItem.itemId);
                    data.SetGatherSoul(displayItem.level, -1);
                    itemTipsModel.SetItemTipsModel(data);
                }
            }
        }
System/GatheringSoul/GatherSoulResolveItem.cs
@@ -11,6 +11,7 @@
    {
        [SerializeField] RectTransform m_Container;
        [SerializeField] Image m_Icon;
        [SerializeField] RectTransform m_ContainerLevel;
        [SerializeField] Text m_Level;
        [SerializeField] Button m_Func;
@@ -30,12 +31,13 @@
        {
            this.index = index;
            var item = index < model.resolveItems.Count ? model.resolveItems[index] : null;
            bool exist = index < model.resolveItems.Count || !item.Equals(default(GatherSoulItem));
            bool exist = item != null;
            m_Container.gameObject.SetActive(exist);
            if (exist)
            {
                var itemConfig = Config.Instance.Get<ItemConfig>(item.id);
                m_Icon.SetSprite(itemConfig.IconKey);
                m_ContainerLevel.gameObject.SetActive(itemConfig.Type != GatheringSoulModel.GATHERSOUL_ESSENCE_TYPE);
                m_Level.text = item.level.ToString();
            }
        }
System/GatheringSoul/GatherSoulResolveWin.cs
@@ -127,6 +127,7 @@
        private void OneKeyResolveRefresh()
        {
            m_ScrollerControl.m_Scorller.RefreshActiveCellViews();
            DisplayResolveSoulDust();
        }
        private void Display()
@@ -140,6 +141,10 @@
            bool change = false;
            for (int i = 0; i < model.resolveItems.Count; i++)
            {
                if (model.resolveItems[i] == null)
                {
                    continue;
                }
                if (!model.CheckExist(model.resolveItems[i]))
                {
                    change = true;
@@ -178,6 +183,10 @@
            var result = 0;
            for (int i = 0; i < model.resolveItems.Count; i++)
            {
                if (model.resolveItems[i] == null)
                {
                    continue;
                }
                result += model.GetResolveReturnCost(model.resolveItems[i].id, model.resolveItems[i].level);
            }
            var soulDust = UIHelper.ReplaceLargeNum(UIHelper.GetMoneyCnt(28));
@@ -212,7 +221,7 @@
            var page = Mathf.CeilToInt((float)list.Count / 50);
            for (int i = 0; i < page; i++)
            {
                ushort[] resolves = list.Skip(page * 50).Take((i < page - 1) ? 50 : (list.Count - page * 50)).ToArray();
                ushort[] resolves = list.Skip(i * 50).Take((i < page - 1) ? 50 : (list.Count - i * 50)).ToArray();
                model.SendResolvePack(resolves, false);
            }
        }
System/GatheringSoul/GatheringSoulModel.cs
@@ -308,17 +308,32 @@
            List<int> removeList = new List<int>();
            for (int i = 0; i < packIndexs.Count; i++)
            {
                if (removeList.Contains(i))
                {
                    continue;
                }
                GatherSoulItem item;
                virtualPack.TryGetItem(PackType.rptGatherSoul, packIndexs[i], out item);
                for (int k = i + 1; k < packIndexs.Count; k++)
                {
                    if (removeList.Contains(k))
                    {
                        continue;
                    }
                    GatherSoulItem compareItem;
                    virtualPack.TryGetItem(PackType.rptGatherSoul, packIndexs[k], out compareItem);
                    int compare = item.Compare(compareItem);
                    if (item.ExistSameProperty(compareItem.id)
                        && (compare == 1 || compare == 0))
                    if (item.ExistSameProperty(compareItem.id))
                    {
                        removeList.Add(k);
                        if(compare == 1 || compare == 0)
                        {
                            removeList.Add(k);
                        }
                        else
                        {
                            removeList.Add(i);
                            break;
                        }
                    }
                }
            }
@@ -672,30 +687,27 @@
        public void ExecuteResolve(GatherSoulItem item)
        {
            var list = gatherSoulPropertys[item.id];
            if (list.Count > 1)
            GatherSoulComposeModel.Compose compose;
            if (composeModel.TryGetCompose(item.id, out compose)
                && compose.requireItems.Count > 0)
            {
                var config = Config.Instance.Get<ItemConfig>(item.id);
                var baseName = config.ItemName;
                var sb = new StringBuilder();
                for (int i = 0; i < list.Count; i++)
                for (int i = 0; i < compose.requireItems.Count; i++)
                {
                    var itemId = 0;
                    if (TryGetSinglePropertyItems(list[i], out itemId))
                    var itemId = compose.requireItems[i];
                    config = Config.Instance.Get<ItemConfig>(itemId);
                    sb.Append(config.ItemName);
                    if (i < compose.requireItems.Count - 2)
                    {
                        config = Config.Instance.Get<ItemConfig>(itemId);
                        sb.Append(config.ItemName);
                        if (i < list.Count - 2)
                        {
                            sb.Append("、");
                        }
                        else if (i == list.Count - 2)
                        {
                            sb.Append(Language.Get("GatherSoulAnd"));
                        }
                        sb.Append("、");
                    }
                    else if (i == compose.requireItems.Count - 2)
                    {
                        sb.Append(Language.Get("GatherSoulAnd"));
                    }
                }
                GatherSoulComposeModel.Compose compose;
                var requireSoulCore = 0;
                var requireSoulSplinters = 0;
                var soulDust = GetResolveReturnCost(item.id, item.level);
@@ -1097,7 +1109,7 @@
            }
            var soulStageModulus = soulStageModulusDict != null && soulStageModulusDict.ContainsKey(stage) ?
                soulStageModulusDict[stage] : 1;
            if (propertyCount > 1)
            if (multiPropertyModulus.ContainsKey(propertyCount))
            {
                result = formulaResult * qualityCostModulus[itemConfig.ItemColor]
                    * soulStageModulus * multiPropertyModulus[propertyCount];
@@ -1138,11 +1150,22 @@
            }
            for (int i = 1; i <= level; i++)
            {
                if (i == 1 && !fromCompose)
                if (i == 1)
                {
                    if (qualityResolveCostDict != null && qualityResolveCostDict.ContainsKey(itemConfig.ItemColor))
                    if (!fromCompose)
                    {
                        result += qualityResolveCostDict[itemConfig.ItemColor];
                        var stage = 0;
                        var config = Config.Instance.Get<GatherSoulConfig>(id);
                        if (config != null)
                        {
                            stage = config.soulStage;
                        }
                        var soulStageModulus = soulStageModulusDict != null && soulStageModulusDict.ContainsKey(stage) ?
                                soulStageModulusDict[stage] : 1;
                        if (qualityResolveCostDict != null && qualityResolveCostDict.ContainsKey(itemConfig.ItemColor))
                        {
                            result += qualityResolveCostDict[itemConfig.ItemColor] * soulStageModulus;
                        }
                    }
                }
                else
@@ -1199,7 +1222,7 @@
                    }
                    var property = propertys[0];
                    var config = Config.Instance.Get<ItemConfig>(item.id);
                    if (config.ItemColor < quality && config.ItemColor < dict[property])
                    if (config.ItemColor <= quality && config.ItemColor < dict[property])
                    {
                        list.Add(item);
                    }
@@ -1226,7 +1249,8 @@
        {
            if (index != -1 && index < resolveItems.Count)
            {
                resolveItems[index] = null;
                resolveItems.RemoveAt(index);
                resolveItems.Insert(index, null);
                if (oneKeyResolveRefresh != null)
                {
                    oneKeyResolveRefresh();
@@ -1292,7 +1316,7 @@
                    {
                        if (SatisfyEquipSoul(item, holes[i], out error))
                        {
                            equipRedpointHole = i;
                            equipRedpointHole = holes[i];
                            equipRedpoint.state = RedPointState.Simple;
                            return;
                        }
System/GatheringSoul/VirtualPackModel.cs
@@ -78,20 +78,20 @@
            return false;
        }
        public bool TryGetItem<T>(PackType packType, int index, out T item) where T : VirtualPackItem
        public bool TryGetItem<T>(PackType packType, int packIndex, out T item) where T : VirtualPackItem
        {
            item = default(T);
            if (virtualPackItems.ContainsKey(packType))
            {
                var _index = virtualPackItems[packType].FindIndex((x) =>
                 {
                     return x.index == index;
                     return x.index == packIndex;
                 });
                if (index != -1)
                if (_index != -1)
                {
                    item = virtualPackItems[packType][_index] as T;
                }
                return index != -1;
                return _index != -1;
            }
            return false;
        }
@@ -107,11 +107,7 @@
                    return;
            }
            List<VirtualPackItem> list;
            if (virtualPackItems.TryGetValue(packType, out list))
            {
                list.Clear();
            }
            else
            if (!virtualPackItems.TryGetValue(packType, out list))
            {
                list = new List<VirtualPackItem>();
                virtualPackItems.Add(packType, list);
@@ -147,7 +143,16 @@
        {
            for (int i = 0; i < items.Length; i++)
            {
                var item = VirtualPackItem.Get(packType);
                var item = list.Find((x) =>
                {
                    return x.index == items[i].ItemPlace;
                });
                if (item != null)
                {
                    list.Remove(item);
                    item = null;
                }
                item = VirtualPackItem.Get(packType);
                list.Add(item);
                item.ParsePackItem(items[i].ItemPlace, items[i].ItemData);
            }