| | |
| | | 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; |
| | |
| | | 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>(); |
| | |
| | | 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; |
| | | } |
| | |
| | | |
| | | 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; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |