| | |
| | | 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>(); |
| | |
| | | |
| | | operateType.value = CalculateTrainOperateType(equipPosition); |
| | | InitTrainableProperties(equipPosition, operateType.value); |
| | | UpdateTrainLimitState(equipPosition); |
| | | } |
| | | |
| | | if (candidatePlaces.Count > 0) |
| | |
| | | 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) |
| | |
| | | |
| | | 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) |
| | | { |
| | |
| | | } |
| | | |
| | | 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; |
| | | } |
| | |
| | | && properties.z >= data.config.attMax3; |
| | | if (isFull) |
| | | { |
| | | if (currentStarLevel >= absoluteMax) |
| | | if (currentTrainLevel >= absoluteMax) |
| | | { |
| | | return TrainState.MaxLevel; |
| | | } |
| | | |
| | | if (currentTrainLevel >= relativeMax) |
| | | { |
| | | return TrainState.StarLimit; |
| | | } |
| | | } |
| | | |
| | |
| | | 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"); |