From 89343a7a0909e5244a3b69c4db1294de4536243b Mon Sep 17 00:00:00 2001
From: lcy <1459594991@qq.com>
Date: 星期一, 15 十二月 2025 18:15:22 +0800
Subject: [PATCH] 262 幻境阁系统-客户端 新增仅适用武将解锁的头像和形象的红点移除规则

---
 Main/System/Battle/BattleObject/BattleObject.cs |   64 ++++++++++++++++++++++++--------
 1 files changed, 48 insertions(+), 16 deletions(-)

diff --git a/Main/System/Battle/BattleObject/BattleObject.cs b/Main/System/Battle/BattleObject/BattleObject.cs
index 984cfea..41176c9 100644
--- a/Main/System/Battle/BattleObject/BattleObject.cs
+++ b/Main/System/Battle/BattleObject/BattleObject.cs
@@ -179,6 +179,7 @@
                 long toHp = GeneralDefine.GetFactValue(_refreshInfo.Value, _refreshInfo.ValueEx);
                 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);
@@ -343,14 +344,14 @@
             {
                 PushDropItems(battleHurtParam.battleDrops);
             }
-            battleField.OnObjsDead(new List<HB422_tagMCTurnFightObjDead>() { battleHurtParam.deadPack });
+            battleField.OnObjsDead(new List<BattleDeadPack>() { battleHurtParam.deadPack });
 
         }
         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
             // {
@@ -358,7 +359,7 @@
             {
                 if (!buffMgr.isControled[BattleConst.HardControlGroup])
                 {
-                    battleField.soundManager.PlayEffectSound(teamHero.heroConfig.HitSFX);
+                    battleField.soundManager.PlayEffectSound(teamHero.heroConfig.HitSFX, false);
                     motionBase.PlayAnimation(MotionName.hit, false);
                 }
             }
@@ -377,9 +378,12 @@
         // 搴旂敤琛�閲忓彉鍖�
         teamHero.curHp = hurter.toHp;
         
-        // 鎶ょ浘鍊肩敱buff绯荤粺鑷姩绠$悊锛屼笉闇�瑕佹墜鍔ㄨ缃�
-        // buffMgr浼氭牴鎹湇鍔″櫒鐨凥B428_tagSCBuffRefresh鍖呮洿鏂版姢鐩惧��
-        
+        // foreach (var obj in battleField.battleObjMgr.allBattleObjDict.Values)
+        // {
+        //     Debug.LogError($"[ApplyHurtToTarget] ObjID: {obj.ObjID}, Name: {obj.teamHero.heroConfig.Name}, CurHp: {obj.teamHero.curHp}, MaxHp: {obj.teamHero.maxHp} Skill {battleHurtParam.hB427_TagSCUseSkill.packUID} ");
+        // }
+
+
 #if UNITY_EDITOR
         // 鏈�鍚庝竴鍑绘椂楠岃瘉琛�閲忔槸鍚︿笌鏈嶅姟鍣ㄤ竴鑷�
         if (isLastHit)
@@ -432,16 +436,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()
@@ -456,10 +473,18 @@
     public void OnReborn(HB427_tagSCUseSkill.tagSCUseSkillHurt vNetData)
     {
         // 澶勭悊澶嶆椿閫昏緫
-        teamHero.curHp = GeneralDefine.GetFactValue(vNetData.CurHP, vNetData.CurHPEx);
-        teamHero.isDead = false;
-        heroGo.SetActive(true);
-        motionBase.ResetToIdleAnimation();
+        RebornRecordAction recordAction = new RebornRecordAction(battleField, this, () =>
+        {
+            battleField.OnObjReborn((uint)ObjID);
+
+            teamHero.curHp = GeneralDefine.GetFactValue(vNetData.CurHP, vNetData.CurHPEx);
+            heroRectTrans.anchoredPosition = Vector2.zero;
+            // Debug.LogError("OnReborn " + teamHero.curHp);
+            teamHero.isDead = false;
+            heroGo.SetActive(true);
+            motionBase.ResetForReborn();
+        });
+        battleField.recordPlayer.InsertRecord(recordAction);
     }
 
     // 浼ゅ杩樿鐪� 鏄惁闂伩 鏆村嚮 and so on 闇�瑕佹湁涓�涓狣amageType 鏈嶅姟鍣ㄥ簲璇ヤ細缁�
@@ -600,6 +625,7 @@
                 long toHp = GeneralDefine.GetFactValue(vNetData.Value, vNetData.ValueEx);
                 heroInfoBar.UpdateHP(teamHero.curHp, toHp, teamHero.maxHp, true);
                 teamHero.curHp = newValue;
+                // Debug.LogError("OnObjPropertyRefreshView " + teamHero.curHp);
                 break;
             case PlayerDataType.MaxHP:
                 teamHero.maxHp = newValue;
@@ -696,6 +722,12 @@
         
         // 搴旂敤琛�閲忓彉鍖�
         teamHero.curHp = caster.toHp;
+
+        //  鎵撳嵃鎵�鏈夎鑹茬殑鍚嶅瓧鍜屽綋鍓嶈閲忚窡鎬昏閲�
+        // foreach (var obj in battleField.battleObjMgr.allBattleObjDict.Values)
+        // {
+        //     Debug.LogError($"[ApplyHurtToCaster] ObjID: {obj.ObjID}, Name: {obj.teamHero.heroConfig.Name}, CurHp: {obj.teamHero.curHp}, MaxHp: {obj.teamHero.maxHp} Skill {battleHurtParam.hB427_TagSCUseSkill.packUID} " );
+        // }
         
         // 鎶ょ浘鍊肩敱buff绯荤粺鑷姩绠$悊锛屼笉闇�瑕佹墜鍔ㄨ缃�
         

--
Gitblit v1.8.0