From 83ff2cfc367d3227449fa8414a25541374929ecb Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期四, 29 一月 2026 15:43:50 +0800
Subject: [PATCH] 125 战斗 命格复活支持

---
 Main/System/Battle/BattleObject/MinggeBattleObject.cs |   79 ++++++++++++++++++++++++++++++++++-----
 1 files changed, 69 insertions(+), 10 deletions(-)

diff --git a/Main/System/Battle/BattleObject/MinggeBattleObject.cs b/Main/System/Battle/BattleObject/MinggeBattleObject.cs
index c575e93..35d7aea 100644
--- a/Main/System/Battle/BattleObject/MinggeBattleObject.cs
+++ b/Main/System/Battle/BattleObject/MinggeBattleObject.cs
@@ -8,18 +8,19 @@
 /// </summary>
 public class MinggeBattleObject : BattleObject
 {
+    public TeamMingge teamMingge { get; private set; }
+    
     public MinggeBattleObject(BattleField _battleField) : base(_battleField)
     {
     }
 
-    public override void Init(TeamHero _teamHero, BattleCamp _camp)
+    public virtual void Init(TeamBase teamBase, TeamMingge _teamMingge, BattleCamp _camp)
     {
-        teamHero = _teamHero;
+        teamMingge = _teamMingge;
         Camp = _camp;
+        ObjID = teamMingge.ObjID;
         
-        // 鍛芥牸鍙渶瑕� buff 绠$悊鍣ㄧ敤浜庢妧鑳芥晥鏋�
-        buffMgr = new BattleObjectBuffMgr();
-        buffMgr.Init(this);
+        // 鍛芥牸涓嶉渶瑕� buff 绠$悊鍣紙鍛芥牸閲婃斁鎶�鑳戒絾鑷韩涓嶄細鏈� buff锛�
         
         layerMgr = new BattleObjectLayerMgr();
         layerMgr.Init(this);
@@ -42,11 +43,38 @@
 
     public override void Destroy()
     {
-        if (buffMgr != null)
-        {
-            buffMgr.Release();
-        }
+        // 鍛芥牸娌℃湁闇�瑕佹竻鐞嗙殑璧勬簮
     }
+
+    // ============ 瀹炵幇鎶借薄璁块棶鏂规硶 ============
+    
+    public override BattleObjectBuffMgr GetBuffMgr() => null; // 鍛芥牸涓嶆湁 buff 绯荤粺
+    
+    public override int GetPositionNum() => teamMingge.positionNum;
+    public override float GetModelScale() => teamMingge.modelScale;
+    public override string GetName() => teamMingge.name;
+    
+    protected override bool GetIsStunned() => teamMingge.isStunned;
+    protected override bool GetIsFrozen() => teamMingge.isFrozen;
+    protected override bool GetIsStoned() => teamMingge.isStoned;
+    protected override bool GetIsSlient() => teamMingge.isSlient;
+    protected override bool GetIsDisarmed() => teamMingge.isDisarmed;
+    protected override bool GetIsInvincible() => teamMingge.isInvinceble;
+    protected override bool GetIsDead() => teamMingge.isDead;
+    public override int GetRage() => teamMingge.rage;
+    
+    protected override void ApplyCasterHpChange(long newHp)
+    {
+        // 鍛芥牸娌℃湁琛�閲忥紝蹇界暐
+    }
+    
+    public override long GetCurHp() => 0;
+    public override long GetMaxHp() => 0;
+    public override void SetCurHp(long value) { }
+    public override void SetIsDead(bool value) { }
+    
+    public override int GetNPCID() => 0;
+    public override long GetFightPower() => 0;
 
     // ============ 鍔ㄧ敾鐩稿叧鏂规硶瀹炵幇锛堝懡鏍兼病鏈夊姩鐢伙級 ============
     
@@ -62,8 +90,39 @@
     
     public override Spine.TrackEntry PlaySkillAnimation(SkillConfig skillConfig, SkillBase skillBase, bool isCounter, Action onComplete)
     {
-        // 鍛芥牸娌℃湁鎶�鑳藉姩鐢伙紝鐩存帴瀹屾垚
+        // 鍛芥牸娌℃湁鎶�鑳藉姩鐢伙紝绔嬪嵆瑙﹀彂鎵�鏈夊抚浜嬩欢
+        int loopCount = skillConfig.LoopCount + 1; //榛樿浼氭湁涓�娆�
+        int frameCount = skillConfig.ActiveFrames.Length;
+        
+        // 1. 鎶�鑳藉紑濮�
+        skillBase.OnSkillStart();
+        
+        // 2. 鍓嶆憞缁撴潫
+        skillBase.OnStartSkillFrameEnd();
+        
+        // 3. 寰幆鎵ц涓憞
+        int triggerCount = 0;
+        for (int currentLoop = 0; currentLoop < loopCount; currentLoop++)
+        {
+            // 姣忎釜 loop 寮�濮嬫椂璋冪敤 OnMiddleFrameStart
+            skillBase.OnMiddleFrameStart(currentLoop);
+            
+            // 瑙﹀彂璇� loop 鐨勬墍鏈� ActiveFrame
+            for (int i = 0; i < frameCount; i++)
+            {
+                skillBase.OnMiddleFrameEnd(currentLoop, triggerCount++);
+            }
+        }
+        
+        // 4. 鍚庢憞寮�濮�
+         skillBase.OnFinalFrameStart();
+        
+        // 5. 瀹屾垚鍥炶皟
         onComplete?.Invoke();
+        
+        // 6. 鍚庢憞缁撴潫
+        skillBase.OnFinalFrameEnd();
+        
         return null;
     }
     

--
Gitblit v1.8.0