From eb27e5fd31f73b998a4bbd85511a31e40b8c61b7 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期五, 21 十一月 2025 17:03:47 +0800
Subject: [PATCH] 0312 关闭游戏内日志

---
 Main/System/Battle/Skill/SkillBase.cs |   43 ++++++++++++++++++++++++++++++++++++-------
 1 files changed, 36 insertions(+), 7 deletions(-)

diff --git a/Main/System/Battle/Skill/SkillBase.cs b/Main/System/Battle/Skill/SkillBase.cs
index 7fb0d75..4af6a18 100644
--- a/Main/System/Battle/Skill/SkillBase.cs
+++ b/Main/System/Battle/Skill/SkillBase.cs
@@ -17,18 +17,18 @@
                                                         189f / 255f);
 
     protected SkillEffect skillEffect;
-    protected HB427_tagSCUseSkill tagUseSkillAttack;
+    public HB427_tagSCUseSkill tagUseSkillAttack;
     public SkillConfig skillConfig;
     protected bool isFinished = false;
     protected BattleField battleField = null; // 鎴樺満
     protected RectTransform targetNode = null; // 鐩爣鑺傜偣
-    protected BattleObject caster = null; // 鏂芥硶鑰�
+    public BattleObject caster = null; // 鏂芥硶鑰�
     protected List<GameNetPackBasic> packList;
     protected List<SkillRecordAction> otherSkillActionList = new List<SkillRecordAction>();
     protected List<H0704_tagRolePackRefresh> dropPackList = new List<H0704_tagRolePackRefresh>();
     protected List<HB405_tagMCAddExp> expPackList = new List<HB405_tagMCAddExp>();
     protected bool moveFinished = false;
-    public int fromSkillId;
+    public SkillBase fromSkill;
     public bool isPlay = false;
 
     private float MoveSpeed = 750f;
@@ -51,6 +51,26 @@
         tagUseSkillAttack = vNetData;
         battleField = _battleField;
         packList = _packList;
+
+        SafetyCheck();
+    }
+
+    private void SafetyCheck()
+    {
+        bool safety = caster != null 
+                        && skillConfig != null 
+                        && tagUseSkillAttack != null 
+                        && battleField != null
+                        && caster.IsDead() == false;
+
+        
+        if (!safety)
+        {
+            Debug.LogError("SkillBase SafetyCheck failed! Caster or SkillConfig or TagUseSkillAttack or BattleField is null, or Caster is dead.");
+            ForceFinished();
+        }
+
+        
     }
 
     // 鎶�鑳借繍琛屼富閫昏緫锛氬鐞嗘妧鑳芥晥鏋滃拰鍏朵粬鎶�鑳藉姩浣�
@@ -219,7 +239,7 @@
             return;
         }
 
-        int mainTargetPosNum = BattleUtility.GetMainTargetPositionNum(caster, tagUseSkillAttack.HurtList.ToList(), skillConfig);
+        int mainTargetPosNum = BattleUtility.GetMainTargetPositionNum(this, caster, tagUseSkillAttack.HurtList.ToList(), skillConfig);
         BattleCamp battleCamp = skillConfig.TagFriendly != 0 ? caster.Camp : caster.GetEnemyCamp();
         RectTransform targetTrans = battleField.GetTeamNode(battleCamp, mainTargetPosNum);
 
@@ -340,14 +360,23 @@
     {
         HandleDead();
         
-        skillEffect = SkillEffectFactory.CreateSkillEffect(caster, skillConfig, tagUseSkillAttack);
+        skillEffect = SkillEffectFactory.CreateSkillEffect(this, caster, skillConfig, tagUseSkillAttack);
         skillEffect.Play(OnHitTargets);
         foreach (var subSkillPack in tagUseSkillAttack.subSkillList)
         {
             SkillRecordAction recordAction = CustomHB426CombinePack.CreateSkillAction(battleField.guid, new List<GameNetPackBasic>() { subSkillPack });
+            recordAction.fromSkill = this;
             otherSkillActionList.Add(recordAction);
             battleField.recordPlayer.ImmediatelyPlay(recordAction);
         }
+        foreach (var subCombinePack in tagUseSkillAttack.subSkillCombinePackList)
+        {
+            SkillRecordAction recordAction = CustomHB426CombinePack.CreateSkillAction(battleField.guid, subCombinePack.packList);
+            recordAction.fromSkill = this;
+            otherSkillActionList.Add(recordAction);
+            battleField.recordPlayer.ImmediatelyPlay(recordAction);
+        }
+
         isPlay = true;
     }
 
@@ -874,7 +903,7 @@
             if (pack is CustomHB426CombinePack combinePack && combinePack.startTag.Tag.StartsWith("Skill_"))
             {
                 var otherSkillAction = combinePack.CreateSkillAction();
-                otherSkillAction.fromSkillId = skillConfig.SkillID;
+                otherSkillAction.fromSkill = this;
                 otherSkillAction.ForceFinish();
             }
             else
@@ -955,7 +984,7 @@
             {
                 BattleDebug.LogError("other skill casting " + combinePack.startTag.Tag);
                 var otherSkillAction = combinePack.CreateSkillAction();
-                otherSkillAction.fromSkillId = skillConfig.SkillID;
+                otherSkillAction.fromSkill = this;
                 otherSkillActionList.Add(otherSkillAction);
                 return false;
             }

--
Gitblit v1.8.0