From aa84cb62bebb9c8a4e586bcc1ec28eb7a16a8860 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期一, 26 一月 2026 18:10:34 +0800
Subject: [PATCH] 422 子 【内政】命格系统 / 【内政】命格系统-客户端

---
 Main/System/Battle/BattleObject/BattleObject.cs |  100 +++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 78 insertions(+), 22 deletions(-)

diff --git a/Main/System/Battle/BattleObject/BattleObject.cs b/Main/System/Battle/BattleObject/BattleObject.cs
index d0a4b6e..7e84f50 100644
--- a/Main/System/Battle/BattleObject/BattleObject.cs
+++ b/Main/System/Battle/BattleObject/BattleObject.cs
@@ -72,6 +72,8 @@
     private List<HB405_tagMCAddExp> hB405_tagMCAddExps = new List<HB405_tagMCAddExp>();
     public BattleHeroInfoBar heroInfoBar;
 
+    public bool isReborning = false;
+
     public BattleObject(BattleField _battleField)
     {
         battleField = _battleField;
@@ -177,13 +179,19 @@
         {
             case PlayerDataType.HP:
                 long toHp = GeneralDefine.GetFactValue(_refreshInfo.Value, _refreshInfo.ValueEx);
-                heroInfoBar.UpdateHP(teamHero.curHp, toHp, teamHero.maxHp, false);
+                if (!IsTianziBoss())
+                {
+                    heroInfoBar.UpdateHP(teamHero.curHp, toHp, teamHero.maxHp, false);
+                }
                 teamHero.curHp = GeneralDefine.GetFactValue(_refreshInfo.Value, _refreshInfo.ValueEx);
                 // Debug.LogError("OnObjInfoRefresh " + teamHero.curHp);
                 break;
             case PlayerDataType.MaxHP:
                 teamHero.maxHp = GeneralDefine.GetFactValue(_refreshInfo.Value, _refreshInfo.ValueEx);
-                heroInfoBar.UpdateHP(teamHero.curHp, teamHero.curHp, teamHero.maxHp, false);
+                if (!IsTianziBoss())
+                {
+                    heroInfoBar.UpdateHP(teamHero.curHp, teamHero.curHp, teamHero.maxHp, false);
+                }
                 break;
             case PlayerDataType.XP:
                 long toXp = GeneralDefine.GetFactValue(_refreshInfo.Value, _refreshInfo.ValueEx);
@@ -307,8 +315,9 @@
         return true;
     }
 
-    public virtual void Hurt(BattleHurtParam battleHurtParam)
+    public virtual DeathRecordAction Hurt(BattleHurtParam battleHurtParam, RecordAction _causingRecordAction = null)
     {
+        DeathRecordAction recordAction = null;
         bool isLastHit = battleHurtParam.hitIndex >= battleHurtParam.skillConfig.DamageDivide.Length - 1;
         bool firstHit = battleHurtParam.hitIndex == 0;
         
@@ -327,6 +336,10 @@
             if (isLastHit)
             {
                 DodgeFinishAction dodgeFinish = new DodgeFinishAction(battleField, this);
+                // 銆愪娇鐢� BattleField.recordPlayer銆�
+                // 鍘熷洜锛氶棯閬垮畬鎴愬姩浣滄槸鐩爣瑙掕壊鐨勭嫭绔嬭涓猴紝涓嶆槸鎶�鑳藉唴閮ㄤ骇鐢熺殑
+                // 铏界劧鏄湪Hurt杩囩▼涓Е鍙戯紝浣嗘槸闂伩鍔ㄤ綔鏈韩鏄洰鏍囩殑鍙嶅簲锛屽簲璇ョ敱涓籖ecordPlayer绠$悊
+                // 浣跨敤InsertRecord鍙互鎻掑埌闃熷垪鏈�鍓嶉潰锛屼繚璇侀棯閬胯〃鐜扮殑浼樺厛绾�
                 battleField.recordPlayer.InsertRecord(dodgeFinish);
             }
 
@@ -344,14 +357,14 @@
             {
                 PushDropItems(battleHurtParam.battleDrops);
             }
-            battleField.OnObjsDead(new List<HB422_tagMCTurnFightObjDead>() { battleHurtParam.deadPack });
+            recordAction = battleField.OnObjsDead(new List<BattleDeadPack>() { battleHurtParam.deadPack }, _causingRecordAction);
 
         }
         else
         {
             if (dmgInfo.IsType(DamageType.Block))
             {
-                battleField.battleEffectMgr.PlayEffect(this, BattleConst.BlockEffectID, heroRectTrans, Camp);
+                battleField.battleEffectMgr.PlayEffect(this, BattleConst.BlockEffectID, heroRectTrans, Camp, teamHero.modelScale);
             }
             // else
             // {
@@ -359,13 +372,15 @@
             {
                 if (!buffMgr.isControled[BattleConst.HardControlGroup])
                 {
-                    battleField.soundManager.PlayEffectSound(teamHero.heroConfig.HitSFX);
+                    battleField.soundManager.PlayEffectSound(teamHero.heroConfig.HitSFX, false);
                     motionBase.PlayAnimation(MotionName.hit, false);
                 }
             }
             // }
 
         }
+
+        return recordAction;
     }
 
     /// <summary>
@@ -436,16 +451,29 @@
         battleField.battleTweenMgr.OnPlayTween(tween);
     }
 
-    public virtual void OnDeath(Action _onDeathAnimationComplete)
+    public virtual void OnDeath(Action _onDeathAnimationComplete, bool withoutAnime = false)
     {
         buffMgr.RemoveAllBuff();
-        battleField.soundManager.PlayEffectSound(teamHero.heroConfig.DeathSFX);
-        motionBase.PlayDeadAnimation(() =>
+        battleField.soundManager.PlayEffectSound(teamHero.heroConfig.DeathSFX, false);
+        if (withoutAnime)
         {
-            teamHero.isDead = true;
-            OnDeadAnimationComplete();
+            SetDeath();
             _onDeathAnimationComplete?.Invoke();
-        });
+        }
+        else
+        {
+            motionBase.PlayDeadAnimation(() =>
+            {
+                SetDeath();
+                _onDeathAnimationComplete?.Invoke();
+            });
+        }
+    }
+
+    public void SetDeath()
+    {
+        teamHero.isDead = true;
+        OnDeadAnimationComplete();
     }
 
     protected virtual void OnDeadAnimationComplete()
@@ -457,15 +485,35 @@
         buffMgr.RemoveAllBuff();
     }
 
-    public void OnReborn(HB427_tagSCUseSkill.tagSCUseSkillHurt vNetData)
+    //  閲婃斁鑰呭氨鏄娲昏�呮椂璋冪敤
+    public void PreReborn(bool reviveSelf = false)
     {
-        // 澶勭悊澶嶆椿閫昏緫
-        teamHero.curHp = GeneralDefine.GetFactValue(vNetData.CurHP, vNetData.CurHPEx);
-        // Debug.LogError("OnReborn " + teamHero.curHp);
-        teamHero.isDead = false;
         heroGo.SetActive(true);
-        motionBase.ResetToIdleAnimation();
+        motionBase.skeletonAnim.skeleton.A = 0f;
+        motionBase.skeletonAnim.LateUpdate();
+        heroRectTrans.anchoredPosition = Vector2.zero;
+        motionBase.ResetForReborn(reviveSelf);
     }
+
+    //  澶嶆椿action
+    public void OnReborn(HB427_tagSCUseSkill.tagSCUseSkillHurt vNetData, bool reviveSelf = false, RecordAction parentAction = null)
+    {
+        isReborning = true;
+        heroGo.SetActive(true);
+        motionBase.ResetForReborn(reviveSelf);
+        heroRectTrans.anchoredPosition = Vector2.zero;
+        motionBase.skeletonAnim.skeleton.A = 0f;
+        motionBase.skeletonAnim.LateUpdate();
+
+    }
+
+    public void AfterReborn()
+    {
+        //  娓呯┖鎵�鏈�
+        motionBase.ResetForReborn(false);
+        isReborning = false;
+    }
+
 
     // 浼ゅ杩樿鐪� 鏄惁闂伩 鏆村嚮 and so on 闇�瑕佹湁涓�涓狣amageType 鏈嶅姟鍣ㄥ簲璇ヤ細缁�
     protected virtual BattleDmgInfo PopDamage(BattleHurtParam battleHurtParam)
@@ -496,7 +544,7 @@
     protected virtual BattleDmgInfo PopDamageForCaster(BattleHurtParam battleHurtParam)
     {
         // 浼犲叆 isCasterView=true 琛ㄧず杩欐槸鏂芥硶鑰呰瑙�
-        BattleDmgInfo battleDmgInfo = new BattleDmgInfo(battleField.guid, battleHurtParam, isCasterView: true);
+        BattleDmgInfo battleDmgInfo = new BattleDmgInfo(battleField.guid, battleHurtParam, _isCasterView: true);
         
         BattleObject boss = battleField.FindBoss();
         if (boss != null && battleField.MapID == 30020 && boss.ObjID == this.ObjID)
@@ -535,8 +583,9 @@
         heroGo.SetActive(true);
         motionBase.HaveRest();
         heroRectTrans.anchoredPosition = Vector2.zero;
+        heroInfoBar.HaveRest();
+        isReborning = false;
 
-        heroInfoBar.SetActive(false);
         SetFront();
     }
 
@@ -603,13 +652,20 @@
         {
             case PlayerDataType.HP:
                 long toHp = GeneralDefine.GetFactValue(vNetData.Value, vNetData.ValueEx);
-                heroInfoBar.UpdateHP(teamHero.curHp, toHp, teamHero.maxHp, true);
+                bool isMinus = teamHero.curHp > toHp;
+                if (!IsTianziBoss())
+                {
+                    heroInfoBar.UpdateHP(teamHero.curHp, toHp, teamHero.maxHp, false);
+                }
                 teamHero.curHp = newValue;
                 // Debug.LogError("OnObjPropertyRefreshView " + teamHero.curHp);
                 break;
             case PlayerDataType.MaxHP:
                 teamHero.maxHp = newValue;
-                heroInfoBar.UpdateHP(teamHero.curHp, teamHero.curHp, teamHero.maxHp, true);
+                if (!IsTianziBoss())
+                {
+                    heroInfoBar.UpdateHP(teamHero.curHp, teamHero.curHp, teamHero.maxHp, false);
+                }
                 break;
             case PlayerDataType.XP:
                 long toXp = newValue;

--
Gitblit v1.8.0