From ed9bf64c03bf5fee5e115645de5a975baaa9041d Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期五, 09 一月 2026 11:04:53 +0800
Subject: [PATCH] 125 战斗 修改死亡表现 带动作的子技能同时触发导致的卡死

---
 Main/System/Battle/BattleField/RecordActions/DeathRecordAction.cs |   73 ++++++++++++++++++++++++++++++++++++
 1 files changed, 72 insertions(+), 1 deletions(-)

diff --git a/Main/System/Battle/BattleField/RecordActions/DeathRecordAction.cs b/Main/System/Battle/BattleField/RecordActions/DeathRecordAction.cs
index bcd04bd..c46e151 100644
--- a/Main/System/Battle/BattleField/RecordActions/DeathRecordAction.cs
+++ b/Main/System/Battle/BattleField/RecordActions/DeathRecordAction.cs
@@ -15,10 +15,28 @@
 
     protected Dictionary<int, bool> dropStateDict = new Dictionary<int, bool>();
 
-    public DeathRecordAction(BattleField _battleField, List<BattleDeadPack> _deadPackList)
+    protected RecordAction causingRecordAction = null;
+
+    protected bool hasDeathTriggerSkill = false;
+
+    public DeathRecordAction(BattleField _battleField, List<BattleDeadPack> _deadPackList, RecordAction _causingRecordAction = null)
         : base(RecordActionType.Death, _battleField, null)
     {
         deadPackList = _deadPackList;
+        causingRecordAction = _causingRecordAction;
+        CheckHasDeathTriggerSkill();
+    }
+
+    protected void CheckHasDeathTriggerSkill()
+    {
+        foreach (var battleDeadPack in deadPackList)
+        {
+            if (battleDeadPack.deadTriggerSkill != null)
+            {
+                hasDeathTriggerSkill = true;
+                break;
+            }
+        }
     }
 
 
@@ -42,6 +60,10 @@
                     if (null != skillAction)
                     {
                         deathActionDict.Add(battleDeadPack, skillAction);
+                        //  姝讳骸瑙﹀彂鎶�鑳介兘璁剧疆WaitingPlay=true锛岀瓑寰呯埗鑺傜偣鍔ㄤ綔瀹屾垚
+                        //  濡傛灉DeathRecordAction鏈夌埗鑺傜偣锛堝鑷存浜$殑鎶�鑳斤級锛屽垯绛夊緟閭d釜鐖惰妭鐐�
+                        //  鍚﹀垯绛夊緟DeathRecordAction鏈韩
+                        battleField.recordPlayer.ImmediatelyPlay(skillAction, causingRecordAction == null ? this : causingRecordAction, true);
                     }
                 }
                 else
@@ -78,6 +100,11 @@
                 deathActionDict.Remove(key);
             }
 
+            if (0 == deathActionDict.Count)
+            {
+                hasDeathTriggerSkill = false;
+            }
+
             int completeNum = 0;
 
             foreach (var kv in deadActionStatesDict)
@@ -90,9 +117,18 @@
 
             if (completeNum == deadPackList.Count)
             {
+                isActionCompleted = true;
                 isFinish = true;
             }
         }
+    }
+
+
+
+    //  閲嶅啓IsActionCompleted锛屾浜″姩浣滄槸鍚﹀畬鎴�
+    public override bool IsActionCompleted()
+    {
+        return isActionCompleted || isFinish;
     }
 
     private Func<bool> CreateDeadActionState(BattleDeadPack deadPack, bool withoutAnime = false)
@@ -166,4 +202,39 @@
             deadObj.PerformDrop();
         }
     }
+
+    protected bool HasDeathTriggerSkill()
+    {
+        return hasDeathTriggerSkill;
+    }
+
+    public override bool CanStartExecution()
+    {
+        //  濡傛灉涓嶆槸WaitingPlay妯″紡锛岀洿鎺ュ彲浠ユ墽琛�
+        if (!isWaitingPlay)
+        {
+            return true;
+        }
+        
+        //  濡傛灉娌℃湁鐖惰妭鐐癸紝涔熷彲浠ユ墽琛�
+        if (parentAction == null)
+        {
+            return true;
+        }
+
+        //  鍙互鍏堟墽琛屾病鏈夋浜¤Е鍙戞妧鑳界殑姝讳骸鍔ㄤ綔
+        if (!HasDeathTriggerSkill())
+        {
+            return true;
+        }
+        
+        //  WaitingPlay妯″紡涓嬶紝闇�瑕佺瓑寰呯洿鎺ョ埗鑺傜偣鐨勫姩浣滃畬鎴愶紙涓嶇鐖惰妭鐐规槸鍚aitingPlay锛�
+        if (!parentAction.IsActionCompleted())
+        {
+            BattleDebug.LogError($"RecordAction.CanStartExecution: {this.GetType().Name} 绛夊緟鐖惰妭鐐� {parentAction.GetType().Name} 鍔ㄤ綔瀹屾垚");
+            return false;
+        }
+        
+        return true;
+    }
 }
\ No newline at end of file

--
Gitblit v1.8.0