| | |
| | | public int ItemInde = 0;//物品下标
|
| | | public ItemModel Crystal_ItemModel;//当前所选中的水晶物品
|
| | | public int ItemPlace = -1;//神兽装备位置信息
|
| | | public Dictionary<int, int> QualityLimit = new Dictionary<int, int>();//对应品质所能选择的最大强化等级
|
| | | public Dictionary<int, int> QualityLimit = new Dictionary<int, int>();//对应品质所能选择的最大强化等级
|
| | | DogzModel Dogz_model;
|
| | | 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>()); } }
|
| | | private const int Redpoint_key1 = 11202;//神兽强化红点
|
| | | public Redpoint redPointStre1 = new Redpoint(112, Redpoint_key1);
|
| | | public override void Init()
|
| | | {
|
| | | if (QualityLimit.Count <= 0)
|
| | |
| | |
|
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | playerPack.ItemCntAddAct -= ItemCntAddAct;
|
| | | playerPack.ItemCntReduceAct -= ItemCntReduceAct;
|
| | | dogz_model.UpdateAssistDogzEvent -= UpdateAssistDogzEvent;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChangeEvent;
|
| | | playerPack.ItemCntAddAct += ItemCntAddAct;//物品数量增加
|
| | | playerPack.ItemCntReduceAct += ItemCntReduceAct;//物品数量减少
|
| | | dogz_model.UpdateAssistDogzEvent += UpdateAssistDogzEvent;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent;
|
| | | GodBeastRedPoint();
|
| | | }
|
| | |
|
| | | private void OnFuncStateChangeEvent(int obj)
|
| | | {
|
| | | if (obj == 138)
|
| | | {
|
| | | GodBeastRedPoint();
|
| | | }
|
| | | }
|
| | |
|
| | | private void UpdateAssistDogzEvent()
|
| | | {
|
| | | GodBeastRedPoint();
|
| | | }
|
| | |
|
| | | private void ItemCntReduceAct(PackType packType, int arg2, int arg3)
|
| | | {
|
| | | if (packType == PackType.rptDogzItem || packType == PackType.rptDogzEquip)
|
| | | {
|
| | | GodBeastRedPoint();
|
| | | }
|
| | | }
|
| | |
|
| | | private void ItemCntAddAct(PackType packType, int arg2, int arg3)
|
| | | {
|
| | | if (packType == PackType.rptDogzItem || packType == PackType.rptDogzEquip)
|
| | | {
|
| | | GodBeastRedPoint();
|
| | | }
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| | |
| | | return false;
|
| | | }
|
| | | int lv = QualityLimit[itemModel.chinItemModel.ItemColor];
|
| | | var DogzEquipMaxConfig = DogzEquipPlusConfig.GetEquipplaceAndLevel(itemModel.chinItemModel.EquipPlace, lv); |
| | | var DogzEquipMaxConfig = DogzEquipPlusConfig.GetEquipplaceAndLevel(itemModel.chinItemModel.EquipPlace, lv);
|
| | | var IudetDogzEquipPlus = itemModel.GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus);
|
| | |
|
| | | if (IudetDogzEquipPlus != null)
|
| | |
| | | else
|
| | | {
|
| | | return false;
|
| | | } |
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void GodBeastRedPoint()//神兽强化红点
|
| | | {
|
| | | bool Istrue = false;
|
| | | int ItemColor = 10;
|
| | | var DogzEquipDict = dogz_model.dogzAssistStateDict;
|
| | | redPointStre1.state = RedPointState.None;
|
| | | int Type = 0;
|
| | | foreach (var key in DogzEquipDict.Keys)
|
| | | {
|
| | | if (DogzEquipDict[key] == 1)
|
| | | {
|
| | | Type += 1;
|
| | | List<ItemModel> itemModel = dogz_model.GetDogzEquips(key);
|
| | | for (int i = 0; i < itemModel.Count; i++)
|
| | | {
|
| | | if (itemModel[i].chinItemModel.ItemColor < ItemColor)//获取最低品质的颜色
|
| | | {
|
| | | ItemColor = itemModel[i].chinItemModel.ItemColor;
|
| | | }
|
| | | var IudetDogzEquipPlus = itemModel[i].GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus);// 神兽装备强化信息列表 [强化等级, 强化熟练度]
|
| | | if (IudetDogzEquipPlus == null)//判断是否都满级 满级不可亮红点
|
| | | {
|
| | | Istrue = true;
|
| | | }
|
| | | else
|
| | | {
|
| | | if (QualityLimit.ContainsKey(itemModel[i].chinItemModel.ItemColor) && IudetDogzEquipPlus[0] < (QualityLimit[itemModel[i].chinItemModel.ItemColor]))
|
| | | {
|
| | | Istrue = true;
|
| | | }
|
| | | }
|
| | | }
|
| | | if (Istrue)
|
| | | {
|
| | | if (playerPack.GetSinglePackModel(PackType.rptDogzItem) == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | | Dictionary<int, ItemModel> BackpackDic = playerPack.GetSinglePackModel(PackType.rptDogzItem).GetPackModelIndexDict();
|
| | | int _ItemColor = 10;
|
| | | foreach (var keyBack in BackpackDic.Keys)
|
| | | {
|
| | | var itemModelBack = BackpackDic[keyBack];
|
| | | if (itemModelBack.chinItemModel.Type == 70)//有神兽水晶时的红点
|
| | | {
|
| | | redPointStre1.state = RedPointState.Simple;
|
| | | return;
|
| | | }
|
| | | if (itemModelBack.chinItemModel.ItemColor < _ItemColor)
|
| | | {
|
| | | _ItemColor = itemModelBack.chinItemModel.ItemColor;
|
| | | }
|
| | | }
|
| | | if (Type >= dogz_model.DogzAssistDefaultCnt && ItemColor> _ItemColor)//出战神兽已满,且神兽背包有品质低于已助战神兽品质颜色时
|
| | | {
|
| | | redPointStre1.state = RedPointState.Simple;
|
| | | return;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | } |
| | | |
| | | |