| | |
| | | DogzModel dogz_model { get { return Dogz_model ?? (Dogz_model = ModelCenter.Instance.GetModel<DogzModel>()); } }
|
| | | PlayerPackModel _playerPack;
|
| | | PlayerPackModel playerPack { get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PlayerPackModel>()); } }
|
| | | public Dictionary<int, Redpoint> GodBeastRedPointDic = new Dictionary<int, Redpoint>();//key装备位置下标(红点)
|
| | | private List<int> RedPointLIst = new List<int>();
|
| | | private const int Redpoint_key1 = 11202;//神兽强化红点
|
| | | public Redpoint redPointStre1 = new Redpoint(112, Redpoint_key1);
|
| | | public override void Init()
|
| | |
| | | playerPack.ItemCntReduceAct += ItemCntReduceAct;//物品数量减少
|
| | | dogz_model.UpdateAssistDogzEvent += UpdateAssistDogzEvent;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent;
|
| | | SetRedPointID();
|
| | | GodBeastRedPoint();
|
| | | }
|
| | |
|
| | |
| | |
|
| | | private void UpdateAssistDogzEvent()
|
| | | {
|
| | | SetRedPointID();
|
| | | GodBeastRedPoint();
|
| | | }
|
| | |
|
| | |
| | | if (_IudetDogzEquipPlus != null)
|
| | | {
|
| | | SingleProficiency += _IudetDogzEquipPlus[1];
|
| | | DoubleProficiency += item_Model.chinItemModel.EffectValueA1+ _IudetDogzEquipPlus[1];
|
| | | DoubleProficiency += item_Model.chinItemModel.EffectValueA1 + _IudetDogzEquipPlus[1];
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | private void SetRedPointID()//设置红点ID
|
| | | {
|
| | | GodBeastRedPointDic.Clear();
|
| | | RedPointLIst.Clear();
|
| | | var DogzEquipDict = dogz_model.dogzAssistStateDict;
|
| | | foreach (var key in DogzEquipDict.Keys)
|
| | | {
|
| | | if (DogzEquipDict[key] == 1)
|
| | | {
|
| | | List<ItemModel> itemModel = dogz_model.GetDogzEquips(key);
|
| | | for (int i = 0; i < itemModel.Count; i++)
|
| | | {
|
| | | int IndexId = itemModel[i].itemInfo.ItemPlace;
|
| | | int RedPoint = Redpoint_key1 * 1000 + IndexId;
|
| | | Redpoint redPointStare = new Redpoint(Redpoint_key1, RedPoint);
|
| | | if (!GodBeastRedPointDic.ContainsKey(IndexId))
|
| | | {
|
| | | GodBeastRedPointDic.Add(IndexId, redPointStare);
|
| | | RedPointLIst.Add(IndexId);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | RedPointLIst.Sort(Compare);
|
| | | }
|
| | | int Compare(int x, int y)
|
| | | {
|
| | | ItemModel IindexitemModelx = playerPack.GetItemModelByIndex(PackType.rptDogzEquip, x);
|
| | | ItemModel IindexitemModely = playerPack.GetItemModelByIndex(PackType.rptDogzEquip, y);
|
| | | if (IindexitemModelx.chinItemModel.ItemColor.CompareTo(IindexitemModely.chinItemModel.ItemColor) != 0)//品质
|
| | | {
|
| | | return -IindexitemModelx.chinItemModel.ItemColor.CompareTo(IindexitemModely.chinItemModel.ItemColor);
|
| | | }
|
| | | if (IindexitemModelx.chinItemModel.StarLevel.CompareTo(IindexitemModely.chinItemModel.StarLevel) != 0)//星级
|
| | | {
|
| | | return -IindexitemModelx.chinItemModel.StarLevel.CompareTo(IindexitemModely.chinItemModel.StarLevel);
|
| | | }
|
| | | if (IindexitemModelx.chinItemModel.EquipPlace.CompareTo(IindexitemModely.chinItemModel.EquipPlace) != 0)//装备位
|
| | | {
|
| | | return IindexitemModelx.chinItemModel.EquipPlace.CompareTo(IindexitemModely.chinItemModel.EquipPlace);
|
| | | }
|
| | | if (GetLV(IindexitemModelx).CompareTo(GetLV(IindexitemModely)) != 0)//强化等级
|
| | | {
|
| | | return -GetLV(IindexitemModelx).CompareTo(GetLV(IindexitemModely));
|
| | | }
|
| | | if (GetProficiency(IindexitemModelx).CompareTo(GetProficiency(IindexitemModely)) != 0)//熟练度
|
| | | {
|
| | | return -GetProficiency(IindexitemModelx).CompareTo(GetProficiency(IindexitemModely));
|
| | | }
|
| | | if (IindexitemModelx.equipScore.CompareTo(IindexitemModely.equipScore) != 0)//装备评分
|
| | | {
|
| | | return -IindexitemModelx.equipScore.CompareTo(IindexitemModely.equipScore);
|
| | | }
|
| | | return 1;
|
| | | }
|
| | |
|
| | | private int GetLV(ItemModel _ItemModel)
|
| | | {
|
| | | var IudetDogzEquipPlus = _ItemModel.GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus);
|
| | | if (IudetDogzEquipPlus != null)
|
| | | {
|
| | | return IudetDogzEquipPlus[0];
|
| | | }
|
| | | return 0;
|
| | | }
|
| | | private int GetProficiency(ItemModel _ItemModel)
|
| | | {
|
| | | var IudetDogzEquipPlus = _ItemModel.GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus);
|
| | | if (IudetDogzEquipPlus != null)
|
| | | {
|
| | | return IudetDogzEquipPlus[1];
|
| | | }
|
| | | return 0;
|
| | | }
|
| | | public int IndexId = 0;
|
| | | private void GodBeastRedPoint()//神兽强化红点
|
| | | {
|
| | | bool Istrue = false;
|
| | | bool IsRedPoint = false;
|
| | | int ItemColor = 10;
|
| | | var DogzEquipDict = dogz_model.dogzAssistStateDict;
|
| | | redPointStre1.state = RedPointState.None;
|
| | | IndexId = 0;
|
| | | foreach (var key in GodBeastRedPointDic.Keys)
|
| | | {
|
| | | GodBeastRedPointDic[key].state = RedPointState.None;
|
| | | }
|
| | | int Type = 0;
|
| | | foreach (var key in DogzEquipDict.Keys)
|
| | | {
|
| | |
| | | var itemModelBack = BackpackDic[keyBack];
|
| | | if (itemModelBack.chinItemModel.Type == 70)//有神兽水晶时的红点
|
| | | {
|
| | | redPointStre1.state = RedPointState.Simple;
|
| | | return;
|
| | | IsRedPoint = true;
|
| | | }
|
| | | if (itemModelBack.chinItemModel.ItemColor < _ItemColor)
|
| | | {
|
| | | _ItemColor = itemModelBack.chinItemModel.ItemColor;
|
| | | }
|
| | | }
|
| | | if (Type >= dogz_model.curSumAssistNum && ItemColor> _ItemColor)//出战神兽已满,且神兽背包有品质低于已助战神兽品质颜色时
|
| | | if (Type >= dogz_model.curSumAssistNum && ItemColor > _ItemColor)//出战神兽已满,且神兽背包有品质低于已助战神兽品质颜色时
|
| | | {
|
| | | redPointStre1.state = RedPointState.Simple;
|
| | | return;
|
| | | IsRedPoint = true;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (IsRedPoint)
|
| | | {
|
| | | int Lv = 100;
|
| | | for (int i = 0; i < RedPointLIst.Count; i++)
|
| | | {
|
| | | ItemModel _itemModel = playerPack.GetItemModelByIndex(PackType.rptDogzEquip, RedPointLIst[i]);
|
| | | var _IudetDogzEquipPlus = _itemModel.GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus);
|
| | | if (_IudetDogzEquipPlus != null)
|
| | | {
|
| | | if (_IudetDogzEquipPlus[0] < Lv)
|
| | | {
|
| | | IndexId = RedPointLIst[i];
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (0 < Lv)
|
| | | {
|
| | | Lv = 0;
|
| | | IndexId = RedPointLIst[i];
|
| | | }
|
| | | }
|
| | | }
|
| | | if (GodBeastRedPointDic.ContainsKey(IndexId))
|
| | | {
|
| | | GodBeastRedPointDic[IndexId].state = RedPointState.Simple;
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | public bool IsNeedEquipment()//是否有极品装备需要弹框
|
| | | public bool IsNeedEquipment()//是否有极品装备需要弹框
|
| | | {
|
| | | bool IsBool = false;
|
| | | foreach (var key in Absorption_Dic.Keys)
|
| | |
| | | IsBool = true;
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | }
|
| | | return IsBool;
|
| | | }
|