少年修仙传客户端代码仓库
client_Wu Xijin
2019-03-22 c06a8e7c84ebae7bf30408159126a9e854aff6fb
3335 修改装备洗练功能。
2个文件已修改
56 ■■■■ 已修改文件
System/EquipTrain/EquipTrainModel.cs 46 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/EquipTrain/EquipTrainWin.cs 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/EquipTrain/EquipTrainModel.cs
@@ -16,6 +16,7 @@
        public readonly LogicEnum<TrainOperateType> operateType = new LogicEnum<TrainOperateType>(TrainOperateType.None);
        public readonly LogicList<EquipTrainCandidate> candidatePlaces = new LogicList<EquipTrainCandidate>();
        public readonly LogicList<EquipTrainPropertyBar> propertyBars = new LogicList<EquipTrainPropertyBar>();
        public readonly LogicBool trainLimit = new LogicBool();
        static Dictionary<int, int> trainTypes = new Dictionary<int, int>();
        Dictionary<int, EquipTrainSet> equipTrains = new Dictionary<int, EquipTrainSet>();
@@ -105,6 +106,7 @@
                operateType.value = CalculateTrainOperateType(equipPosition);
                InitTrainableProperties(equipPosition, operateType.value);
                UpdateTrainLimitState(equipPosition);
            }
            if (candidatePlaces.Count > 0)
@@ -153,7 +155,7 @@
                if (!DayRemind.Instance.GetDayRemind(DayRemind.EQUIPTRAIN_COSTDIAMOND))
                {
                    ConfirmCancel.ToggleConfirmCancel(Language.Get("Mail101"),
                        Language.Get("TodayDungeonComplete"),
                        Language.Get("EquipWash103", inevitableCount, moneyNeed),
                        Language.Get("TodayNoNotify"), (bool isOk, bool isToggle) =>
                        {
                            if (isToggle)
@@ -287,12 +289,20 @@
            operateType.value = CalculateTrainOperateType(equipPosition);
            InitTrainableProperties(equipPosition, operateType.value);
            UpdateTrainLimitState(equipPosition);
        }
        public void SetInevitable(int index, bool invevitable)
        {
            var equipPosition = new Int2(selectedLevel.value, selectedPlace.value);
            var state = GetEquipPlaceTrainState(equipPosition);
            var maxLevel = GetMaxTrainLevel(equipPosition);
            if (maxLevel < 1)
            {
                SysNotifyMgr.Instance.ShowTip("WashStarRequirement");
                return;
            }
            if (state == TrainState.Empty)
            {
@@ -406,16 +416,16 @@
            }
            var type = GetTrainType(equipPosition.y);
            var currentStarLevel = GetTrainLevel(equipPosition);
            var currentTrainLevel = GetTrainLevel(equipPosition);
            var absoluteMax = GetMaxTrainLevel(equipPosition.y);
            var data = EquipWashConfig.Get(type, Mathf.Clamp(currentStarLevel, 1, absoluteMax));
            var data = EquipWashConfig.Get(type, Mathf.Clamp(currentTrainLevel, 1, absoluteMax));
            if (data == null)
            {
                return TrainState.Empty;
            }
            var relativeMax = GetMaxTrainLevel(new Int2(equip.config.LV, equip.config.EquipPlace));
            if (relativeMax == 0 || currentStarLevel >= relativeMax)
            if (relativeMax == 0)
            {
                return TrainState.StarLimit;
            }
@@ -426,9 +436,14 @@
                && properties.z >= data.config.attMax3;
            if (isFull)
            {
                if (currentStarLevel >= absoluteMax)
                if (currentTrainLevel >= absoluteMax)
                {
                    return TrainState.MaxLevel;
                }
                if (currentTrainLevel >= relativeMax)
                {
                    return TrainState.StarLimit;
                }
            }
@@ -587,6 +602,27 @@
            return TrainOperateType.None;
        }
        private void UpdateTrainLimitState(Int2 equipPosition)
        {
            var type = GetTrainType(equipPosition.y);
            var currentLevel = GetTrainLevel(equipPosition);
            var data = EquipWashConfig.Get(type, currentLevel);
            if (data == null)
            {
                trainLimit.value = false;
            }
            else
            {
                var properties = GetTrainedProperties(equipPosition);
                var isFull = properties.x >= data.config.attMax1
                    && properties.y >= data.config.attMax2
                    && properties.z >= data.config.attMax3;
                var trainState = GetEquipPlaceTrainState(equipPosition);
                trainLimit.value = isFull && (trainState == TrainState.StarLimit || trainState == TrainState.MaxLevel);
            }
        }
        private void ParseConfig()
        {
            var config = FuncConfigConfig.Get("EquipWashGroup");
System/EquipTrain/EquipTrainWin.cs
@@ -57,7 +57,7 @@
        protected override void OnPreOpen()
        {
            if ( model.selectedLevel.value==0)
            if (model.selectedLevel.value == 0)
            {
                model.SelectLevel(equipModel.GetLastestUnLockEquipSet());
            }
@@ -144,7 +144,6 @@
            {
                var trainLevel = model.equipTrainLevel.Fetch();
                m_TrainLevel.text = string.Format("{0}级洗练", trainLevel);
                m_MaxLevelContainer.gameObject.SetActive(trainLevel > 1 && trainLevel >= model.equipTrainMaxLevel.value);
            }
            if (force || model.equipTrainMaxLevel.dirty)
@@ -165,6 +164,11 @@
                {
                    m_MaxTrainLevel.text = "提升装备星级可洗练";
                }
            }
            if (force || model.trainLimit.dirty)
            {
                m_MaxLevelContainer.gameObject.SetActive(model.trainLimit.Fetch());
            }
            if (force || model.material.dirty)
@@ -249,7 +253,7 @@
        private void DisplayOperateButton(EquipTrainModel.TrainOperateType opreateType)
        {
            m_Train.gameObject.SetActive(opreateType== EquipTrainModel.TrainOperateType.Train);
            m_Train.gameObject.SetActive(opreateType == EquipTrainModel.TrainOperateType.Train);
            m_Save.gameObject.SetActive(opreateType == EquipTrainModel.TrainOperateType.Save);
            m_GiveUp.gameObject.SetActive(opreateType == EquipTrainModel.TrainOperateType.Save);
            m_UpdateLevel.gameObject.SetActive(opreateType == EquipTrainModel.TrainOperateType.LevelUp);