| | |
| | | public delegate void OnRefreshWashModel();
|
| | | public event OnRefreshWashModel RefreshWashModelEvent;
|
| | |
|
| | | public int[] washGroups1 { get; private set; }
|
| | | public int[] washGroups2 { get; private set; }
|
| | | public int[] washGroups3 { get; private set; }
|
| | |
|
| | | private Dictionary<int, WashProCount> washEquipProDict = new Dictionary<int, WashProCount>();
|
| | | private FuncConfigConfig funcModel;
|
| | | private Dictionary<int, int> _equipWashLimitDict;
|
| | | private Dictionary<int, Dictionary<int, int>> _equipWashLimitDict = new Dictionary<int, Dictionary<int, int>>();
|
| | | private List<WashProCount> orderWashProlist = new List<WashProCount>();
|
| | | PlayerPackModel _playerPack;
|
| | | PlayerPackModel playerPack
|
| | |
| | |
|
| | | public override void Init()
|
| | | {
|
| | | _equipWashLimitDict = null;
|
| | | funcModel = Config.Instance.Get<FuncConfigConfig>("EquipWashMaxLV");
|
| | | if (funcModel != null)
|
| | | _equipWashLimitDict = ConfigParse.GetDic<int, int>(funcModel.Numerical1);
|
| | | _equipWashLimitDict.Clear();
|
| | | FuncConfigConfig washGroup1Model = Config.Instance.Get<FuncConfigConfig>("EquipWashGroup1");
|
| | | FuncConfigConfig washGroup2Model = Config.Instance.Get<FuncConfigConfig>("EquipWashGroup2");
|
| | | FuncConfigConfig washGroup3Model = Config.Instance.Get<FuncConfigConfig>("EquipWashGroup3");
|
| | | washGroups1 = ConfigParse.GetMultipleStr<int>(washGroup1Model.Numerical1);
|
| | | washGroups2 = ConfigParse.GetMultipleStr<int>(washGroup2Model.Numerical1);
|
| | | washGroups3 = ConfigParse.GetMultipleStr<int>(washGroup3Model.Numerical1);
|
| | | SetEquipWashMaxLV(washGroups1, washGroup1Model.Numerical2);
|
| | | SetEquipWashMaxLV(washGroups2, washGroup2Model.Numerical2);
|
| | | SetEquipWashMaxLV(washGroups3, washGroup3Model.Numerical2);
|
| | | }
|
| | |
|
| | | private void SetEquipWashMaxLV(int[] groups,string limit)
|
| | | {
|
| | | Dictionary<int,int> limitDict = ConfigParse.GetDic<int, int>(limit);
|
| | | if (groups != null && limitDict != null)
|
| | | {
|
| | | for (int i = 0; i < groups.Length; i++)
|
| | | {
|
| | | if (!_equipWashLimitDict.ContainsKey(groups[i]))
|
| | | {
|
| | | _equipWashLimitDict.Add(groups[i], limitDict);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| | |
| | | //得到洗练群组类型
|
| | | public int OnGetWashType(int itemPlace)
|
| | | {
|
| | | FuncConfigConfig washGroup1Model = Config.Instance.Get<FuncConfigConfig>("EquipWashGroup1");
|
| | | FuncConfigConfig washGroup2Model = Config.Instance.Get<FuncConfigConfig>("EquipWashGroup2");
|
| | | FuncConfigConfig washGroup3Model = Config.Instance.Get<FuncConfigConfig>("EquipWashGroup3");
|
| | | int[] _equipPlacelist1 = ConfigParse.GetMultipleStr<int>(washGroup1Model.Numerical1);
|
| | | int[] _equipPlacelist2 = ConfigParse.GetMultipleStr<int>(washGroup2Model.Numerical1);
|
| | | int[] _equipPlacelist3 = ConfigParse.GetMultipleStr<int>(washGroup3Model.Numerical1);
|
| | | int i = 0;
|
| | | for (i = 0; i < _equipPlacelist1.Length; i++)
|
| | | for (i = 0; i < washGroups1.Length; i++)
|
| | | {
|
| | | if (_equipPlacelist1[i] == itemPlace)
|
| | | if (washGroups1[i] == itemPlace)
|
| | | return 1;
|
| | | }
|
| | |
|
| | | for (i = 0; i < _equipPlacelist2.Length; i++)
|
| | | for (i = 0; i < washGroups2.Length; i++)
|
| | | {
|
| | | if (_equipPlacelist2[i] == itemPlace)
|
| | | if (washGroups2[i] == itemPlace)
|
| | | return 2;
|
| | | }
|
| | |
|
| | | for (i = 0; i < _equipPlacelist3.Length; i++)
|
| | | for (i = 0; i < washGroups3.Length; i++)
|
| | | {
|
| | | if (_equipPlacelist3[i] == itemPlace)
|
| | | if (washGroups3[i] == itemPlace)
|
| | | return 3;
|
| | | }
|
| | | return 0;
|
| | |
| | | /// </summary>
|
| | | /// <param name="equipLv"></param>
|
| | | /// <returns></returns>
|
| | | public int GetWashFullLv(int equipLv)
|
| | | public int GetWashFullLv(int equipPlace,int equipLv)
|
| | | {
|
| | | if (_equipWashLimitDict == null)
|
| | | return 0;
|
| | |
|
| | | if (_equipWashLimitDict.ContainsKey(equipLv))
|
| | | return _equipWashLimitDict[equipLv];
|
| | | else
|
| | | return 0;
|
| | | if (_equipWashLimitDict.ContainsKey(equipPlace))
|
| | | {
|
| | | if(_equipWashLimitDict[equipPlace].ContainsKey(equipLv))
|
| | | {
|
| | | return _equipWashLimitDict[equipPlace][equipLv];
|
| | | }
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | | public int GetEquipWashMinLv(int equipPlace)
|
| | | {
|
| | | if (_equipWashLimitDict.ContainsKey(equipPlace))
|
| | | {
|
| | | List<int> lvlist = _equipWashLimitDict[equipPlace].Keys.ToList();
|
| | | if (lvlist != null && lvlist.Count > 0)
|
| | | {
|
| | | return lvlist[0];
|
| | | }
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | |
|
| | | /// <summary>
|
| | | /// 判断当前装备是否洗练满阶
|
| | |
| | | return false;
|
| | |
|
| | | chinItemModel = Config.Instance.Get<ItemConfig>((int)model.itemInfo.ItemID);
|
| | | int fullLv = GetWashFullLv(chinItemModel.LV);
|
| | | int fullLv = GetWashFullLv(chinItemModel.EquipPlace,chinItemModel.LV);
|
| | | if (washPro.XLAttrLV == fullLv)
|
| | | {
|
| | | if (washPro.proValuelist[0].XLAttrValue < tagEquipWash.attMax1)
|
| | |
| | |
|
| | | public bool IsCanWash(ItemModel model)
|
| | | {
|
| | | if (model == null || _equipWashLimitDict == null)
|
| | | if (model == null)
|
| | | return false;
|
| | |
|
| | | chinItemModel = Config.Instance.Get<ItemConfig>((int)model.itemInfo.ItemID);
|
| | | int[] equipLvs = _equipWashLimitDict.Keys.ToArray();
|
| | | if (chinItemModel.LV >= equipLvs[0])
|
| | | if(chinItemModel.LV >= GetEquipWashMinLv(chinItemModel.EquipPlace))
|
| | | {
|
| | | return true;
|
| | | else
|
| | | return false;
|
| | | }
|
| | |
|
| | | public int WashMinLV()
|
| | | {
|
| | | if (_equipWashLimitDict == null)
|
| | | return -1;
|
| | |
|
| | | int[] equipLvs = _equipWashLimitDict.Keys.ToArray();
|
| | | return equipLvs[0];
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 得到装备位最大洗练等级
|
| | | /// </summary>
|
| | | /// <returns></returns>
|
| | | public int GetMaxWashLv()
|
| | | public int GetMaxWashLv(int equipPlace)
|
| | | {
|
| | | if (_equipWashLimitDict == null)
|
| | | return 0;
|
| | | int[] washLvs = _equipWashLimitDict.Values.ToArray();
|
| | | return washLvs[washLvs.Length - 1];
|
| | | if (_equipWashLimitDict.ContainsKey(equipPlace))
|
| | | {
|
| | | List<int> washLvlist = _equipWashLimitDict[equipPlace].Values.ToList();
|
| | | if (washLvlist != null && washLvlist.Count > 0)
|
| | | {
|
| | | return washLvlist[washLvlist.Count - 1];
|
| | | }
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | | public string GetCurWashLvStr(WashProCount washPro, EquipWashConfig tagEquipWash)
|
| | | {
|
| | | int maxWashLv = GetMaxWashLv();
|
| | | int maxWashLv = GetMaxWashLv(washPro.EquipPlace);
|
| | |
|
| | | if (washPro.XLAttrLV < maxWashLv)
|
| | | {
|