| | |
| | | protected SkillEffect skillEffect; |
| | | public HB427_tagSCUseSkill tagUseSkillAttack; |
| | | public SkillConfig skillConfig; |
| | | |
| | | public SkillSkinConfig skillSkinConfig; |
| | | protected bool isFinished = false; |
| | | protected BattleField battleField = null; // 战场 |
| | | protected RectTransform targetNode = null; // 目标节点 |
| | |
| | | public bool isPlay = false; |
| | | |
| | | // 父RecordAction(SkillRecordAction),用于子技能建立父子关系 |
| | | protected RecordAction parentRecordAction; |
| | | protected SkillRecordAction ownRecordAction; |
| | | |
| | | // 技能动画是否播放完成(针对有动画的技能) |
| | | protected bool isMotionCompleted = false; |
| | |
| | | battleField = _battleField; |
| | | packList = _packList; |
| | | |
| | | if (_caster is HeroBattleObject heroBattleObject) |
| | | { |
| | | skillSkinConfig = skillConfig.GetSkillSkinConfig(heroBattleObject.teamHero.SkinID); |
| | | |
| | | if (null == skillSkinConfig) |
| | | { |
| | | Debug.LogError("找不到技能皮肤表 " + "skillId: " + skillConfig.SkillID + " skinId: " + heroBattleObject.teamHero.SkinID); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | skillSkinConfig = skillConfig.GetOriginSkinConfig(); |
| | | } |
| | | |
| | | |
| | | // 注册正在释放的技能 |
| | | if (battleField != null && caster != null) |
| | | { |
| | |
| | | } |
| | | |
| | | // 设置父RecordAction |
| | | public void SetParentRecordAction(RecordAction recordAction) |
| | | public void SetOwnRecordAction(SkillRecordAction recordAction) |
| | | { |
| | | parentRecordAction = recordAction; |
| | | ownRecordAction = recordAction; |
| | | } |
| | | |
| | | #if UNITY_EDITOR |
| | |
| | | var Hurt = tagUseSkillAttack.HurtList[i]; |
| | | BattleObject battleObject = caster.battleField.battleObjMgr.GetBattleObject((int)Hurt.ObjID); |
| | | |
| | | string targetName = battleObject != null ? battleObject.teamHero.name : "Unknown"; |
| | | string targetName = battleObject != null ? battleObject.GetName() : "Unknown"; |
| | | long hurtHp = GeneralDefine.GetFactValue(Hurt.HurtHP, Hurt.HurtHPEx); |
| | | long curHp = GeneralDefine.GetFactValue(Hurt.CurHP, Hurt.CurHPEx); |
| | | |
| | |
| | | var HurtEx = tagUseSkillAttack.HurtListEx[i]; |
| | | BattleObject battleObject = caster.battleField.battleObjMgr.GetBattleObject((int)HurtEx.ObjID); |
| | | |
| | | string targetName = battleObject != null ? battleObject.teamHero.name : "Unknown"; |
| | | string targetName = battleObject != null ? battleObject.GetName() : "Unknown"; |
| | | long hurtHp = GeneralDefine.GetFactValue(HurtEx.HurtHP, HurtEx.HurtHPEx); |
| | | long curHp = GeneralDefine.GetFactValue(HurtEx.CurHP, HurtEx.CurHPEx); |
| | | |
| | |
| | | if (change) |
| | | { |
| | | MoveSpeed = 1125f; |
| | | caster.motionBase.ShowIllusionShadow(true, color); |
| | | caster.ShowIllusionShadow(true, color); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | MoveSpeed = 750f; |
| | | caster.motionBase.ShowIllusionShadow(false); |
| | | caster.ShowIllusionShadow(false); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | // 广播技能释放事件 |
| | | string guid = battleField.guid; |
| | | TeamHero teamHero = caster.teamHero; |
| | | // 获取释放者数据:Hero 传递 teamHero,Mingge 传递 null(因为事件监听器只处理 Hero 数据) |
| | | TeamHero teamHero = null; |
| | | if (caster is HeroBattleObject heroBattleObject) |
| | | { |
| | | teamHero = heroBattleObject.teamHero; |
| | | } |
| | | // 命格释放技能时 teamHero 为 null,监听器会正确处理(已有 null 检查) |
| | | EventBroadcast.Instance.Broadcast<string, SkillConfig, TeamHero>(EventName.BATTLE_CAST_SKILL, guid, skillConfig, teamHero); |
| | | |
| | | if (skillConfig.SkinllSFX1 != 0) |
| | | if (skillSkinConfig.SkinllSFX1 != 0) |
| | | { |
| | | battleField.soundManager.PlayEffectSound(skillConfig.SkinllSFX1, false); |
| | | battleField.soundManager.PlayEffectSound(skillSkinConfig.SkinllSFX1, false); |
| | | } |
| | | |
| | | if (caster != null) |
| | |
| | | HighLightAllTargets(); |
| | | |
| | | // 根据释放模式执行相应逻辑 |
| | | switch (skillConfig.castMode) |
| | | switch (skillSkinConfig.castMode) |
| | | { |
| | | case SkillCastMode.None: |
| | | case SkillCastMode.Self: |
| | |
| | | DashCast(OnAttackFinish); |
| | | break; |
| | | default: |
| | | Debug.LogError("强制结束技能 暂时不支持其他的方式释放 有需求please联系策划 技能id:" + skillConfig.SkillID + " cast position " + skillConfig.CastPosition); |
| | | Debug.LogError("强制结束技能 暂时不支持其他的方式释放 有需求please联系策划 技能id:" + skillConfig.SkillID + " cast position " + skillSkinConfig.CastPosition); |
| | | ForceFinished(); |
| | | break; |
| | | } |
| | |
| | | { |
| | | if (hintConfig != null) |
| | | { |
| | | battleObject.heroInfoBar.ShowTips(((char)hintConfig.prefix).ToString(), true, false, 1.25f); |
| | | battleObject.ShowTips(((char)hintConfig.prefix).ToString(), true, false, 1.25f); |
| | | } |
| | | } |
| | | |
| | |
| | | // 对敌方释放技能:移动到敌方区域进行攻击 |
| | | protected void CastToEnemy() |
| | | { |
| | | RectTransform target = battleField.GetTeamNode(caster.GetEnemyCamp(), skillConfig); |
| | | RectTransform target = battleField.GetTeamNode(caster.GetEnemyCamp(), skillSkinConfig); |
| | | ExecuteMoveAndCastSequence(target, () => |
| | | { |
| | | if (skillConfig.ClientTriggerTiming == 1) |
| | |
| | | else |
| | | { |
| | | // ShadowIllutionCreate(true); |
| | | MoveToTarget(battleField.GetTeamNode(caster.Camp, caster.teamHero.positionNum), Vector2.zero, () => |
| | | MoveToTarget(battleField.GetTeamNode(caster.Camp, caster.GetPositionNum()), Vector2.zero, () => |
| | | { |
| | | // ShadowIllutionCreate(false); |
| | | OnAttackFinish(); |
| | |
| | | |
| | | ExecuteMoveAndCastSequence(targetTrans, () => |
| | | { |
| | | RectTransform rectTransform = battleField.GetTeamNode(caster.Camp, caster.teamHero.positionNum); |
| | | RectTransform rectTransform = battleField.GetTeamNode(caster.Camp, caster.GetPositionNum()); |
| | | // ShadowIllutionCreate(true); |
| | | MoveToTarget(rectTransform, Vector2.zero, () => |
| | | { |
| | |
| | | // 对友方释放技能:移动到友方区域进行治疗或增益 |
| | | protected void CastToAllies() |
| | | { |
| | | RectTransform target = battleField.GetTeamNode(caster.Camp, skillConfig); |
| | | RectTransform target = battleField.GetTeamNode(caster.Camp, skillSkinConfig); |
| | | ExecuteMoveAndCastSequence(target, () => |
| | | { |
| | | if (skillConfig.ClientTriggerTiming == 1) |
| | |
| | | else |
| | | { |
| | | // ShadowIllutionCreate(true); |
| | | MoveToTarget(battleField.GetTeamNode(caster.Camp, caster.teamHero.positionNum), Vector2.zero, () => |
| | | MoveToTarget(battleField.GetTeamNode(caster.Camp, caster.GetPositionNum()), Vector2.zero, () => |
| | | { |
| | | // ShadowIllutionCreate(false); |
| | | OnAttackFinish(); |
| | |
| | | private void ExecuteMoveAndCastSequence(RectTransform target, Action onReturnComplete) |
| | | { |
| | | ShadowIllutionCreate(true); |
| | | MoveToTarget(target, new Vector2(skillConfig.CastDistance, 0), () => |
| | | MoveToTarget(target, new Vector2(skillSkinConfig.CastDistance, 0), () => |
| | | { |
| | | if (skillConfig.CastDistance < 9999 && skillConfig.SkinllSFX2 != 0) |
| | | if (skillSkinConfig.CastDistance < 9999 && skillSkinConfig.SkinllSFX2 != 0) |
| | | { |
| | | battleField.soundManager.PlayEffectSound(skillConfig.SkinllSFX2, false); |
| | | battleField.soundManager.PlayEffectSound(skillSkinConfig.SkinllSFX2, false); |
| | | } |
| | | |
| | | TurnBack(() => |
| | |
| | | // 移动到目标位置:处理角色的移动动画和逻辑 |
| | | protected void MoveToTarget(RectTransform target, Vector2 offset, Action _onComplete = null, float speed = 750f) |
| | | { |
| | | if (skillConfig.CastDistance >= 9999) |
| | | if (skillSkinConfig.CastDistance >= 9999) |
| | | { |
| | | _onComplete?.Invoke(); |
| | | return; |
| | | } |
| | | |
| | | caster.motionBase.PlayAnimation(MotionName.run, true); |
| | | var tweener = BattleUtility.MoveToTarget(caster.heroRectTrans, target, offset, () => |
| | | caster.PlayAnimation(MotionName.run, true); |
| | | var tweener = BattleUtility.MoveToTarget(caster.GetRectTransform(), target, offset, () => |
| | | { |
| | | caster.motionBase.PlayAnimation(MotionName.idle, true); |
| | | caster.PlayAnimation(MotionName.idle, true); |
| | | _onComplete?.Invoke(); |
| | | }, speed); |
| | | battleField.battleTweenMgr.OnPlayTween(tweener); |
| | |
| | | // 转身逻辑:根据技能配置处理角色转向 |
| | | protected void TurnBack(Action _onComplete, float forward) |
| | | { |
| | | if (skillConfig.CastDistance < 0) |
| | | if (skillSkinConfig.CastDistance < 0) |
| | | { |
| | | Vector3 scale = caster.heroGo.transform.localScale; |
| | | scale.x = Mathf.Abs(scale.x) * forward; |
| | | caster.heroGo.transform.localScale = scale; |
| | | caster.SetFacing(forward); |
| | | } |
| | | _onComplete?.Invoke(); |
| | | } |
| | |
| | | { |
| | | TurnBack(null, 1f); |
| | | OnAllAttackMoveFinished(); |
| | | caster.motionBase.PlayAnimation(MotionName.idle, true); |
| | | caster.PlayAnimation(MotionName.idle, true); |
| | | } |
| | | |
| | | // 所有攻击移动完成后的处理:恢复UI显示状态 |
| | |
| | | foreach (BattleObject bo in allList) |
| | | { |
| | | bo.layerMgr.SetFront(); |
| | | bo.heroInfoBar.SetActive(true); |
| | | bo.GetHeroInfoBar()?.SetActive(true); |
| | | } |
| | | battleField.battleRootNode.skillMaskNode.SetActive(false); |
| | | } |
| | |
| | | // 执行技能释放动画和逻辑:播放施法动作并提供回调 |
| | | protected TrackEntry CastImpl(Action onComplete = null) |
| | | { |
| | | return caster.motionBase.PlaySkillAnimation(skillConfig, this, tagUseSkillAttack.BattleType == 4, onComplete); |
| | | return caster.PlaySkillAnimation(skillConfig, skillSkinConfig, this, tagUseSkillAttack.BattleType == 4, onComplete); |
| | | } |
| | | |
| | | // 技能开始回调:处理死亡、子技能、技能效果初始化 |
| | |
| | | // 再处理 内嵌技能 |
| | | ProcessSubSkill(); |
| | | |
| | | skillEffect = SkillEffectFactory.CreateSkillEffect(this, caster, skillConfig, tagUseSkillAttack); |
| | | skillEffect = SkillEffectFactory.CreateSkillEffect(this, caster, skillConfig, skillSkinConfig, tagUseSkillAttack); |
| | | skillEffect.Play(OnHitTargets); |
| | | |
| | | |
| | |
| | | if (pack is HB427_tagSCUseSkill skillPack) |
| | | { |
| | | SkillConfig ssc = SkillConfig.Get((int)skillPack.SkillID); |
| | | if (!string.IsNullOrEmpty(ssc.SkillMotionName)) |
| | | SkillSkinConfig sscSkin = ssc.GetOriginSkinConfig(); |
| | | if (!string.IsNullOrEmpty(sscSkin.SkillMotionName)) |
| | | { |
| | | break; |
| | | } |
| | | if (ssc.SkillType == 8) |
| | | { |
| | | break; |
| | | } |
| | |
| | | { |
| | | HB427_tagSCUseSkill sp = combinePack.GetMainHB427SkillPack(); |
| | | SkillConfig ssc = SkillConfig.Get((int)sp.SkillID); |
| | | |
| | | if (!string.IsNullOrEmpty(ssc.SkillMotionName)) |
| | | SkillSkinConfig sscSkin = ssc.GetOriginSkinConfig(); |
| | | if (!string.IsNullOrEmpty(sscSkin.SkillMotionName)) |
| | | { |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | |
| | | var highlightSet = new HashSet<BattleObject>(highlightList); |
| | | |
| | | // 先把施法者的 InfoBar 隐藏(原逻辑保留) |
| | | caster.heroInfoBar.SetActive(false); |
| | | caster.GetHeroInfoBar()?.SetActive(false); |
| | | |
| | | foreach (BattleObject bo in allList) |
| | | { |
| | |
| | | } |
| | | |
| | | // 目标(含 HurtListEx)都应显示 InfoBar |
| | | bo.heroInfoBar.SetActive(isTarget); |
| | | bo.GetHeroInfoBar()?.SetActive(isTarget); |
| | | } |
| | | |
| | | battleField.battleRootNode.skillMaskNode.SetActive(true); |
| | |
| | | // 命中目标回调:处理所有被命中的目标(包括主目标、弹射目标、溅射目标) |
| | | protected virtual void OnHitTargets(int _hitIndex, List<HB427_tagSCUseSkill.tagSCUseSkillHurt> hitList) |
| | | { |
| | | // Debug.LogError($"Skill {skillConfig.SkillID} hit targets _hitIndex: {_hitIndex} hit {string.Join(", ", hitList.Select(h => h.ObjID + ":" + battleField.battleObjMgr.GetBattleObject((int)h.ObjID)?.teamHero.name))}"); |
| | | // Debug.LogError($"Skill {skillConfig.SkillID} hit targets _hitIndex: {_hitIndex} hit {string.Join(", ", hitList.Select(h => h.ObjID + ":" + battleField.battleObjMgr.GetBattleObject((int)h.ObjID)?.GetName()))}"); |
| | | |
| | | // 造成伤害前先处理血量刷新包 |
| | | HandleRefreshHP(); |
| | |
| | | DamageNumConfig hintConfig = DamageNumConfig.Get(BattleConst.BreakArmor); |
| | | Hint(battleObject, hintConfig); |
| | | battleField.battleEffectMgr.PlayEffect(battleObject, |
| | | BattleConst.BreakArmorEffectID, battleObject.heroRectTrans, battleObject.Camp, |
| | | battleObject.teamHero.modelScale); |
| | | BattleConst.BreakArmorEffectID, battleObject.GetRectTransform(), battleObject.Camp, |
| | | battleObject.GetModelScale()); |
| | | } |
| | | } |
| | | else if ((hurt.AttackTypes & (int)DamageType.Parry) == (int)DamageType.Parry) |
| | |
| | | DamageNumConfig hintConfig = DamageNumConfig.Get(BattleConst.Parry); |
| | | Hint(battleObject, hintConfig); |
| | | battleField.battleEffectMgr.PlayEffect(battleObject, |
| | | BattleConst.ParryEffectID, battleObject.heroRectTrans, battleObject.Camp, |
| | | battleObject.teamHero.modelScale); |
| | | BattleConst.ParryEffectID, battleObject.GetRectTransform(), battleObject.Camp, |
| | | battleObject.GetModelScale()); |
| | | } |
| | | } |
| | | } |
| | |
| | | #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); |
| | | } |
| | | |
| | |
| | | #if UNITY_EDITOR |
| | | private void PrintHurtParamDebugInfo(BattleHurtParam hurtParam) |
| | | { |
| | | bool isLastHit = hurtParam.hitIndex >= hurtParam.skillConfig.DamageDivide.Length - 1; |
| | | bool isLastHit = hurtParam.hitIndex >= hurtParam.skillSkinConfig.DamageDivide.Length - 1; |
| | | |
| | | long currentHitDamage = hurtParam.hurter.damageList != null ? hurtParam.hurter.damageList.Sum() : 0; |
| | | long currentHitSuckHp = hurtParam.caster.suckHpList != null ? hurtParam.caster.suckHpList.Sum() : 0; |
| | |
| | | |
| | | BattleDebug.LogError( |
| | | (hurtParam.caster.casterObj.Camp == BattleCamp.Red ? "【红方行动】" : "【蓝方行动】 ") + |
| | | $"攻击者: {hurtParam.caster.casterObj.teamHero.name} (ObjID:{hurtParam.caster.casterObj.ObjID})\n" + |
| | | $"目标: {hurtParam.hurter.hurtObj.teamHero.name} (ObjID:{hurtParam.hurter.hurtObj.ObjID})\n" + |
| | | $"攻击者: {hurtParam.caster.casterObj.GetName()} (ObjID:{hurtParam.caster.casterObj.ObjID})\n" + |
| | | $"目标: {hurtParam.hurter.hurtObj.GetName()} (ObjID:{hurtParam.hurter.hurtObj.ObjID})\n" + |
| | | $"技能: {hurtParam.skillConfig.SkillName} (ID:{hurtParam.skillConfig.SkillID})\n" + |
| | | $"击数: 第{hurtParam.hitIndex + 1}击 / 共{hurtParam.skillConfig.DamageDivide.Length}击" + (isLastHit ? " [最后一击]" : " [中间击]") + "\n" + |
| | | $"击数: 第{hurtParam.hitIndex + 1}击 / 共{hurtParam.skillSkinConfig.DamageDivide.Length}击" + (isLastHit ? " [最后一击]" : " [中间击]") + "\n" + |
| | | $"\n" + |
| | | $"========== 目标受伤数据 ==========\n" + |
| | | $"伤害: {currentHitDamage} / 总伤害: {totalDamage}\n" + |
| | |
| | | // 【使用 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); |
| | | } |
| | | |
| | |
| | | |
| | | BattleDrops battleDrops = new BattleDrops() |
| | | { |
| | | rectTransform = deadTarget.heroRectTrans, |
| | | rectTransform = deadTarget.GetRectTransform(), |
| | | dropItemPackIndex = itemIndexList, |
| | | expDrops = expAssign[i] |
| | | }; |
| | |
| | | if (moveFinished) |
| | | { |
| | | // 如果技能有动画(SkillMotionName不为空),需要等待动画播放完成 |
| | | if (skillConfig != null && !string.IsNullOrEmpty(skillConfig.SkillMotionName)) |
| | | if (skillSkinConfig != null && !string.IsNullOrEmpty(skillSkinConfig.SkillMotionName)) |
| | | { |
| | | if (!isMotionCompleted) |
| | | { |
| | |
| | | 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(); |
| | | |
| | | // 1. 强制结束技能效果 |
| | | skillEffect?.ForceFinished(); |
| | |
| | | } |
| | | |
| | | // 3. 清理 DOTween 动画(防止移动回调在战斗结束后执行) |
| | | if (caster != null && caster.heroRectTrans != null) |
| | | if (caster != null) |
| | | { |
| | | DG.Tweening.DOTween.Kill(caster.heroRectTrans); |
| | | caster.StopMoveAnimation(); |
| | | } |
| | | |
| | | // 4. 重置施法者状态 |
| | | if (caster != null) |
| | | { |
| | | // 重置位置到原点 |
| | | if (caster.heroRectTrans != null) |
| | | { |
| | | caster.heroRectTrans.anchoredPosition = Vector2.zero; |
| | | } |
| | | caster.ResetPosition(); |
| | | |
| | | // 重置朝向 |
| | | if (caster.heroGo != null) |
| | | { |
| | | Vector3 scale = caster.heroGo.transform.localScale; |
| | | scale.x = Mathf.Abs(scale.x); |
| | | caster.heroGo.transform.localScale = scale; |
| | | } |
| | | caster.ResetFacing(); |
| | | |
| | | // 取消幻影效果 |
| | | caster.motionBase?.ShowIllusionShadow(false); |
| | | |
| | | // 播放待机动画(如果还活着) |
| | | if (!caster.teamHero.isDead) |
| | | { |
| | | caster.motionBase?.ResetForReborn(false); |
| | | } |
| | | caster.ShowIllusionShadow(false); |
| | | } |
| | | |
| | | // 5. 恢复 UI 状态 |
| | |
| | | foreach (BattleObject bo in allList) |
| | | { |
| | | bo.layerMgr?.SetFront(); |
| | | bo.heroInfoBar?.SetActive(true); |
| | | bo.GetHeroInfoBar()?.SetActive(true); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | 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); |
| | | } |
| | | } |
| | | |
| | |
| | | BattleObject battleObj = battleField.battleObjMgr.GetBattleObject((int)buffRefresh.ObjID); |
| | | if (battleObj != null) |
| | | { |
| | | battleObj.buffMgr.RefreshBuff(buffRefresh, true); |
| | | var buffMgr = battleObj.GetBuffMgr(); |
| | | if (buffMgr != null) // 命格不有 buff 管理器 |
| | | { |
| | | buffMgr.RefreshBuff(buffRefresh, true); |
| | | } |
| | | } |
| | | } |
| | | else if (pack is HB429_tagSCBuffDel buffDel) |
| | |
| | | BattleObject battleObj = battleField.battleObjMgr.GetBattleObject((int)buffDel.ObjID); |
| | | if (battleObj != null) |
| | | { |
| | | battleObj.buffMgr.RemoveBuff(buffDel, false); |
| | | var buffMgr = battleObj.GetBuffMgr(); |
| | | if (buffMgr != null) // 命格不有 buff 管理器 |
| | | { |
| | | buffMgr.RemoveBuff(buffDel, false); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | // 【使用 parentRecordAction.innerRecordPlayer】 |
| | | // 原因:Buff包是技能效果的核心组成部分,应该由SkillRecordAction管理 |
| | | // 即使是强制分发的情况,也要保持在正确的RecordAction上下文中 |
| | | PackageRegeditEx.DistributeToRecordAction(pack, parentRecordAction); |
| | | PackageRegeditEx.DistributeToRecordAction(pack, ownRecordAction); |
| | | } |
| | | } |
| | | |
| | |
| | | return false; |
| | | } |
| | | |
| | | if (string.IsNullOrEmpty(skillConfig.SkillMotionName)) |
| | | if (string.IsNullOrEmpty(skillSkinConfig.SkillMotionName)) |
| | | { |
| | | return true; |
| | | } |