From e0b8aaa81d7db2bfb76245523c12fbce2c4c75db Mon Sep 17 00:00:00 2001
From: client_Zxw <826696702@qq.com>
Date: 星期四, 27 九月 2018 11:24:28 +0800
Subject: [PATCH] 2614 【前端】神兽——强化功能

---
 System/Strengthening/GodBeastModel.cs      |  108 +++++++++++++++++++++++++++++++++++-
 System/Strengthening/GodBeastAttributes.cs |   45 ++++++++++++---
 2 files changed, 141 insertions(+), 12 deletions(-)

diff --git a/System/Strengthening/GodBeastAttributes.cs b/System/Strengthening/GodBeastAttributes.cs
index 75414a2..8bce378 100644
--- a/System/Strengthening/GodBeastAttributes.cs
+++ b/System/Strengthening/GodBeastAttributes.cs
@@ -76,7 +76,7 @@
         {
             GodBeast_Number = 0;
             GodBeast_Part = 0;
-            
+
             GodBeastReinforcementWin.ChooseToModify -= ChooseToModify;
             godBeastModel.AbsorbEvent -= AbsorbEvent;
         }
@@ -96,7 +96,7 @@
             {
                 AttributeAssignment();
             }
-          
+
         }
         private void OnClickStrengthBtn()
         {
@@ -108,15 +108,42 @@
                 ListIndex.Add(key);
                 ListCount.Add(DicAb[key]);
             }
-            if (m_DoubleToggle.isOn)
+            if (m_DoubleToggle.isOn)//鍙屽�嶅己鍖�
             {
                 if (ListIndex.Count <= 0)
                 {
                     return;
                 }
-                dogz_model.SendDogzEquipStrength(m_DogZItemModel.itemInfo.ItemPlace, ListIndex, ListCount, 1);
+                if (NeedFairyJade <= 0)
+                {
+                    dogz_model.SendDogzEquipStrength(m_DogZItemModel.itemInfo.ItemPlace, ListIndex, ListCount, 0);
+                }
+                else
+                {
+                    int Gold = (int)UIHelper.GetMoneyCnt(1);//浠欑帀
+                    string strNull = string.Format(Language.Get("DogzDoubleRemind"), NeedFairyJade);
+                    ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), strNull, (bool isOk) =>
+                     {
+                         if (isOk)
+                         {
+                             if (Gold >= NeedFairyJade)
+                             {
+                                 dogz_model.SendDogzEquipStrength(m_DogZItemModel.itemInfo.ItemPlace, ListIndex, ListCount, 1);
+                             }
+                             else
+                             {
+                                 if (VersionConfig.Get().isBanShu)
+                                 {
+                                     SysNotifyMgr.Instance.ShowTip("GoldErr");
+                                     return;
+                                 }
+                                 WindowCenter.Instance.Open<RechargeTipWin>();
+                             }
+                         }
+                     });
+                }
             }
-            else
+            else//鍗曞�嶅己鍖�
             {
                 if (ListIndex.Count <= 0)
                 {
@@ -162,7 +189,7 @@
                 }
                 m_UIAlphaTween.gameObject.SetActive(true);
                 m_FrameNull.SetActive(true);
-                m_FullLevel.SetActive(false);            
+                m_FullLevel.SetActive(false);
                 GetDogZLevelAndExp();
                 AttributeAssignment();
             }
@@ -226,7 +253,7 @@
                 }
                 else
                 {
-                  
+
                     m_StrengthenDoubleBtn.interactable = true;
                     m_StrengthenBtn.interactable = true;
                     m_Text_two.SetActive(true);
@@ -285,7 +312,7 @@
                         else
                         {
                             DoubleProficiency += itemModel.chinItemModel.EffectValueA1 * 2 * DicAb[key];
-                            NeedFairyJade += itemModel.chinItemModel.Effect2 * DicAb[key];
+                            NeedFairyJade += itemModel.chinItemModel.EffectValueB1 * DicAb[key];
                         }
                     }
                 }
@@ -382,7 +409,7 @@
             var IudetDogzEquipPlus = m_DogZItemModel.GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus);
             if (IudetDogzEquipPlus != null)
             {
-                ToExpTotal+= IudetDogzEquipPlus[1];
+                ToExpTotal += IudetDogzEquipPlus[1];
             }
             for (int i = lv; i >= 0; i--)
             {
diff --git a/System/Strengthening/GodBeastModel.cs b/System/Strengthening/GodBeastModel.cs
index eac4735..a7acac6 100644
--- a/System/Strengthening/GodBeastModel.cs
+++ b/System/Strengthening/GodBeastModel.cs
@@ -18,11 +18,13 @@
     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)
@@ -39,7 +41,44 @@
 
     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()
@@ -137,7 +176,7 @@
             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)
@@ -175,7 +214,7 @@
             else
             {
                 return false;
-            }         
+            }
         }
         else
         {
@@ -189,6 +228,69 @@
             }
         }
     }
+
+    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;
+                    }
+                }
+            }
+        }
+    }
 }
 
 

--
Gitblit v1.8.0