From 3e2a34a04bc4a8a2827ca0407a0f7635bce56722 Mon Sep 17 00:00:00 2001
From: lcy <1459594991@qq.com>
Date: 星期四, 27 十一月 2025 11:45:36 +0800
Subject: [PATCH] 362 【付费内容】特权卡-补充 支持配表设置跳过战斗

---
 Main/System/Battle/BattleConst.cs   |    8 ++++
 Main/System/Battle/BattleManager.cs |   16 +++++--
 Main/System/Battle/BaseBattleWin.cs |   47 ++++++++++++++++++++---
 3 files changed, 60 insertions(+), 11 deletions(-)

diff --git a/Main/System/Battle/BaseBattleWin.cs b/Main/System/Battle/BaseBattleWin.cs
index 1880e9e..604ec76 100644
--- a/Main/System/Battle/BaseBattleWin.cs
+++ b/Main/System/Battle/BaseBattleWin.cs
@@ -194,17 +194,49 @@
         if (!FuncOpen.Instance.IsFuncOpen(BattleManager.Instance.passFuncId, true))
             return;
 
-        //涓荤嚎Boss涔嬪鐨勬垬鏂楁敮鎸佹案涔呯壒鏉冭烦杩�
+        int passRound = BattleManager.Instance.defaultPassRound;
         var name = battleField.ToString();
-        bool isStoryBossBattleField = name == "StoryBossBattleField";
+        
+        // 妫�鏌ユ槸鍚︿负姘镐箙鐗规潈鍗$帺瀹�
         bool hasForeverPrivilege = InvestModel.Instance.IsInvested(InvestModel.foreverCardType);
-        if (hasForeverPrivilege && !isStoryBossBattleField)
+
+        if (hasForeverPrivilege)
         {
-            battleField.ForceFinish();
-            return;
+            // 姘镐箙鐗规潈鍗$帺瀹堕�昏緫
+            if (BattleConst.FieldNameToIndex.ContainsKey(name))
+            {
+                int index = BattleConst.FieldNameToIndex[name];
+                if (BattleManager.Instance.foreverPrivilegePassDict.ContainsKey(index))
+                {
+                    passRound = BattleManager.Instance.foreverPrivilegePassDict[index];
+                }
+                else
+                {
+                    // 鏈厤缃殑鎴樺満绫诲瀷锛屼娇鐢ㄦ櫘閫氱帺瀹惰鍒�
+                    if (BattleManager.Instance.passDict.ContainsKey(index))
+                    {
+                        passRound = BattleManager.Instance.passDict[index];
+                    }
+                    // 鍚﹀垯浣跨敤榛樿閰嶇疆
+                }
+            }
+            // 濡傛灉鎴樺満绫诲瀷涓嶅湪 FieldNameToIndex 涓紝浣跨敤榛樿閰嶇疆
+        }
+        else
+        {
+            // 鏅�氱帺瀹堕�昏緫
+            if (BattleConst.FieldNameToIndex.ContainsKey(name))
+            {
+                int index = BattleConst.FieldNameToIndex[name];
+                if (BattleManager.Instance.passDict.ContainsKey(index))
+                {
+                    passRound = BattleManager.Instance.passDict[index];
+                }
+                // 鍚﹀垯浣跨敤榛樿閰嶇疆
+            }
+            // 濡傛灉鎴樺満绫诲瀷涓嶅湪 FieldNameToIndex 涓紝浣跨敤榛樿閰嶇疆
         }
 
-        int passRound = BattleManager.Instance.passRound;
         int nowRound = battleField.round;
         if (nowRound < passRound)
         {
@@ -214,6 +246,9 @@
         battleField.ForceFinish();
     }
 
+
+
+
     /// <summary>
     /// 鏀瑰彉閫熷害
     /// </summary>
diff --git a/Main/System/Battle/BattleConst.cs b/Main/System/Battle/BattleConst.cs
index daf90bc..93e01e6 100644
--- a/Main/System/Battle/BattleConst.cs
+++ b/Main/System/Battle/BattleConst.cs
@@ -22,6 +22,14 @@
         { "TianziBillboradBattleField", "TianziBillboradBattleWin" },
     };
 
+    public static Dictionary<string, int> FieldNameToIndex = new Dictionary<string, int>()
+    {
+        { "StoryBossBattleField", 1 },
+        { "ArenaBattleField", 2 },
+        { "BoneBattleField", 3},
+        { "TianziBillboradBattleField", 4 },
+    };
+
     public const int BattleStartEffectID = 1001; // Example effect ID for battle start
 
     public const int skillMotionFps = 30;
diff --git a/Main/System/Battle/BattleManager.cs b/Main/System/Battle/BattleManager.cs
index 2d4093e..6257ef5 100644
--- a/Main/System/Battle/BattleManager.cs
+++ b/Main/System/Battle/BattleManager.cs
@@ -26,7 +26,11 @@
     }
     public readonly int[] speedIndexfuncIdArr = new int[] { 34, 35, 36 };  // 鎴樻枟鍊嶆暟瀵瑰簲鐨勫姛鑳絀D
     public readonly int passFuncId = 33;    // 璺宠繃鎴樻枟瀵瑰簲鐨勫姛鑳絀D
-    public int passRound;   // 瓒呰繃X鍥炲悎鍙烦杩�
+
+    public int defaultPassRound;   
+    public Dictionary<int, int> passDict = new Dictionary<int, int>(); 
+    public Dictionary<int, int> foreverPrivilegePassDict = new Dictionary<int, int>();
+
     public int fightGuideID;
     public int fightGuideMainLevelLimit;
     public int fightGuideNoClickSeconds;
@@ -46,7 +50,7 @@
         DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += OnPlayerLoginOk;
         DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += BeforePlayerInit;
         ParseConfig();
-        
+
     }
 
     void ParseConfig()
@@ -61,7 +65,9 @@
         challengeBossGuides = JsonMapper.ToObject<int[]>(config.Numerical4);
 
         config = FuncConfigConfig.Get("BattleButton");
-        passRound= int.Parse(config.Numerical1);
+        defaultPassRound = int.Parse(config.Numerical1);
+        passDict = ConfigParse.ParseIntDict(config.Numerical2);
+        foreverPrivilegePassDict = ConfigParse.ParseIntDict(config.Numerical3);
     }
 
 
@@ -269,9 +275,9 @@
             packQueue.Enqueue(pack);
         }
 
-    
 
-            // packQueue = new Queue<GameNetPackBasic>(newPackList);
+
+        // packQueue = new Queue<GameNetPackBasic>(newPackList);
 
         DistributeNextPackage();
     }

--
Gitblit v1.8.0