少年修仙传客户端代码仓库
client_Wu Xijin
2019-03-26 7d4a6920cc062a38c83419dc364ba885a977bf89
3147  【2.0】双孔装备导致同位单孔装备Tips镶嵌孔显示异常
1个文件已修改
35 ■■■■ 已修改文件
System/ItemTip/EquipTipUtility.cs 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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;
            }
        }
    }
}