少年修仙传客户端代码仓库
client_linchunjie
2019-03-26 e369f932d6cd35897dc497335839b05c9474af23
Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
2个文件已修改
61 ■■■■ 已修改文件
System/Equip/EquipModel.cs 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/ItemTip/EquipTipUtility.cs 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Equip/EquipModel.cs
@@ -712,21 +712,23 @@
                    }
                    break;
                case PackType.Equip:
                    var equip = packModel.GetItemByIndex(PackType.Equip, index);
                    var clientPlace = EquipSet.ServerPlaceToClientPlace(index);
                    equipSets[clientPlace.x].UpdateEquipSlot(clientPlace.y, equip == null ? string.Empty : equip.guid);
                    appearance.value = GetAppearance(selectedLevel.value);
                    if (clientPlace.x == selectedLevel.value)
                    if (equipSets.ContainsKey(clientPlace.x))
                    {
                        equipDirty = true;
                    }
                    if (clientPlace.x == PlayerDatas.Instance.baseData.equipShowSwitch / 10)
                    {
                        if (appearanceChangeEvent != null)
                        var equip = packModel.GetItemByIndex(PackType.Equip, index);
                        equipSets[clientPlace.x].UpdateEquipSlot(clientPlace.y, equip == null ? string.Empty : equip.guid);
                        appearance.value = GetAppearance(selectedLevel.value);
                        if (clientPlace.x == selectedLevel.value)
                        {
                            appearanceChangeEvent();
                            equipDirty = true;
                        }
                        if (clientPlace.x == PlayerDatas.Instance.baseData.equipShowSwitch / 10)
                        {
                            if (appearanceChangeEvent != null)
                            {
                                appearanceChangeEvent();
                            }
                        }
                    }
System/ItemTip/EquipTipUtility.cs
@@ -333,7 +333,9 @@
            var baseProperty = GetBaseProperty(item.itemId);
            var starProperties = new List<Int2>();
            var star = starModel.GetEquipStarLevel(new Int2(item.config.LV, item.config.EquipPlace));
            var currentStar = starModel.GetEquipStarLevel(new Int2(item.config.LV, item.config.EquipPlace));
            var maxStar = EquipStarModel.GetMaxStarLevel(item.config.ItemColor, item.config.LV);
            var star = Mathf.Min(currentStar, maxStar);
            if (star > 0)
            {
                baseProperty.star = star;
@@ -542,10 +544,11 @@
            var place = item.config.EquipPlace;
            var gemInfo = new GemInfo();
            var maxStar = EquipStarModel.GetMaxStarLevel(item.config.ItemColor, item.config.LV);
            gemInfo.activeStates = new Dictionary<int, bool>();
            for (int i = 0; i < 4; i++)
            {
                gemInfo.activeStates[i] = IsEquipGemHoleOpen(new Int2(level, place), i);
                gemInfo.activeStates[i] = IsEquipGemHoleOpen(new Int2(level, place), maxStar, i);
            }
            gemInfo.gems = new Dictionary<int, int>();
@@ -655,13 +658,13 @@
            return operates;
        }
        private static bool IsEquipGemHoleOpen(Int2 equipPosition, int hole)
        private static bool IsEquipGemHoleOpen(Int2 equipPosition, int maxStar, int hole)
        {
            GemHoleCondition condition;
            if (gemModel.TryGetGemHoleCondition(hole, out condition))
            {
                var star = starModel.GetEquipStarLevel(equipPosition);
                if (star < condition.equipStar)
                if (Mathf.Min(star, maxStar) < condition.equipStar)
                {
                    return false;
                }
@@ -675,6 +678,30 @@
            return true;
        }
        private static int GetStarGemHoleCount(int itemId)
        {
            var config = ItemConfig.Get(itemId);
            if (config == null)
            {
                return 0;
            }
            var maxStar = EquipStarModel.GetMaxStarLevel(config.ItemColor, config.LV);
            if (maxStar >= 5)
            {
                return 3;
            }
            else if (maxStar >= 2)
            {
                return 2;
            }
            else
            {
                return 1;
            }
        }
    }
}