From a6253e0b49b184a13887caa51955db70819d4199 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期二, 27 一月 2026 18:49:41 +0800
Subject: [PATCH] 125 战斗 RecordAction关系名字重命名 修复死亡技能所导致卡死的问题
---
Main/System/Battle/Skill/SkillBase.cs | 67 +++++++++++++++++++++++----------
1 files changed, 47 insertions(+), 20 deletions(-)
diff --git a/Main/System/Battle/Skill/SkillBase.cs b/Main/System/Battle/Skill/SkillBase.cs
index 4919082..b501bfb 100644
--- a/Main/System/Battle/Skill/SkillBase.cs
+++ b/Main/System/Battle/Skill/SkillBase.cs
@@ -35,7 +35,7 @@
public bool isPlay = false;
// 鐖禦ecordAction锛圫killRecordAction锛夛紝鐢ㄤ簬瀛愭妧鑳藉缓绔嬬埗瀛愬叧绯�
- protected RecordAction parentRecordAction;
+ protected SkillRecordAction ownRecordAction;
// 鎶�鑳藉姩鐢绘槸鍚︽挱鏀惧畬鎴愶紙閽堝鏈夊姩鐢荤殑鎶�鑳斤級
protected bool isMotionCompleted = false;
@@ -73,9 +73,9 @@
}
// 璁剧疆鐖禦ecordAction
- public void SetParentRecordAction(RecordAction recordAction)
+ public void SetOwnRecordAction(SkillRecordAction recordAction)
{
- parentRecordAction = recordAction;
+ ownRecordAction = recordAction;
}
#if UNITY_EDITOR
@@ -513,6 +513,10 @@
{
break;
}
+ if (ssc.SkillType == 8)
+ {
+ break;
+ }
SkillRecordAction skillRecordAction = CustomHB426CombinePack.CreateSkillAction(battleField.guid, new List<GameNetPackBasic> { skillPack });
allSubSkills.Add((skillPack.packUID, skillRecordAction));
removePackList.Add(pack);
@@ -530,9 +534,20 @@
{
break;
}
+
+ if (ssc.SkillType == 8)
+ {
+ break;
+ }
+
SkillRecordAction skillRecordAction = combinePack.CreateSkillAction();
allSubSkills.Add((sp.packUID, skillRecordAction));
removePackList.Add(pack);
+
+ if (skillRecordAction.useParentRecordPlayer)
+ {
+ break;
+ }
}
}
@@ -546,11 +561,13 @@
foreach (var (packUID, recordAction) in allSubSkills)
{
- battleField.recordPlayer.ImmediatelyPlay(recordAction);
-
- if (recordAction.IsNeedWaiting())
+ if (recordAction.useParentRecordPlayer)
{
- currentWaitingSkill.Add(recordAction);
+ ownRecordAction.GetInnerRecordPlayer().PlayRecord(recordAction, ownRecordAction);
+ }
+ else
+ {
+ ownRecordAction.GetInnerRecordPlayer().ImmediatelyPlay(recordAction);
}
}
}
@@ -814,12 +831,12 @@
#endif
// 鍏堣皟鐢ㄧ洰鏍囧彈浼�
- DeathRecordAction recordAc = target.Hurt(hurtParam, parentRecordAction);
+ DeathRecordAction recordAc = target.Hurt(hurtParam, ownRecordAction);
if (null != recordAc)
{
tempDeadPackList.Remove(hurtParam.hurter.hurtObj.ObjID);
- battleField.recordPlayer.ImmediatelyPlay(recordAc, parentRecordAction, true);
+ ownRecordAction.GetInnerRecordPlayer().ImmediatelyPlay(recordAc, ownRecordAction, true);
currentWaitingSkill.Add(recordAc);
}
@@ -909,7 +926,7 @@
// 銆愪娇鐢� parentRecordAction.innerRecordPlayer銆�
// 鍘熷洜锛欻P鍒锋柊鍖呮槸鎶�鑳藉唴閮ㄤ骇鐢熺殑锛屽簲璇ョ敱褰撳墠SkillRecordAction鐨刬nnerRecordPlayer绠$悊
// 杩欐牱鍙互纭繚HP鍒锋柊涓庢妧鑳界殑鐢熷懡鍛ㄦ湡缁戝畾锛孎orceFinish鏃朵竴骞跺鐞�
- PackageRegeditEx.DistributeToRecordAction(refreshPack, parentRecordAction);
+ PackageRegeditEx.DistributeToRecordAction(refreshPack, ownRecordAction);
packList.Remove(refreshPack);
}
}
@@ -975,7 +992,7 @@
// 銆愪娇鐢� parentRecordAction.innerRecordPlayer銆�
// 鍘熷洜锛氭帀钀藉寘鏄妧鑳芥晥鏋滅殑涓�閮ㄥ垎锛屽簲璇ョ敱褰撳墠SkillRecordAction绠$悊
// 鎺夎惤鍖呯殑鍒嗗彂涓庢妧鑳藉畬鎴愮粦瀹氾紝纭繚鍦ㄦ妧鑳紽orceFinish鏃舵纭鐞�
- PackageRegeditEx.DistributeToRecordAction(_dropPack, parentRecordAction);
+ PackageRegeditEx.DistributeToRecordAction(_dropPack, ownRecordAction);
packList.Remove(_dropPack);
}
@@ -1233,6 +1250,7 @@
return false;
}
+
// 妫�鏌ユ渶缁堝畬鎴愮姸鎬�
if (isFinished && moveFinished)
{
@@ -1243,7 +1261,7 @@
}
// 濡傛灉鑷繁鍐呴儴鐨剅ecora action鐨� inner record player杩樻湁娌℃墽琛屽畬鐨勫寘 涔熸槸杩斿洖false
- if (parentRecordAction != null && parentRecordAction.GetInnerRecordPlayer().IsPlaying())
+ if (ownRecordAction != null && ownRecordAction.GetInnerRecordPlayer().IsPlaying())
{
return false;
}
@@ -1254,16 +1272,16 @@
battleField.RemoveCastingSkill(caster.ObjID, this);
// 浼犻�抪arentRecordAction锛岃姝讳骸鎶�鑳界瓑寰呭綋鍓嶆妧鑳藉畬鎴�
- DeathRecordAction recordAction = battleField.OnObjsDead(new List<BattleDeadPack>(tempDeadPackList.Values));
+ DeathRecordAction recordAction = battleField.OnObjsDead(new List<BattleDeadPack>(tempDeadPackList.Values), null, ownRecordAction);
if (null != recordAction)
{
- parentRecordAction.GetInnerRecordPlayer().ImmediatelyPlay(recordAction);
+ ownRecordAction.GetInnerRecordPlayer().ImmediatelyPlay(recordAction);
tempDeadPackList.Clear();
return false;
}
}
- return true;
+ return !ownRecordAction.GetInnerRecordPlayer().IsPlaying();
}
return false;
@@ -1286,7 +1304,7 @@
RecordAction rc = battleField.OnObjsDead(new List<BattleDeadPack>(tempDeadPackList.Values));
if (null != rc)
{
- parentRecordAction.GetInnerRecordPlayer().ImmediatelyPlay(rc);
+ ownRecordAction.GetInnerRecordPlayer().ImmediatelyPlay(rc);
}
tempDeadPackList.Clear();
@@ -1453,11 +1471,20 @@
if (pack is CustomHB426CombinePack combinePack && combinePack.startTag.Tag.StartsWith("Skill_"))
{
- BattleDebug.LogError("other skill casting " + combinePack.startTag.Tag);
var skillRecordAction = combinePack.CreateSkillAction();
skillRecordAction.fromSkill = this;
currentWaitingSkill.Add(skillRecordAction);
- parentRecordAction.GetInnerRecordPlayer().PlayRecord(skillRecordAction);
+
+ // 闇�瑕佺粰鐪熸parent鎾殑
+ if (skillRecordAction.useParentRecordPlayer && skillRecordAction.parentSkillAction != null)
+ {
+ skillRecordAction.parentSkillAction.GetInnerRecordPlayer().PlayRecord(skillRecordAction);
+ }
+ else
+ {
+ ownRecordAction.GetInnerRecordPlayer().PlayRecord(skillRecordAction);
+ }
+
return false;
}
else if (IsBuffPack(pack))
@@ -1490,7 +1517,7 @@
// 銆愪娇鐢� parentRecordAction.innerRecordPlayer銆�
// 鍘熷洜锛氭妧鑳芥墽琛岃繃绋嬩腑鐨勫寘锛圔uff銆佸睘鎬у埛鏂扮瓑锛夋槸鎶�鑳芥晥鏋滅殑涓�閮ㄥ垎
// 搴旇鐢盨killRecordAction鐨刬nnerRecordPlayer绠$悊锛岀‘淇濅笌鎶�鑳界敓鍛藉懆鏈熶竴鑷�
- PackageRegeditEx.DistributeToRecordAction(pack, parentRecordAction);
+ PackageRegeditEx.DistributeToRecordAction(pack, ownRecordAction);
}
}
@@ -1561,7 +1588,7 @@
// 銆愪娇鐢� parentRecordAction.innerRecordPlayer銆�
// 鍘熷洜锛欱uff鍖呮槸鎶�鑳芥晥鏋滅殑鏍稿績缁勬垚閮ㄥ垎锛屽簲璇ョ敱SkillRecordAction绠$悊
// 鍗充娇鏄己鍒跺垎鍙戠殑鎯呭喌锛屼篃瑕佷繚鎸佸湪姝g‘鐨凴ecordAction涓婁笅鏂囦腑
- PackageRegeditEx.DistributeToRecordAction(pack, parentRecordAction);
+ PackageRegeditEx.DistributeToRecordAction(pack, ownRecordAction);
}
}
--
Gitblit v1.8.0