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/Skill/SkillBase.cs | 472 ++++++++++++++++++++++++++++++++++++++++++----------------
1 files changed, 339 insertions(+), 133 deletions(-)
diff --git a/Main/System/Battle/Skill/SkillBase.cs b/Main/System/Battle/Skill/SkillBase.cs
index ef7132f..4919082 100644
--- a/Main/System/Battle/Skill/SkillBase.cs
+++ b/Main/System/Battle/Skill/SkillBase.cs
@@ -24,15 +24,21 @@
protected RectTransform targetNode = null; // 鐩爣鑺傜偣
public BattleObject caster = null; // 鏂芥硶鑰�
protected List<GameNetPackBasic> packList;
- protected List<SkillRecordAction> otherSkillActionList = new List<SkillRecordAction>();
+
+ protected List<RecordAction> currentWaitingSkill = new List<RecordAction>();
+
protected List<H0704_tagRolePackRefresh> dropPackList = new List<H0704_tagRolePackRefresh>();
protected List<HB405_tagMCAddExp> expPackList = new List<HB405_tagMCAddExp>();
-
- protected List<BattleDeadPack> endDeadPackList = new List<BattleDeadPack>();
protected bool moveFinished = false;
public SkillBase fromSkill;
public bool isPlay = false;
+
+ // 鐖禦ecordAction锛圫killRecordAction锛夛紝鐢ㄤ簬瀛愭妧鑳藉缓绔嬬埗瀛愬叧绯�
+ protected RecordAction parentRecordAction;
+
+ // 鎶�鑳藉姩鐢绘槸鍚︽挱鏀惧畬鎴愶紙閽堝鏈夊姩鐢荤殑鎶�鑳斤級
+ protected bool isMotionCompleted = false;
private float MoveSpeed = 750f;
@@ -59,12 +65,17 @@
}
SafetyCheck();
-#if UNITY_EDITOR
- if (Launch.Instance.isOpenSkillLogFile)
- {
- PinrtHB427Hp();
- }
-#endif
+ }
+
+ public virtual void AfterAddToQueue()
+ {
+
+ }
+
+ // 璁剧疆鐖禦ecordAction
+ public void SetParentRecordAction(RecordAction recordAction)
+ {
+ parentRecordAction = recordAction;
}
#if UNITY_EDITOR
@@ -144,6 +155,13 @@
private void SafetyCheck()
{
+#if UNITY_EDITOR
+ if (Launch.Instance.isOpenSkillLogFile)
+ {
+ PinrtHB427Hp();
+ }
+#endif
+
bool safety = caster != null
&& skillConfig != null
&& tagUseSkillAttack != null
@@ -176,22 +194,7 @@
return;
}
- if (otherSkillActionList.Count > 0)
- {
- for (int i = otherSkillActionList.Count - 1; i >= 0; i--)
- {
- var action = otherSkillActionList[i];
- if (action.IsFinished())
- {
- otherSkillActionList.RemoveAt(i);
- OnSkillFinished();
- }
- else if (moveFinished)
- {
- action.Run();
- }
- }
- }
+
}
protected void ShadowIllutionCreate(bool create)
@@ -481,28 +484,75 @@
return;
}
+ // 鍏堟妸姝讳骸鍖呮敹闆嗕簡
HandleDead();
+
+ // 鍐嶅鐞� 鍐呭祵鎶�鑳�
+ ProcessSubSkill();
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);
- }
- tagUseSkillAttack.subSkillList.Clear();
- foreach (var subCombinePack in tagUseSkillAttack.subSkillCombinePackList)
- {
- SkillRecordAction recordAction = CustomHB426CombinePack.CreateSkillAction(battleField.guid, subCombinePack.packList);
- recordAction.fromSkill = this;
- otherSkillActionList.Add(recordAction);
- battleField.recordPlayer.ImmediatelyPlay(recordAction);
- }
- tagUseSkillAttack.subSkillCombinePackList.Clear();
+
isPlay = true;
+ }
+
+ protected void ProcessSubSkill()
+ {
+ // 鎸塸ackUID鎺掑簭鎵�鏈夊瓙鎶�鑳�
+ var allSubSkills = new List<(ulong packUID, SkillRecordAction action)>();
+
+ List<GameNetPackBasic> removePackList = new List<GameNetPackBasic>();
+
+ foreach (var pack in packList)
+ {
+ if (pack is HB427_tagSCUseSkill skillPack)
+ {
+ SkillConfig ssc = SkillConfig.Get((int)skillPack.SkillID);
+ if (!string.IsNullOrEmpty(ssc.SkillMotionName))
+ {
+ break;
+ }
+ SkillRecordAction skillRecordAction = CustomHB426CombinePack.CreateSkillAction(battleField.guid, new List<GameNetPackBasic> { skillPack });
+ allSubSkills.Add((skillPack.packUID, skillRecordAction));
+ removePackList.Add(pack);
+ }
+ else if (pack is HB422_tagMCTurnFightObjDead dead)
+ {
+ break;
+ }
+ else if (pack is CustomHB426CombinePack combinePack)
+ {
+ HB427_tagSCUseSkill sp = combinePack.GetMainHB427SkillPack();
+ SkillConfig ssc = SkillConfig.Get((int)sp.SkillID);
+
+ if (!string.IsNullOrEmpty(ssc.SkillMotionName))
+ {
+ break;
+ }
+ SkillRecordAction skillRecordAction = combinePack.CreateSkillAction();
+ allSubSkills.Add((sp.packUID, skillRecordAction));
+ removePackList.Add(pack);
+ }
+ }
+
+ for (int i = 0; i < removePackList.Count; i++)
+ {
+ packList.Remove(removePackList[i]);
+ }
+
+ // 鎸塸ackUID鎺掑簭
+ allSubSkills.Sort((a, b) => a.packUID.CompareTo(b.packUID));
+
+ foreach (var (packUID, recordAction) in allSubSkills)
+ {
+ battleField.recordPlayer.ImmediatelyPlay(recordAction);
+
+ if (recordAction.IsNeedWaiting())
+ {
+ currentWaitingSkill.Add(recordAction);
+ }
+ }
}
// 鎶�鑳藉墠鎽囩粨鏉熷洖璋�
@@ -529,6 +579,9 @@
// 鎶�鑳藉悗鎽囩粨鏉熷洖璋冿細閫氱煡鎶�鑳芥晥鏋滃鐞嗗悗鎽囩粨鏉�
public virtual void OnFinalFrameEnd()
{
+ // 鏍囪鍔ㄧ敾鎾斁瀹屾垚
+ isMotionCompleted = true;
+ BattleDebug.LogError($"SkillBase.OnFinalFrameEnd: 鎶�鑳� {skillConfig?.SkillID} 鍔ㄧ敾鎾斁瀹屾垚");
skillEffect?.OnFinalFrameEnd(); // 淇锛氭坊鍔犵┖鍊兼鏌�
}
@@ -536,7 +589,7 @@
// 楂樹寒鎵�鏈夌浉鍏崇洰鏍囷細璁剧疆鏂芥硶鑰呭拰鐩爣鐨勬樉绀哄眰绾�
protected void HighLightAllTargets()
{
- caster.layerMgr.SetSortingOrder(BattleConst.ActiveHeroActionSortingOrder);
+ caster.layerMgr.SetSortingOrder(BattleConst.SkillMaskOrder + BattleConst.BattleActiveHeroOffset);
if (skillConfig.FuncType != 2)
return;
@@ -609,7 +662,6 @@
battleField.battleRootNode.skillMaskNode.SetActive(true);
}
- protected long suckHp = 0;
// 鍛戒腑鐩爣鍥炶皟锛氬鐞嗘墍鏈夎鍛戒腑鐨勭洰鏍囷紙鍖呮嫭涓荤洰鏍囥�佸脊灏勭洰鏍囥�佹簠灏勭洰鏍囷級
protected virtual void OnHitTargets(int _hitIndex, List<HB427_tagSCUseSkill.tagSCUseSkillHurt> hitList)
@@ -619,13 +671,7 @@
// 閫犳垚浼ゅ鍓嶅厛澶勭悊琛�閲忓埛鏂板寘
HandleRefreshHP();
- suckHp = 0;
-
- // 缁熻鍚歌鎬婚噺锛堜富鐩爣锛�
- foreach (var hurt in hitList)
- {
- suckHp += hurt.SuckHP;
- }
+ bool suckHp = true;
// 澶勭悊涓荤洰鏍囧垪琛�
foreach (var hurt in hitList)
@@ -637,7 +683,9 @@
continue;
}
- OnHitEachTarget(_hitIndex, target, hurt);
+ OnHitEachTarget(_hitIndex, target, hurt, suckHp);
+
+ suckHp = false;
// 澶勭悊璇ョ洰鏍囩殑棰濆鐩爣鍒楄〃锛堝寮瑰皠浼ゅ鐨勫钩鎽婄洰鏍囷級
if (hurt.HurtListEx != null && hurt.HurtListEx.Length > 0)
@@ -672,6 +720,11 @@
}
}
+ HandleHint(_hitIndex, hitList);
+ }
+
+ protected void HandleHint(int _hitIndex, List<HB427_tagSCUseSkill.tagSCUseSkillHurt> hitList)
+ {
if (0 == _hitIndex)
{
bool needhint = false;
@@ -707,13 +760,41 @@
DamageNumConfig hintConfig = DamageNumConfig.Get(BattleConst.BattleStun);
Hint(caster, hintConfig);
}
- }
-
+ for (int i = 0; i < hitList.Count; i++)
+ {
+ var hurt = hitList[i];
+
+ if ((hurt.AttackTypes & (int)DamageType.BreakArmor) == (int)DamageType.BreakArmor)
+ {
+ BattleObject battleObject = caster.battleField.battleObjMgr.GetBattleObject((int)hurt.ObjID);
+ if (battleObject != null)
+ {
+ DamageNumConfig hintConfig = DamageNumConfig.Get(BattleConst.BreakArmor);
+ Hint(battleObject, hintConfig);
+ battleField.battleEffectMgr.PlayEffect(battleObject,
+ BattleConst.BreakArmorEffectID, battleObject.heroRectTrans, battleObject.Camp,
+ battleObject.teamHero.modelScale);
+ }
+ }
+ else if ((hurt.AttackTypes & (int)DamageType.Parry) == (int)DamageType.Parry)
+ {
+ BattleObject battleObject = caster.battleField.battleObjMgr.GetBattleObject((int)hurt.ObjID);
+ if (battleObject != null)
+ {
+ DamageNumConfig hintConfig = DamageNumConfig.Get(BattleConst.Parry);
+ Hint(battleObject, hintConfig);
+ battleField.battleEffectMgr.PlayEffect(battleObject,
+ BattleConst.ParryEffectID, battleObject.heroRectTrans, battleObject.Camp,
+ battleObject.teamHero.modelScale);
+ }
+ }
+ }
+ }
}
// 澶勭悊鍗曚釜鐩爣琚懡涓�:搴旂敤浼ゅ鍜屾柦娉曡�呮晥鏋�
- protected virtual void OnHitEachTarget(int _hitIndex, BattleObject target, HB427_tagSCUseSkill.tagSCUseSkillHurt hurt)
+ protected virtual void OnHitEachTarget(int _hitIndex, BattleObject target, HB427_tagSCUseSkill.tagSCUseSkillHurt hurt, bool suckHp)
{
// ============ 鑾峰彇涓存椂鏁版嵁(鎺夎惤銆佹浜$瓑) ============
int objID = (int)target.ObjID;
@@ -726,20 +807,21 @@
deadPack = null;
}
- bool clearSuckHp = tagUseSkillAttack.HurtList.ToList().IndexOf(hurt) != 0;
-
// ============ 鍙傛暟鎵撳寘 ============
- BattleHurtParam hurtParam = BattleUtility.CalcBattleHurtParam(this, _hitIndex, target, hurt, battleDrops, deadPack);
- if (clearSuckHp)
- {
- hurtParam.caster.suckHpList.Clear();
- }
+ BattleHurtParam hurtParam = BattleUtility.CalcBattleHurtParam(this, _hitIndex, target, hurt, battleDrops, deadPack, suckHp);
#if UNITY_EDITOR
PrintHurtParamDebugInfo(hurtParam);
#endif
// 鍏堣皟鐢ㄧ洰鏍囧彈浼�
- target.Hurt(hurtParam);
+ DeathRecordAction recordAc = target.Hurt(hurtParam, parentRecordAction);
+
+ if (null != recordAc)
+ {
+ tempDeadPackList.Remove(hurtParam.hurter.hurtObj.ObjID);
+ battleField.recordPlayer.ImmediatelyPlay(recordAc, parentRecordAction, true);
+ currentWaitingSkill.Add(recordAc);
+ }
// 鍐嶈皟鐢ㄦ柦娉曡�呭惛琛�/鍙嶄激
caster.OnHurtTarget(hurtParam);
@@ -768,23 +850,13 @@
HurtHPEx = hurtEx.HurtHPEx,
CurHP = hurtEx.CurHP,
CurHPEx = hurtEx.CurHPEx,
- SuckHP = hurtEx.SuckHP,
+ SuckHP = 0,//hurtEx.SuckHP, 鑾峰彇鍏ㄩ儴鍚歌鏃跺凡缁忚绠楄繃 杩欓噷灏变笉鍐嶈绠�
BounceHP = 0, // HurtEx 娌℃湁鍙嶄激瀛楁
HurtCountEx = 0,
HurtListEx = null
};
- BattleHurtParam hurtParam = BattleUtility.CalcBattleHurtParam(this, _hitIndex, target, hurt, battleDrops, deadPack);
-
-#if UNITY_EDITOR
- PrintHurtParamDebugInfo(hurtParam);
-#endif
-
- // 鍏堣皟鐢ㄧ洰鏍囧彈浼�
- target.Hurt(hurtParam);
-
- // 鍐嶈皟鐢ㄦ柦娉曡�呭惛琛�/鍙嶄激
- caster.OnHurtTarget(hurtParam);
+ OnHitEachTarget(_hitIndex, target, hurt, false);//鑾峰彇鍏ㄩ儴鍚歌鏃跺凡缁忚绠楄繃 杩欓噷灏变笉鍐嶈绠�
}
#if UNITY_EDITOR
@@ -834,7 +906,10 @@
if (refreshPack != null)
{
// 鍒嗗彂HP鍒锋柊鍖�
- PackageRegedit.Distribute(refreshPack);
+ // 銆愪娇鐢� parentRecordAction.innerRecordPlayer銆�
+ // 鍘熷洜锛欻P鍒锋柊鍖呮槸鎶�鑳藉唴閮ㄤ骇鐢熺殑锛屽簲璇ョ敱褰撳墠SkillRecordAction鐨刬nnerRecordPlayer绠$悊
+ // 杩欐牱鍙互纭繚HP鍒锋柊涓庢妧鑳界殑鐢熷懡鍛ㄦ湡缁戝畾锛孎orceFinish鏃朵竴骞跺鐞�
+ PackageRegeditEx.DistributeToRecordAction(refreshPack, parentRecordAction);
packList.Remove(refreshPack);
}
}
@@ -845,13 +920,62 @@
List<BattleDeadPack> deadPackList = BattleUtility.FindDeadPack(packList);
if (deadPackList.Count <= 0) return;
+ foreach (var deadPack in deadPackList)
+ {
+ packList.Remove(deadPack.deadPack);
+ packList.Remove(deadPack.deadTriggerSkill);
+ }
+
+ // 鎵惧埌鏈�澶х殑姝讳骸鍖� packUID
+ BattleDeadPack lastBattleDeadPack = null;
+ ulong maxDeathPackUID = 0;
+ foreach (var deadPack in deadPackList)
+ {
+ if (deadPack.deadPack != null && deadPack.deadPack.packUID > maxDeathPackUID)
+ {
+ maxDeathPackUID = deadPack.deadPack.packUID;
+ lastBattleDeadPack = deadPack;
+ }
+ }
+
+ // 濡傛灉鎵惧埌浜嗘浜″寘锛屾敹闆嗘墍鏈� packUID > maxDeathPackUID 鐨勫寘
+ if (maxDeathPackUID > 0 && lastBattleDeadPack != null)
+ {
+ BattleDebug.LogError($"SkillBase.HandleDead: 鎵惧埌姝讳骸鍖咃紝maxDeathPackUID = {maxDeathPackUID}锛屽紑濮嬫敹闆嗘浜″悗鐨勫寘");
+
+ // 1. 鏀堕泦 packList 涓� packUID 澶т簬姝讳骸鍖呯殑鍖咃紙鎺掗櫎缁忛獙鍖呭拰鎺夎惤鍖咃紝瀹冧滑闇�瑕佸湪褰撳墠鎶�鑳戒腑澶勭悊锛�
+ List<GameNetPackBasic> packsToRemove = new List<GameNetPackBasic>();
+ foreach (var pack in packList)
+ {
+ ulong packUID = GetPackUID(pack);
+ if (packUID > maxDeathPackUID)
+ {
+ // 鎺掗櫎缁忛獙鍖呭拰鎺夎惤鍖咃紝瀹冧滑灞炰簬褰撳墠姝讳骸浜嬩欢鐨勪竴閮ㄥ垎锛屼笉鏄�"姝讳骸鍚�"鐨勫寘
+ if (pack is HB405_tagMCAddExp expPack && expPack.Source == 2 ||
+ (pack is H0704_tagRolePackRefresh h0704 && h0704.PackType == (byte)PackType.DropItem && h0704.IsBind == 1))
+ {
+ continue; // 璺宠繃缁忛獙鍖呭拰鎺夎惤鍖咃紝璁� CheckAfterDeadhPack() 澶勭悊瀹冧滑
+ }
+
+ BattleDebug.LogError($"SkillBase.HandleDead: 浠巔ackList鏀堕泦姝讳骸鍚庣殑鍖� - Type: {pack.GetType().Name}, UID: {packUID}");
+ lastBattleDeadPack.packListAfterDeath.Add(pack);
+ packsToRemove.Add(pack);
+ }
+ }
+
+ packList.RemoveAll(p => packsToRemove.Contains(p));
+ }
+
CheckAfterDeadhPack();
// 淇锛氬厛鏀堕泦瑕佸垹闄ょ殑鍖咃紝閬垮厤鍦╢oreach涓慨鏀归泦鍚�
var dropPacksToRemove = new List<H0704_tagRolePackRefresh>(dropPackList);
foreach (var _dropPack in dropPacksToRemove)
{
- PackageRegedit.Distribute(_dropPack);
+ // 銆愪娇鐢� parentRecordAction.innerRecordPlayer銆�
+ // 鍘熷洜锛氭帀钀藉寘鏄妧鑳芥晥鏋滅殑涓�閮ㄥ垎锛屽簲璇ョ敱褰撳墠SkillRecordAction绠$悊
+ // 鎺夎惤鍖呯殑鍒嗗彂涓庢妧鑳藉畬鎴愮粦瀹氾紝纭繚鍦ㄦ妧鑳紽orceFinish鏃舵纭鐞�
+ PackageRegeditEx.DistributeToRecordAction(_dropPack, parentRecordAction);
packList.Remove(_dropPack);
}
@@ -866,8 +990,8 @@
// 鏋勯�燘attleDrops骞剁紦瀛�
for (int i = 0; i < deadPackList.Count; i++)
{
- BattleDeadPack battleDeadPack = deadPackList[i];
- int objID = (int)battleDeadPack.deadPack.ObjID;
+ BattleDeadPack bdp = deadPackList[i];
+ int objID = (int)bdp.deadPack.ObjID;
BattleObject deadTarget = battleField.battleObjMgr.GetBattleObject(objID);
// 淇锛氭坊鍔犵┖鍊兼鏌�
@@ -926,6 +1050,48 @@
for (int i = 0; i < itemList.Count; i++)
dropAssign[i % deadCount].Add(itemList[i]);
return dropAssign;
+ }
+
+ // 鑾峰彇鍖呯殑 packUID
+ protected ulong GetPackUID(GameNetPackBasic pack)
+ {
+ if (pack == null) return 0;
+
+ if (pack is HB422_tagMCTurnFightObjDead deadPack)
+ return deadPack.packUID;
+
+ if (pack is CustomHB426CombinePack combinePack)
+ {
+ var mainSkillPack = combinePack.GetMainHB427SkillPack();
+ return mainSkillPack?.packUID ?? 0;
+ }
+
+ if (pack is HB427_tagSCUseSkill skillPack)
+ return skillPack.packUID;
+
+ if (pack is HB428_tagSCBuffRefresh buffRefresh)
+ return buffRefresh.packUID;
+
+ if (pack is HB429_tagSCBuffDel buffDel)
+ return buffDel.packUID;
+
+ if (pack is HB419_tagSCObjHPRefresh hpRefresh)
+ return hpRefresh.packUID;
+
+ if (pack is HB405_tagMCAddExp expPack)
+ return expPack.packUID;
+
+ if (pack is H0704_tagRolePackRefresh dropPack)
+ return dropPack.packUID;
+
+ // 灏濊瘯閫氳繃鍙嶅皠鑾峰彇 packUID
+ var packUIDField = pack.GetType().GetField("packUID");
+ if (packUIDField != null)
+ {
+ return (ulong)packUIDField.GetValue(pack);
+ }
+
+ return 0;
}
// 鍒嗛厤缁忛獙鍊硷細灏嗙粡楠屽寘骞冲潎鍒嗛厤缁欐瘡涓浜″璞�
@@ -1005,7 +1171,7 @@
}
- public virtual bool IsFinishedForJudge()
+ public virtual bool IsActionCompleted()
{
if (!isPlay) return false;
@@ -1014,19 +1180,16 @@
if (!skillEffect.IsFinished()) return false;
}
- if (otherSkillActionList.Count > 0)
+ if (moveFinished)
{
- foreach (var action in otherSkillActionList)
+ // 濡傛灉鎶�鑳芥湁鍔ㄧ敾锛圫killMotionName涓嶄负绌猴級锛岄渶瑕佺瓑寰呭姩鐢绘挱鏀惧畬鎴�
+ if (skillConfig != null && !string.IsNullOrEmpty(skillConfig.SkillMotionName))
{
- if (!action.IsFinishedForJudge()) return false;
- }
- }
-
- if (isFinished && moveFinished)
- {
- if (packList.Count > 0)
- {
- return false;
+ if (!isMotionCompleted)
+ {
+ BattleDebug.LogError($"SkillBase.IsActionCompleted: 鎶�鑳� {skillConfig.SkillID} 绛夊緟鍔ㄧ敾鎾斁瀹屾垚");
+ return false;
+ }
}
return true;
@@ -1052,18 +1215,14 @@
}
// 妫�鏌ュ叾浠栨妧鑳藉姩浣滄槸鍚﹀畬鎴�
- if (otherSkillActionList.Count > 0)
+ if (currentWaitingSkill.Count > 0)
{
- for (int i = otherSkillActionList.Count - 1; i >= 0; i--)
+ if (currentWaitingSkill.Any(s => s.IsFinished()))
{
- var action = otherSkillActionList[i];
- if (action.IsFinished())
- {
- otherSkillActionList.RemoveAt(i);
- OnSkillFinished();
- }
+ currentWaitingSkill.RemoveAll(s => s.IsFinished());
+ OnSkillFinished();
}
- if (otherSkillActionList.Count > 0)
+ else
{
tempRetValue = false;
}
@@ -1083,12 +1242,25 @@
return false;
}
+ // 濡傛灉鑷繁鍐呴儴鐨剅ecora action鐨� inner record player杩樻湁娌℃墽琛屽畬鐨勫寘 涔熸槸杩斿洖false
+ if (parentRecordAction != null && parentRecordAction.GetInnerRecordPlayer().IsPlaying())
+ {
+ return false;
+ }
+
// 鎶�鑳藉畬鍏ㄧ粨鏉燂紝绉婚櫎鎶�鑳芥敞鍐屽苟瑙﹀彂寤惰繜鐨勬浜″垽瀹�
if (battleField != null && caster != null)
{
battleField.RemoveCastingSkill(caster.ObjID, this);
- battleField.OnObjsDead(new List<BattleDeadPack>(tempDeadPackList.Values));
+ // 浼犻�抪arentRecordAction锛岃姝讳骸鎶�鑳界瓑寰呭綋鍓嶆妧鑳藉畬鎴�
+ DeathRecordAction recordAction = battleField.OnObjsDead(new List<BattleDeadPack>(tempDeadPackList.Values));
+ if (null != recordAction)
+ {
+ parentRecordAction.GetInnerRecordPlayer().ImmediatelyPlay(recordAction);
+ tempDeadPackList.Clear();
+ return false;
+ }
}
return true;
@@ -1110,13 +1282,27 @@
battleField.RemoveCastingSkill(caster.ObjID, this);
}
+ // 浼犻�抪arentRecordAction锛岃姝讳骸鎶�鑳界瓑寰呭綋鍓嶆妧鑳藉畬鎴�
+ RecordAction rc = battleField.OnObjsDead(new List<BattleDeadPack>(tempDeadPackList.Values));
+ if (null != rc)
+ {
+ parentRecordAction.GetInnerRecordPlayer().ImmediatelyPlay(rc);
+ }
+ tempDeadPackList.Clear();
+
// 1. 寮哄埗缁撴潫鎶�鑳芥晥鏋�
skillEffect?.ForceFinished();
skillEffect = null;
// 2. 寮哄埗缁撴潫鎵�鏈夊瓙鎶�鑳藉姩浣�
- otherSkillActionList.ForEach(action => action.ForceFinish());
- otherSkillActionList.Clear();
+ if (currentWaitingSkill.Count > 0)
+ {
+ foreach (var skill in currentWaitingSkill)
+ {
+ skill.ForceFinish();
+ }
+ currentWaitingSkill.Clear();
+ }
// 3. 娓呯悊 DOTween 鍔ㄧ敾锛堥槻姝㈢Щ鍔ㄥ洖璋冨湪鎴樻枟缁撴潫鍚庢墽琛岋級
if (caster != null && caster.heroRectTrans != null)
@@ -1143,12 +1329,6 @@
// 鍙栨秷骞诲奖鏁堟灉
caster.motionBase?.ShowIllusionShadow(false);
-
- // 鎾斁寰呮満鍔ㄧ敾锛堝鏋滆繕娲荤潃锛�
- if (!caster.teamHero.isDead)
- {
- caster.motionBase?.ResetForReborn(false);
- }
}
// 5. 鎭㈠ UI 鐘舵��
@@ -1175,6 +1355,9 @@
isFinished = true;
moveFinished = true;
isPlay = true;
+
+ // 寮哄埗缁撴潫鏃讹紝鏃犺鏄惁鏈夊姩鐢伙紝閮芥爣璁板姩鐢诲畬鎴�
+ isMotionCompleted = true;
// 6. 澶勭悊鎵�鏈夊墿浣欏寘锛堝寘鎷� buff 鍖咃級
// 鍏堝鐞� buffPackCollections
@@ -1195,8 +1378,9 @@
}
else
{
- if (pack is CustomB421ActionPack actionPack)
- actionPack.Distribute();
+ // 銆愪娇鐢� parentRecordAction.innerRecordPlayer銆�
+ // 鍘熷洜锛欶orceFinished鏃跺墿浣欑殑鍖呬篃鏄妧鑳藉唴閮ㄤ骇鐢熺殑锛屽簲璇ョ敱innerRecordPlayer绠$悊
+ // 杩欐牱鍙互纭繚鍗充娇寮哄埗缁撴潫锛屽寘鐨勫鐞嗕篃鍦ㄦ纭殑涓婁笅鏂囦腑
PackageRegedit.Distribute(pack);
}
}
@@ -1221,20 +1405,14 @@
}
// 楠岃瘉鍏朵粬鎶�鑳藉姩浣滄槸鍚﹀畬鎴�
- if (otherSkillActionList.Count > 0)
+ if (currentWaitingSkill.Count > 0)
{
- bool hasFinishedAction = false;
- for (int i = otherSkillActionList.Count - 1; i >= 0; i--)
- {
- var action = otherSkillActionList[i];
- if (action.IsFinished())
- {
- otherSkillActionList.RemoveAt(i);
- hasFinishedAction = true;
- }
- }
+ bool hasFinishedAction = currentWaitingSkill.All(s => s.IsFinished());
+
if (hasFinishedAction)
{
+ // 淇姝诲惊鐜細瀹屾垚鍚庨渶瑕佹竻绌� currentWaitingSkill
+ currentWaitingSkill.Clear();
continue; // 浣跨敤continue浠f浛閫掑綊璋冪敤
}
return;
@@ -1262,17 +1440,24 @@
protected virtual bool ResolvePackList()
{
+ if (currentWaitingSkill.Count > 0)
+ {
+ return false;
+ }
+
while (packList.Count > 0)
{
var pack = packList[0];
packList.RemoveAt(0);
+
if (pack is CustomHB426CombinePack combinePack && combinePack.startTag.Tag.StartsWith("Skill_"))
{
BattleDebug.LogError("other skill casting " + combinePack.startTag.Tag);
- var otherSkillAction = combinePack.CreateSkillAction();
- otherSkillAction.fromSkill = this;
- otherSkillActionList.Add(otherSkillAction);
+ var skillRecordAction = combinePack.CreateSkillAction();
+ skillRecordAction.fromSkill = this;
+ currentWaitingSkill.Add(skillRecordAction);
+ parentRecordAction.GetInnerRecordPlayer().PlayRecord(skillRecordAction);
return false;
}
else if (IsBuffPack(pack))
@@ -1300,14 +1485,12 @@
buffPackCollections.Clear();
continue;
}
-
- if (pack is CustomB421ActionPack actionPack)
- {
- actionPack.Distribute();
- }
else
{
- PackageRegedit.Distribute(pack);
+ // 銆愪娇鐢� parentRecordAction.innerRecordPlayer銆�
+ // 鍘熷洜锛氭妧鑳芥墽琛岃繃绋嬩腑鐨勫寘锛圔uff銆佸睘鎬у埛鏂扮瓑锛夋槸鎶�鑳芥晥鏋滅殑涓�閮ㄥ垎
+ // 搴旇鐢盨killRecordAction鐨刬nnerRecordPlayer绠$悊锛岀‘淇濅笌鎶�鑳界敓鍛藉懆鏈熶竴鑷�
+ PackageRegeditEx.DistributeToRecordAction(pack, parentRecordAction);
}
}
@@ -1319,7 +1502,7 @@
{
tempDropList?.Clear();
tempDeadPackList?.Clear();
- otherSkillActionList?.Clear();
+ currentWaitingSkill?.Clear();
dropPackList?.Clear();
expPackList?.Clear();
buffPackCollections?.Clear();
@@ -1360,7 +1543,7 @@
BattleObject battleObj = battleField.battleObjMgr.GetBattleObject((int)buffDel.ObjID);
if (battleObj != null)
{
- battleObj.buffMgr.RemoveBuff(buffDel);
+ battleObj.buffMgr.RemoveBuff(buffDel, false);
}
}
}
@@ -1375,10 +1558,33 @@
foreach (var pack in buffPacks)
{
- PackageRegedit.Distribute(pack);
+ // 銆愪娇鐢� parentRecordAction.innerRecordPlayer銆�
+ // 鍘熷洜锛欱uff鍖呮槸鎶�鑳芥晥鏋滅殑鏍稿績缁勬垚閮ㄥ垎锛屽簲璇ョ敱SkillRecordAction绠$悊
+ // 鍗充娇鏄己鍒跺垎鍙戠殑鎯呭喌锛屼篃瑕佷繚鎸佸湪姝g‘鐨凴ecordAction涓婁笅鏂囦腑
+ PackageRegeditEx.DistributeToRecordAction(pack, parentRecordAction);
}
}
+ public virtual bool CanStartExecution()
+ {
+ if (null == caster)
+ {
+ return false;
+ }
+
+ if (null == skillConfig)
+ {
+ return false;
+ }
+
+ if (string.IsNullOrEmpty(skillConfig.SkillMotionName))
+ {
+ return true;
+ }
+
+ return !battleField.IsCastingSkill(caster.ObjID);
+ }
+
#endregion
}
\ No newline at end of file
--
Gitblit v1.8.0