少年修仙传客户端代码仓库
client_Hale
2019-04-11 9f89e3be35da42eb9ccb44e6589d62f320aa444c
System/EquipStar/EquipStarModel.cs
@@ -22,6 +22,8 @@
            {5,new LogicString () },
        };
        public readonly LogicList<Star> stars = new LogicList<Star>();
        public readonly LogicInt specialMaterial = new LogicInt();
        public readonly LogicInt starResultEffect = new LogicInt();
@@ -52,6 +54,7 @@
        public void UpdateStarLevels(HA3B1_tagMCEquipPartStarInfo info)
        {
            var selectedEquipOldStar = GetEquipStarLevel(new Int2(selectedLevel.value, selectedPlace.value));
            for (var i = 0; i < info.InfoList.Length; i++)
            {
                var equipPosition = EquipSet.ServerPlaceToClientPlace(info.InfoList[i].EquipPackIndex);
@@ -62,8 +65,12 @@
                }
            }
            equipStarLevel.value = GetEquipStarLevel(new Int2(selectedLevel.value, selectedPlace.value));
            var starLevel = GetEquipStarLevel(new Int2(selectedLevel.value, selectedPlace.value));
            equipStarLevel.value = starLevel;
            selectedPlace.dirty = true;
            var maxStarLevel = GetMaxStarLevel(selectedLevel.value);
            UpdateSelelctedEquipStars(selectedEquipOldStar, starLevel, maxStarLevel);
            foreach (var candidate in candidatePlaces.Values)
            {
@@ -174,6 +181,8 @@
            {
                item.value = string.Empty;
            }
            stars.Clear();
        }
        public void SelectLevel(int level)
@@ -212,9 +221,12 @@
                candidate.selected.value = candidate.equipPosition == equipPosition;
            }
            equipStarLevel.value = GetEquipStarLevel(equipPosition);
            equipMaxStarLevel.value = GetMaxStarLevel(equipPosition.x);
            var starLevel = GetEquipStarLevel(equipPosition);
            var maxStarLevel = GetMaxStarLevel(equipPosition.x);
            equipStarLevel.value = starLevel;
            equipMaxStarLevel.value = maxStarLevel;
            UpdateSelelctedEquipStars(starLevel, starLevel, maxStarLevel);
            AutoAddMaterials(equipPosition);
            CalculateStarUpgradeProbability(equipPosition);
        }
@@ -558,6 +570,19 @@
            return materials.ContainsKey(index) ? materials[index] : null;
        }
        private void UpdateSelelctedEquipStars(int oldStarLevel, int newStarLevel, int maxStarLevel)
        {
            stars.Clear();
            for (var i = 1; i <= maxStarLevel; i++)
            {
                stars.Add(new Star()
                {
                    actived = i <= newStarLevel,
                    newGet = i <= newStarLevel && i > oldStarLevel,
                });
            }
        }
        private void ParseConfig()
        {
            var configs = EquipStarConfig.GetValues();
@@ -570,6 +595,11 @@
            }
        }
        public struct Star
        {
            public bool actived;
            public bool newGet;
        }
    }
}