From 39001a600fcae2bcf27c225df8752d75fb92fef4 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期五, 31 十月 2025 11:18:26 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts

---
 Main/Config/PartialConfigs/PlayerPropertyConfig.cs |   87 +++++++++++++++++++++++--------------------
 1 files changed, 46 insertions(+), 41 deletions(-)

diff --git a/Main/Config/PartialConfigs/PlayerPropertyConfig.cs b/Main/Config/PartialConfigs/PlayerPropertyConfig.cs
index 722d71e..80dbebe 100644
--- a/Main/Config/PartialConfigs/PlayerPropertyConfig.cs
+++ b/Main/Config/PartialConfigs/PlayerPropertyConfig.cs
@@ -5,29 +5,42 @@
 
 public partial class PlayerPropertyConfig : ConfigBase<int, PlayerPropertyConfig>
 {
-    private static Dictionary<int, List<PlayerPropertyConfig>> m_PropCfgs = new Dictionary<int, List<PlayerPropertyConfig>>();
-    private static Dictionary<int, List<int>> outputDict = new Dictionary<int, List<int>>();
+    public const int baseType = 1;  //鍩虹灞炴��
+    public const int fightType = 2; //鎴樻枟灞炴��
+    public const int fightAntiType = 3; //鎴樻枟鎶楁��
+    public const int specialType = 4; //鐗规畩灞炴��
 
-    public static int[] baseAttrs = { 6, 7, 8 };    //鏀婚槻琛�
-
-    protected override void OnConfigParseCompleted()
+    // 鎸夋樉绀虹被鍨嬪垎
+    private static Dictionary<int, List<int>> m_PlayerPropertyDict = new Dictionary<int, List<int>>();
+    public static Dictionary<int, List<int>> playerPropertyDict
     {
-        List<PlayerPropertyConfig> list = null;
-        m_PropCfgs.TryGetValue(type, out list);
-        if (list != null)
+        get
         {
-            list.Add(this);
-        }
-        else
-        {
-            list = new List<PlayerPropertyConfig>();
-            list.Add(this);
-            m_PropCfgs.Add(type, list);
+            if (m_PlayerPropertyDict.IsNullOrEmpty())
+                RefreshShowDict();
+            return m_PlayerPropertyDict;
         }
     }
-    public static Dictionary<int, List<int>> GetShowDict()
+
+    public static int[] inheritAttrs = new int[] { 13, 14, 15 };
+
+
+    //涓嶅悓鐨勫姛鑳借〃璋冪敤瀵瑰簲鑷繁鐨勫姛鑳藉惈涔夊拰浣跨敤鏂瑰紡锛屽闃靛鍏夌幆閰嶇疆灏辩敤鍦ㄥ搴旇绠楀眰
+    public static int[] basePerAttrs = new int[] { 16, 17, 18 };
+
+    public static int[] baseAttrs = new int[] { 6, 7, 8 };
+
+    // 鏄犲皠瀵瑰簲鐨勭櫨鍒嗘瘮灞炴�э紝鏂逛究浣跨敤锛屽璁$畻灞炴�ч渶瑕佹壘瀵瑰簲鐨勭櫨鍒嗘瘮鍔犳垚
+    public static Dictionary<int, int> baseAttr2perDict = new Dictionary<int, int>()
     {
-        if (outputDict.IsNullOrEmpty())
+        { 6,16 },
+        { 7,17 },
+        { 8,18 }
+    };
+
+    private static Dictionary<int, List<int>> RefreshShowDict()
+    {
+        if (m_PlayerPropertyDict.IsNullOrEmpty())
         {
             var keys = GetKeys();
             for (int i = 0; i < keys.Count; i++)
@@ -36,23 +49,21 @@
                 int showType = Get(id).showType;
                 if (showType == 0)  //涓�0鏃朵笉鏄剧ず
                     continue;
-                if (!outputDict.ContainsKey(showType))
+                if (!m_PlayerPropertyDict.ContainsKey(showType))
                 {
-                    outputDict[showType] = new List<int> { id };
+                    m_PlayerPropertyDict[showType] = new List<int> { id };
                 }
                 else
                 {
-                    outputDict[showType].Add(id);
+                    m_PlayerPropertyDict[showType].Add(id);
                 }
             }
-            var outputList = outputDict.Keys.ToList();
-            for (int i = 0; i < outputList.Count; i++)
+            foreach (var showType in m_PlayerPropertyDict.Keys)
             {
-                int showType = outputList[i];
-                outputDict[showType].Sort(cmp);
+                m_PlayerPropertyDict[showType].Sort(cmp);
             }
         }
-        return outputDict;
+        return m_PlayerPropertyDict;
     }
 
     static int cmp(int id1, int id2)
@@ -63,12 +74,6 @@
         return config1.showSequence.CompareTo(config2.showSequence);
     }
 
-    public static List<PlayerPropertyConfig> GetPropByType(int type)
-    {
-        List<PlayerPropertyConfig> list = null;
-        m_PropCfgs.TryGetValue(type, out list);
-        return list;
-    }
 
 
     public static string GetFullDescription(Int2 property)
@@ -76,7 +81,7 @@
         return GetFullDescription(property.x, property.y);
     }
 
-    public static string GetFullDescription(int id, long value)
+    public static string GetFullDescription(int id, long value, string format="{0}+{1}")
     {
         var config = Get(id);
         if (config == null)
@@ -84,26 +89,26 @@
             return string.Empty;
         }
 
-        if (config.Name.Contains("%s"))
+        if (config.ShowName.Contains("%s"))
         {
-            if (id == 52)
+            // if (id == 52)
+            // {
+            //     return Regex.Replace(config.ShowName, "%s", (value * 0.0001f).ToString("f2"));
+            // }
+            // else
             {
-                return Regex.Replace(config.Name, "%s", (value * 0.0001f).ToString("f2"));
-            }
-            else
-            {
-                return Regex.Replace(config.Name, "%s", value.ToString());
+                return Regex.Replace(config.ShowName, "%s", value.ToString());
             }
         }
         else
         {
-            return string.Format("{0} +{1}", config.Name, GetValueDescription(id, value));
+            return string.Format(format, config.ShowName, GetValueDescription(id, value));
         }
     }
 
     public static string GetValueDescription(int id, long value)
     {
-        return GetValueDescription(id, value, false);
+        return GetValueDescription(id, value, true);
     }
 
     public static string GetValueDescription(int id, long value, bool largeValue)

--
Gitblit v1.8.0