From d331ecebf0bcf281da1ce463d0386d90c2062f8f Mon Sep 17 00:00:00 2001
From: client_Zxw <826696702@qq.com>
Date: 星期五, 08 三月 2019 10:35:23 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts

---
 System/RolePromote/RolePromoteModel.cs |   30 ---------------
 Lua/Gen/SnxxzUIRolePromoteModelWrap.cs |   18 ---------
 System/RoleParticulars/ViewFuncCell.cs |    4 +
 System/EquipGem/EquipGemModel.cs       |   20 ++++++++++
 4 files changed, 23 insertions(+), 49 deletions(-)

diff --git a/Lua/Gen/SnxxzUIRolePromoteModelWrap.cs b/Lua/Gen/SnxxzUIRolePromoteModelWrap.cs
index bbe413b..a7c5f84 100644
--- a/Lua/Gen/SnxxzUIRolePromoteModelWrap.cs
+++ b/Lua/Gen/SnxxzUIRolePromoteModelWrap.cs
@@ -43,7 +43,6 @@
 			Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetPromoteDetailShow", _m_GetPromoteDetailShow);
 			
 			
-			Utils.RegisterFunc(L, Utils.GETTER_IDX, "allStoneLv", _g_get_allStoneLv);
             Utils.RegisterFunc(L, Utils.GETTER_IDX, "wingLv2GenerDict", _g_get_wingLv2GenerDict);
             Utils.RegisterFunc(L, Utils.GETTER_IDX, "roleStrongerDic", _g_get_roleStrongerDic);
             Utils.RegisterFunc(L, Utils.GETTER_IDX, "fightPowerPercents", _g_get_fightPowerPercents);
@@ -609,23 +608,6 @@
                 return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
             }
             
-        }
-        
-        
-        
-        
-        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
-        static int _g_get_allStoneLv(RealStatePtr L)
-        {
-		    try {
-                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
-			
-                Snxxz.UI.RolePromoteModel gen_to_be_invoked = (Snxxz.UI.RolePromoteModel)translator.FastGetCSObj(L, 1);
-                LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.allStoneLv);
-            } catch(System.Exception gen_e) {
-                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
-            }
-            return 1;
         }
         
         [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
diff --git a/System/EquipGem/EquipGemModel.cs b/System/EquipGem/EquipGemModel.cs
index 87e6ea4..a96aa07 100644
--- a/System/EquipGem/EquipGemModel.cs
+++ b/System/EquipGem/EquipGemModel.cs
@@ -484,6 +484,26 @@
             return count;
         }
 
+        public int GetAllGemsLevel()
+        {
+            var level = 0;
+            foreach (var key in m_EquipGems.Keys)
+            {
+                var equipGems = m_EquipGems[key];
+                foreach (var equipGem in equipGems)
+                {
+                    var id = equipGem.id;
+                    if (id == 0)
+                    {
+                        continue;
+                    }
+                    var config = ItemConfig.Get(id);
+                    level += config != null ? config.EffectValueB1 : 0;
+                }
+            }
+            return level;
+        }
+
         public int Compare(string lhs, string rhs)
         {
             var lhsItem = packModel.GetItemByGuid(lhs);
diff --git a/System/RoleParticulars/ViewFuncCell.cs b/System/RoleParticulars/ViewFuncCell.cs
index 581c313..fdbc646 100644
--- a/System/RoleParticulars/ViewFuncCell.cs
+++ b/System/RoleParticulars/ViewFuncCell.cs
@@ -74,6 +74,8 @@
             get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PackModel>()); }
         }
 
+        EquipGemModel equipGemModel { get { return ModelCenter.Instance.GetModel<EquipGemModel>(); } }
+
         [SerializeField] Image funcImg;
         [SerializeField] Text targetFightPowerTxt;
         [SerializeField] Text selfFightPowerTxt;
@@ -140,7 +142,7 @@
                         break;
                     case FuncPowerType.Stone:
                         targetValue = GetAllStoneLv(viewPlayerData.rolePlusData.GetAllEquipStone());
-                        selfValue = GetAllStoneLv(PlayerStoneData.Instance.GetAllStone());
+                        selfValue = equipGemModel.GetAllGemsLevel();
                         break;
                     case FuncPowerType.Suit:
                         handled = true;
diff --git a/System/RolePromote/RolePromoteModel.cs b/System/RolePromote/RolePromoteModel.cs
index e43b544..6b39b2f 100644
--- a/System/RolePromote/RolePromoteModel.cs
+++ b/System/RolePromote/RolePromoteModel.cs
@@ -20,7 +20,6 @@
         {
             ParseConfig();
             playerPack.refreshItemCountEvent += RefreshItemCountAct;
-            PlayerStoneData.OnRefreshStoneData += OnRefreshStoneData;
             MountModel.Event_MountHA301A += OnRefreshMountData;
             PetModel.Event_H0704Add += OnRefreshPetData;
             PetModel.Event_H0704Update += OnRefreshPetData;
@@ -57,7 +56,6 @@
 
         public void RefreshData()
         {
-            GetAllStoneLv();
             GetWashCntDic();
             GetPetCntDic();
             GetMountCntDic();
@@ -269,34 +267,6 @@
             }
             _count = totalLv >= _tatalLv ? _runeHoleDatas.Count : 0;
             return totalLv >= _tatalLv;
-        }
-        #endregion
-
-        #region 瀹濈煶
-        private void OnRefreshStoneData()
-        {
-            GetAllStoneLv();
-        }
-        private int m_AllStoneLv = 0;
-        public int allStoneLv
-        {
-            get { return m_AllStoneLv; }
-        }
-        private void GetAllStoneLv()
-        {
-            m_AllStoneLv = 0;
-            var dict = PlayerStoneData.Instance.GetAllStone();
-            foreach (uint[] array in dict.Values)
-            {
-                if (array == null || array.Length == 0) continue;
-                for (int i = 0; i < array.Length; i++)
-                {
-                    if (array[i] == 0) continue;
-                    ItemConfig _tagChinItemModel = ItemConfig.Get((int)array[i]);
-                    if (_tagChinItemModel == null) continue;
-                    m_AllStoneLv += _tagChinItemModel.EffectValueB1;
-                }
-            }
         }
         #endregion
 

--
Gitblit v1.8.0