From 14ee87c15749b585d8e2e505d7c4a6222d2e1092 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期五, 09 一月 2026 13:34:17 +0800
Subject: [PATCH] 270 子 【内政】古宝系统 / 【内政】古宝系统-客户端

---
 Main/Config/PartialConfigs/GubaoLVAttrConfig.cs |    2 
 Main/System/Gubao/GubaoManager.cs               |  148 +++++++++++++++++++++++++++++-------------------
 Main/System/Gubao/GubaoTipWin.cs                |   22 +++++--
 3 files changed, 106 insertions(+), 66 deletions(-)

diff --git a/Main/Config/PartialConfigs/GubaoLVAttrConfig.cs b/Main/Config/PartialConfigs/GubaoLVAttrConfig.cs
index af1950b..c36d6f3 100644
--- a/Main/Config/PartialConfigs/GubaoLVAttrConfig.cs
+++ b/Main/Config/PartialConfigs/GubaoLVAttrConfig.cs
@@ -21,7 +21,7 @@
         }
     }
 
-    // 鍙ゅ疂鐨勬寚瀹氬睘鎬D瀵瑰簲鐨勬垚闀垮��
+    // 鍙ゅ疂鐨勬寚瀹氬睘鎬D瀵瑰簲鐨勬�绘垚闀垮�硷紝澶栧眰闇�澶勭悊鍗曞眰
     public static long GetSpecLVAttrValue(int gubaoQuality, int gubaoLV, int specAttrID)
     {
         if (gubaoSpecLVAttrDict.ContainsKey(gubaoQuality) && gubaoSpecLVAttrDict[gubaoQuality].ContainsKey(gubaoLV))
diff --git a/Main/System/Gubao/GubaoManager.cs b/Main/System/Gubao/GubaoManager.cs
index 03cfc0b..f9c3252 100644
--- a/Main/System/Gubao/GubaoManager.cs
+++ b/Main/System/Gubao/GubaoManager.cs
@@ -390,7 +390,7 @@
 
 
     #region 灞炴��
-
+    //婵�娲绘椂鍙ゅ疂鏄�0鏄燂紝鍩虹灞炴�у彧鏈夊拰鏄熺骇鐩稿叧
     public Dictionary<int, long> GetBaseAttrByGBID(int gubaoID, bool isPreview = false)
     {
         Dictionary<int, long> attrDict = new Dictionary<int, long>();
@@ -428,80 +428,110 @@
         return attrDict;
     }
 
+    //鍗曞眰鐨勭瓑绾у睘鎬�
+    public float GetSpecLVAttrValueOneLayer(int quality, int lv, int specAttrID, int maxLV)
+    {
+        return GubaoLVAttrConfig.GetSpecLVAttrValue(quality, lv, specAttrID) * 1.0f / maxLV;
+    }
 
-
+    //鑾峰彇鐗规畩灞炴�ф�诲睘鎬у�硷紝婵�娲绘椂鍙ゅ疂鏄�0鏄�1绾�
+    //鐗规畩鏁堟灉灞炴�ц绠� = 锛堝彇鏁达級锛堬紙鍒濆鍊� + 姣忔槦鎴愰暱 * 鏄熺骇 + 鍝佽川绛夌骇鎬诲睘鎬�/鎬诲眰绾э級* 鐗规畩灞傦級
     public Dictionary<int, long> GetSpecialAttrByGBID(int gubaoID, bool isPreview = false)
     {
         Dictionary<int, long> attrDict = new Dictionary<int, long>();
         var config = GubaoConfig.Get(gubaoID);
+
+        if (config.SpecAttrID == 0)
+        {
+            //鏃犲睘鎬�
+            return attrDict;
+        }
         var gubaoInfo = TryGetGubaoInfo(gubaoID);
+        int star = 0;
+        int lv = 0;
+        int layer = 0;
+        int maxLayer = config.SpecEffType != 0 ? config.SpecEffLayerMax : 1;
+        int quality = config.GubaoQuality;
         if (gubaoInfo == null)
         {
             if (isPreview)
             {
-                //鐗规畩灞炴�ф縺娲诲睘鎬� = 鍒濆灞炴�� + 1绾х殑鐗规畩灞炴��
-                attrDict[config.SpecAttrID] = config.SpecAttrValue + GubaoLVAttrConfig.GetSpecLVAttrValue(config.GubaoQuality, 1, config.SpecAttrID);
+                lv = 1;
+                layer = 1;
             }
-            return attrDict;
+            else
+            {
+                lv = 0;
+                layer = 0;
+            }
         }
-
-        attrDict[config.SpecAttrID] = config.SpecAttrValue + config.SpecAttrPerStarAdd * gubaoInfo.GubaoStar
-            + GubaoLVAttrConfig.GetSpecLVAttrValue(gubaoInfo.Quality, gubaoInfo.GubaoLV, config.SpecAttrID);
-
-        if (config.SpecEffType != 0)
-        {
-            //鏈嶅姟绔褰�
-            attrDict[config.SpecAttrID] *= gubaoInfo.EffLayer;
-        }
-
-        return attrDict;
-    }
-
-    public Dictionary<int, long> GetSpecialMaxAttrByGBID(int gubaoID)
-    {
-        Dictionary<int, long> attrDict = new Dictionary<int, long>();
-        var config = GubaoConfig.Get(gubaoID);
-        int quality = config.GubaoQuality;
-        var maxStar = GubaoStarConfig.GetMaxStar(config.GubaoQuality);
-        var maxLV = GubaoLVAttrConfig.GetMaxLV(quality);
-
-
-        attrDict[config.SpecAttrID] = config.SpecAttrValue + config.SpecAttrPerStarAdd * maxStar
-            + GubaoLVAttrConfig.GetSpecLVAttrValue(quality, maxLV, config.SpecAttrID);
-
-        if (config.SpecEffType != 0)
-        {
-            attrDict[config.SpecAttrID] *= config.SpecEffLayerMax;
-        }
-
-        return attrDict;
-    }
-
-
-    //鍗曞眰鐨勫睘鎬э紝鎴栬�呬笉闇�瑕佸眰鐨�
-    public Dictionary<int, long> GetSpecialAttrSingleLayerByGBID(int gubaoID, int lv = 0, int star = 0)
-    {
-        Dictionary<int, long> attrDict = new Dictionary<int, long>();
-        var config = GubaoConfig.Get(gubaoID);
-        var gubaoInfo = TryGetGubaoInfo(gubaoID);
-        if (gubaoInfo == null)
-        {
-            //鐗规畩灞炴�ф縺娲诲睘鎬� = 鍒濆灞炴�� + 1绾х殑鐗规畩灞炴��
-            attrDict[config.SpecAttrID] = config.SpecAttrValue + GubaoLVAttrConfig.GetSpecLVAttrValue(config.GubaoQuality, 1, config.SpecAttrID);
-            return attrDict;
-        }
-
-        if (lv == 0)
-        {
-            lv = gubaoInfo.GubaoLV;
-        }
-        if (star == 0)
+        else
         {
             star = gubaoInfo.GubaoStar;
+            lv = gubaoInfo.GubaoLV;
+            layer = gubaoInfo.EffLayer;
         }
 
-        attrDict[config.SpecAttrID] = config.SpecAttrValue + config.SpecAttrPerStarAdd * star
-            + GubaoLVAttrConfig.GetSpecLVAttrValue(gubaoInfo.Quality, lv, config.SpecAttrID);
+        //鐗规畩鏁堟灉灞炴�ц绠� = 锛堝彇鏁达級锛堬紙鍒濆鍊� + 姣忔槦鎴愰暱 * 鏄熺骇 + 鍝佽川绛夌骇鎬诲睘鎬�/鎬诲眰绾э級* 鐗规畩灞傦級
+        attrDict[config.SpecAttrID] = (int)((config.SpecAttrValue + config.SpecAttrPerStarAdd * star + GetSpecLVAttrValueOneLayer(quality, lv, config.SpecAttrID, maxLayer)) * layer);
+
+        return attrDict;
+    }
+
+    //婊℃槦婊$骇 鍗曞眰
+    public Dictionary<int, long> GetSpecialMaxAttrByGBID(int gubaoID, bool oneLayer = true)
+    {
+        Dictionary<int, long> attrDict = new Dictionary<int, long>();
+        var config = GubaoConfig.Get(gubaoID);
+        if (config.SpecAttrID == 0)
+        {
+            //鏃犲睘鎬�
+            return attrDict;
+        }
+
+        int quality = config.GubaoQuality;
+        int star = GubaoStarConfig.GetMaxStar(config.GubaoQuality);
+        int lv = GubaoLVAttrConfig.GetMaxLV(quality);
+        int maxLayer = config.SpecEffType != 0 ? config.SpecEffLayerMax : 1;
+        int layer = oneLayer ? 1 : maxLayer;
+
+        attrDict[config.SpecAttrID] = (int)((config.SpecAttrValue + config.SpecAttrPerStarAdd * star + GetSpecLVAttrValueOneLayer(quality, lv, config.SpecAttrID, maxLayer)) * layer);
+
+        return attrDict;
+    }
+
+
+    //鍗曞眰鐨勫睘鎬э紝鎴栬�呬笉闇�瑕佸眰鐨�; 涓嶉渶瑕佸眰涔熷氨鏄�诲睘鎬�
+    public Dictionary<int, long> GetSpecialAttrSingleLayerByGBID(int gubaoID, int thelv = 0, int thestar = 0)
+    {
+        Dictionary<int, long> attrDict = new Dictionary<int, long>();
+        var config = GubaoConfig.Get(gubaoID);
+
+        if (config.SpecAttrID == 0)
+        {
+            //鏃犲睘鎬�
+            return attrDict;
+        }
+        var gubaoInfo = TryGetGubaoInfo(gubaoID);
+        int star = thestar == 0 ? 0 : thestar;  //濡傛灉娌℃湁鏁版嵁榛樿
+        int lv = thelv == 0 ? 1 : thelv;    //濡傛灉娌℃湁鏁版嵁榛樿
+        int layer = 1;
+        int maxLayer = config.SpecEffType != 0 ? config.SpecEffLayerMax : 1;
+        int quality = config.GubaoQuality;
+        if (gubaoInfo != null)
+        {
+            if (thestar == 0)
+            {
+                star = gubaoInfo.GubaoStar;
+            }
+            if (thelv == 0)
+            {
+                lv = gubaoInfo.GubaoLV;
+            }
+        }
+
+        //鐗规畩鏁堟灉灞炴�ц绠� = 锛堝彇鏁达級锛堬紙鍒濆鍊� + 姣忔槦鎴愰暱 * 鏄熺骇 + 鍝佽川绛夌骇鎬诲睘鎬�/鎬诲眰绾э級* 鐗规畩灞傦級
+        attrDict[config.SpecAttrID] = (int)((config.SpecAttrValue + config.SpecAttrPerStarAdd * star + GetSpecLVAttrValueOneLayer(quality, lv, config.SpecAttrID, maxLayer)) * layer);
 
         return attrDict;
     }
diff --git a/Main/System/Gubao/GubaoTipWin.cs b/Main/System/Gubao/GubaoTipWin.cs
index d1885fc..5be64e5 100644
--- a/Main/System/Gubao/GubaoTipWin.cs
+++ b/Main/System/Gubao/GubaoTipWin.cs
@@ -55,7 +55,8 @@
         gubaoID = functionOrder;
         if (GubaoManager.Instance.tipType == 0)
         {
-            isFull = false;
+            //鏈嫢鏈夊彧鏄剧ず婊$骇
+            isFull = GubaoManager.Instance.IsActive(gubaoID) ? false : true;
         }
         else if (GubaoManager.Instance.tipType == 1)
         {
@@ -82,8 +83,18 @@
         if (GubaoManager.Instance.tipType == 0)
         {
             basePanel.SetActive(true);
-            fullRect.SetActive(false);
-            changeBtn.SetActive(true);
+            //鏈嫢鏈夊彧鏄剧ず婊$骇
+            if (GubaoManager.Instance.IsActive(gubaoID))
+            {
+                fullRect.SetActive(false);
+                changeBtn.SetActive(true);
+            }
+            else
+            {
+                fullRect.SetActive(true);
+                changeBtn.SetActive(false);
+            }
+
             linePanel.SetActive(true);
             ShowBase();
             ShowSuite();
@@ -121,8 +132,7 @@
         changeText.text = isFull ? Language.Get("Gubao8") : Language.Get("Gubao9");
         mainItemCell.Init(new ItemCellModel(config.UnlockItemID, false, 1));
         mainItemCell.pieceIcon.SetActive(false);
-        mainItemCell.countText.text = lv == 0 ? "" : Language.Get("L1113", isFull ? GubaoLVAttrConfig.GetMaxLV(quality) : lv);
-
+        mainItemCell.countText.text = isFull ? Language.Get("L1113", GubaoLVAttrConfig.GetMaxLV(quality)) : Language.Get("L1113", lv);
         if (GubaoManager.Instance.IsMaxStar(gubaoID))
         {
             processRect.SetActive(false);
@@ -183,7 +193,7 @@
         }
 
         //鐗规畩灞炴�у拰鐗规潈鍙樉绀轰竴涓� 
-        var specAttrDict = !isFull ? GubaoManager.Instance.GetSpecialAttrByGBID(gubaoID, true) : GubaoManager.Instance.GetSpecialMaxAttrByGBID(gubaoID);
+        var specAttrDict = !isFull ? GubaoManager.Instance.GetSpecialAttrSingleLayerByGBID(gubaoID) : GubaoManager.Instance.GetSpecialMaxAttrByGBID(gubaoID);
         if (config.SpecEffType == 0 && config.SpecAttrID != 0)
         {
             specialText.text = PlayerPropertyConfig.GetFullDescription(config.SpecAttrID, specAttrDict[config.SpecAttrID], format);

--
Gitblit v1.8.0