| | |
| | | public bool isPlay = false; |
| | | |
| | | // 父RecordAction(SkillRecordAction),用于子技能建立父子关系 |
| | | protected RecordAction parentRecordAction; |
| | | protected SkillRecordAction ownRecordAction; |
| | | |
| | | // 技能动画是否播放完成(针对有动画的技能) |
| | | protected bool isMotionCompleted = false; |
| | |
| | | } |
| | | |
| | | // 设置父RecordAction |
| | | public void SetParentRecordAction(RecordAction recordAction) |
| | | public void SetOwnRecordAction(SkillRecordAction recordAction) |
| | | { |
| | | parentRecordAction = recordAction; |
| | | ownRecordAction = recordAction; |
| | | } |
| | | |
| | | #if UNITY_EDITOR |
| | |
| | | { |
| | | break; |
| | | } |
| | | if (ssc.SkillType == 8) |
| | | { |
| | | break; |
| | | } |
| | | SkillRecordAction skillRecordAction = CustomHB426CombinePack.CreateSkillAction(battleField.guid, new List<GameNetPackBasic> { skillPack }); |
| | | allSubSkills.Add((skillPack.packUID, skillRecordAction)); |
| | | removePackList.Add(pack); |
| | |
| | | { |
| | | break; |
| | | } |
| | | |
| | | if (ssc.SkillType == 8) |
| | | { |
| | | break; |
| | | } |
| | | |
| | | SkillRecordAction skillRecordAction = combinePack.CreateSkillAction(); |
| | | allSubSkills.Add((sp.packUID, skillRecordAction)); |
| | | removePackList.Add(pack); |
| | | |
| | | if (skillRecordAction.useParentRecordPlayer) |
| | | { |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | |
| | | #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); |
| | | } |
| | | |
| | |
| | | // 【使用 parentRecordAction.innerRecordPlayer】 |
| | | // 原因:HP刷新包是技能内部产生的,应该由当前SkillRecordAction的innerRecordPlayer管理 |
| | | // 这样可以确保HP刷新与技能的生命周期绑定,ForceFinish时一并处理 |
| | | PackageRegeditEx.DistributeToRecordAction(refreshPack, parentRecordAction); |
| | | PackageRegeditEx.DistributeToRecordAction(refreshPack, ownRecordAction); |
| | | packList.Remove(refreshPack); |
| | | } |
| | | } |
| | |
| | | // 【使用 parentRecordAction.innerRecordPlayer】 |
| | | // 原因:掉落包是技能效果的一部分,应该由当前SkillRecordAction管理 |
| | | // 掉落包的分发与技能完成绑定,确保在技能ForceFinish时正确处理 |
| | | PackageRegeditEx.DistributeToRecordAction(_dropPack, parentRecordAction); |
| | | PackageRegeditEx.DistributeToRecordAction(_dropPack, ownRecordAction); |
| | | packList.Remove(_dropPack); |
| | | } |
| | | |
| | |
| | | return false; |
| | | } |
| | | |
| | | |
| | | // 检查最终完成状态 |
| | | if (isFinished && moveFinished) |
| | | { |
| | |
| | | } |
| | | |
| | | // 如果自己内部的recora action的 inner record player还有没执行完的包 也是返回false |
| | | if (parentRecordAction != null && parentRecordAction.GetInnerRecordPlayer().IsPlaying()) |
| | | if (ownRecordAction != null && ownRecordAction.GetInnerRecordPlayer().IsPlaying()) |
| | | { |
| | | return false; |
| | | } |
| | |
| | | battleField.RemoveCastingSkill(caster.ObjID, this); |
| | | |
| | | // 传递parentRecordAction,让死亡技能等待当前技能完成 |
| | | 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; |
| | |
| | | RecordAction rc = battleField.OnObjsDead(new List<BattleDeadPack>(tempDeadPackList.Values)); |
| | | if (null != rc) |
| | | { |
| | | parentRecordAction.GetInnerRecordPlayer().ImmediatelyPlay(rc); |
| | | ownRecordAction.GetInnerRecordPlayer().ImmediatelyPlay(rc); |
| | | } |
| | | tempDeadPackList.Clear(); |
| | | |
| | |
| | | |
| | | 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)) |
| | |
| | | // 【使用 parentRecordAction.innerRecordPlayer】 |
| | | // 原因:技能执行过程中的包(Buff、属性刷新等)是技能效果的一部分 |
| | | // 应该由SkillRecordAction的innerRecordPlayer管理,确保与技能生命周期一致 |
| | | PackageRegeditEx.DistributeToRecordAction(pack, parentRecordAction); |
| | | PackageRegeditEx.DistributeToRecordAction(pack, ownRecordAction); |
| | | } |
| | | } |
| | | |
| | |
| | | // 【使用 parentRecordAction.innerRecordPlayer】 |
| | | // 原因:Buff包是技能效果的核心组成部分,应该由SkillRecordAction管理 |
| | | // 即使是强制分发的情况,也要保持在正确的RecordAction上下文中 |
| | | PackageRegeditEx.DistributeToRecordAction(pack, parentRecordAction); |
| | | PackageRegeditEx.DistributeToRecordAction(pack, ownRecordAction); |
| | | } |
| | | } |
| | | |